Permalink
Browse files

Rename the internal mapper invoke to invoke_mapper

* Prevents wrong function selection caused through ADL
* Also namespace a call to make_tuple
  • Loading branch information...
Naios committed Jul 24, 2017
1 parent 35bd75b commit c708feafe5759b9cda7714d021ab8fa5343f5eb0
Showing with 8 additions and 7 deletions.
  1. +6 −6 hpx/util/detail/pack_traversal_impl.hpp
  2. +2 −1 hpx/util/pack_traversal.hpp
@@ -864,7 +864,7 @@ namespace util {
/// Invokes the real mapper with the given element
template <typename T>
auto invoke(T&& element)
auto invoke_mapper(T&& element)
-> decltype(std::declval<mapping_helper>().mapper_(
std::forward<T>(element)))
{
@@ -874,12 +874,12 @@ namespace util {
/// SFINAE helper for plain elements not satisfying the tuple like
/// or container requirements.
///
/// We use the proxy function invoke here,
/// We use the proxy function invoke_mapper here,
/// because some compilers (MSVC) tend to instantiate the invocation
/// before matching the tag, which leads to build failures.
template <typename T>
auto match(container_match_tag<false, false>, T&& element)
-> decltype(std::declval<mapping_helper>().invoke(
-> decltype(std::declval<mapping_helper>().invoke_mapper(
std::forward<T>(element)));
/// SFINAE helper for elements satisfying the container
@@ -915,17 +915,17 @@ namespace util {
/// Match plain elements not satisfying the tuple like or
/// container requirements.
///
/// We use the proxy function invoke here,
/// We use the proxy function invoke_mapper here,
/// because some compilers (MSVC) tend to instantiate the invocation
/// before matching the tag, which leads to build failures.
template <typename T>
auto try_match(container_match_tag<false, false>, T&& element)
-> decltype(std::declval<mapping_helper>().invoke(
-> decltype(std::declval<mapping_helper>().invoke_mapper(
std::forward<T>(element)))
{
// T could be any non container or non tuple like type here,
// take int or hpx::future<int> as an example.
return invoke(std::forward<T>(element));
return invoke_mapper(std::forward<T>(element));
}
/// Match elements satisfying the container requirements,
@@ -7,6 +7,7 @@
#define HPX_UTIL_PACK_TRAVERSAL_HPP
#include <hpx/util/detail/pack_traversal_impl.hpp>
#include <hpx/util/tuple.hpp>
#include <type_traits>
#include <utility>
@@ -72,7 +73,7 @@ namespace util {
T&&... args)
{
return detail::spreading::spread_box<typename std::decay<T>::type...>(
make_tuple(std::forward<T>(args)...));
util::make_tuple(std::forward<T>(args)...));
}
/// Traverses the pack with the given visitor.

0 comments on commit c708fea

Please sign in to comment.