fork download
  1. #include <iostream>
  2. #include <type_traits>
  3. using namespace std;
  4.  
  5. int main() {
  6. static_assert(is_convertible<int64_t, int>::value);
  7. int64_t a = 1234567890123456ll;
  8. int b = a; // UB or not UB? that's teh question...
  9. cout << b << endl;
  10. return 0;
  11. }
Success #stdin #stdout 0.01s 5272KB
stdin
Standard input is empty
stdout
1015724736