Skip to content

Commit 466e4eb

Browse files
authored
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
1 parent 3325bbd commit 466e4eb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/gsl/pointers

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ namespace details
5454
// Copied from cppfront's implementation of the CppCoreGuidelines F.16 (https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rf-in)
5555
template<typename T>
5656
using value_or_reference_return_t = std::conditional_t<
57-
sizeof(T) < 2*sizeof(void*) && std::is_trivially_copy_constructible<T>::value,
57+
sizeof(T) <= 2*sizeof(void*) && std::is_trivially_copy_constructible<T>::value,
5858
const T,
5959
const T&>;
6060

0 commit comments

Comments
 (0)