stl: std::is_reference_v
This commit is contained in:
@@ -494,7 +494,7 @@ public:
|
||||
*/
|
||||
template<typename Type>
|
||||
[[nodiscard]] meta_any allow_cast() const {
|
||||
if constexpr(!std::is_reference_v<Type> || stl::is_const_v<stl::remove_reference_t<Type>>) {
|
||||
if constexpr(!stl::is_reference_v<Type> || stl::is_const_v<stl::remove_reference_t<Type>>) {
|
||||
if(storage.has_value<stl::remove_cvref_t<Type>>()) {
|
||||
return as_ref();
|
||||
} else if(*this) {
|
||||
@@ -530,7 +530,7 @@ public:
|
||||
*/
|
||||
template<typename Type>
|
||||
[[nodiscard]] bool allow_cast() {
|
||||
if constexpr(std::is_reference_v<Type> && !stl::is_const_v<stl::remove_reference_t<Type>>) {
|
||||
if constexpr(stl::is_reference_v<Type> && !stl::is_const_v<stl::remove_reference_t<Type>>) {
|
||||
return allow_cast<const stl::remove_reference_t<Type> &>() && (storage.policy() != any_policy::cref);
|
||||
} else {
|
||||
if(storage.has_value<stl::remove_cvref_t<Type>>()) {
|
||||
|
||||
@@ -33,7 +33,7 @@ struct as_void_t final: private internal::meta_policy {
|
||||
struct as_ref_t final: private internal::meta_policy {
|
||||
/*! @cond ENTT_INTERNAL */
|
||||
template<typename Type>
|
||||
static constexpr bool value = std::is_reference_v<Type> && !stl::is_const_v<stl::remove_reference_t<Type>>;
|
||||
static constexpr bool value = stl::is_reference_v<Type> && !stl::is_const_v<stl::remove_reference_t<Type>>;
|
||||
/*! @endcond */
|
||||
};
|
||||
|
||||
@@ -41,7 +41,7 @@ struct as_ref_t final: private internal::meta_policy {
|
||||
struct as_cref_t final: private internal::meta_policy {
|
||||
/*! @cond ENTT_INTERNAL */
|
||||
template<typename Type>
|
||||
static constexpr bool value = std::is_reference_v<Type>;
|
||||
static constexpr bool value = stl::is_reference_v<Type>;
|
||||
/*! @endcond */
|
||||
};
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ using std::is_nothrow_destructible_v;
|
||||
using std::is_nothrow_invocable_v;
|
||||
using std::is_nothrow_move_constructible_v;
|
||||
using std::is_pointer_v;
|
||||
using std::is_reference_v;
|
||||
using std::is_same_v;
|
||||
using std::is_trivially_destructible_v;
|
||||
using std::is_void_v;
|
||||
|
||||
Reference in New Issue
Block a user