27 Nov
2018
27 Nov
'18
3:22 a.m.
On Mon, Nov 26, 2018 at 2:15 PM Gavin Lambert via Boost < boost@lists.boost.org> wrote:
Fact: the cast does not do the same thing as the implicit conversion.
(The cast converts to the type you specify in the cast. The implicit conversion converts to the target type.)
No, the implicit conversion promotes to *some* type (usually one of int, unsigned, int64_t, or uint64_t), which is not necessarily the type of either.
In the end, the result does get converted to the target value type, since it is being stored in a variable of that type. I don't see your point though, are you saying that implicit conversions are dangerous and we should avoid them, using casts every time an implicit conversion might occur?