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
Ploshtina na krug
Queue with Limited Size of Arrays
Rotate array
Triplet sum in array
rotate
maximum_frequent_sum
C++
Policy based smart pointer
Stream generalization
1163. Last Substring in Lexicographical Order