New answers tagged

3

Nice, clean and functional. Still, there are a few things: If you don't have to declare a special member-function, just don't: bad_function_call::bad_function_call(), callable::~callable(), and function::~function() are superfluous. If you actually have to declare a special member-function, explicitly default it in-class where that is enough: callable_base::...


-1

Use type_index. (Yours is a standard problem with a standard solution from the standard library, which is this one.)


Top 50 recent answers are included