// Algorithm implementation -*- C++ -*-
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
+// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING. If not, write to the Free
-// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-// USA.
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
-// As a special exception, you may use this file as part of a free software
-// library without restriction. Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License. This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
/*
*
/**
* @brief Find last matching subsequence in a sequence.
+ * @ingroup non_mutating_algorithms
* @param first1 Start of range to search.
* @param last1 End of range to search.
* @param first2 Start of sequence to match.
/**
* @brief Find last matching subsequence in a sequence using a predicate.
+ * @ingroup non_mutating_algorithms
* @param first1 Start of range to search.
* @param last1 End of range to search.
* @param first2 Start of sequence to match.
/**
* @brief Checks that a predicate is true for all the elements
* of a sequence.
+ * @ingroup non_mutating_algorithms
* @param first An input iterator.
* @param last An input iterator.
* @param pred A predicate.
/**
* @brief Checks that a predicate is false for all the elements
* of a sequence.
+ * @ingroup non_mutating_algorithms
* @param first An input iterator.
* @param last An input iterator.
* @param pred A predicate.
/**
* @brief Checks that a predicate is false for at least an element
* of a sequence.
+ * @ingroup non_mutating_algorithms
* @param first An input iterator.
* @param last An input iterator.
* @param pred A predicate.
/**
* @brief Find the first element in a sequence for which a
* predicate is false.
+ * @ingroup non_mutating_algorithms
* @param first An input iterator.
* @param last An input iterator.
* @param pred A predicate.
/**
* @brief Checks whether the sequence is partitioned.
+ * @ingroup mutating_algorithms
* @param first An input iterator.
* @param last An input iterator.
* @param pred A predicate.
/**
* @brief Find the partition point of a partitioned range.
+ * @ingroup mutating_algorithms
* @param first An iterator.
* @param last Another iterator.
* @param pred A predicate.
/**
* @brief Copy a sequence, removing elements of a given value.
+ * @ingroup mutating_algorithms
* @param first An input iterator.
* @param last An input iterator.
* @param result An output iterator.
/**
* @brief Copy a sequence, removing elements for which a predicate is true.
+ * @ingroup mutating_algorithms
* @param first An input iterator.
* @param last An input iterator.
* @param result An output iterator.
#ifdef __GXX_EXPERIMENTAL_CXX0X__
/**
* @brief Copy the elements of a sequence for which a predicate is true.
+ * @ingroup mutating_algorithms
* @param first An input iterator.
* @param last An input iterator.
* @param result An output iterator.
/**
* @brief Copies the range [first,first+n) into [result,result+n).
+ * @ingroup mutating_algorithms
* @param first An input iterator.
* @param n The number of elements to copy.
* @param result An output iterator.
/**
* @brief Copy the elements of a sequence to separate output sequences
* depending on the truth value of a predicate.
+ * @ingroup mutating_algorithms
* @param first An input iterator.
* @param last An input iterator.
* @param out_true An output iterator.
/**
* @brief Remove elements from a sequence.
+ * @ingroup mutating_algorithms
* @param first An input iterator.
* @param last An input iterator.
* @param value The value to be removed.
/**
* @brief Remove elements from a sequence using a predicate.
+ * @ingroup mutating_algorithms
* @param first A forward iterator.
* @param last A forward iterator.
* @param pred A predicate.
/**
* @brief Remove consecutive duplicate values from a sequence.
+ * @ingroup mutating_algorithms
* @param first A forward iterator.
* @param last A forward iterator.
* @return An iterator designating the end of the resulting sequence.
/**
* @brief Remove consecutive values from a sequence using a predicate.
+ * @ingroup mutating_algorithms
* @param first A forward iterator.
* @param last A forward iterator.
* @param binary_pred A binary predicate.
/**
* @brief Reverse a sequence.
+ * @ingroup mutating_algorithms
* @param first A bidirectional iterator.
* @param last A bidirectional iterator.
* @return reverse() returns no value.
/**
* @brief Copy a sequence, reversing its elements.
+ * @ingroup mutating_algorithms
* @param first A bidirectional iterator.
* @param last A bidirectional iterator.
* @param result An output iterator.
/**
* @brief Rotate the elements of a sequence.
+ * @ingroup mutating_algorithms
* @param first A forward iterator.
* @param middle A forward iterator.
* @param last A forward iterator.
/**
* @brief Copy a sequence, rotating its elements.
+ * @ingroup mutating_algorithms
* @param first A forward iterator.
* @param middle A forward iterator.
* @param last A forward iterator.
/**
* @brief Move elements for which a predicate is true to the beginning
* of a sequence, preserving relative ordering.
+ * @ingroup mutating_algorithms
* @param first A forward iterator.
* @param last A forward iterator.
* @param pred A predicate functor.
/**
* @brief Copy the smallest elements of a sequence.
+ * @ingroup sorting_algorithms
* @param first An iterator.
* @param last Another iterator.
* @param result_first A random-access iterator.
/**
* @brief Copy the smallest elements of a sequence using a predicate for
* comparison.
+ * @ingroup sorting_algorithms
* @param first An input iterator.
* @param last Another input iterator.
* @param result_first A random-access iterator.
* @return An iterator pointing to the first element "not less
* than" @a val, or end() if every element is less than
* @a val.
- * @ingroup binarysearch
+ * @ingroup binary_search_algorithms
*/
template<typename _ForwardIterator, typename _Tp>
_ForwardIterator
/**
* @brief Finds the first position in which @a val could be inserted
* without changing the ordering.
+ * @ingroup binary_search_algorithms
* @param first An iterator.
* @param last Another iterator.
* @param val The search term.
* @param comp A functor to use for comparisons.
* @return An iterator pointing to the first element "not less than" @a val,
* or end() if every element is less than @a val.
- * @ingroup binarysearch
+ * @ingroup binary_search_algorithms
*
* The comparison function should have the same effects on ordering as
* the function used for the initial sort.
/**
* @brief Finds the last position in which @a val could be inserted
* without changing the ordering.
+ * @ingroup binary_search_algorithms
* @param first An iterator.
* @param last Another iterator.
* @param val The search term.
* @return An iterator pointing to the first element greater than @a val,
* or end() if no elements are greater than @a val.
- * @ingroup binarysearch
+ * @ingroup binary_search_algorithms
*/
template<typename _ForwardIterator, typename _Tp>
_ForwardIterator
/**
* @brief Finds the last position in which @a val could be inserted
* without changing the ordering.
+ * @ingroup binary_search_algorithms
* @param first An iterator.
* @param last Another iterator.
* @param val The search term.
* @param comp A functor to use for comparisons.
* @return An iterator pointing to the first element greater than @a val,
* or end() if no elements are greater than @a val.
- * @ingroup binarysearch
+ * @ingroup binary_search_algorithms
*
* The comparison function should have the same effects on ordering as
* the function used for the initial sort.
/**
* @brief Finds the largest subrange in which @a val could be inserted
* at any place in it without changing the ordering.
+ * @ingroup binary_search_algorithms
* @param first An iterator.
* @param last Another iterator.
* @param val The search term.
* @return An pair of iterators defining the subrange.
- * @ingroup binarysearch
+ * @ingroup binary_search_algorithms
*
* This is equivalent to
* @code
* @param val The search term.
* @param comp A functor to use for comparisons.
* @return An pair of iterators defining the subrange.
- * @ingroup binarysearch
+ * @ingroup binary_search_algorithms
*
* This is equivalent to
* @code
/**
* @brief Determines whether an element exists in a range.
+ * @ingroup binary_search_algorithms
* @param first An iterator.
* @param last Another iterator.
* @param val The search term.
* @return True if @a val (or its equivalent) is in [@a first,@a last ].
- * @ingroup binarysearch
*
* Note that this does not actually return an iterator to @a val. For
* that, use std::find or a container's specialized find member functions.
/**
* @brief Determines whether an element exists in a range.
+ * @ingroup binary_search_algorithms
* @param first An iterator.
* @param last Another iterator.
* @param val The search term.
* @param comp A functor to use for comparisons.
* @return True if @a val (or its equivalent) is in [@a first,@a last ].
- * @ingroup binarysearch
*
* Note that this does not actually return an iterator to @a val. For
* that, use std::find or a container's specialized find member functions.
/**
* @brief Merges two sorted ranges in place.
+ * @ingroup sorting_algorithms
* @param first An iterator.
* @param middle Another iterator.
* @param last Another iterator.
/**
* @brief Merges two sorted ranges in place.
+ * @ingroup sorting_algorithms
* @param first An iterator.
* @param middle Another iterator.
* @param last Another iterator.
* @param last2 End of sequence.
* @return True if each element in [first2,last2) is contained in order
* within [first1,last1). False otherwise.
- * @ingroup setoperations
+ * @ingroup set_algorithms
*
* This operation expects both [first1,last1) and [first2,last2) to be
* sorted. Searches for the presence of each element in [first2,last2)
/**
* @brief Determines whether all elements of a sequence exists in a range
* using comparison.
+ * @ingroup set_algorithms
* @param first1 Start of search range.
* @param last1 End of search range.
* @param first2 Start of sequence
* @param comp Comparison function to use.
* @return True if each element in [first2,last2) is contained in order
* within [first1,last1) according to comp. False otherwise.
- * @ingroup setoperations
+ * @ingroup set_algorithms
*
* This operation expects both [first1,last1) and [first2,last2) to be
* sorted. Searches for the presence of each element in [first2,last2)
/**
* @brief Permute range into the next "dictionary" ordering.
+ * @ingroup sorting_algorithms
* @param first Start of range.
* @param last End of range.
* @return False if wrapped to first permutation, true otherwise.
/**
* @brief Permute range into the next "dictionary" ordering using
* comparison functor.
+ * @ingroup sorting_algorithms
* @param first Start of range.
* @param last End of range.
* @param comp A comparison functor.
/**
* @brief Permute range into the previous "dictionary" ordering.
+ * @ingroup sorting_algorithms
* @param first Start of range.
* @param last End of range.
* @return False if wrapped to last permutation, true otherwise.
/**
* @brief Permute range into the previous "dictionary" ordering using
* comparison functor.
+ * @ingroup sorting_algorithms
* @param first Start of range.
* @param last End of range.
* @param comp A comparison functor.
/**
* @brief Copy a sequence, replacing each value for which a predicate
* returns true with another value.
+ * @ingroup mutating_algorithms
* @param first An input iterator.
* @param last An input iterator.
* @param result An output iterator.
#ifdef __GXX_EXPERIMENTAL_CXX0X__
/**
* @brief Determines whether the elements of a sequence are sorted.
+ * @ingroup sorting_algorithms
* @param first An iterator.
* @param last Another iterator.
* @return True if the elements are sorted, false otherwise.
/**
* @brief Determines whether the elements of a sequence are sorted
* according to a comparison functor.
+ * @ingroup sorting_algorithms
* @param first An iterator.
* @param last Another iterator.
* @param comp A comparison functor.
/**
* @brief Determines the end of a sorted sequence.
+ * @ingroup sorting_algorithms
* @param first An iterator.
* @param last Another iterator.
* @return An iterator pointing to the last iterator i in [first, last)
/**
* @brief Determines the end of a sorted sequence using comparison functor.
+ * @ingroup sorting_algorithms
* @param first An iterator.
* @param last Another iterator.
* @param comp A comparison functor.
/**
* @brief Determines min and max at once as an ordered pair.
+ * @ingroup sorting_algorithms
* @param a A thing of arbitrary type.
* @param b Another thing of arbitrary type.
* @return A pair(b, a) if b is smaller than a, pair(a, b) otherwise.
/**
* @brief Determines min and max at once as an ordered pair.
+ * @ingroup sorting_algorithms
* @param a A thing of arbitrary type.
* @param b Another thing of arbitrary type.
- * @param comp A @link s20_3_3_comparisons comparison functor@endlink.
+ * @param comp A @link comparison_functor comparison functor@endlink.
* @return A pair(b, a) if b is smaller than a, pair(a, b) otherwise.
*/
template<typename _Tp, typename _Compare>
/**
* @brief Return a pair of iterators pointing to the minimum and maximum
* elements in a range.
+ * @ingroup sorting_algorithms
* @param first Start of range.
* @param last End of range.
* @return make_pair(m, M), where m is the first iterator i in
/**
* @brief Return a pair of iterators pointing to the minimum and maximum
* elements in a range.
+ * @ingroup sorting_algorithms
* @param first Start of range.
* @param last End of range.
* @param comp Comparison functor.
return std::make_pair(__min, __max);
}
- // N2722.
+ // N2722 + fixes.
template<typename _Tp>
- inline const _Tp&
+ inline _Tp
min(initializer_list<_Tp> __l)
{ return *std::min_element(__l.begin(), __l.end()); }
template<typename _Tp, typename _Compare>
- inline const _Tp&
+ inline _Tp
min(initializer_list<_Tp> __l, _Compare __comp)
{ return *std::min_element(__l.begin(), __l.end(), __comp); }
template<typename _Tp>
- inline const _Tp&
+ inline _Tp
max(initializer_list<_Tp> __l)
{ return *std::max_element(__l.begin(), __l.end()); }
template<typename _Tp, typename _Compare>
- inline const _Tp&
+ inline _Tp
max(initializer_list<_Tp> __l, _Compare __comp)
{ return *std::max_element(__l.begin(), __l.end(), __comp); }
template<typename _Tp>
- inline pair<const _Tp&, const _Tp&>
+ inline pair<_Tp, _Tp>
minmax(initializer_list<_Tp> __l)
{
pair<const _Tp*, const _Tp*> __p =
}
template<typename _Tp, typename _Compare>
- inline pair<const _Tp&, const _Tp&>
+ inline pair<_Tp, _Tp>
minmax(initializer_list<_Tp> __l, _Compare __comp)
{
pair<const _Tp*, const _Tp*> __p =
/**
* @brief Apply a function to every element of a sequence.
+ * @ingroup non_mutating_algorithms
* @param first An input iterator.
* @param last An input iterator.
* @param f A unary function object.
/**
* @brief Find the first occurrence of a value in a sequence.
+ * @ingroup non_mutating_algorithms
* @param first An input iterator.
* @param last An input iterator.
* @param val The value to find.
/**
* @brief Find the first element in a sequence for which a
* predicate is true.
+ * @ingroup non_mutating_algorithms
* @param first An input iterator.
* @param last An input iterator.
* @param pred A predicate.
/**
* @brief Find element from a set in a sequence.
+ * @ingroup non_mutating_algorithms
* @param first1 Start of range to search.
* @param last1 End of range to search.
* @param first2 Start of match candidates.
/**
* @brief Find element from a set in a sequence using a predicate.
+ * @ingroup non_mutating_algorithms
* @param first1 Start of range to search.
* @param last1 End of range to search.
* @param first2 Start of match candidates.
/**
* @brief Find two adjacent values in a sequence that are equal.
+ * @ingroup non_mutating_algorithms
* @param first A forward iterator.
* @param last A forward iterator.
* @return The first iterator @c i such that @c i and @c i+1 are both
/**
* @brief Find two adjacent values in a sequence using a predicate.
+ * @ingroup non_mutating_algorithms
* @param first A forward iterator.
* @param last A forward iterator.
* @param binary_pred A binary predicate.
/**
* @brief Count the number of copies of a value in a sequence.
+ * @ingroup non_mutating_algorithms
* @param first An input iterator.
* @param last An input iterator.
* @param value The value to be counted.
/**
* @brief Count the elements of a sequence for which a predicate is true.
+ * @ingroup non_mutating_algorithms
* @param first An input iterator.
* @param last An input iterator.
* @param pred A predicate.
/**
* @brief Search a sequence for a matching sub-sequence.
+ * @ingroup non_mutating_algorithms
* @param first1 A forward iterator.
* @param last1 A forward iterator.
* @param first2 A forward iterator.
/**
* @brief Search a sequence for a matching sub-sequence using a predicate.
+ * @ingroup non_mutating_algorithms
* @param first1 A forward iterator.
* @param last1 A forward iterator.
* @param first2 A forward iterator.
/**
* @brief Search a sequence for a number of consecutive values.
+ * @ingroup non_mutating_algorithms
* @param first A forward iterator.
* @param last A forward iterator.
* @param count The number of consecutive values.
/**
* @brief Search a sequence for a number of consecutive values using a
* predicate.
+ * @ingroup non_mutating_algorithms
* @param first A forward iterator.
* @param last A forward iterator.
* @param count The number of consecutive values.
/**
* @brief Perform an operation on a sequence.
+ * @ingroup mutating_algorithms
* @param first An input iterator.
* @param last An input iterator.
* @param result An output iterator.
/**
* @brief Perform an operation on corresponding elements of two sequences.
+ * @ingroup mutating_algorithms
* @param first1 An input iterator.
* @param last1 An input iterator.
* @param first2 An input iterator.
/**
* @brief Replace each occurrence of one value in a sequence with another
* value.
+ * @ingroup mutating_algorithms
* @param first A forward iterator.
* @param last A forward iterator.
* @param old_value The value to be replaced.
/**
* @brief Replace each value in a sequence for which a predicate returns
* true with another value.
+ * @ingroup mutating_algorithms
* @param first A forward iterator.
* @param last A forward iterator.
* @param pred A predicate.
/**
* @brief Assign the result of a function object to each value in a
* sequence.
+ * @ingroup mutating_algorithms
* @param first A forward iterator.
* @param last A forward iterator.
* @param gen A function object taking no arguments and returning
/**
* @brief Assign the result of a function object to each value in a
* sequence.
+ * @ingroup mutating_algorithms
* @param first A forward iterator.
* @param n The length of the sequence.
* @param gen A function object taking no arguments and returning
/**
* @brief Copy a sequence, removing consecutive duplicate values.
+ * @ingroup mutating_algorithms
* @param first An input iterator.
* @param last An input iterator.
* @param result An output iterator.
/**
* @brief Copy a sequence, removing consecutive values using a predicate.
+ * @ingroup mutating_algorithms
* @param first An input iterator.
* @param last An input iterator.
* @param result An output iterator.
/**
* @brief Randomly shuffle the elements of a sequence.
+ * @ingroup mutating_algorithms
* @param first A forward iterator.
* @param last A forward iterator.
* @return Nothing.
/**
* @brief Shuffle the elements of a sequence using a random number
* generator.
+ * @ingroup mutating_algorithms
* @param first A forward iterator.
* @param last A forward iterator.
* @param rand The RNG functor or function.
/**
* @brief Move elements for which a predicate is true to the beginning
* of a sequence.
+ * @ingroup mutating_algorithms
* @param first A forward iterator.
* @param last A forward iterator.
* @param pred A predicate functor.
/**
* @brief Sort the smallest elements of a sequence.
+ * @ingroup sorting_algorithms
* @param first An iterator.
* @param middle Another iterator.
* @param last Another iterator.
/**
* @brief Sort the smallest elements of a sequence using a predicate
* for comparison.
+ * @ingroup sorting_algorithms
* @param first An iterator.
* @param middle Another iterator.
* @param last Another iterator.
/**
* @brief Sort a sequence just enough to find a particular position.
+ * @ingroup sorting_algorithms
* @param first An iterator.
* @param nth Another iterator.
* @param last Another iterator.
/**
* @brief Sort a sequence just enough to find a particular position
* using a predicate for comparison.
+ * @ingroup sorting_algorithms
* @param first An iterator.
* @param nth Another iterator.
* @param last Another iterator.
/**
* @brief Sort the elements of a sequence.
+ * @ingroup sorting_algorithms
* @param first An iterator.
* @param last Another iterator.
* @return Nothing.
/**
* @brief Sort the elements of a sequence using a predicate for comparison.
+ * @ingroup sorting_algorithms
* @param first An iterator.
* @param last Another iterator.
* @param comp A comparison functor.
/**
* @brief Merges two sorted ranges.
+ * @ingroup sorting_algorithms
* @param first1 An iterator.
* @param first2 Another iterator.
* @param last1 Another iterator.
/**
* @brief Merges two sorted ranges.
+ * @ingroup sorting_algorithms
* @param first1 An iterator.
* @param first2 Another iterator.
* @param last1 Another iterator.
/**
* @brief Sort the elements of a sequence, preserving the relative order
* of equivalent elements.
+ * @ingroup sorting_algorithms
* @param first An iterator.
* @param last Another iterator.
* @return Nothing.
/**
* @brief Sort the elements of a sequence using a predicate for comparison,
* preserving the relative order of equivalent elements.
+ * @ingroup sorting_algorithms
* @param first An iterator.
* @param last Another iterator.
* @param comp A comparison functor.
/**
* @brief Return the union of two sorted ranges.
+ * @ingroup set_algorithms
* @param first1 Start of first range.
* @param last1 End of first range.
* @param first2 Start of second range.
* @param last2 End of second range.
* @return End of the output range.
- * @ingroup setoperations
+ * @ingroup set_algorithms
*
* This operation iterates over both ranges, copying elements present in
* each range in order to the output range. Iterators increment for each
/**
* @brief Return the union of two sorted ranges using a comparison functor.
+ * @ingroup set_algorithms
* @param first1 Start of first range.
* @param last1 End of first range.
* @param first2 Start of second range.
* @param last2 End of second range.
* @param comp The comparison functor.
* @return End of the output range.
- * @ingroup setoperations
+ * @ingroup set_algorithms
*
* This operation iterates over both ranges, copying elements present in
* each range in order to the output range. Iterators increment for each
/**
* @brief Return the intersection of two sorted ranges.
+ * @ingroup set_algorithms
* @param first1 Start of first range.
* @param last1 End of first range.
* @param first2 Start of second range.
* @param last2 End of second range.
* @return End of the output range.
- * @ingroup setoperations
+ * @ingroup set_algorithms
*
* This operation iterates over both ranges, copying elements present in
* both ranges in order to the output range. Iterators increment for each
/**
* @brief Return the intersection of two sorted ranges using comparison
* functor.
+ * @ingroup set_algorithms
* @param first1 Start of first range.
* @param last1 End of first range.
* @param first2 Start of second range.
* @param last2 End of second range.
* @param comp The comparison functor.
* @return End of the output range.
- * @ingroup setoperations
+ * @ingroup set_algorithms
*
* This operation iterates over both ranges, copying elements present in
* both ranges in order to the output range. Iterators increment for each
/**
* @brief Return the difference of two sorted ranges.
+ * @ingroup set_algorithms
* @param first1 Start of first range.
* @param last1 End of first range.
* @param first2 Start of second range.
* @param last2 End of second range.
* @return End of the output range.
- * @ingroup setoperations
+ * @ingroup set_algorithms
*
* This operation iterates over both ranges, copying elements present in
* the first range but not the second in order to the output range.
/**
* @brief Return the difference of two sorted ranges using comparison
* functor.
+ * @ingroup set_algorithms
* @param first1 Start of first range.
* @param last1 End of first range.
* @param first2 Start of second range.
* @param last2 End of second range.
* @param comp The comparison functor.
* @return End of the output range.
- * @ingroup setoperations
+ * @ingroup set_algorithms
*
* This operation iterates over both ranges, copying elements present in
* the first range but not the second in order to the output range.
/**
* @brief Return the symmetric difference of two sorted ranges.
+ * @ingroup set_algorithms
* @param first1 Start of first range.
* @param last1 End of first range.
* @param first2 Start of second range.
* @param last2 End of second range.
* @return End of the output range.
- * @ingroup setoperations
+ * @ingroup set_algorithms
*
* This operation iterates over both ranges, copying elements present in
* one range but not the other in order to the output range. Iterators
/**
* @brief Return the symmetric difference of two sorted ranges using
* comparison functor.
+ * @ingroup set_algorithms
* @param first1 Start of first range.
* @param last1 End of first range.
* @param first2 Start of second range.
* @param last2 End of second range.
* @param comp The comparison functor.
* @return End of the output range.
- * @ingroup setoperations
+ * @ingroup set_algorithms
*
* This operation iterates over both ranges, copying elements present in
* one range but not the other in order to the output range. Iterators
/**
* @brief Return the minimum element in a range.
+ * @ingroup sorting_algorithms
* @param first Start of range.
* @param last End of range.
* @return Iterator referencing the first instance of the smallest value.
/**
* @brief Return the minimum element in a range using comparison functor.
+ * @ingroup sorting_algorithms
* @param first Start of range.
* @param last End of range.
* @param comp Comparison functor.
/**
* @brief Return the maximum element in a range.
+ * @ingroup sorting_algorithms
* @param first Start of range.
* @param last End of range.
* @return Iterator referencing the first instance of the largest value.
/**
* @brief Return the maximum element in a range using comparison functor.
+ * @ingroup sorting_algorithms
* @param first Start of range.
* @param last End of range.
* @param comp Comparison functor.