   Is it Possible to Return a Variables Type?[resolved]
  Well, I was hoping I wouldn't have to ask, but I do.  I want to be able to return the type that a variable is, kinda confusing, so I'll show you what I mean.typedef struct {   int x;   bool y;} i;typedef struct {   float x;   double y;} f;template <class T> class tempclass{    public:   T a;   T b; //For variable b, I want it to be whatever type the y section is for the typedefs   //So if it was templcass<i>, I'd want it to be bool b.  But if it was tempclass<f>   //I'd want it to be double b.} ;If you know of anyway to do this, I'd appreciate knowing.Thanks,--Michael[Edited by - MikeTacular on December 29, 2005 12:57:27 AM]
  You're probably looking for something like this:struct i {   int x;   typedef bool Type;   Type y;};struct f {   float x;   typedef double Type;   Type y;};template<class T>struct tempclass {   T a;   typename T::Type b;};Also, typedef struct isn't really needed in C++.   ;  Hey thanks a ton.  It works perfect now.  Also, I never could get it to work without doing typedef struct, but from looking at your code, I just kept forgetting to delcare its name.  Thanks.   