Stroustrup's slides about c++11 and c++14

Peter Alexander via Digitalmars-d digitalmars-d at puremagic.com
Sun Sep 14 04:17:01 PDT 2014


On Sunday, 14 September 2014 at 09:42:28 UTC, deadalnix wrote:
>> • Specifies how things are done (implementation)
> I'm not sure what this one mean precisely.

The way I interpret it is that (for template constraints), they 
are quite clumsy for specifying preferences between overloads, 
e.g.

void foo(R)(R r) if (isInputRange!R && !isRandomAccessRange!R && 
!isSomeString!R)
void foo(R)(R r) if (isRandomAccessRange!R && !isSomeString!R)
void foo(R)(R r) if (isSomeString!R)

Would be nice to have something like this instead:

void foo(InputRange R)(R r);
void foo(RandomAccessRange R)(R r);
void foo(SomeString R)(R r);

along with a way to specify if one "concept" is more refined than 
another (either explicitly or implicitly).


More information about the Digitalmars-d mailing list