aboutsummaryrefslogtreecommitdiff
path: root/contrib/libstdc++/include/ext
diff options
context:
space:
mode:
authorAlexander Kabaev <kan@FreeBSD.org>2002-09-01 20:39:13 +0000
committerAlexander Kabaev <kan@FreeBSD.org>2002-09-01 20:39:13 +0000
commitca6500fcd0812d2b2da8a62d52b3613b4cbab12a (patch)
treef69812e8f56ae46c848e604412b0729b776c7756 /contrib/libstdc++/include/ext
parentbb3c979bf518abbe971bd277250c68a3ec567b59 (diff)
Notes
Diffstat (limited to 'contrib/libstdc++/include/ext')
-rw-r--r--contrib/libstdc++/include/ext/algorithm40
-rw-r--r--contrib/libstdc++/include/ext/hash_map11
-rw-r--r--contrib/libstdc++/include/ext/hash_set10
-rw-r--r--contrib/libstdc++/include/ext/iterator5
-rw-r--r--contrib/libstdc++/include/ext/numeric15
-rw-r--r--contrib/libstdc++/include/ext/rb_tree5
-rw-r--r--contrib/libstdc++/include/ext/slist5
-rw-r--r--contrib/libstdc++/include/ext/stdio_filebuf.h71
-rw-r--r--contrib/libstdc++/include/ext/stl_hashtable.h19
-rw-r--r--contrib/libstdc++/include/ext/stl_rope.h5
10 files changed, 176 insertions, 10 deletions
diff --git a/contrib/libstdc++/include/ext/algorithm b/contrib/libstdc++/include/ext/algorithm
index bf72765df931a..b35d36f5e4222 100644
--- a/contrib/libstdc++/include/ext/algorithm
+++ b/contrib/libstdc++/include/ext/algorithm
@@ -247,6 +247,11 @@ namespace __gnu_cxx
// random_sample and random_sample_n (extensions, not part of the standard).
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
template<typename _ForwardIter, typename _OutputIter, typename _Distance>
_OutputIter
random_sample_n(_ForwardIter __first, _ForwardIter __last,
@@ -273,6 +278,11 @@ namespace __gnu_cxx
return __out;
}
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
template<typename _ForwardIter, typename _OutputIter, typename _Distance,
typename _RandomNumberGenerator>
_OutputIter
@@ -353,6 +363,11 @@ namespace __gnu_cxx
return __out + __m;
}
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
template<typename _InputIter, typename _RandomAccessIter>
inline _RandomAccessIter
random_sample(_InputIter __first, _InputIter __last,
@@ -367,6 +382,11 @@ namespace __gnu_cxx
__out_first, __out_last - __out_first);
}
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
template<typename _InputIter, typename _RandomAccessIter,
typename _RandomNumberGenerator>
inline _RandomAccessIter
@@ -418,6 +438,11 @@ namespace __gnu_cxx
return true;
}
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
template<typename _RandomAccessIter>
inline bool
is_heap(_RandomAccessIter __first, _RandomAccessIter __last)
@@ -430,6 +455,11 @@ namespace __gnu_cxx
return __is_heap(__first, __last - __first);
}
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
template<typename _RandomAccessIter, typename _StrictWeakOrdering>
inline bool
is_heap(_RandomAccessIter __first, _RandomAccessIter __last,
@@ -448,6 +478,11 @@ namespace __gnu_cxx
// nondescending order. This is an extension, not part of the C++
// standard.
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
template<typename _ForwardIter>
bool
is_sorted(_ForwardIter __first, _ForwardIter __last)
@@ -469,6 +504,11 @@ namespace __gnu_cxx
return true;
}
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
template<typename _ForwardIter, typename _StrictWeakOrdering>
bool
is_sorted(_ForwardIter __first, _ForwardIter __last, _StrictWeakOrdering __comp)
diff --git a/contrib/libstdc++/include/ext/hash_map b/contrib/libstdc++/include/ext/hash_map
index 08ed87bf390c5..b66758de4462d 100644
--- a/contrib/libstdc++/include/ext/hash_map
+++ b/contrib/libstdc++/include/ext/hash_map
@@ -83,7 +83,11 @@ class hash_map;
template <class _Key, class _Tp, class _HashFn, class _EqKey, class _Alloc>
inline bool operator==(const hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc>&,
const hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc>&);
-
+/**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+*/
template <class _Key, class _Tp, class _HashFcn, class _EqualKey,
class _Alloc>
class hash_map
@@ -235,6 +239,11 @@ inline bool
operator==(const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm1,
const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm2);
+/**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+*/
template <class _Key, class _Tp, class _HashFcn, class _EqualKey, class _Alloc>
class hash_multimap
{
diff --git a/contrib/libstdc++/include/ext/hash_set b/contrib/libstdc++/include/ext/hash_set
index eaeed7c99644c..0f420e2dd7ebc 100644
--- a/contrib/libstdc++/include/ext/hash_set
+++ b/contrib/libstdc++/include/ext/hash_set
@@ -85,6 +85,11 @@ inline bool
operator==(const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs1,
const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs2);
+/**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+*/
template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
class hash_set
{
@@ -236,6 +241,11 @@ operator==(const hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs1,
const hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs2);
+/**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+*/
template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
class hash_multiset
{
diff --git a/contrib/libstdc++/include/ext/iterator b/contrib/libstdc++/include/ext/iterator
index 3892eb673a8b4..f23212f241d6b 100644
--- a/contrib/libstdc++/include/ext/iterator
+++ b/contrib/libstdc++/include/ext/iterator
@@ -93,6 +93,11 @@ namespace __gnu_cxx
__n += __last - __first;
}
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
template<typename _InputIterator, typename _Distance>
inline void
distance(_InputIterator __first, _InputIterator __last,
diff --git a/contrib/libstdc++/include/ext/numeric b/contrib/libstdc++/include/ext/numeric
index 601cb82bd5527..6770461b5c6cc 100644
--- a/contrib/libstdc++/include/ext/numeric
+++ b/contrib/libstdc++/include/ext/numeric
@@ -105,11 +105,21 @@ namespace __gnu_cxx
// Alias for the internal name __power. Note that power is an extension,
// not part of the C++ standard.
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
template<typename _Tp, typename _Integer, typename _MonoidOperation>
inline _Tp
power(_Tp __x, _Integer __n, _MonoidOperation __monoid_op)
{ return __power(__x, __n, __monoid_op); }
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
template<typename _Tp, typename _Integer>
inline _Tp
power(_Tp __x, _Integer __n)
@@ -117,6 +127,11 @@ namespace __gnu_cxx
// iota is not part of the C++ standard. It is an extension.
+ /**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+ */
template<typename _ForwardIter, typename _Tp>
void
iota(_ForwardIter __first, _ForwardIter __last, _Tp __value)
diff --git a/contrib/libstdc++/include/ext/rb_tree b/contrib/libstdc++/include/ext/rb_tree
index f4b24b6fa591e..394124383828e 100644
--- a/contrib/libstdc++/include/ext/rb_tree
+++ b/contrib/libstdc++/include/ext/rb_tree
@@ -73,6 +73,11 @@ using std::allocator;
// Class rb_tree is not part of the C++ standard. It is provided for
// compatibility with the HP STL.
+/**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+*/
template <class _Key, class _Value, class _KeyOfValue, class _Compare,
class _Alloc = allocator<_Value> >
struct rb_tree : public _Rb_tree<_Key, _Value, _KeyOfValue, _Compare, _Alloc>
diff --git a/contrib/libstdc++/include/ext/slist b/contrib/libstdc++/include/ext/slist
index df2e97ba81bbd..35e089af53067 100644
--- a/contrib/libstdc++/include/ext/slist
+++ b/contrib/libstdc++/include/ext/slist
@@ -295,6 +295,11 @@ _Slist_base<_Tp,_Alloc>::_M_erase_after(_Slist_node_base* __before_first,
return __last_node;
}
+/**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+*/
template <class _Tp, class _Alloc = allocator<_Tp> >
class slist : private _Slist_base<_Tp,_Alloc>
{
diff --git a/contrib/libstdc++/include/ext/stdio_filebuf.h b/contrib/libstdc++/include/ext/stdio_filebuf.h
index 1b0d5ae72fc9c..59ab41a03e559 100644
--- a/contrib/libstdc++/include/ext/stdio_filebuf.h
+++ b/contrib/libstdc++/include/ext/stdio_filebuf.h
@@ -27,10 +27,27 @@
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
+/** @file ext/stdio_filebuf.h
+ * This file is a GNU extension to the Standard C++ Library.
+ */
+
+#ifndef _EXT_STDIO_FILEBUF
+#define _EXT_STDIO_FILEBUF
+
+#pragma GCC system_header
#include <fstream>
namespace __gnu_cxx
{
+ /**
+ * @class stdio_filebuf ext/stdio_filebuf.h <ext/stdio_filebuf.h>
+ * @brief Provides a layer of compatibility for C/POSIX.
+ *
+ * This GNU extension provides extensions for working with standard C
+ * FILE*'s and POSIX file descriptors. It must be instantiated by the
+ * user with the type of character used in the file stream, e.g.,
+ * stdio_filebuf<char>.
+ */
template<typename _CharT, typename _Traits = std::char_traits<_CharT> >
class stdio_filebuf : public std::basic_filebuf<_CharT, _Traits>
{
@@ -47,15 +64,47 @@ namespace __gnu_cxx
char_type _M_unbuf[4];
public:
+ /**
+ * @param fd An open file descriptor.
+ * @param mode Same meaning as in a standard filebuf.
+ * @param del Whether to close the file on destruction.
+ * @param size Optimal or preferred size of internal buffer, in bytes.
+ *
+ * This constructor associates a file stream buffer with an open
+ * POSIX file descriptor. Iff @a del is true, then the associated
+ * file will be closed when the stdio_filebuf is closed/destroyed.
+ */
stdio_filebuf(int __fd, std::ios_base::openmode __mode, bool __del,
int_type __size);
+ /**
+ * @param f An open @c FILE*.
+ * @param mode Same meaning as in a standard filebuf.
+ * @param size Optimal or preferred size of internal buffer, in bytes.
+ * Defaults to system's @c BUFSIZ.
+ *
+ * This constructor associates a file stream buffer with an open
+ * C @c FILE*. The @c FILE* will not be automatically closed when the
+ * stdio_filebuf is closed/destroyed.
+ */
stdio_filebuf(std::__c_file* __f, std::ios_base::openmode __mode,
int_type __size = static_cast<int_type>(BUFSIZ));
+ /**
+ * Possibly closes the external data stream, in the case of the file
+ * descriptor constructor and @c del @c == @c true.
+ */
virtual
~stdio_filebuf();
+ /**
+ * @return The underlying file descriptor.
+ *
+ * Once associated with an external data stream, this function can be
+ * used to access the underlying POSIX file descriptor. Note that
+ * there is no way for the library to track what you do with the
+ * descriptor, so be careful.
+ */
int
fd()
{ return _M_file.fd(); }
@@ -74,16 +123,18 @@ namespace __gnu_cxx
if (this->is_open())
{
_M_mode = __mode;
- _M_buf_size_opt = __size;
-
if (__size > 0 && __size < 4)
{
+ // Specify unbuffered.
_M_buf = _M_unbuf;
_M_buf_size = __size;
+ _M_buf_size_opt = 0;
}
else
- _M_allocate_internal_buffer();
-
+ {
+ _M_buf_size_opt = __size;
+ _M_allocate_internal_buffer();
+ }
_M_set_indeterminate();
}
}
@@ -97,17 +148,21 @@ namespace __gnu_cxx
if (this->is_open())
{
_M_mode = __mode;
- _M_buf_size_opt = __size;
-
if (__size > 0 && __size < 4)
{
+ // Specify unbuffered.
_M_buf = _M_unbuf;
_M_buf_size = __size;
+ _M_buf_size_opt = 0;
}
else
- _M_allocate_internal_buffer();
-
+ {
+ _M_buf_size_opt = __size;
+ _M_allocate_internal_buffer();
+ }
_M_set_indeterminate();
}
}
} // namespace __gnu_cxx
+
+#endif /* _EXT_STDIO_FILEBUF */
diff --git a/contrib/libstdc++/include/ext/stl_hashtable.h b/contrib/libstdc++/include/ext/stl_hashtable.h
index 5ee49d815f7cc..2bc8a2fcec0a6 100644
--- a/contrib/libstdc++/include/ext/stl_hashtable.h
+++ b/contrib/libstdc++/include/ext/stl_hashtable.h
@@ -610,11 +610,28 @@ bool operator==(const hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>& __ht1,
for (size_t __n = 0; __n < __ht1._M_buckets.size(); ++__n) {
_Node* __cur1 = __ht1._M_buckets[__n];
_Node* __cur2 = __ht2._M_buckets[__n];
- for ( ; __cur1 && __cur2 && __cur1->_M_val == __cur2->_M_val;
+ // Check same length of lists
+ for ( ; __cur1 && __cur2;
__cur1 = __cur1->_M_next, __cur2 = __cur2->_M_next)
{}
if (__cur1 || __cur2)
return false;
+ // Now check one's elements are in the other
+ for (__cur1 = __ht1._M_buckets[__n] ; __cur1; __cur1 = __cur1->_M_next)
+ {
+ bool _found__cur1 = false;
+ for (_Node* __cur2 = __ht2._M_buckets[__n];
+ __cur2; __cur2 = __cur2->_M_next)
+ {
+ if (__cur1->_M_val == __cur2->_M_val)
+ {
+ _found__cur1 = true;
+ break;
+ }
+ }
+ if (!_found__cur1)
+ return false;
+ }
}
return true;
}
diff --git a/contrib/libstdc++/include/ext/stl_rope.h b/contrib/libstdc++/include/ext/stl_rope.h
index 188fc40d3376d..bb9bb47258d16 100644
--- a/contrib/libstdc++/include/ext/stl_rope.h
+++ b/contrib/libstdc++/include/ext/stl_rope.h
@@ -1238,6 +1238,11 @@ struct _Rope_base
};
+/**
+ * This is an SGI extension.
+ * @ingroup SGIextensions
+ * @doctodo
+*/
template <class _CharT, class _Alloc>
class rope : public _Rope_base<_CharT,_Alloc> {
public: