Add documentation to transform_inclusive_scan

Problem:
- There is no documentation for the existing functions. This will make
  it harder for users to consume these functions, especially as new
  variants are added.

Solution:
- Add documentation.
This commit is contained in:
Jonathan Gopel
2022-06-05 14:03:16 +00:00
parent da8ea581eb
commit 02f436c25d
2 changed files with 34 additions and 1 deletions

View File

@ -106,6 +106,11 @@ Generate an increasing series
Apply a functor to the elements of a sequence Apply a functor to the elements of a sequence
[endsect:for_each_n] [endsect:for_each_n]
[section:transform_inclusive_scan transform_inclusive_scan]
[*[^[link boost.algorithm.transform_inclusive_scan transform_inclusive_scan] ] ]
Transform each element in a range then combine adjacent elements to create an output range. Inclusive scaning means that the nth input is present in the nth output.
[endsect:transform_inclusive_scan]
[endsect:CXX17_inner_algorithms] [endsect:CXX17_inner_algorithms]
[endsect:CXX17] [endsect:CXX17]
@ -235,7 +240,6 @@ Raise a value to an integral power ([^constexpr] since C++14)
* [*[^[link header.boost.algorithm.cxx17.inclusive_scan_hpp inclusive_scan] ] ] * [*[^[link header.boost.algorithm.cxx17.inclusive_scan_hpp inclusive_scan] ] ]
* [*[^[link header.boost.algorithm.cxx17.reduce_hpp reduce] ] ] * [*[^[link header.boost.algorithm.cxx17.reduce_hpp reduce] ] ]
* [*[^[link header.boost.algorithm.cxx17.transform_exclusive_scan_hpp transform_exclusive_scan] ] ] * [*[^[link header.boost.algorithm.cxx17.transform_exclusive_scan_hpp transform_exclusive_scan] ] ]
* [*[^[link header.boost.algorithm.cxx17.transform_inclusive_scan_hpp transform_inclusive_scan] ] ]
* [*[^[link header.boost.algorithm.cxx17.transform_reduce_hpp transform_reduce] ] ] * [*[^[link header.boost.algorithm.cxx17.transform_reduce_hpp transform_reduce] ] ]
[endsect:not_yet_documented_cxx17_algos] [endsect:not_yet_documented_cxx17_algos]

View File

@ -22,6 +22,21 @@
namespace boost { namespace algorithm { namespace boost { namespace algorithm {
/// \fn transform_inclusive_scan ( InputIterator first, InputIterator last, OutputIterator result, BinaryOperation bOp, UnaryOperation uOp, T init )
/// \brief Transforms elements from the input range with uOp and then combines
/// those transformed elements with bOp such that the n-1th element and the nth
/// element are combined. Inclusivity means that the nth element is included in
/// the nth combination.
/// \return The updated output iterator
///
/// \param first The start of the input sequence
/// \param last The end of the input sequence
/// \param result The output iterator to write the results into
/// \param bOp The operation for combining transformed input elements
/// \param uOp The operation for transforming input elements
/// \param init The initial value
///
/// \note This function is part of the C++17 standard library
template<class InputIterator, class OutputIterator, template<class InputIterator, class OutputIterator,
class BinaryOperation, class UnaryOperation, class T> class BinaryOperation, class UnaryOperation, class T>
OutputIterator transform_inclusive_scan(InputIterator first, InputIterator last, OutputIterator transform_inclusive_scan(InputIterator first, InputIterator last,
@ -37,6 +52,20 @@ OutputIterator transform_inclusive_scan(InputIterator first, InputIterator last,
return result; return result;
} }
/// \fn transform_inclusive_scan ( InputIterator first, InputIterator last, OutputIterator result, BinaryOperation bOp, UnaryOperation uOp, T init )
/// \brief Transforms elements from the input range with uOp and then combines
/// those transformed elements with bOp such that the n-1th element and the nth
/// element are combined. Inclusivity means that the nth element is included in
/// the nth combination. The first value will be used as the init.
/// \return The updated output iterator
///
/// \param first The start of the input sequence
/// \param last The end of the input sequence
/// \param result The output iterator to write the results into
/// \param bOp The operation for combining transformed input elements
/// \param uOp The operation for transforming input elements
///
/// \note This function is part of the C++17 standard library
template<class InputIterator, class OutputIterator, template<class InputIterator, class OutputIterator,
class BinaryOperation, class UnaryOperation> class BinaryOperation, class UnaryOperation>
OutputIterator transform_inclusive_scan(InputIterator first, InputIterator last, OutputIterator transform_inclusive_scan(InputIterator first, InputIterator last,