On Mon, Mar 15, 2010 at 16:12, Steven Schveighoffer <schveiguy@yahoo.com> wrote:
Yeah, I tried to get it to work too, but it doesn't. Even something like this doesn't work:
struct Foo {
uint x;
uint castToUint() { return x; }
alias castToUint this;
}
This should work. The template code you wrote above might not work, because you can't overload functions on no arguments. I'm unsure how this should work, but at least something like this should:
alias opCast!uint this;
A bug filing is in order I think.