RE: the sizeof "internal class" ... a question to C++ gurus

From: Jacek M. Holeczek <holeczek_at_us.edu.pl>
Date: Fri, 21 Jan 2005 09:32:03 +0100 (MET)


Hi,

> template <class T> MyTemplate {
> public:
> typedef T value_type;
> };
>
> Then you can do
> sizeof(MyTemplate<MyClass>::value_type)

Nice trick, indeed.
However, I need this to work with basic types like "float", "double", "complex<float>", "complex<double>", ... None of them has the "value_type" implemented, though ...

Any other ideas?
Thanks in advance,
Best regards,
Jacek. Received on Fri Jan 21 2005 - 09:32:12 MET

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:04 MET