i have a litte problem concerning nested templated types/functions in a class used as a template param, and would like to hear your inputs/ideas/workarounds...
basically, i tried to do this (well, simplified example):
struct holder1
{
template <int i>
static void func()
{
cout << i << endl;
}
};
template <typename T>
struct holder2
{
static void func()
{
T::func<5>();
};
};
this works with VC++ 2005, but doesnt work with the latest GCC (or any GCC). since VC++ has a history of parsing non-standard c++, is this code standards-conforming? if not, what should i change? if yes, what should i change to get this compiled with gcc?
i also tried another possibility:
struct holder1
{
template <int i>
struct nested
{
static void func()
{
cout << i << endl;
}
};
};
template <typename T>
struct holder2
{
static void func()
{
T::nested<5>::func(); // ok, this shouldn't really work
// but this one should:
typedef typename T::nested<5> nested_t;
nested_t::func();
};
};
doesn't work either... any ideas on how to fix this?
thanks in advance
ElOmmy











