Skip to content

Commit 02f436c

Browse files
committed
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.
1 parent da8ea58 commit 02f436c

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

doc/algorithm.qbk

+5-1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ Generate an increasing series
106106
Apply a functor to the elements of a sequence
107107
[endsect:for_each_n]
108108

109+
[section:transform_inclusive_scan transform_inclusive_scan]
110+
[*[^[link boost.algorithm.transform_inclusive_scan transform_inclusive_scan] ] ]
111+
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.
112+
[endsect:transform_inclusive_scan]
113+
109114
[endsect:CXX17_inner_algorithms]
110115

111116
[endsect:CXX17]
@@ -235,7 +240,6 @@ Raise a value to an integral power ([^constexpr] since C++14)
235240
* [*[^[link header.boost.algorithm.cxx17.inclusive_scan_hpp inclusive_scan] ] ]
236241
* [*[^[link header.boost.algorithm.cxx17.reduce_hpp reduce] ] ]
237242
* [*[^[link header.boost.algorithm.cxx17.transform_exclusive_scan_hpp transform_exclusive_scan] ] ]
238-
* [*[^[link header.boost.algorithm.cxx17.transform_inclusive_scan_hpp transform_inclusive_scan] ] ]
239243
* [*[^[link header.boost.algorithm.cxx17.transform_reduce_hpp transform_reduce] ] ]
240244

241245
[endsect:not_yet_documented_cxx17_algos]

include/boost/algorithm/cxx17/transform_inclusive_scan.hpp

+29
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,21 @@
2222

2323
namespace boost { namespace algorithm {
2424

25+
/// \fn transform_inclusive_scan ( InputIterator first, InputIterator last, OutputIterator result, BinaryOperation bOp, UnaryOperation uOp, T init )
26+
/// \brief Transforms elements from the input range with uOp and then combines
27+
/// those transformed elements with bOp such that the n-1th element and the nth
28+
/// element are combined. Inclusivity means that the nth element is included in
29+
/// the nth combination.
30+
/// \return The updated output iterator
31+
///
32+
/// \param first The start of the input sequence
33+
/// \param last The end of the input sequence
34+
/// \param result The output iterator to write the results into
35+
/// \param bOp The operation for combining transformed input elements
36+
/// \param uOp The operation for transforming input elements
37+
/// \param init The initial value
38+
///
39+
/// \note This function is part of the C++17 standard library
2540
template<class InputIterator, class OutputIterator,
2641
class BinaryOperation, class UnaryOperation, class T>
2742
OutputIterator transform_inclusive_scan(InputIterator first, InputIterator last,
@@ -37,6 +52,20 @@ OutputIterator transform_inclusive_scan(InputIterator first, InputIterator last,
3752
return result;
3853
}
3954

55+
/// \fn transform_inclusive_scan ( InputIterator first, InputIterator last, OutputIterator result, BinaryOperation bOp, UnaryOperation uOp, T init )
56+
/// \brief Transforms elements from the input range with uOp and then combines
57+
/// those transformed elements with bOp such that the n-1th element and the nth
58+
/// element are combined. Inclusivity means that the nth element is included in
59+
/// the nth combination. The first value will be used as the init.
60+
/// \return The updated output iterator
61+
///
62+
/// \param first The start of the input sequence
63+
/// \param last The end of the input sequence
64+
/// \param result The output iterator to write the results into
65+
/// \param bOp The operation for combining transformed input elements
66+
/// \param uOp The operation for transforming input elements
67+
///
68+
/// \note This function is part of the C++17 standard library
4069
template<class InputIterator, class OutputIterator,
4170
class BinaryOperation, class UnaryOperation>
4271
OutputIterator transform_inclusive_scan(InputIterator first, InputIterator last,

0 commit comments

Comments
 (0)