What does it mean :: template means other than compiling TMP

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)
        {
// Perhaps with newer versions of the compilers we can find a syntax that both accept. This is with gcc-4.5 and Visual Studio 2010
#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 ?

+3
2

, AddBinding - AddBinding T, ( , ++ AFAIK). template ::, , . , , , , <, < AddBinding.

, ++ Templates: The Complete Guide. ( , PDF, Google.)

+2

AddBinding - , . template < , .

+1

All Articles