summaryrefslogtreecommitdiffhomepage
path: root/compat
diff options
context:
space:
mode:
Diffstat (limited to 'compat')
-rw-r--r--compat/macros.hpp3
1 files changed, 2 insertions, 1 deletions
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<typename t>
using to_const_ref_t = std::add_lvalue_reference_t<std::add_const_t<remove_cvref_t<t>>>;
template<typename t>
-using cv_qualified = std::conditional_t<std::is_fundamental_v<remove_cvref_t<t>>,
+using cv_qualified = std::conditional_t<sizeof(remove_cvref_t<t>) <= sizeof(void*)*4 && std::is_trivially_copyable_v<t> ||
+ std::is_fundamental_v<remove_cvref_t<t>>,
remove_cvref_t<t>,
to_const_ref_t<t>>;