Stroustrup's talk on C++0x

Reiner Pope some at address.com
Thu Aug 23 01:27:53 PDT 2007


Reiner Pope wrote:
> 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

I see Walter has now said elsewhere in this thread that 'concepts aren't 
a whole lot more than interface specialization, which is already 
supported in D.' True; what I'm really wondering, though, is

  1. Will specialisation be "fixed" to work with IFTI?
  2. Will there be a way to support user-defined specialisations, for 
instance once which don't depend on the inheritance hierarchy?

   -- Reiner



More information about the Digitalmars-d mailing list