summaryrefslogtreecommitdiffhomepage
path: root/compat
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-05-07 17:25:43 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-05-10 11:19:22 +0200
commitc114e085b3bb51da51c4a7ecceda146e095c7a2e (patch)
tree123b8a1e867f1b3266e30a4595eb9c0640439509 /compat
parent3e913cdf543d5d4b2fd297eb27f3536be692100c (diff)
compat/util: simplify
Diffstat (limited to 'compat')
-rw-r--r--compat/functional.hpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/compat/functional.hpp b/compat/functional.hpp
index 141bbef7..893fe1a0 100644
--- a/compat/functional.hpp
+++ b/compat/functional.hpp
@@ -4,14 +4,12 @@
#include <iterator>
#include <type_traits>
-namespace functools
-{
-
-constexpr void return_void();
-
template<typename t>
using remove_qualifiers = std::remove_reference_t<std::remove_cv_t<t>>;
+namespace functools
+{
+
template<typename seq_, typename = void>
struct reserver_
{
@@ -22,7 +20,7 @@ struct reserver_
};
template<typename seq_>
-struct reserver_<seq_, decltype(std::declval<seq_>().reserve(0u), return_void())>
+struct reserver_<seq_, decltype(std::declval<seq_>().reserve(0u), (void)0)>
{
static inline void maybe_reserve_space(seq_& seq, unsigned sz)
{
@@ -54,7 +52,7 @@ struct constant final
template<typename seq_, typename F>
auto map(F&& fun, const seq_& seq)
{
- using seq_type = functools::remove_qualifiers<seq_>;
+ using seq_type = remove_qualifiers<seq_>;
seq_type ret;
std::back_insert_iterator<seq_type> it = std::back_inserter(ret);