January 2018
Intermediate to advanced
374 pages
9h 53m
English
There are two categories of type traits:
The first category returns true or false depending on the input and ends with _v (short for value).
Here are some examples of compile-time type checking using type traits:
auto same_type = std::is_same_v<uint8_t, unsigned char>; auto flt = 0.3f; auto is_float_or_double = std::is_floating_point_v<decltype(flt)>; ...