R
RA Scheltema
hi all,
I have the following situation:
template <typename _Ta>
class A
{
template <size_t _Tsize>
struct B
{
char buffer[_Tsize];
};
};
The thing is, I need to define a function which returns struct B, but not
with a pre-defined template-argument _Tsize. I have been trying some things
like:
template <typename _Ta>
class A
{
...
template <typename _Tsize>
B<_Tsize> GetB()
{
return B<_Tsize>();
}
};
and attempted to call this function as follows:
A<int> a;
A<int>::B<1> b = a.GetB<1>();
But this doesn't seem to make it through my Visual C++ 6.0 compiler (wierd
stuff with operators for the std::vector are popping up). Can anybody tell
me if there even is a standard c++ way for doing this ?
thanks ahead,
richard
I have the following situation:
template <typename _Ta>
class A
{
template <size_t _Tsize>
struct B
{
char buffer[_Tsize];
};
};
The thing is, I need to define a function which returns struct B, but not
with a pre-defined template-argument _Tsize. I have been trying some things
like:
template <typename _Ta>
class A
{
...
template <typename _Tsize>
B<_Tsize> GetB()
{
return B<_Tsize>();
}
};
and attempted to call this function as follows:
A<int> a;
A<int>::B<1> b = a.GetB<1>();
But this doesn't seem to make it through my Visual C++ 6.0 compiler (wierd
stuff with operators for the std::vector are popping up). Can anybody tell
me if there even is a standard c++ way for doing this ?
thanks ahead,
richard