fork download
  1. #include <iostream>
  2. #include <array>
  3.  
  4. template<typename T>
  5. struct ValueType { using value_type = typename T::value_type; };
  6.  
  7. template<template<typename> typename A, typename T>
  8. struct ValueType<A<T>> { using value_type = T; };
  9.  
  10. template<typename T>
  11. using value_type_t = typename ValueType<T>::value_type;
  12.  
  13. template<typename...> struct Show;
  14.  
  15. template<typename T>
  16. struct Array {};
  17.  
  18. int main() {
  19.  
  20. Show<value_type_t<Array<int>>> _;
  21.  
  22.  
  23. return 0;
  24. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:20:33: error: aggregate ‘Show<int> _’ has incomplete type and cannot be defined
  Show<value_type_t<Array<int>>> _;
                                 ^
stdout
Standard output is empty