Stroustrup's talk on C++0x

Reiner Pope some at address.com
Thu Aug 23 01:18:26 PDT 2007


Walter Bright wrote:
> eao197 wrote:
>> On Mon, 20 Aug 2007 23:26:33 +0400, Robert Fraser
>>> You seem to forget that D is evolving, too. C++ might get a lot of 
>>> the cool D features (albiet with ugly syntax), but by that time, D 
>>> might have superpowers incomprehensible to the C++ mind.
>>
>> I didn't. From my point of view, permanent envolvement is a main D's 
>> problem. I can't start use D on my work regulary because D and Tango 
>> is not stable enough. I can't start teach students D because D 1.0 is 
>> obsolete and D 2.0 is not finished yet.
> 
> I don't understand this. You could as well say that C++98 is obsolete 
> and C++0x is not finished yet.
> 
> 
>> To outperform C++ in 2009-2010 D must have full strength now and must 
>> be stable during some years to proof that strength in some killer 
>> applications.
> 
> C++0x's new features are essentially all present in D 1.0.
> 

All except Concepts.

I know there was a small discussion of Concepts here after someone 
posted a Doug Gregor video on Concepts, but other than that they haven't 
really got much attention. I know that a lot of the problems they solve 
in simplifying template error messages can be done alternatively in D 
with static-if, is() and now __traits, in conjunction with the 'static 
unittest' idiom, but even then, I think C++0x Concepts give a nicer 
syntax for expressing exactly what you want, and they also allow 
overloading on Concepts (which AFAIK there is no way to emulate in D).

Two characteristic examples (the first one is in would-be D with Concepts):

// if D had Concepts
void sort(T :: RandomAccessIteratorConcept)(T t) {...}

// currently
void sort(T)(T t) {
     static assert(IsRandomAccessIterator!(T), T.stringof ~ " isn't a 
random access iterator");
     ...
}
alias sort!(MinimalRandomAccessIterator) _sort__UnitTest;

It isn't syntactically clean, so people won't be encouraged to support 
this idiom, and it doesn't allow the Concepts features of overloading or 
concept maps (I think concept maps can be emulated, but they currently 
break IFTI).

I'm interested in knowing your thoughts/plans for this.

   -- Reiner



More information about the Digitalmars-d mailing list