Take a look at the following snippet:
#include <iostream>
#include <cstdint>
#include <boost/type_index.hpp>
using boost::typeindex::type_id_with_cvr;
int main(int argc, char** argv)
{
constexpr uint16_t b = 2;
constexpr uint16_t c = 3;
constexpr const auto bc = b * c;
std::cout << "b: " << type_id_with_cvr<decltype(b)>().pretty_name() << std::endl;
std::cout << "b * c: " << type_id_with_cvr<decltype(bc)>().pretty_name() << std::endl;
}
This results in the following:
b: unsigned short const
b * c: int const
Why does multiplying two unsinged ints results in an integer?
Compiler: g++ 5.4.0