summaryrefslogtreecommitdiffhomepage
path: root/compat/meta.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-04-03 12:29:30 +0200
committerStanislaw Halik <sthalik@misaki.pl>2018-04-05 03:24:02 +0200
commit600d9e686dcf4e5b7f781341efc7843845a7b7db (patch)
tree97a14420a35068a81e520932eb14bfe8841852df /compat/meta.hpp
parent9918192f0943a61e9970bad9f1a02ffbe3af8591 (diff)
compat/meta: slightly more correct cast
Diffstat (limited to 'compat/meta.hpp')
-rw-r--r--compat/meta.hpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/compat/meta.hpp b/compat/meta.hpp
index 80eca89a..51e9f238 100644
--- a/compat/meta.hpp
+++ b/compat/meta.hpp
@@ -10,7 +10,9 @@
#include <type_traits>
template<typename t>
-using cv_qualified = std::conditional_t<std::is_fundamental_v<std::decay_t<t>>, std::decay_t<t>, const t&>;
+using cv_qualified = std::conditional_t<std::is_fundamental_v<std::decay_t<t>>,
+ std::decay_t<t>,
+ std::add_lvalue_reference_t<std::add_const_t<std::remove_reference_t<t>>>>;
#define progn(...) (([&]() { __VA_ARGS__ })())
#define prog1(x, ...) (([&]() { auto _ret1324 = (x); do { __VA_ARGS__; } while (0); return _ret1324; })())