fork download
  1. #include <tuple>
  2. #include <type_traits>
  3. #include <vector>
  4.  
  5. template<typename T>
  6. struct innermost_impl
  7. {
  8. using type = T;
  9. };
  10.  
  11. template<template<typename> class E, typename T>
  12. struct innermost_impl<E<T>>
  13. {
  14. using type = typename innermost_impl<T>::type;
  15. };
  16.  
  17. template<template<typename...> class E, typename... Ts>
  18. struct innermost_impl<E<Ts...>>
  19. {
  20. using type = std::tuple<typename innermost_impl<Ts>::type...>;
  21. };
  22.  
  23. template<typename T>
  24. using innermost = typename innermost_impl<T>::type;
  25.  
  26. static_assert(std::is_same<innermost<std::vector<std::vector<std::vector<int>>>>, int>::value, "");
  27.  
  28. int main()
  29. {
  30. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:26:1: error: static assertion failed: 
 static_assert(std::is_same<innermost<std::vector<std::vector<std::vector<int>>>>, int>::value, "");
 ^
stdout
Standard output is empty