fork download
  1. #include <iostream>
  2. #include <tuple>
  3. #include <type_traits>
  4.  
  5.  
  6. using namespace std;
  7.  
  8. template<template<class,class> class F, typename...Ts>
  9. struct Univ;
  10.  
  11. template<template<class, class> class F, typename T, typename U, typename...Ts>
  12. struct Univ<F, T, U, Ts...>
  13. {
  14. static const int value = F<T, U>::value && Univ<F, U, Ts...>::value;
  15. };
  16.  
  17. template<template<class, class> class F, typename T>
  18. struct Univ<F, T>
  19. {
  20. static const int value = 1;
  21. };
  22.  
  23.  
  24. int main()
  25. {
  26. cout << Univ<is_same,int, int, int>::value;
  27.  
  28. return 0;
  29. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
1