2 ms·
Everything you said is very much true, but there is a kind of nominal typing even in template land via (partial) specialization of special trait classes. For a
by gpderetta 5y ago
Everything you said is very much true, but there is a kind of nominal typing even in template land via (partial) specialization of special trait classes.
For an example see std::tuple_size/tuple_element and their relation with (ironically) structured binding.
- ncmncm 5y agoRight: C++ offers a continuum between pure structural typing and nominal typing. Author chooses according to need. Failing to support structural typing is not an advantage.
- gpderetta 5y agoYes, as usual, name a language feature and it is probably somewhere in C++ :) (mind, I'm not complaining).