Uri class and parser

jerro a at a.com
Thu Nov 8 15:42:42 PST 2012


> After trying your solution I found out I was calling 
> indexOf(string, char) which apparently is different than 
> indexOf(string, string) as I now no longer have that error.
> Instead, when I call parse on compile time I get the following 
> at the method parse:
> Error: URI class literals cannot be returned from CTFE

It looks like you can't have class enums. This fails too:

class A{}
enum a = new A;

I don't think you can get around this, but you can still test if 
your URI class works at compile time by doing something like this:

auto foo()
{
    // Write code that uses the URI class here

    // return something that can be assigned to an enum
    return something;
}

enum bar = foo();


More information about the Digitalmars-d mailing list