#include <iostream>
#include <functional>
#include <string>

struct TestA
{
    std::string s;
    TestA(){}
    TestA(std::string const&s) : s(s) {}
    TestA(TestA const&) = default;
    TestA(TestA &&) = default;
    TestA &operator=(TestA const&) = default;
    TestA &operator=(TestA &&) = default;
    ~TestA() = default;
};

template<typename T, typename... Args>
std::function<T (Args...)> WrapCtor()
{
    return [](Args... args) -> T
    {
        return T(args...);
    };
}

int main()
{
    auto f = WrapCtor<TestA, std::string const&>();
    TestA inst = f("test");
    std::cout << inst.s << std::endl;
}
