Hi all,

This code gives me an error on gcc 3.4.2:

struct Simple {
    template <class T>
        void fun() {}
    template <>               // *)
        void fun<int>() {}    // **)
};

*)  error: invalid explicit specialization before '>' token
    error: explicit specialization in non-namespace scope `struct Simple'
**) error: invalid member function declaration

However following code compiles:

template <class T>
    void fun() {}
template <>
    void fun<int>() {}

Can anybody explain what is wrong with the first code and what is the 
rationale behind this error? And how to fix it so the code could compile on 
g++, VC6 and VC7.1?

TIA,

martines


_______________________________________________
Help-gplusplus mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to