introduce gsl::not_null<T>::element_type (#1196)

* introduce gsl::not_null<T>::element_type

* use std::is_same instead of is_same_v

* fix: cannot put a non-pointer in a gsl::not_null
This commit is contained in:
Carson Radtke
2025-02-12 09:16:05 -06:00
committed by GitHub
parent 7f4fc9388b
commit ec729d63a7
4 changed files with 23 additions and 0 deletions

View File

@@ -88,4 +88,10 @@ TEST(pointers_test, swap)
"!SwapCompilesFor<NotMoveAssignableCustomPtr>");
}
TEST(pointers_test, member_types)
{
static_assert(std::is_same<gsl::not_null<int*>::element_type, int*>::value,
"check member type: element_type");
}
} // namespace