fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <type_traits>
  4. #include <memory>
  5. using namespace std;
  6.  
  7. int main() {
  8. cout << is_arithmetic<long long>::value << endl;
  9. cout << is_arithmetic<uint64_t>::value << endl;
  10. cout << is_arithmetic<bool>::value << endl;
  11. cout << is_integral<bool>::value << endl;
  12. cout << is_integral<bool*>::value << endl;
  13. cout << endl;
  14.  
  15. cout << !is_convertible<shared_ptr<string>, bool>::value << endl;
  16. cout << is_arithmetic<shared_ptr<string>>::value << endl;
  17.  
  18. shared_ptr<string> bbb = nullptr;
  19. if (!bbb) {
  20. cout << "bbb" << endl;
  21. }
  22. }
Success #stdin #stdout 0s 4540KB
stdin
Standard input is empty
stdout
1
1
1
1
0

1
0
bbb