std::numeric_limits<volatile int>::is_integer
evaluates to 'false'.
But why? Isn't a volatile int still an integer type? I want to know if there is some kind of deep meaning in this.
UPD: Compiler is armcc from Keil 4.72
You are (or, may be, your compiler) wrong here because it should be true.
From numeric_limits page:
Additionally, a specialization exists for every cv-qualified version of each arithmetic type, identical to the unqualified specialization, e.g. std::numeric_limits< const int >, std::numeric_limits< volatile int >, and std::numeric_limits< const volatile int > are provided and are equivalent to std::numeric_limits< int >.
And from numeric_limits/is_integer page:
Standard specializations:
...
int true
...
Well, it doesn't evaluate to false, it evaluates to true:
#include <iostream>
#include <limits>
int main() {
std::cout << std::boolalpha << std::numeric_limits<volatile int>::is_integer << std::endl;
return 0;
}
https://ideone.com/y3ne6Y
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With