|
-
January 8th, 2010, 12:57 AM
#1
[RESOLVED] can operator() be a member function template
Hello all,
I want to overload operator() of a class with a template function like below
//---------------------------
class A {
public:
template< int type >
void
operator()() {
int i;
}
};
int main() {
A an_a;
an_a()<100>;
}
//--------------------
but i get the following errors (gcc 4.3.3):
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
what is the problem?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|