|
@@ -368,7 +368,7 @@ public:
|
|
|
* @param other Wrapper with which to compare.
|
|
* @param other Wrapper with which to compare.
|
|
|
* @return False if the two objects differ in their content, true otherwise.
|
|
* @return False if the two objects differ in their content, true otherwise.
|
|
|
*/
|
|
*/
|
|
|
- bool operator==(const basic_any &other) const noexcept {
|
|
|
|
|
|
|
+ [[nodiscard]] bool operator==(const basic_any &other) const noexcept {
|
|
|
if(vtable && *info == *other.info) {
|
|
if(vtable && *info == *other.info) {
|
|
|
return (vtable(operation::compare, *this, other.data()) != nullptr);
|
|
return (vtable(operation::compare, *this, other.data()) != nullptr);
|
|
|
}
|
|
}
|
|
@@ -376,6 +376,15 @@ public:
|
|
|
return (!vtable && !other.vtable);
|
|
return (!vtable && !other.vtable);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @brief Checks if two wrappers differ in their content.
|
|
|
|
|
+ * @param other Wrapper with which to compare.
|
|
|
|
|
+ * @return True if the two objects differ in their content, false otherwise.
|
|
|
|
|
+ */
|
|
|
|
|
+ [[nodiscard]] bool operator!=(const basic_any &other) const noexcept {
|
|
|
|
|
+ return !(*this == other);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* @brief Aliasing constructor.
|
|
* @brief Aliasing constructor.
|
|
|
* @return A wrapper that shares a reference to an unmanaged object.
|
|
* @return A wrapper that shares a reference to an unmanaged object.
|
|
@@ -407,19 +416,6 @@ private:
|
|
|
policy mode;
|
|
policy mode;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-/**
|
|
|
|
|
- * @brief Checks if two wrappers differ in their content.
|
|
|
|
|
- * @tparam Len Size of the storage reserved for the small buffer optimization.
|
|
|
|
|
- * @tparam Align Alignment requirement.
|
|
|
|
|
- * @param lhs A wrapper, either empty or not.
|
|
|
|
|
- * @param rhs A wrapper, either empty or not.
|
|
|
|
|
- * @return True if the two wrappers differ in their content, false otherwise.
|
|
|
|
|
- */
|
|
|
|
|
-template<std::size_t Len, std::size_t Align>
|
|
|
|
|
-[[nodiscard]] inline bool operator!=(const basic_any<Len, Align> &lhs, const basic_any<Len, Align> &rhs) noexcept {
|
|
|
|
|
- return !(lhs == rhs);
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* @brief Performs type-safe access to the contained object.
|
|
* @brief Performs type-safe access to the contained object.
|
|
|
* @tparam Type Type to which conversion is required.
|
|
* @tparam Type Type to which conversion is required.
|