5 ms·
I was really looking forward to concepts. But the actual implementation seems like a syntactic and ( partially) semantic mess to me. Obscure syntax (`requires
by the_duke 6y ago
I was really looking forward to concepts.
But the actual implementation seems like a syntactic and ( partially) semantic mess to me.
Obscure syntax (`requires requires`), soooo many different ways to specify things, mangling together with `auto`, mixing of function signature and type property requirements (`&& sizeof(T) == 4`), etc etc.
This reeks of design by committee without a coherent vision, and blows way past the complexity budget I would have expected to be spent.
Rust (traits), Haskell (type classes) and even the Nim/D metaprogramming capabilities seem simple and elegant in comparison.
- gpderetta 6y agoThe original C++0x concept proposal had proper type signatures and was based, I think, on more traditional type theory. But it had to be continually tweaked as it did not work well in practice so it grew in complexity a lot. Additionally the only implementation was extremely slow to compile. It was taken out of the standard, and the new version (aka concept-lite) is actually much simpler, although expression based. We lost the ability to type check template definitions though. Far from being a design by committee, I think for the most part is the brainchild of a single author. The 'auto' thing is definitely a committee addition as many vetoed "implicit" templates and requiring auto after the concept name in the shorthand form was the compromise that pleased no one [1]. [1]: this is an obvious manifestation of Stroustrup's Rule