Can operators "return" type?

Simen Kjaeraas simen.kjaras at gmail.com
Thu Nov 29 08:57:52 PST 2012


On 2012-11-29, 17:33, Zhenya wrote:

> Hi!
> It would useful for some my project,if operators could be a  
> template,that "return"
> type.Something like
>
> alias TypeTuple!(int,char) types;
>
> static assert(types[1] == char) //opIndex
>
> So can I define something like that?

This works out of the box. If you want to define your own
TypeTuple-like construct, the answer is most likely going to be no.

-- 
Simen


More information about the Digitalmars-d-learn mailing list