[ create a new paste ] login | about

Link: http://codepad.org/XYy3ZoXw    [ raw code | output | fork ]

C++, pasted on Sep 23:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
struct MaClasse
{
    template<class T>
    void fait() { }
};

template<class T>
void mafonction(T& t)
{
    t.fait<int>(); //error: expected primary-expression before 'int'
}

int main()
{
    MaClasse maclasse;
    mafonction(maclasse);
}


Output:
1
2
3
In function 'void mafonction(T&)':
Line 10: error: expected primary-expression before 'int'
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: