Closed lorentey closed 1 year ago
Also add some basic tests exercising these.
With this in place, RawRepresentable types whose RawValue is AtomicOptionalWrappable can also opt into "atomic optional wrappability" by simply conforming to the protocol -- no need to define any members:
RawRepresentable
RawValue
AtomicOptionalWrappable
struct Hyacinth: RawRepresentable, AtomicOptionalWrappable { var rawValue: UnsafeRawPointer init(rawValue: UnsafeRawPointer) { self.rawValue = rawValue } } let ref = ManagedAtomic<Hyacinth?>(nil) // OK! ref.store(Hyacinth(rawValue: p)!, ordering: .relaxed) // OK!
@swift-ci test
Also add some basic tests exercising these.
With this in place,
RawRepresentable
types whoseRawValue
isAtomicOptionalWrappable
can also opt into "atomic optional wrappability" by simply conforming to the protocol -- no need to define any members:Checklist