|
Boost : |
From: Paul Mensonides (pmenso57_at_[hidden])
Date: 2003-01-09 14:41:18
----- Original Message -----
From: "Terje Slettebø" <tslettebo_at_[hidden]>
> Looks good. What should we call it? size_descriptor, like here?
I'm not suggesting you do it exactly that way. Rather, I'm just suggesting
that you don't use the pp-lib for something so trivially solved by the
template mechanism. As Dave mentioned, the Python lib already has such a
thing--though, if I recall correctly, it is being used as a workaround for
certain compilers. I personally don't even bother with the typedefs:
template<class T> struct is_class {
private:
template<class U> static char check(int U::*);
template<class U> static char (& check(...))[2];
public:
static const bool value = sizeof(check<T>(0)) == 1;
};
template<class T> const bool is_class<T>::value;
Paul Mensonides
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk