What UnsafePointer can point to and allocate mem for?
I opened an issue last week in which I reported a problem with allocating for an array of Sets
https://github.com/modularml/mojo/issues/2503
This issue was closed as
and Set in this example seems to be an appropriate object to point to.
As usual, I guess there is a fundamental misunderstanding here on my side and I wonder if anybody can explain to me, what Unsafepointer can point to and allocate memory for. The docu says
but Set comfirms with AnyType of course ... Thx
https://github.com/modularml/mojo/issues/2503
This issue was closed as
not planned'which leaves me confused right now,. From the docu it says UnsafePointer is a pointer type that can point to any generic value that is movable.
and Set in this example seems to be an appropriate object to point to.
As usual, I guess there is a fundamental misunderstanding here on my side and I wonder if anybody can explain to me, what Unsafepointer can point to and allocate memory for. The docu says
T (AnyType): The type the pointer points to.
but Set comfirms with AnyType of course ... Thx
GitHub![[BUG] Accessing allocated memory for an array of sets crashes · Iss...](https://images-ext-1.discordapp.net/external/mAtltLgCmdSC9pBwcGIIVhHgpml2zacUaKrqava9YzM/https/opengraph.githubassets.com/2164f24159bc3670e8f9af82e14b347a4a90dd0b91a0af3f5e7c7292e50ca6f3/modularml/mojo/issues/2503)
Bug description the following code crashes: from collections import Set @value struct IDStruct(KeyElement): var id: Int fn eq(self, other: Self) -> Bool: return self.id == other.id fn ne...
