Boost logo

Boost Users :

Subject: [Boost-users] Template method applied to template object
From: Adrien Chauve (adrien.chauve_at_[hidden])
Date: 2009-03-03 12:45:28

Hi all,

The following lines don't compile with g++ (4.3.2) whereas it's ok with msvc

struct Foo
    template<class T>
    unsigned int foo() const
        return sizeof(T);


struct OtherFoo
    template<class T>
    void f(const T& t)


int main()
    Foo foo;
    OtherFoo other;

    return 0;

The ouput is :
test.cpp: In member function ‘void OtherFoo::f(const T&)’:
test.cpp:17: erreur: expected primary-expression before ‘double’
test.cpp:17: erreur: expected `;' before ‘double’

Does anybody know a workaround ?


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at