28 Nov
2018
28 Nov
'18
12:56 a.m.
On Tue, Nov 27, 2018 at 3:44 PM Gavin Lambert via Boost < boost@lists.boost.org> wrote:
As should hopefully be obvious, implicit narrowing conversions are never a good idea.
short f(); short x = f(); short y = x+1; //Implicit conversion from int to short. Do you think the compiler should warn in this case? Is the version below better? Safer? short y = static_cast<short>(x+1);