| | |
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.
New members chased away this month: 4
![]() |
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
Views: 284 | Replies: 5
| Thread Tools | Search this Thread |
Tag cloud for C++
6 api application array arrays assignment beginner binary bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete developer display dll email encryption error file format forms fstream function functions game generator getline givemetehcodez graph iamthwee ifstream image input int java lib loop looping loops map math matrix memory multidimensional multiple newbie news node number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg sort sorting string strings struct template templates text tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






