automem
automem copied to clipboard
UniqueArray can't be used with classes
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?
I was just updating Unique
and RefCounted
to work with classes and thought UniqueArray
should be able to do that too.
@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);
}
@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...