On Mon, Sep 02, 2013 at 06:21:18AM +0200, Era Scarecrow wrote:
>   k here's the condensed test file. Seems related to an 'alias
> this', in theory the HandleFlags bit/flag handling you should be
> able to say 'state.def' and it would be the same as
> 'FlagStates.def' without actually having to name it.
> 
> [code]
> 
> import std.traits;
> 
> ///
> struct HandleFlags(E, I)
> if (is(E == enum) && isIntegral!(I) && isFloatingPoint!(I) ==
> false) {
>    I state;   ///Holds state.
>    alias E Enum;
>    alias Enum this;    //seems to be root cause of the problem...

You can't alias a type to this. You need to instantiate it first, then
alias the instance to this (because 'this' is an object, not a type).
For example:

        struct S {}
        struct T {
                //alias S this;  // NG: S is a type
                S s;
                alias s this;   // OK: s is an instance of S
        }


T

-- 
Three out of two people have difficulties with fractions. -- Dirk Eddelbuettel

Reply via email to