     ///     succeeds.
     /// - Returns: `True` if the exchange occurred, or `False` if `expected` did not
     ///     match the current value and so no exchange occurred.
+    @_specialize(where T == Int)
+    @_specialize(where T == Bool)
+    @_specialize(where T == UInt64)
+    // in Swift 4.0 (fixed in 4.0.2), there was a crash that only allowed three specialisations otherwise the compiler would crash
+    // FIXME: Bring back when we require Swift >= 4.0.2
+    // @_specialize(where T == UInt)
+    // @_specialize(where T == Int64)
     public func compareAndExchange(expected: T, desired: T) -> Bool {
         return T.atomic_compare_and_exchange(self.value, expected, desired)
     }

    /// event will be ordered before or after this one.
    ///
    /// - Returns: The value of this object
    public func load() -> T {
        return T.atomic_load(self.value)
    }

    ///
    /// - Parameter rhs: The value to add to this object.
    /// - Returns: The previous value of this object, before the addition occurred.
    @_specialize(where T == Int)
    @_specialize(where T == Bool)
    @_specialize(where T == UInt64)
    // in Swift 4.0 (fixed in 4.0.2), there was a crash that only allowed three specialisations otherwise the compiler would crash
    // FIXME: Bring back when we require Swift >= 4.0.2
    // @_specialize(where T == UInt)
    // @_specialize(where T == Int64)
    public func add(_ rhs: T) -> T {
        return T.atomic_add(self.value, rhs)
    }
