From 466e4ebaa54dcf4257698d707d76d69a90614450 Mon Sep 17 00:00:00 2001 From: ozaktash <60927683+ozaktash@users.noreply.github.com> Date: Mon, 12 May 2025 19:02:03 +0200 Subject: [PATCH] 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 --- include/gsl/pointers | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/gsl/pointers b/include/gsl/pointers index 28f997c..3a5409a 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&>;