fork(1) download
  1. #include <iostream>
  2. #include <type_traits>
  3.  
  4. using namespace std;
  5.  
  6. template <typename T>
  7. constexpr bool condition() { return sizeof(T) > 1; }
  8.  
  9. template <typename T>
  10. enable_if_t<condition<T>()> test() { cout << "true\n"; }
  11.  
  12. template <typename T>
  13. enable_if_t<!condition<T>()> test() { cout << "false\n"; }
  14.  
  15. int main() {
  16. test<int>();
  17. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
true