The following is the expanded version, which works fine, only I’d like to use an initializer list vector<shared_ptr<Foo>> inputs = { make_shared<Foo>("foo"), make_shared<Foo>("bar"), make_shared<Foo>("baz") }; So I’ve tried something like vector<shared_ptr<Foo>> inputs2 = { { "foo" }, { "bar" }, { "baz" } }; as well as with two brackets, or none, ie {{ "foo" […]
The post How to initialize a vector of shared_ptr for classes that take one parameter? appeared first on BlogoSfera.