summaryrefslogtreecommitdiffhomepage
path: root/compat
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-10-13 15:05:05 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-10-13 15:09:26 +0200
commit9a0822c445e56580fb3034224191ec825ea0274a (patch)
tree9fce6a93bb72a0db6b60015b58272abe0fba68ba /compat
parent887dd41c5d67c30bd1e9631920d8fc1c3dd1a3f0 (diff)
options/tie: change "tie" overloads
Adjust usages. There are ODR issues with MSVC and it doesn't support C++17 "static inline constexpr" _variables_. Otherwise, "signal_fun" could be a variable and not a function. The usages in accela/ewma2 dialog are more verbose now but the original API was silly.
Diffstat (limited to 'compat')
-rw-r--r--compat/util.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/compat/util.hpp b/compat/util.hpp
index c0d3e3fd..41c8def9 100644
--- a/compat/util.hpp
+++ b/compat/util.hpp
@@ -8,6 +8,7 @@
#include "macros.hpp"
#include "value-templates.hpp"
+#include <type_traits>
#include <memory>
#include <cmath>
#include <utility>
@@ -80,3 +81,8 @@ inline auto clamp(const t& val, const u& min, const w& max)
using tp = decltype(val + min + max);
return ::util_detail::clamp<std::decay_t<tp>, tp>::clamp_(val, min, max);
}
+
+template<typename t>
+using cv_qualified = std::conditional_t<is_fundamental_v<std::decay_t<t>>, std::decay_t<t>, const t&>;
+
+