I am trying to use Atomic
wrapped types, but I find there are very few methods defined; I assuming this is intentional, but I’d be curious to hear more about the limitations that prevent these from being included! A list of calls I tried:
zero(Atomic{Int}) # MethodError
one(Atomic{Int}) # MethodError
# same for rand, typemin, typemax
isequal(Atomic{Int}(1), 1) # false -- this one is extra surprising
isless(Atomic{Int}(1), 2) # MethodError
convert(Int, Atomic{Int}(1)) # MethodError
only(Atomic{Int}(1)) # MethodError
Eventually I found in some GH issue that getindex
can be used to unwrap Atomic
types, but how come we can’t do more with them directly?