Without using #if, stdint.h, inttypes.h, or compiler-specific extensions (other than nonstandard intrinsic types), but making free use of all other C++ features (including C++11 type_traits for instance) is it possible to write code that has the effect of
typedef {some implementation-specific type} int_least64;
if and only if there is an implementation-specific type that provides at least 64 bits of precision, and otherwise produces a compile-time error?
The construct should detect nonstandard intrinsic types that might have the desired properties (e.g. __int64 on MSVC++) as well as standard ones (long, long long). If several types fit the requirement it should pick the smallest one that qualifies. Ideally it would be generalizable to use in enable_if as well as just erroring out, and to detect arbitrarily large integers (e.g. some compilers provide __int128 now).
No, you can’t. There are no facilities for a program to introspect the types available from the implementation, and given an unqualified name there is no way to use it in a program in such a way that the program continues to be well-formed even if the name does not denote a type.
That was part of the motivation for adding
cstdintto C++, along with C99 compatibility.