Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
BindWithContainer
//Title of this code //clang 3.6.0 #include <iostream> #include <functional> #include <vector> #include <algorithm> using std::placeholders::_1; class Beer { public: Beer(const char* name) : _name(name) {} void Dump() { std::cout << _name << std::endl; } private: std::string _name; }; int main() { std::vector<Beer> beers = {Beer("budlight"), Beer("heineken")}; for_each(beers.begin(), beers.end(), std::bind(&Beer::Dump, _1)); return 0; }
run
|
edit
|
history
|
help
0
1068 - Investigation
Primality test Fermat primality test
stream1
fgm
Dar
Wipro Problem 1: generate roll number
Undefined behavior
ShoppingList
773. Sliding Puzzle
Memory_test