fork(2) download
  1. #include <utility>
  2. #include <type_traits>
  3.  
  4. template <typename T>
  5. class A {
  6. public:
  7. template <typename U = T>
  8. void b(typename std::enable_if<!std::is_pointer<U>::value, U>::type o);
  9.  
  10. template <typename U = T>
  11. void b(typename std::enable_if<std::is_pointer<U>::value, U>::type o);
  12. };
  13.  
  14. template <typename T>
  15. template <typename U>
  16. void A<T>::b(typename std::enable_if<!std::is_pointer<U>::value, U>::type o) {}
  17.  
  18. template <typename T>
  19. template <typename U>
  20. void A<T>::b(typename std::enable_if<std::is_pointer<U>::value, U>::type o) {}
  21.  
  22.  
  23. int main() {
  24. A<int> a;
  25. a.b(0);
  26. }
Success #stdin #stdout 0s 2880KB
stdin
Standard input is empty
stdout
Standard output is empty