| | |
Overloading Of ( ) is possible
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
When you overload the () operator, it's used as if it were a function call operator and nothing more:
If that's not what you want, you're SOL.
C++ Syntax (Toggle Plain Text)
#include <iostream> struct foo { void operator()() { std::cout<<"FOO!\n"; } }; int main() { foo bar; bar(); }
Last edited by Narue; Feb 20th, 2009 at 4:09 pm.
I'm here to prove you wrong.
![]() |
Similar Threads
- Overloading PHP Functions (PHP)
- C++ Tic Tac Toe using classes & operator overloading (C++)
- Overloading matrix bracket operators (C++)
- overloading [] with 2 dimensional arrays (C++)
- need help with simple overloading operator+ for adding two object data. (C++)
- program for finding factorial of a number using *operator overloading (C++)
Other Threads in the C++ Forum
- Previous Thread: C++ Graphics
- Next Thread: N digits in word increasing order
| Thread Tools | Search this Thread |
Tag cloud for C++
api application array arrays assignment based beginner binary bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete deploy developer dll dynamiccharacterarray email encryption error file format forms fstream function functions game generator getline graph homeworkhelper iamthwee ifstream image input int java lib list loop looping loops map math matrix memory multidimensional multiple newbie news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference rpg sorting string strings template text tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






