mirror of
https://github.com/microsoft/GSL
synced 2026-08-26 04:23:04 -04:00
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:
parent
7f4fc9388b
commit
ec729d63a7
4 changed files with 23 additions and 0 deletions
|
|
@ -366,6 +366,13 @@ TEST(strict_notnull_tests, TestStrictNotNull)
|
|||
}
|
||||
}
|
||||
|
||||
TEST(pointers_test, member_types)
|
||||
{
|
||||
// make sure `element_type` is inherited from `gsl::not_null`
|
||||
static_assert(std::is_same<gsl::strict_not_null<int*>::element_type, int*>::value,
|
||||
"check member type: element_type");
|
||||
}
|
||||
|
||||
#if defined(__cplusplus) && (__cplusplus >= 201703L)
|
||||
|
||||
TEST(strict_notnull_tests, TestStrictNotNullConstructorTypeDeduction)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue