Constraints

dennis luehring dl.soluz at gmx.net
Wed May 9 12:09:22 PDT 2012


Am 09.05.2012 19:02, schrieb "İbrahim Gökhan YANIKLAR" 
<yanikibo at gmail.com>":
> There is not a huge difference, but this idea can be extended.
> After your reply, I have found this proposal for C++.
>
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2081.pdf

D's concept/constrains system is more powerfull like these C++ concepts 
(which where discussed very much...)

why do i need to derive from one of these concept if i just can write

template Bar(T) if (isFloatingPoint!(T))
{
    ...
}

and i can combine these concept/constrains checkers without any problem 
to something like

template Bar(T,A,B) if 
(isFloatingPointAndMySpecialXYZAndSomethingElse!(T,A,B))
{
    ...
}

try to compare D's concepts and the proposed C++ concepts and you will
find minor differences - or try to show the differences and what your 
idea makes better


More information about the Digitalmars-d mailing list