Error: type XXX is not an expression

Era Scarecrow rtcvb32 at yahoo.com
Sun Sep 1 21:21:18 PDT 2013


   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...
}

enum FlagStates {def}

struct Changes {
    string fileFrom;    //goes away if commented out...?
    HandleFlags!(FlagStates, int) state;
}

[/code]


More information about the Digitalmars-d-learn mailing list