Storing and loading functions The class Functions can store/load any functions. It does this by assigning a unique name to every function that gets added. You can then call the function by specifying its name and return type.

Here is a sample usage

//Create class
Functions funcs;

//Add 2 functions (foo -&gt; void(int, int) | add -&gt; int(int, int))
funcs.add("foo", foo);
funcs.add("add", add);

//Call them
int r = funcs.call&lt;int&gt;("add", 3, 2);
funcs.call&lt;void&gt;("foo", r, 2);


Here is the actual class

class Functions
{
public:
    template&lt;typename T, typename... Ts&gt;
    void add(std::string name, T(*func)(Ts...))
    {
        mFunctions.insert(std::make_pair(name, func));
    }

    template&lt;typename T, typename... Ts&gt;
    T call(std::string name, Ts... args)
    {
        try
        {
            return boost::any_cast&lt;T(*)(Ts...)&gt;(mFunctions.at(name))(args...);
        }
        catch (const std::out_of_range&amp;)
        {
            throw std::invalid_argument("Function doesn't exist!");
        }
    }
private:
    std::map&lt;std::string, boost::any&gt; mFunctions;
};


Is there anything to be improved, like maybe naming, programming techniques, ...? Some general feedback would be appreciated.
Its a good start.
But function pointers are not the only type callable objects. Functors were a big part of C++03 and with C++11 lambdas are even more important.

Rather than using:

T(*func)(Ts...)


Which handles function pointers. You can generalize this with std::function&lt;&gt;.

std::function&lt;T(Ts...)&gt;


Which generalizes the callable construct.