Re: Custom Data Formatter for C++ Template Classes
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