     }
     return nil
   }
+#endif
 }
 
 extension Unmanaged

    }
    return nil
  }

  @inline(__always)
  public mutating func swapIfNil(_ ref: T, order: MemoryOrder = .sequential) -> Bool
  {


extension AtomicReference
{
#if swift(>=4.2)
  @inlinable
  public mutating func swap(_ ref: T?, order: MemoryOrder = .sequential) -> T?
  {
    let u = Unmanaged.tryRetain(ref)?.toOpaque()
    if let pointer = ptr.swap(u, order)
    {
      return Unmanaged<T>.fromOpaque(pointer).takeRetainedValue()
    }
    return nil
  }
#else
  @inline(__always)
  public mutating func swap(_ ref: T?, order: MemoryOrder = .sequential) -> T?
  {
