fork download
  1. #include <iostream>
  2. #include <tuple>
  3. using namespace std;
  4.  
  5. template <typename... Args>
  6. struct pack
  7. {
  8. };
  9.  
  10. template <template <typename... Args> class ENCAP, typename... Args>
  11. struct encapsulate_arguments
  12. {
  13. typedef pack<ENCAP<Args>...> type;
  14. };
  15.  
  16. template <template <typename... Args> class ENCAP, typename... Args>
  17. struct encapsulate_arguments<ENCAP, pack<Args...>>
  18. {
  19. typedef pack<ENCAP<Args>...> type;
  20. };
  21.  
  22. template <typename L>
  23. struct Master
  24. {
  25. template <typename T>
  26. struct Slave
  27. {
  28. typedef T type;
  29. };
  30. };
  31.  
  32. template <typename L>
  33. struct Other
  34. {
  35. // typedef typename encapsulate_arguments<typename Master<L>::Slave, pack<double, int>>::type EmbeddedType;
  36. typedef typename encapsulate_arguments<Master<L>::template Slave, pack<double, int>>::type EmbeddedType;
  37. };
  38.  
  39. int main() {
  40. encapsulate_arguments<Master<float>::Slave, pack<double, int>>::type foo;
  41. encapsulate_arguments<Master<float>::Slave, double, int>::type bar;
  42. return 0;
  43. }
  44.  
Success #stdin #stdout 0s 3092KB
stdin
Standard input is empty
stdout
Standard output is empty