fork descargar
  1. #include <iostream>
  2. #include <type_traits>
  3.  
  4. //#define DEFINE_F
  5.  
  6. #ifdef DEFINE_F
  7. void f()
  8. {
  9.  
  10. }
  11. #endif
  12.  
  13. namespace
  14. {
  15. constexpr struct special
  16. {
  17. std::false_type operator()() const;
  18. }f;
  19. }
  20.  
  21. struct checkForF
  22. {
  23. static const constexpr auto value = std::conditional< std::is_same<std::false_type, decltype(::f())>::value, std::false_type, std::true_type >::type();
  24. };
  25.  
  26. int main()
  27. {
  28. std::cout << checkForF::value << std::endl;
  29. }
Éxito #stdin #stdout 0s 3140KB
stdin
Standard input is empty
stdout
0