Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alias this issue #15

Open
togrue opened this issue Aug 15, 2016 · 1 comment
Open

Alias this issue #15

togrue opened this issue Aug 15, 2016 · 1 comment

Comments

@togrue
Copy link

togrue commented Aug 15, 2016

This broken down testcase doesn't compile, as long there is a alias this.

    struct TestStruct {
        char[] txt;
        alias txt this;
    }

    auto decerealiser = Decerealiser([0, 2, 0x90, 0x91]);
    auto ts = decerealiser.value!TestStruct;
    assert(ts.txt == ['\x90', '\x91']);
    assert(ts.txt.length == 2);
@atilaneves
Copy link
Owner

This is tricky. The problem here is that the alias this makes TestStruct an InputRange and those are treated differently from "regular" aggregates. I'm not sure how to support ranges and have the example code work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants