Oh man.
#cplusplus supports a user-defined literal. So if you define an MyDistanceType operator""_km(long double val)
function, it’ll allow you to say const auto distance = 12_km;
and cause that to evaluate to a MyDistanceType representing 12 kilometers.
Cute, but I really can’t see why anyone would bother when the language already supports const auto distance = Distance::from_kilometers(12);
@mtomczak trying to go for total unreadability