Possible duplicate:
Using template parameters as template parameters
Here's a code snippet of some highly shaded container classes used to bind an arbitrary number of fields of arbitrary types. One of my colleagues found that my code does not compile under GCC, and after much research, he found a fix to make it display templates correctly by adding ::template... None of us have ever seen this before and still don’t really know that it is for something that GCC requires for my code that Visual Studio 2010 does not need.
template< typename T, int N >
struct SingleBindMemberStruct
{
typedef typename TGenericBindingHandler<T>::BindToUse BindType;
BindType m_Member;
template< typename ContainerClass >
static void AddBinding(CPackedTableDataSpec* spec)
{
#if defined(__GNUC__)
TGenericBindingHandler<T>::template AddBinding<ContainerClass>(spec, N, &ContainerClass::template SingleBindMemberStruct<T,N>::m_Member);
#else
TGenericBindingHandler<T>::template AddBinding<ContainerClass>(spec, N, &ContainerClass::SingleBindMemberStruct<T,N>::m_Member);
#endif
}
};
- , ::template? - , , !
Edit:
, , , , static, , , . , , Visual Studio ?