See Public API for a list of names and headers that are part of the public HPX API.

namespace hpx
namespace experimental


template<typename T>
constexpr hpx::parallel::v2::detail::induction_stride_helper<T> induction(T &&value, std::size_t stride)#

The function template returns an induction object of unspecified type having a value type and encapsulating an initial value value of that type and, optionally, a stride.

For each element in the input range, a looping algorithm over input sequence S computes an induction value from an induction variable and ordinal position p within S by the formula i + p * stride if a stride was specified or i + p otherwise. This induction value is passed to the element access function.

If the value argument to induction is a non-const lvalue, then that lvalue becomes the live-out object for the returned induction object. For each induction object that has a live-out object, the looping algorithm assigns the value of i + n * stride to the live-out object upon return, where n is the number of elements in the input range.

Template Parameters

T – The value type to be used by the induction object.

  • value – [in] The initial value to use for the induction object

  • stride – [in] The (optional) stride to use for the induction object (default: 1)


This returns an induction object with value type T, initial value value, and (if specified) stride stride. If T is an lvalue of non-const type, value is used as the live-out object for the induction object; otherwise there is no live-out object.

namespace parallel#
namespace v2#