Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
c++functor
#include<iostream> class Func { public: void operator()(int num) { std::cout<< "Num: " << num << std::endl; } }; struct Bar { void operator()() { std::cout << "Bar" << std::endl; } }; int main() { Func foo; foo(5); Func()(5); Bar()(); return 0; }
run
|
edit
|
history
|
help
0
Not Common Numbers
du
C++ instantiation
Default constructor - none defined
Sorting algorithm comparison
throwing std::function on MSVC is dangerous
multiplie linked list numbers
vc++ bug?
Cross-platform multithreading minimal example (g++ and cl.exe)
#27