On 6/19/12, Andrej Mitrovic <andrej.mitrov...@gmail.com> wrote: > On 6/19/12, Andrej Mitrovic <andrej.mitrov...@gmail.com> wrote: >> On 6/19/12, Timon Gehr <timon.g...@gmx.ch> wrote: >>> Indeed. If you are interested, I'll make it work with qualified types as >>> well. =) >> >> I thought it already does? >> > > Oh you meant to *keep* the qualifier, yeah. >
Well since you conveniently use the "R" alias, I think all that's needed is this at the end: static if (is(A T == const)) alias const(R) SwapElem; else alias R SwapElem;