Start using deducing this, needs more utilities work
This commit is contained in:
4
.bazelrc
4
.bazelrc
@ -9,8 +9,8 @@ build:windows --extra_toolchains=@@rules_cc++cc_configure_extension+local_confi
|
|||||||
|
|
||||||
build:linux --repo_env=CC=clang
|
build:linux --repo_env=CC=clang
|
||||||
|
|
||||||
build:windows --cxxopt=-Xclang=-std=c++20
|
build:windows --cxxopt=-Xclang=-std=c++23
|
||||||
build:linux --cxxopt=-std=c++20
|
build:linux --cxxopt=-std=c++23
|
||||||
|
|
||||||
build --cxxopt=-Wall
|
build --cxxopt=-Wall
|
||||||
build --cxxopt=-Wno-c++98-compat
|
build --cxxopt=-Wno-c++98-compat
|
||||||
|
@ -193,11 +193,11 @@ template<typename T> concept is_integer = _is_integer_helper<un_cv_t<T>>::value;
|
|||||||
|
|
||||||
template<typename T> concept is_enum = __is_enum(T);
|
template<typename T> concept is_enum = __is_enum(T);
|
||||||
|
|
||||||
template<typename T> struct is_uniquely_represented : false_type {};
|
template<typename T> struct is_uniquely_represented : false_type {};
|
||||||
template<is_integer T> struct is_uniquely_represented<T> : true_type {};
|
template<is_integer T> struct is_uniquely_represented<T> : true_type {};
|
||||||
template<is_enum T> struct is_uniquely_represented<T> : true_type {};
|
template<is_enum T> struct is_uniquely_represented<T> : true_type {};
|
||||||
template<> struct is_uniquely_represented<uint128_t> : true_type {};
|
template<> struct is_uniquely_represented<uint128_t> : true_type {};
|
||||||
template<> struct is_uniquely_represented<byte> : true_type {};
|
template<> struct is_uniquely_represented<byte> : true_type {};
|
||||||
|
|
||||||
template<typename T> concept uniquely_represented = is_uniquely_represented<un_cv_t<T>>::value;
|
template<typename T> concept uniquely_represented = is_uniquely_represented<un_cv_t<T>>::value;
|
||||||
|
|
||||||
|
@ -365,23 +365,11 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Todo(C++23) Deducing this
|
template<typename Self>
|
||||||
constexpr T&& value() &&
|
constexpr auto&& value(this Self&& self)
|
||||||
{
|
{
|
||||||
ASL_ASSERT_RELEASE(has_value());
|
ASL_ASSERT_RELEASE(self.has_value());
|
||||||
return ASL_MOVE(m_payload).as_init_unsafe();
|
return ASL_FWD(self).m_payload.as_init_unsafe();
|
||||||
}
|
|
||||||
|
|
||||||
constexpr T& value() &
|
|
||||||
{
|
|
||||||
ASL_ASSERT_RELEASE(has_value());
|
|
||||||
return m_payload.as_init_unsafe();
|
|
||||||
}
|
|
||||||
|
|
||||||
constexpr const T& value() const&
|
|
||||||
{
|
|
||||||
ASL_ASSERT_RELEASE(has_value());
|
|
||||||
return m_payload.as_init_unsafe();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename U>
|
template<typename U>
|
||||||
|
Reference in New Issue
Block a user