Created
February 18, 2016 23:11
-
-
Save xoolive/7b2fdc7dd561e0f5058d to your computer and use it in GitHub Desktop.
Check int64_t size with your compiler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cstdint> | |
template <typename T> | |
bool is_int64() { return false; } | |
template <> | |
bool is_int64<int64_t>() { return true; } | |
int main() | |
{ | |
std::cout << "int:\t" << is_int64<int>() << std::endl; | |
std::cout << "int64_t:\t" << is_int64<int64_t>() << std::endl; | |
std::cout << "long int:\t" << is_int64<long int>() << std::endl; | |
std::cout << "long long int:\t" << is_int64<long long int>() << std::endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment