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

UniqueArray can't be used with classes #6

Open
atilaneves opened this issue Jun 6, 2017 · 4 comments
Open

UniqueArray can't be used with classes #6

atilaneves opened this issue Jun 6, 2017 · 4 comments

Comments

@atilaneves
Copy link
Owner

No description provided.

@radcapricorn
Copy link
Contributor

You mean actually creating arrays of class instances, as opposed to class references? It's doable, although IMHO there wouldn't be much benefit to it. Do you have a practical use case for it?

@atilaneves
Copy link
Owner Author

I was just updating Unique and RefCounted to work with classes and thought UniqueArray should be able to do that too.

@jmh530
Copy link
Contributor

jmh530 commented Jan 30, 2019

@atilaneves There are also no class unittests for Unique as well. I noticed when the following failed when I tried to run it:

import stdx.allocator.mallocator: Mallocator;
import automem : Unique;

class Point
{
    int x;
    int y;
}

void main()
{
    auto u1 = Unique!(Point, Mallocator)(2, 3);
}

@jmh530
Copy link
Contributor

jmh530 commented Jan 30, 2019

@atilaneves Hmm, well I was incorrect that there are no unittests for this keep. You just keep them in a separate folder. I'm still not really sure why it fails though...

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

3 participants