From 9e7895f7fe246dc16eee1d98b461832e35ed96f5 Mon Sep 17 00:00:00 2001 From: Haluk Ozaktas Date: Sun, 4 May 2025 17:08:03 +0200 Subject: [PATCH] Update return by value threshold in gsl::not_null - Allow returning by value for types that are not greater than two pointers in size --- include/gsl/pointers | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/gsl/pointers b/include/gsl/pointers index 28f997c26..3a5409ada 100644 --- a/include/gsl/pointers +++ b/include/gsl/pointers @@ -54,7 +54,7 @@ namespace details // Copied from cppfront's implementation of the CppCoreGuidelines F.16 (https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rf-in) template using value_or_reference_return_t = std::conditional_t< - sizeof(T) < 2*sizeof(void*) && std::is_trivially_copy_constructible::value, + sizeof(T) <= 2*sizeof(void*) && std::is_trivially_copy_constructible::value, const T, const T&>;