fork download
  1. #include <iostream>
  2. #include <type_traits>
  3.  
  4. template<typename T, bool IsIntegral = std::is_integral<T>::value>
  5. struct Obj {
  6. template<bool _ = IsIntegral>
  7. static constexpr bool fcuk (typename std::enable_if< _>::type* p = nullptr) { return true;}
  8.  
  9. template<bool _ = IsIntegral>
  10. static constexpr bool fcuk (typename std::enable_if<!_>::type* p = nullptr) {return false;}
  11. };
  12.  
  13.  
  14. /* vs
  15.  *
  16.   template<typename T, bool IsIntegral = std::is_integral<T>::value>
  17.   struct Obj {
  18.   static constexpr bool fcuk (typename std::enable_if< IsIntegral>::type* p = nullptr) {return true;}
  19.   static constexpr bool fcuk (typename std::enable_if<!IsIntegral>::type* p = nullptr) {return false;}
  20.   };
  21. */
  22.  
  23. int
  24. main (int argc, char *argv[])
  25. {
  26. std::cerr << Obj<int >::fcuk () << " ";
  27. std::cerr << Obj<int*>::fcuk () << " ";
  28. }
  29.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty