std::shared_ptr and initializer lists
The std::shared_ptr constructor isn't behaving as I expected: #include <iostream> #include <vector> void func(std::vector<std::string> strings) { for (auto const& string : strings) { std::cout << string << '\n'; } } struct Func { Func(std::vector<std::string> strings) { for (auto& string : strings) { std::cout << string << '\n'; } } }; int main(int argc, const char * argv[]) { func({"foo", "bar", "baz"}); Func({"foo", "bar", "baz"}); //auto ptr = std::make_shared<Func>({"foo", "bar", "baz"}); // won't compile. //auto ptr = std::make_shared<Func>{"foo", "bar", "baz"}; // nor this. return 0; }