#Does `int` preserve the size?
7 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
when creating f, x is narrowed to the size of an int, so the value might not be preserved
it doesn't actually matter whether the int is in a struct or not, you would get the same effect with
long long x = do_something_large();
int f = x;
your compiler can warn you when a narrowing conversion happens, but only when compiling as C++
clang-tidy might catch it otherwise, not sure
!solved