3 ms·
Implicit can make things hard to understand meaning it should be used with caution. But allowing CustomInt i = 0; instead of CustomInt i = CustomInt::Zero; or
by Guvante 3y ago
Implicit can make things hard to understand meaning it should be used with caution.
But allowing CustomInt i = 0; instead of CustomInt i = CustomInt::Zero; or worse CustomInt i = static_cast<CustomInt>(i); isn't a bad thing.
- vbezhenar 3y agoFor me this looks fine: var i = CustomInt.valueOf(0)
- joaonmatos 3y agoCan’t you do `auto i = CustomInt(0)`? Then all of the construction is explicit (and in a single place in the statement) without repeating.