From ede972a70c6d93d68a828b6e84240e1a5fa547a0 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 20 Nov 2021 18:34:21 +0100 Subject: compat/macros: pass trivial types by value in cv_qualified --- compat/macros.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'compat/macros.hpp') diff --git a/compat/macros.hpp b/compat/macros.hpp index 497933cf..f40d7c7a 100644 --- a/compat/macros.hpp +++ b/compat/macros.hpp @@ -20,6 +20,7 @@ template using to_const_ref_t = std::add_lvalue_reference_t>>; template -using cv_qualified = std::conditional_t>, +using cv_qualified = std::conditional_t) <= sizeof(void*)*4 && std::is_trivially_copyable_v || + std::is_fundamental_v>, remove_cvref_t, to_const_ref_t>; -- cgit v1.2.3