mirror of
https://github.com/microsoft/GSL.git
synced 2025-08-01 11:44:28 +02:00
Update return by value threshold in gsl::not_null (#1205)
- Allow returning by value for types that are not greater than two pointers in size
This commit is contained in:
@@ -54,7 +54,7 @@ namespace details
|
|||||||
// Copied from cppfront's implementation of the CppCoreGuidelines F.16 (https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rf-in)
|
// Copied from cppfront's implementation of the CppCoreGuidelines F.16 (https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rf-in)
|
||||||
template<typename T>
|
template<typename T>
|
||||||
using value_or_reference_return_t = std::conditional_t<
|
using value_or_reference_return_t = std::conditional_t<
|
||||||
sizeof(T) < 2*sizeof(void*) && std::is_trivially_copy_constructible<T>::value,
|
sizeof(T) <= 2*sizeof(void*) && std::is_trivially_copy_constructible<T>::value,
|
||||||
const T,
|
const T,
|
||||||
const T&>;
|
const T&>;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user