Permalink
Browse files

Add documentation to invoke_fused and invoke

  • Loading branch information...
Naios committed May 5, 2017
1 parent 59b11ef commit e890af420c134eedcd0383c17a47223ea2865255
Showing with 55 additions and 0 deletions.
  1. +2 −0 docs/CMakeLists.txt
  2. +8 −0 docs/hpx.idx
  3. +22 −0 hpx/util/invoke.hpp
  4. +23 −0 hpx/util/invoke_fused.hpp
View
@@ -171,6 +171,8 @@ set(doxygen_dependencies
"${PROJECT_SOURCE_DIR}/hpx/lcos/when_some.hpp"
"${PROJECT_SOURCE_DIR}/hpx/lcos/wait_each.hpp"
"${PROJECT_SOURCE_DIR}/hpx/lcos/when_each.hpp"
"${PROJECT_SOURCE_DIR}/hpx/util/invoke.hpp"
"${PROJECT_SOURCE_DIR}/hpx/util/invoke_fused.hpp"
"${PROJECT_SOURCE_DIR}/hpx/performance_counters/manage_counter_type.hpp")
View
@@ -511,6 +511,14 @@ when_each_n "" "header\.hpx\.lcos\.when_each.*"
wait_each "" "header\.hpx\.lcos\.wait_each.*"
wait_each_n "" "header\.hpx\.lcos\.wait_each.*"
# hpx/util/invoke.hpp
invoke "" "header\.hpx\.util\.invoke.*"
invoke_r "" "header\.hpx\.util\.invoke_r.*"
# hpx/util/invoke_fused.hpp
invoke_fused "" "header\.hpx\.util\.invoke_fused.*"
invoke_fused_r "" "header\.hpx\.util\.invoke_fused_r.*"
# hpx/hpx_finalize.hpp
finalize "" "hpx\.finalize.*"
terminate "" "hpx\.terminate.*"
View
@@ -127,6 +127,22 @@ namespace hpx { namespace util
};
}
/// Invokes the given callable object f with the content of
/// the argument pack vs
///
/// \param f Requires to be a callable object.
/// If f is a member function pointer, the first argument in
/// the pack will be treated as the callee (this object).
///
/// \param vs An arbitrary pack of arguments
///
/// \returns The result of the callable object when it's called with
/// the given argument types.
///
/// \throws std::exception like objects thrown by call to object f
/// with the argument types vs.
///
/// \note This function is similar to `std::invoke` (C++17)
template <typename F, typename ...Ts>
HPX_HOST_DEVICE HPX_FORCEINLINE
typename util::result_of<F&&(Ts&&...)>::type
@@ -138,6 +154,10 @@ namespace hpx { namespace util
std::forward<F>(f), std::forward<Ts>(vs)...);
}
/// \copydoc invoke
///
/// \tparam R The result type of the function when it's called
/// with the content of the given argument types vs.
template <typename R, typename F, typename ...Ts>
HPX_HOST_DEVICE HPX_FORCEINLINE
R invoke_r(F&& f, Ts&&... vs)
@@ -147,6 +167,7 @@ namespace hpx { namespace util
}
///////////////////////////////////////////////////////////////////////////
/// \cond NOINTERNAL
namespace functional
{
struct invoke
@@ -175,6 +196,7 @@ namespace hpx { namespace util
}
};
}
/// \endcond
}}
#endif
View
@@ -68,6 +68,23 @@ namespace hpx { namespace util
}
}
/// Invokes the given callable object f with the content of
/// the sequenced type t (tuples, pairs)
///
/// \param f Must be a callable object. If f is a member function pointer,
/// the first argument in the sequenced type will be treated as
/// the callee (this object).
///
/// \param t A type which is content accessible through a call
/// to hpx#util#get.
///
/// \returns The result of the callable object when it's called with
/// the content of the given sequenced type.
///
/// \throws std::exception like objects thrown by call to object f
/// with the arguments contained in the sequenceable type t.
///
/// \note This function is similar to `std::apply` (C++17)
template <typename F, typename Tuple>
HPX_HOST_DEVICE HPX_FORCEINLINE
typename detail::fused_result_of<F&&(Tuple&&)>::type
@@ -80,6 +97,10 @@ namespace hpx { namespace util
typename detail::fused_index_pack<Tuple>::type());
}
/// \copydoc invoke_fused
///
/// \tparam R The result type of the function when it's called
/// with the content of the given sequenced type.
template <typename R, typename F, typename Tuple>
HPX_HOST_DEVICE HPX_FORCEINLINE
R invoke_fused_r(F&& f, Tuple&& t)
@@ -89,6 +110,7 @@ namespace hpx { namespace util
typename detail::fused_index_pack<Tuple>::type());
}
///////////////////////////////////////////////////////////////////////////
/// \cond NOINTERNAL
namespace functional
{
struct invoke_fused
@@ -119,6 +141,7 @@ namespace hpx { namespace util
}
};
}
/// \endcond
}}
#endif

0 comments on commit e890af4

Please sign in to comment.