From 62823f8f56816f8202c5bf09e15940cbf0d8166c Mon Sep 17 00:00:00 2001 From: Denis Blank Date: Thu, 1 Feb 2018 22:45:20 +0100 Subject: [PATCH] More conversion work --- include/continuable/detail/pack-traversal.hpp | 30 +++++++------------ 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/include/continuable/detail/pack-traversal.hpp b/include/continuable/detail/pack-traversal.hpp index 011ab7b..1c55bba 100644 --- a/include/continuable/detail/pack-traversal.hpp +++ b/include/continuable/detail/pack-traversal.hpp @@ -200,10 +200,10 @@ constexpr auto apply_spread_impl(std::true_type, C&& callable, T&&... args) /// Use the linear instantiation for variadic packs which don't /// contain spread types. template -constexpr auto apply_spread_impl(std::false_type, C&& callable, T&&... args) -> - typename invoke_result::type { - return hpx::util::invoke(std::forward(callable), std::forward(args)...); -} +constexpr auto apply_spread_impl(std::false_type, C&& callable, T&&... args) + -> decltype(std::forward(callable)(std::forward(args)...)) { + return std::forward(callable)(std::forward(args)...); +} // namespace spreading /// Deduces to a true_type if any of the given types marks /// the underlying type to be spread into the current context. @@ -270,7 +270,7 @@ constexpr auto tupelize_or_void(T&&... args) -> decltype(voidify_empty_tuple(tupelize(std::forward(args)...))) { return voidify_empty_tuple(tupelize(std::forward(args)...)); } -} // end namespace spreading +} // namespace spreading /// Just traverses the pack with the given callable object, /// no result is returned or preserved. @@ -457,7 +457,7 @@ auto remap_container(container_mapping_tag, M&& mapper, // We try to reserve the original size from the source // container to the destination container. - traits::detail::reserve_if_reservable(remapped, container.size()); + // TODO traits::detail::reserve_if_reservable(remapped, container.size()); // Perform the actual value remapping from the source to // the destination. @@ -553,8 +553,8 @@ struct tuple_like_remapper, M mapper_; template - auto operator()(Args&&... args) -> - typename always_void::type...>::type { + auto operator()(Args&&... args) + -> std::void_t::type...> { int dummy[] = {0, ((void)mapper_(std::forward(args)), 0)...}; (void)dummy; } @@ -795,10 +795,7 @@ public: /// \copybrief try_traverse template - auto init_traverse(strategy_remap_tag, T&& element) - -> decltype(spreading::unpack_or_void( - std::declval().try_traverse(strategy_remap_tag{}, - std::declval()))) { + auto init_traverse(strategy_remap_tag, T&& element) { return spreading::unpack_or_void( try_traverse(strategy_remap_tag{}, std::forward(element))); } @@ -811,14 +808,7 @@ public: /// and returns a tuple containing the remapped content. template auto init_traverse(strategy_remap_tag strategy, First&& first, - Second&& second, T&&... rest) - -> decltype(spreading::tupelize_or_void( - std::declval().try_traverse( - strategy, std::forward(first)), - std::declval().try_traverse( - strategy, std::forward(second)), - std::declval().try_traverse( - strategy, std::forward(rest))...)) { + Second&& second, T&&... rest) { return spreading::tupelize_or_void( try_traverse(strategy, std::forward(first)), try_traverse(strategy, std::forward(second)),