Hacker News new | ask | show | jobs
by mhh__ 2218 days ago
It's great that it's there now but it absolutely amazes me how long some of these features have taken.

Concepts took, what, the best part of 20 years and the end result is just OK. Unless there's something I'm missing the system as standardized in C++20 just seems overcooked - not very elegant while also introducing a lot of new legalese in the standard. The system D uses seems to be much simpler (and more powerful in the sense that it effectively moves template constraints into the library - doesn't require updating as traits change) i.e.

    template<typename T>
      if(constexprConditionOnT<T>)
    void toy(T x) {}
1 comments

The real power of concepts was the “concept_map” construct. Gaby & Bjarne wanted predicated checking instead of structural checking. Without structural checking there’s no “natural” way in C++ syntax to specify a concept_map. The problem is that predicate checking isn’t that great.

I can send you the turd of a PhD thesis that was left after my doctorate was bombed by the removal of concepts from C++0x.