Author: jonathan_herbst Created on August 7, 2014, 3:51 PM
Idea and most of the code functionality from boost::spirit::hold_any. Interface from boost::any.
A class to hold any type of data, but whose type does not rely on the the type of data being stored.
Example Usage: a list containing many different types.
struct my_type {};
std::list<simple_any> any_list; any_list.emplace_back('a'); any_list.emplace_back(std::string("a string")); any_list.emplace_back(52); any_list.emplace_back(my_type());
Why c-style function pointers are used: The memory for the static function pointers is still allocated at program termination (n3337 Section 3.7.1), but will be invalidated in the case of c++11 style function objects and not c-style pointers because destructors will get called before that point. Example in function_object_failure.cpp.
A class that holds any type of variable in a type safe manner.