Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
bind function
//Title of this code //g++ 4.9.1 #include <iostream> #include <boost/function.hpp> #include <boost/bind.hpp> typedef boost::function<bool()> Pred; class Orch{ public: Orch(Pred iPred) { _pred = iPred; } void execute() { if(_pred()) { std::cout << "pred is true" << std::endl; } else { std::cout << "pred is false" << std::endl; } } private: Pred _pred; }; bool myPred(){ return false; } bool myPred2(){ return true; } int main() { Orch aOrch(boost::bind(myPred) && boost::bind(myPred2)); aOrch.execute(); std::cout << "Hello, world!\n"; }
run
|
edit
|
history
|
help
0
SegTree
Pierwiastkowanie
test
BinomialPoisson
Expected types
team name
break.cpp
Programa 3 (corregido)
HeapSort
BindWithContainer