# wrapper inside std::tuple ```cpp #include #include #include struct A { std::string name; }; struct B {}; struct C {}; struct D {}; template struct MyWrapperHelper { using type = std::shared_ptr; }; template using MyWrapperHelper_t = typename MyWrapperHelper::type; template struct MyWrapper { using type = std::tuple...>; }; template using MyWrapper_t= typename MyWrapper::type; template class Container { public: MyWrapper_t ms; template std::shared_ptr get() { return std::get>(ms); } template void set(std::shared_ptr v) { std::get>(ms) = v; } }; int main() { std::cout << "Hello, World!" << std::endl; Container c; { auto a_ptr = c.get(); if (a_ptr) { std::cout << "a.name: " << a_ptr->name << std::endl; } else { std::cout << "no a" << std::endl; } } auto new_a = std::make_shared(); new_a->name = "Alice"; c.set(new_a); { auto a_ptr = c.get(); if (a_ptr) { std::cout << "a.name: " << a_ptr->name << std::endl; } else { std::cout << "no a" << std::endl; } } return 0; } ``` type of `MyWrapper_t` is `std::tuple, std::shared_ptr, std::shared_ptr, std::shared_ptr>`