// stdBind.cpp : This file contains the 'main' function. Program execution begins and ends there. // // adapted from example in https://oopscenities.net/2012/02/24/c11-stdfunction-and-stdbind/ #include #include #include #include void execute(const std::vector>& fs) { for (auto& f : fs) f(); } void show_text(const std::string& t) { std::cout << "\n Text: " << t; } int main() { std::vector> x; x.push_back(std::bind(show_text, "Bound function")); execute(x); std::cout << "\n\n"; }