You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently someone in the channel has tried to do Atomic[SharedPtr], but it's not currently possible. Of course you don't need the encapsulation, could also use an Atomic[bool] for this. But an idea would be to turn SharedPtr = object to distinct pointer and somehow relax the AtomType type class to accept distinct pointers. I have no idea how that would work.
The text was updated successfully, but these errors were encountered:
On planetis' request I'll document a possible solution to this problem:
import std/typetraits
typeAtomicBases=concept a, type A
distinctBase(A) isAtomTypeAllAtomTypes=AtomTypeorAtomicBasesAtomic*[T: AllAtomTyps] =distinct T
This should allow all types that are actually capable of being atomic to be as such, though i guess one might want to ensure that the T itself is not atomic, but I do not know anything about threading.
Recently someone in the channel has tried to do Atomic[SharedPtr], but it's not currently possible. Of course you don't need the encapsulation, could also use an Atomic[bool] for this. But an idea would be to turn SharedPtr = object to distinct pointer and somehow relax the AtomType type class to accept distinct pointers. I have no idea how that would work.
The text was updated successfully, but these errors were encountered: