Safer casts

Janice Caron caron800 at googlemail.com
Sun May 11 02:18:33 PDT 2008


On 11/05/2008, Yigal Chripun <yigal100 at gmail.com> wrote:
>  BUT, the main difference
>  is that for C++ this is probably the only reasonable solution as C++
>  doesn't have delegates.

C++ has functors (classes which overload operator ()), and they're a
bit like delgates. What C++ doesn't have is alias template parameters,
nor string template parameters.

    sort!("a.member > b.member")(array)

simply couldn't be done in C++. This is /not/ a C++ solution. It's a D
solution, and a fantastically brilliant one.

Perhaps what you mean when you say "C++ solution", is, "it uses templates"?



More information about the Digitalmars-d mailing list