• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Custom Data Formatter for C++ Template Classes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom Data Formatter for C++ Template Classes


  • Subject: Re: Custom Data Formatter for C++ Template Classes
  • From: David Leimbach <email@hidden>
  • Date: Tue, 19 Jul 2005 19:00:31 -0700

I think the problem is that a template class isn't a class at all. It's a "meta" class. You are effectively telling the compiler how you'd like a certain pattern of code to be generated. All template programming is a form of metaprogramming.

Take that plus the fact that you are possibly dealing with classes that are explicitly instantiated differently for different types and you've got a real problem to track.

Take std::vector<bool> for example. It's actually not a vector of "bools" but a bitvector.

How do you want to represent the size? The implemenation of std::vector<bool> is not the same as std::vector<int>.

I'd love to know if you have success with this but it's clearly harder to do than with a real living type. Template classes are rules about how to create more types with similar functionality.

Dave
On Jul 19, 2005, at 6:50 PM, Michael Rice wrote:

Thanks to Jim and Chris, I have been able to develop an Xcode plugin for displaying summary info for my data types in the debugger. My next challenge is to do the same for a C++ template class. It surprises me that Xcode can't display any summary info for the Standard C++ collections, such as std::vector. I know it would be difficult/impossible to display a snapshot of the data. However, in the std::vector case, I would like to see the size of the collection.

I tried adding a data formatter like:

template <class Type>
char* MyTemplateToCString(const MyTemplate<Type>* objPtr, int ID);

using various format specs in the .plist, but none were successful. It looks like the problem may be in how to specify the data formatter function in the .plist file.

So, is there any way to display summary info for a template class? Maybe just for specific sets of template parameters (e.g., std::vector<int>)?

Thanks.
Michael
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Custom Data Formatter for C++ Template Classes
      • From: Michael Rice <email@hidden>
References: 
 >Custom Data Formatter for C++ Template Classes (From: Michael Rice <email@hidden>)

  • Prev by Date: Custom Data Formatter for C++ Template Classes
  • Next by Date: Xcode knowing about unsaved files in other apps?
  • Previous by thread: Custom Data Formatter for C++ Template Classes
  • Next by thread: Re: Custom Data Formatter for C++ Template Classes
  • Index(es):
    • Date
    • Thread