Single-argument constructors and conversion operators should (almost) always be marked as explicit to prevent accidental silent conversions.
When the conversion is desired, explicit operations can be invoked by spelling out the destination type.
Click to open in Compiler Explorer.
Leave a comment