On Friday, 10 March 2017 at 20:31:59 UTC, Ola Fosheim Grøstad
wrote:
On Friday, 10 March 2017 at 19:53:52 UTC, Ali Çehreli wrote:
- constexpr (a poor man's CTFE)
- Type inference
- Range-based for
- Lambdas
As far as I can tell C++11 was mostly an absorption of existing
practices, largely syntactical in nature. Lambdas are only
syntactical sugar over function objects (which in turn is a
weak version of Beta patterns, a language Bjarne most certainly
knew of as he has complained about someone running off with his
book on the language and the fact that he shows a lot of
respect for Kristen Nygaard). The for loop was pure syntactical
sugar over STL iterators, on the level of a C-macro...
IMHO... Only from a typical C++ centric perspective can it be
claimed that C++11 and higher have not copied (not from D which
was most of the time not first). The fact that these features are
theorized outside of languages doesn't mean that the last
language to implement them can claim the same originality as the
first. And everything can be called "syntactic sugar" over
assembly, nay machine code.
Even C# had lambdas, type inference, some constant folding etc
etc years before C++
D has copied these from other languages/theories as well, but the
language has been designed from the beginning to accommodate
them. And yes often D has implemented them first, which can only
be blamed on C++ itself. C++ was designed to be a superset of C
including pre-processor, without any foresight, and the can has
been kicked down the road since -- and each time it could be
kicked only with the approval of an ISO committee.