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

Issue 6935 - struct with @disable this cannot make range #324

Merged
merged 2 commits into from
Nov 13, 2011

Conversation

9rnsr
Copy link
Contributor

@9rnsr 9rnsr commented Nov 12, 2011

@shoo
Copy link
Collaborator

shoo commented Nov 13, 2011

I do not think that these measures bring fundamental solution.
If user-defined @disable init property is defined, this fix is broken.

struct A
{
    @disable this();
    @disable static @property A init();
    @disable this(this);
    enum Dummy { dummy }
    private this(Dummy dummy) {}
}

void main()
{
    A a = A.init; // NG
}

@shoo
Copy link
Collaborator

shoo commented Nov 13, 2011

To replace T foo = T.init to T foo = void; is workaround for this issue.

BTW, isOutputRange is ignored...

@9rnsr
Copy link
Contributor Author

9rnsr commented Nov 13, 2011

@shoo
You are right, T foo = void; is better than T.init in this case.
And I had completely forgotten about isOutputRange. Hahaha.

shoo added a commit that referenced this pull request Nov 13, 2011
Issue 6935 - struct with @disable this cannot make range
@shoo shoo merged commit bd5141b into dlang:master Nov 13, 2011
marler8997 pushed a commit to marler8997/phobos that referenced this pull request Nov 10, 2019
Fix Travis: fix checking out tags with setup.sh
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

Successfully merging this pull request may close these issues.

2 participants