Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template <typename T1, typename... Ts>
- void doSomething()
- {
- ...
- }
- template <typename... Ts>
- struct MyContainerCreator
- {
- using type = boost::mpl::set<Ts...>;
- };
- using MyContainer= MyContainerCreator<T1, T2>;
- void doSomethingForAll()
- {
- //pseudocode:
- doSomething<expandTypesToTemplateParameters<MyContainer::type>>();
- }
- template <typename ... Ts>
- void doSomethingForAll (MyContainer<Ts...> const & mc)
- {
- doSomething<Ts...>();
- }
- template <typename>
- struct foo;
- template <typename ... Ts>
- struct foo<MyContainer<Ts...>>
- {
- static void func ()
- { doSomething<Ts...>(); }
- };
- template <typename MC>
- void doSomethingForAll ()
- { foo<MC>::func(); }
Add Comment
Please, Sign In to add comment