Operator overloading

Dmitry Olshansky dmitry.olsh at gmail.com
Fri Apr 20 07:18:30 PDT 2012


On 20.04.2012 18:10, Xan wrote:
> What fails if I want to define this:
>
> Algorisme!(T,V) opBinary(string op)(Algorisme!(T,U) alg) {

  Algorisme!(T,V) opBinary(string op, T)(Algorisme!(T,U) alg) {

You need to name what T is and that is *sometype*. Anyway I suggest 
getting a decent book (TDPL).

> if (op=="*") {

static if is conceptually and technically better here.


-- 
Dmitry Olshansky


More information about the Digitalmars-d-learn mailing list