struct with template variables in c++
- by monkeyking
I'm playing around with template, so I'm not trying to reinvent the std::vector, I'm trying to get a grasp of templateting in c++.
Can I do the following
template <typename T>
typedef struct{
size_t x;
T *ary;
}array;
What I'm trying to do is a basic templated version of
typedef struct{
size_t x;
int *ary;
}iArray;
It looks like its working if I use a class instead of struct, so is it not possible with typedef structs?
thanks