operator() as memberf function template?

Joined
Jan 2, 2010
Messages
1
Reaction score
0
Hi
I want to compile a code like this with gcc 4.3.3:
//---------------------------
class A {
public:

template< int type >
void
operator()() {
int i;
}
};

int main() {
A an_a;
an_a()<100>;
}
//--------------------

but i get the following errors:
file.cpp: In function ‘int main()’:
file.cpp:14: error: no match for call to ‘(A) ()’
file.cpp:14: error: expected primary-expression before ‘;’ token

can you tell me what is the problem?
thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top