fork download
  1. #include <iostream>
  2. #include <type_traits>
  3. using namespace std;
  4.  
  5. void qt_noop() {}
  6. void qt_assert(const char *assertion, const char *file, int line) { cout << assertion; }
  7.  
  8. #if !defined(MY_ASSERT)
  9. # ifndef QT_NO_DEBUG
  10. # define MY_ASSERT_FIRST_ARGUMENT(A, ...) A
  11. # define MY_ASSERT(...) ((!MY_ASSERT_FIRST_ARGUMENT(__VA_ARGS__)) ? qt_assert(#__VA_ARGS__,__FILE__,__LINE__) : qt_noop())
  12. # else
  13. # define MY_ASSERT(...)
  14. # endif
  15. #endif
  16.  
  17. int main()
  18. {
  19. MY_ASSERT(std::is_same<int, int>::value);
  20.  
  21. return 0;
  22. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:19:25: error: wrong number of template arguments (1, should be 2)
  MY_ASSERT(std::is_same<int, int>::value);
                         ^
prog.cpp:10:46: note: in definition of macro 'MY_ASSERT_FIRST_ARGUMENT'
 #    define MY_ASSERT_FIRST_ARGUMENT(A, ...) A
                                              ^
prog.cpp:19:2: note: in expansion of macro 'MY_ASSERT'
  MY_ASSERT(std::is_same<int, int>::value);
  ^
In file included from /usr/include/c++/5/bits/move.h:57:0,
                 from /usr/include/c++/5/bits/stl_pair.h:59,
                 from /usr/include/c++/5/bits/stl_algobase.h:64,
                 from /usr/include/c++/5/bits/char_traits.h:39,
                 from /usr/include/c++/5/ios:40,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from prog.cpp:1:
/usr/include/c++/5/type_traits:958:12: note: provided for 'template<class, class> struct std::is_same'
     struct is_same;
            ^
stdout
Standard output is empty