[RFC] std.experimental.concepts

deadalnix via Digitalmars-d digitalmars-d at puremagic.com
Fri Jul 24 16:13:22 PDT 2015


On Friday, 24 July 2015 at 19:56:55 UTC, Shammah Chancellor wrote:
> I put up a PR for phobos awhile ago for concepts as a library 
> to kind of start the discussion around concepts.   There seemed 
> to be some interest around the PR, so I have rebased it and 
> fixed the formatting.
>
> Please take a look: 
> https://github.com/D-Programming-Language/phobos/pull/2627
>
> -Shammah

Doing it as a library would miss a lot of the point of concepts :
  - Compiler can do a fair amount of semantic analysis on template 
before instantiating them. This work is done once rather than 
repeating it a every template instantiation.
  - It allow for much more clearer error messages. Anyone having 
to maintain some meta code will understand what I'm talking about 
here.
  - It make compile time and runtime polymorphism more alike. I do 
think we'd all agree that Andrei approach to mention template 
arguments as compile time arguments and go from there is a good 
move. Concept would be the same move, but for typing. By reusing 
common language constructs (C++ failed to use that opportunity) 
for instance.



More information about the Digitalmars-d mailing list