|
@@ -205,10 +205,9 @@ public:
|
|
|
* @param value A pointer to an object to take ownership of.
|
|
* @param value A pointer to an object to take ownership of.
|
|
|
*/
|
|
*/
|
|
|
template<typename Type>
|
|
template<typename Type>
|
|
|
|
|
+ requires (!std::is_const_v<Type> && !std::is_void_v<Type>)
|
|
|
explicit basic_any(std::in_place_t, Type *value)
|
|
explicit basic_any(std::in_place_t, Type *value)
|
|
|
: base_type{} {
|
|
: base_type{} {
|
|
|
- static_assert(!std::is_const_v<Type> && !std::is_void_v<Type>, "Non-const non-void pointer required");
|
|
|
|
|
-
|
|
|
|
|
if(value == nullptr) {
|
|
if(value == nullptr) {
|
|
|
initialize<void>();
|
|
initialize<void>();
|
|
|
} else {
|
|
} else {
|
|
@@ -339,9 +338,8 @@ public:
|
|
|
* @return False if the wrapper does not contain the expected type, true
|
|
* @return False if the wrapper does not contain the expected type, true
|
|
|
* otherwise.
|
|
* otherwise.
|
|
|
*/
|
|
*/
|
|
|
- template<typename Type>
|
|
|
|
|
|
|
+ template<cvref_unqualified Type>
|
|
|
[[nodiscard]] bool has_value() const noexcept {
|
|
[[nodiscard]] bool has_value() const noexcept {
|
|
|
- static_assert(std::is_same_v<std::remove_const_t<Type>, Type>, "Invalid type");
|
|
|
|
|
return (underlying_type == type_hash<Type>::value());
|
|
return (underlying_type == type_hash<Type>::value());
|
|
|
}
|
|
}
|
|
|
|
|
|