aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/include')
-rw-r--r--libstdc++-v3/include/bits/stl_algobase.h183
-rw-r--r--libstdc++-v3/include/ext/hash_map5
-rw-r--r--libstdc++-v3/include/ext/hash_set5
-rw-r--r--libstdc++-v3/include/ext/rope5
-rw-r--r--libstdc++-v3/include/ext/ropeimpl.h7
-rw-r--r--libstdc++-v3/include/ext/slist5
-rw-r--r--libstdc++-v3/include/ext/stl_hash_fun.h5
-rw-r--r--libstdc++-v3/include/ext/stl_hashtable.h5
-rw-r--r--libstdc++-v3/include/ext/stl_rope.h5
9 files changed, 210 insertions, 15 deletions
diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h
index a26a8b5..b252eea 100644
--- a/libstdc++-v3/include/bits/stl_algobase.h
+++ b/libstdc++-v3/include/bits/stl_algobase.h
@@ -155,6 +155,16 @@ namespace std
if (__b < __a) return __b; return __a;
}
+ /**
+ * @brief This does what you think it does.
+ * @param a A thing of arbitrary type.
+ * @param b Another thing of arbitrary type.
+ * @return The greater of the parameters.
+ *
+ * This is the simple classic generic implementation. It will work on
+ * temporary expressions, since they are only evaluated once, unlike a
+ * preprocessor macro.
+ */
template<typename _Tp>
inline const _Tp&
max(const _Tp& __a, const _Tp& __b)
@@ -165,6 +175,16 @@ namespace std
if (__a < __b) return __b; return __a;
}
+ /**
+ * @brief This does what you think it does.
+ * @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.
+ * @return The lesser of the parameters.
+ *
+ * This will work on temporary expressions, since they are only evaluated
+ * once, unlike a preprocessor macro.
+ */
template<typename _Tp, typename _Compare>
inline const _Tp&
min(const _Tp& __a, const _Tp& __b, _Compare __comp)
@@ -173,6 +193,16 @@ namespace std
if (__comp(__b, __a)) return __b; return __a;
}
+ /**
+ * @brief This does what you think it does.
+ * @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.
+ * @return The greater of the parameters.
+ *
+ * This will work on temporary expressions, since they are only evaluated
+ * once, unlike a preprocessor macro.
+ */
template<typename _Tp, typename _Compare>
inline const _Tp&
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
@@ -295,6 +325,19 @@ namespace std
return __copy_ni2(__first, __last, __result, __Normal());
}
+ /**
+ * @brief Copies the range [first,last) into result.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param result An output iterator.
+ * @return result + (first - last)
+ *
+ * This inline function will boil down to a call to @c memmove whenever
+ * possible. Failing that, if random access iterators are passed, then the
+ * loop count will be known (and therefore a candidate for compiler
+ * optimizations such as unrolling). If the input range and the output
+ * range overlap, then the copy_backward function should be used instead.
+ */
template<typename _InputIter, typename _OutputIter>
inline _OutputIter
copy(_InputIter __first, _InputIter __last, _OutputIter __result)
@@ -419,6 +462,20 @@ namespace std
__Normal());
}
+ /**
+ * @brief Copies the range [first,last) into result.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param result An output iterator.
+ * @return result - (first - last)
+ *
+ * The function has the same effect as copy, but starts at the end of the
+ * range and works its way to the start, returning the start of the result.
+ * This inline function will boil down to a call to @c memmove whenever
+ * possible. Failing that, if random access iterators are passed, then the
+ * loop count will be known (and therefore a candidate for compiler
+ * optimizations such as unrolling).
+ */
template <typename _BI1, typename _BI2>
inline _BI2
copy_backward(_BI1 __first, _BI1 __last, _BI2 __result)
@@ -462,6 +519,20 @@ namespace std
return pair<_RAIter, _OutputIter>(__last, copy(__first, __last, __result));
}
+ /**
+ * @brief Copies the range [first,first+count) into [result,result+count).
+ * @param first An input iterator.
+ * @param count The number of elements to copy.
+ * @param result An output iterator.
+ * @return A std::pair composed of first+count and result+count.
+ *
+ * This is an SGI extension.
+ * This inline function will boil down to a call to @c memmove whenever
+ * possible. Failing that, if random access iterators are passed, then the
+ * loop count will be known (and therefore a candidate for compiler
+ * optimizations such as unrolling).
+ * @ingroup SGIextensions
+ */
template<typename _InputIter, typename _Size, typename _OutputIter>
inline pair<_InputIter, _OutputIter>
copy_n(_InputIter __first, _Size __count, _OutputIter __result)
@@ -478,6 +549,17 @@ namespace std
// fill and fill_n
+ /**
+ * @brief Fills the range [first,last) with copies of value.
+ * @param first A forward iterator.
+ * @param last A forward iterator.
+ * @param value A reference-to-const of arbitrary type.
+ * @return Nothing.
+ *
+ * This function fills a range with copies of the same value. For one-byte
+ * types filling contiguous areas of memory, this becomes an inline call to
+ * @c memset.
+ */
template<typename _ForwardIter, typename _Tp>
void
fill(_ForwardIter __first, _ForwardIter __last, const _Tp& __value)
@@ -489,6 +571,17 @@ namespace std
*__first = __value;
}
+ /**
+ * @brief Fills the range [first,first+n) with copies of value.
+ * @param first An output iterator.
+ * @param n The count of copies to perform.
+ * @param value A reference-to-const of arbitrary type.
+ * @return The iterator at first+n.
+ *
+ * This function fills a range with copies of the same value. For one-byte
+ * types filling contiguous areas of memory, this becomes an inline call to
+ * @c memset.
+ */
template<typename _OutputIter, typename _Size, typename _Tp>
_OutputIter
fill_n(_OutputIter __first, _Size __n, const _Tp& __value)
@@ -552,6 +645,18 @@ namespace std
//--------------------------------------------------
// equal and mismatch
+ /**
+ * @brief Finds the places in ranges which don't match.
+ * @param first1 An input iterator.
+ * @param last1 An input iterator.
+ * @param first2 An input iterator.
+ * @return A pair of iterators pointing to the first mismatch.
+ *
+ * This compares the elements of two ranges using @c == and returns a pair
+ * of iterators. The first iterator points into the first range, the
+ * second iterator points into the second range, and the elements pointed
+ * to by the iterators are not equal.
+ */
template<typename _InputIter1, typename _InputIter2>
pair<_InputIter1, _InputIter2>
mismatch(_InputIter1 __first1, _InputIter1 __last1,
@@ -572,6 +677,20 @@ namespace std
return pair<_InputIter1, _InputIter2>(__first1, __first2);
}
+ /**
+ * @brief Finds the places in ranges which don't match.
+ * @param first1 An input iterator.
+ * @param last1 An input iterator.
+ * @param first2 An input iterator.
+ * @param binary_pred A binary predicate @link s20_3_1_base functor@endlink.
+ * @return A pair of iterators pointing to the first mismatch.
+ *
+ * This compares the elements of two ranges using the binary_pred
+ * parameter, and returns a pair
+ * of iterators. The first iterator points into the first range, the
+ * second iterator points into the second range, and the elements pointed
+ * to by the iterators are not equal.
+ */
template<typename _InputIter1, typename _InputIter2, typename _BinaryPredicate>
pair<_InputIter1, _InputIter2>
mismatch(_InputIter1 __first1, _InputIter1 __last1,
@@ -589,6 +708,17 @@ namespace std
return pair<_InputIter1, _InputIter2>(__first1, __first2);
}
+ /**
+ * @brief Tests a range for element-wise equality.
+ * @param first1 An input iterator.
+ * @param last1 An input iterator.
+ * @param first2 An input iterator.
+ * @return A boolean true or false.
+ *
+ * This compares the elements of two ranges using @c == and returns true or
+ * false depending on whether all of the corresponding elements of the
+ * ranges are equal.
+ */
template<typename _InputIter1, typename _InputIter2>
inline bool
equal(_InputIter1 __first1, _InputIter1 __last1,
@@ -607,6 +737,19 @@ namespace std
return true;
}
+ /**
+ * @brief Tests a range for element-wise equality.
+ * @param first1 An input iterator.
+ * @param last1 An input iterator.
+ * @param first2 An input iterator.
+ * @param binary_pred A binary predicate @link s20_3_1_base functor@endlink.
+ * @return A boolean true or false.
+ *
+ * This compares the elements of two ranges using the binary_pred
+ * parameter, and returns true or
+ * false depending on whether all of the corresponding elements of the
+ * ranges are equal.
+ */
template<typename _InputIter1, typename _InputIter2, typename _BinaryPredicate>
inline bool
equal(_InputIter1 __first1, _InputIter1 __last1,
@@ -627,6 +770,20 @@ namespace std
// lexicographical_compare and lexicographical_compare_3way.
// (the latter is not part of the C++ standard.)
+ /**
+ * @brief Performs "dictionary" comparison on ranges.
+ * @param first1 An input iterator.
+ * @param last1 An input iterator.
+ * @param first2 An input iterator.
+ * @param last2 An input iterator.
+ * @return A boolean true or false.
+ *
+ * "Returns true if the sequence of elements defined by the range
+ * [first1,last1) is lexicographically less than the sequence of elements
+ * defined by the range [first2,last2). Returns false otherwise."
+ * (Quoted from [25.3.8]/1.) If the iterators are all character pointers,
+ * then this is an inline call to @c memcmp.
+ */
template<typename _InputIter1, typename _InputIter2>
bool
lexicographical_compare(_InputIter1 __first1, _InputIter1 __last1,
@@ -650,6 +807,18 @@ namespace std
return __first1 == __last1 && __first2 != __last2;
}
+ /**
+ * @brief Performs "dictionary" comparison on ranges.
+ * @param first1 An input iterator.
+ * @param last1 An input iterator.
+ * @param first2 An input iterator.
+ * @param last2 An input iterator.
+ * @param comp A @link s20_3_3_comparisons comparison functor@endlink.
+ * @return A boolean true or false.
+ *
+ * The same as the four-parameter @c lexigraphical_compare, but uses the
+ * comp parameter instead of @c <.
+ */
template<typename _InputIter1, typename _InputIter2, typename _Compare>
bool
lexicographical_compare(_InputIter1 __first1, _InputIter1 __last1,
@@ -749,6 +918,20 @@ namespace std
#endif
}
+ /**
+ * @brief @c memcmp on steroids.
+ * @param first1 An input iterator.
+ * @param last1 An input iterator.
+ * @param first2 An input iterator.
+ * @param last2 An input iterator.
+ * @return An int, as with @c memcmp.
+ *
+ * The return value will be less than zero if the first range is
+ * "lexigraphically less than" the second, greater than zero if the second
+ * range is "lexigraphically less than" the first, and zero otherwise.
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ */
template<typename _InputIter1, typename _InputIter2>
int
lexicographical_compare_3way(_InputIter1 __first1, _InputIter1 __last1,
diff --git a/libstdc++-v3/include/ext/hash_map b/libstdc++-v3/include/ext/hash_map
index cd26c57..228daba 100644
--- a/libstdc++-v3/include/ext/hash_map
+++ b/libstdc++-v3/include/ext/hash_map
@@ -53,8 +53,9 @@
*
*/
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
+/** @file hash_map
+ * This header file is an extension to the Standard C++ Library. You should
+ * use the "ext/" path prefix in your @c #include statements.
*/
#ifndef __SGI_STL_INTERNAL_HASH_MAP_H
diff --git a/libstdc++-v3/include/ext/hash_set b/libstdc++-v3/include/ext/hash_set
index 9ddef60..f5ff2f1 100644
--- a/libstdc++-v3/include/ext/hash_set
+++ b/libstdc++-v3/include/ext/hash_set
@@ -53,8 +53,9 @@
*
*/
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
+/** @file hash_set
+ * This header file is an extension to the Standard C++ Library. You should
+ * use the "ext/" path prefix in your @c #include statements.
*/
#ifndef __SGI_STL_INTERNAL_HASH_SET_H
diff --git a/libstdc++-v3/include/ext/rope b/libstdc++-v3/include/ext/rope
index ca0d63d..78bb7dc 100644
--- a/libstdc++-v3/include/ext/rope
+++ b/libstdc++-v3/include/ext/rope
@@ -40,6 +40,11 @@
* purpose. It is provided "as is" without express or implied warranty.
*/
+/** @file rope
+ * This header file is an extension to the Standard C++ Library. You should
+ * use the "ext/" path prefix in your @c #include statements.
+ */
+
#ifndef __SGI_STL_ROPE
#define __SGI_STL_ROPE
diff --git a/libstdc++-v3/include/ext/ropeimpl.h b/libstdc++-v3/include/ext/ropeimpl.h
index e36fedfa..b8f4568 100644
--- a/libstdc++-v3/include/ext/ropeimpl.h
+++ b/libstdc++-v3/include/ext/ropeimpl.h
@@ -40,13 +40,14 @@
* purpose. It is provided "as is" without express or implied warranty.
*/
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
+/** @file ropeimpl.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
*/
#include <bits/std_cstdio.h>
#include <bits/std_iostream.h>
-# include <bits/functexcept.h>
+#include <bits/functexcept.h>
namespace std
{
diff --git a/libstdc++-v3/include/ext/slist b/libstdc++-v3/include/ext/slist
index 7f1a628..7ed4c31 100644
--- a/libstdc++-v3/include/ext/slist
+++ b/libstdc++-v3/include/ext/slist
@@ -41,8 +41,9 @@
*
*/
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
+/** @file slist
+ * This header file is an extension to the Standard C++ Library. You should
+ * use the "ext/" path prefix in your @c #include statements.
*/
#ifndef __SGI_STL_INTERNAL_SLIST_H
diff --git a/libstdc++-v3/include/ext/stl_hash_fun.h b/libstdc++-v3/include/ext/stl_hash_fun.h
index 0ebfbbc..4dba329 100644
--- a/libstdc++-v3/include/ext/stl_hash_fun.h
+++ b/libstdc++-v3/include/ext/stl_hash_fun.h
@@ -53,8 +53,9 @@
*
*/
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
+/** @file stl_hash_fun.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
*/
#ifndef _CPP_BITS_STL_HASH_FUN_H
diff --git a/libstdc++-v3/include/ext/stl_hashtable.h b/libstdc++-v3/include/ext/stl_hashtable.h
index 83e6ad6..1425bac 100644
--- a/libstdc++-v3/include/ext/stl_hashtable.h
+++ b/libstdc++-v3/include/ext/stl_hashtable.h
@@ -53,8 +53,9 @@
*
*/
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
+/** @file stl_hashtable.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
*/
#ifndef __SGI_STL_INTERNAL_HASHTABLE_H
diff --git a/libstdc++-v3/include/ext/stl_rope.h b/libstdc++-v3/include/ext/stl_rope.h
index 96ec495..00db893 100644
--- a/libstdc++-v3/include/ext/stl_rope.h
+++ b/libstdc++-v3/include/ext/stl_rope.h
@@ -40,8 +40,9 @@
* purpose. It is provided "as is" without express or implied warranty.
*/
-/* NOTE: This is an internal header file, included by other STL headers.
- * You should not attempt to use it directly.
+/** @file stl_rope.h
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
*/
// rope<_CharT,_Alloc> is a sequence of _CharT.