How to achieve strong typing as demonstrated by Bjarne Stroustrup during his latest talk?

Viewed 186

During Bjarne Stroustrup's latest talk he talks about strong typing.

Specifically a custom datatype milliseconds is used instead of int.

How is this achieved?

Further, would this mean that such datatypes would have explicit / implicit conversions? For example from meters to millimetres? How could this be achieved?

Apologies if this seems trivial - I am a C++ novice but find this feature very useful

0 Answers
Related