static_cast does narrowing foor the case mentioned. reinterpret_cast would just reinterpret the same bit pattern as another type.
Whether it is equivalent or not is another story. For example, casting a float to an int will narrow but also will convert the internal format.
You can catch some overflow by {} initialization.
static_cast does narrowing foor the case mentioned. reinterpret_cast would just reinterpret the same bit pattern as another type.
Whether it is equivalent or not is another story. For example, casting a float to an int will narrow but also will convert the internal format.
You can catch some overflow by {} initialization.