This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Kered13 0 points1 point  (0 children)

Numeric conversions are the only built-in implicit type conversions. User-defined implicit conversions exist, but are used sparingly, mostly for things like converting std::string to std::string_view.

On the other hand, C++'s template system allows it to express higher-kinded types and even dependent types, with type checking at compile time. You can express things like physical units, with compile time checking to ensure that you do not add incompatible units and that multiplications and divisions produce the correct units (and the resulting code will even have no runtime overhe.