From d2dac558e7ead367b3c659484592bd7e8dc9df71 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 10 Jun 2019 21:54:53 +1000 Subject: [PATCH] Add a gather overload that infer element type --- src/ranges.hh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/ranges.hh b/src/ranges.hh index 88f6d2ef..014dbd8b 100644 --- a/src/ranges.hh +++ b/src/ranges.hh @@ -53,7 +53,7 @@ template using IteratorOf = decltype(std::begin(std::declval())); template -using ValueOf = typename Range::value_type; +using ValueOf = decltype(*std::declval>()); template struct SkipView @@ -450,6 +450,16 @@ auto gather() }); } +template