3 ms·
The equivalent thing in D is, but without a special feature: template _km(ulong v) { enum _km = inKilometers(v); } auto distance = _km!42; It's used b
by WalterBright 6y ago
The equivalent thing in D is, but without a special feature:
template _km(ulong v) { enum _km = inKilometers(v); }
auto distance = _km!42;
It's used by the Sargon library to create a halffloat type:
https://digitalmars.com/sargon/halffloat.html https://digitalmars.com/sargon/halffloat.html
I haven't seen it used in C++, though my C++ experience post this feature is limited.