Skip to content

Commit 6b7a38f

Browse files
committed
Add documentation to transform_exclusive_scan
Problem: - There is no documentation for the existing functions. This will make it harder for users to consume these functions, espcially as new variants are added. Solution: - Add documentation.
1 parent 02f436c commit 6b7a38f

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

doc/algorithm.qbk

+5-1
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ Apply a functor to the elements of a sequence
111111
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.
112112
[endsect:transform_inclusive_scan]
113113

114+
[section:transform_exclusive_scan transform_exclusive_scan]
115+
[*[^[link boost.algorithm.transform_exclusive_scan transform_exclusive_scan] ] ]
116+
Transform each element in a range then combine adjacent elements to create an output range. Exclusive scanning means that the nth input is not present in the nth output.
117+
[endsect:transform_exclusive_scan]
118+
114119
[endsect:CXX17_inner_algorithms]
115120

116121
[endsect:CXX17]
@@ -239,7 +244,6 @@ Raise a value to an integral power ([^constexpr] since C++14)
239244
* [*[^[link header.boost.algorithm.cxx17.exclusive_scan_hpp exclusive_scan] ] ]
240245
* [*[^[link header.boost.algorithm.cxx17.inclusive_scan_hpp inclusive_scan] ] ]
241246
* [*[^[link header.boost.algorithm.cxx17.reduce_hpp reduce] ] ]
242-
* [*[^[link header.boost.algorithm.cxx17.transform_exclusive_scan_hpp transform_exclusive_scan] ] ]
243247
* [*[^[link header.boost.algorithm.cxx17.transform_reduce_hpp transform_reduce] ] ]
244248

245249
[endsect:not_yet_documented_cxx17_algos]

include/boost/algorithm/cxx17/transform_exclusive_scan.hpp

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

2323
namespace boost { namespace algorithm {
2424

25+
/// \fn transform_exclusive_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. Exclusivity means that the nth element is not
29+
/// included in 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, class T,
2641
class BinaryOperation, class UnaryOperation>
2742
OutputIterator transform_exclusive_scan(InputIterator first, InputIterator last,

0 commit comments

Comments
 (0)