SGI STL extensions(3cxx) | SGI STL extensions(3cxx) |
NAME¶
SGI STL extensions -SYNOPSIS¶
Classes¶
class __gnu_cxx::binary_compose< _Operation1, _Operation2, _Operation3 >
Functions¶
template<typename _Tp > const _Tp & std::__median (const _Tp &__a, const _Tp &__b, const _Tp &__c)
bitset< _Nb > & std::bitset< _Nb >::_Unchecked_set (size_t __pos)
Detailed Description¶
Because libstdc++ based its implementation of the STL subsections of the library on the SGI 3.3 implementation, we inherited their extensions as well. They are additionally documented in the online documentation, a copy of which is also shipped with the library source code (in .../docs/html/documentation.html). You can also read the documentation on SGI's site, which is still running even though the code is not maintained. NB that the following notes are pulled from various comments all over the place, so they may seem stilted. The identity_element functions are not part of the C++ standard; SGI provided them as an extension. Its argument is an operation, and its return value is the identity element for that operation. It is overloaded for addition and multiplication, and you can overload it for your own nefarious operations. As an extension to the binders, SGI provided composition functors and wrapper functions to aid in their creation. The unary_compose functor is constructed from two functions/functors, f and g. Calling operator() with a single argument x returns f(g(x)). The function compose1 takes the two functions and constructs a unary_compose variable for you. binary_compose is constructed from three functors, f, g1, and g2 . Its operator() returns f(g1(x),g2(x)). The function takes f, g1, and g2, and constructs the binary_compose instance for you. For example, if f returns an int, thenint answer = (compose2(f,g1,g2))(x);
is equivalent to
int temp1 = g1(x); int temp2 = g2(x); int answer = f(temp1,temp2);
But the first form is more compact, and can be passed around as a functor to other algorithms. As an extension, SGI provided a functor called identity. When a functor is required but no operations are desired, this can be used as a pass-through. Its operator() returns its argument unchanged. select1st and select2nd are extensions provided by SGI. Their operator()s take a std::pair as an argument, and return either the first member or the second member, respectively. They can be used (especially with the composition functors) to 'strip' data from a sequence before performing the remainder of an algorithm. The operator() of the project1st functor takes two arbitrary arguments and returns the first one, while project2nd returns the second one. They are extensions provided by SGI. These three functors are each constructed from a single arbitrary variable/value. Later, their operator()s completely ignore any arguments passed, and return the stored value.
- •
- constant_void_fun's operator() takes no arguments
- •
- constant_unary_fun's operator() takes one argument (ignored)
- •
- constant_binary_fun's operator() takes two arguments (ignored)
Function Documentation¶
template<typename _Tp > const _Tp& std::__median (const _Tp &__a, const _Tp &__b, const _Tp &__c) [inline]¶
Find the median of three values. Parameters:a A value.
b A value.
c A value.
Returns:
One of a, b or c.
If {l,m,n} is some convolution of {a,b,c} such that l<=m<=n then the value
returned will be m. This is an SGI extension.
Definition at line 85 of file stl_algo.h.
Referenced by std::__introsort_loop().
template<typename _Tp , typename _Compare > const _Tp& std::__median (const _Tp &__a, const _Tp &__b, const _Tp &__c, _Compare__comp) [inline]¶
Find the median of three values using a predicate for comparison. Parameters:a A value.
b A value.
c A value.
comp A binary predicate.
Returns:
One of a, b or c.
If {l,m,n} is some convolution of {a,b,c} such that comp(l,m) and comp(m,n) are
both true then the value returned will be m. This is an SGI extension.
Definition at line 119 of file stl_algo.h.
template<size_t _Nb> size_t std::bitset< _Nb >::_Find_first () const [inline]¶
Finds the index of the first 'on' bit. Returns:The index of the first bit set, or
size() if not found.
See Also:
_Find_next
template<size_t _Nb> size_t std::bitset< _Nb >::_Find_next (size_t__prev) const [inline]¶
Finds the index of the next 'on' bit after prev. Returns:The index of the next bit set, or
size() if not found.
Parameters:
prev Where to start searching.
See Also:
_Find_first
template<size_t _Nb> bitset<_Nb>& std::bitset< _Nb >::_Unchecked_flip (size_t__pos) [inline]¶
These versions of single-bit set, reset, flip, and test are extensions from the SGI version. They do no range checking. Definition at line 896 of file bitset.template<size_t _Nb> bitset<_Nb>& std::bitset< _Nb >::_Unchecked_reset (size_t__pos) [inline]¶
These versions of single-bit set, reset, flip, and test are extensions from the SGI version. They do no range checking. Definition at line 889 of file bitset.template<size_t _Nb> bitset<_Nb>& std::bitset< _Nb >::_Unchecked_set (size_t__pos) [inline]¶
These versions of single-bit set, reset, flip, and test are extensions from the SGI version. They do no range checking. Definition at line 872 of file bitset.template<size_t _Nb> bitset<_Nb>& std::bitset< _Nb >::_Unchecked_set (size_t__pos, int__val) [inline]¶
These versions of single-bit set, reset, flip, and test are extensions from the SGI version. They do no range checking. Definition at line 879 of file bitset.template<size_t _Nb> bool std::bitset< _Nb >::_Unchecked_test (size_t__pos) const [inline]¶
These versions of single-bit set, reset, flip, and test are extensions from the SGI version. They do no range checking. Definition at line 903 of file bitset.template<class _Operation1 , class _Operation2 > unary_compose<_Operation1, _Operation2> __gnu_cxx::compose1 (const _Operation1 &__fn1, const _Operation2 &__fn2) [inline]¶
An SGI extension . Definition at line 145 of file ext/functional.template<class _Operation1 , class _Operation2 , class _Operation3 > binary_compose<_Operation1, _Operation2, _Operation3> __gnu_cxx::compose2 (const _Operation1 &__fn1, const _Operation2 &__fn2, const _Operation3 &__fn3) [inline]¶
An SGI extension . Definition at line 172 of file ext/functional.template<class _Result > constant_void_fun<_Result> __gnu_cxx::constant0 (const _Result &__val) [inline]¶
An SGI extension . Definition at line 326 of file ext/functional.template<class _Result > constant_unary_fun<_Result, _Result> __gnu_cxx::constant1 (const _Result &__val) [inline]¶
An SGI extension . Definition at line 332 of file ext/functional.template<class _Result > constant_binary_fun<_Result,_Result,_Result> __gnu_cxx::constant2 (const _Result &__val) [inline]¶
An SGI extension . Definition at line 338 of file ext/functional.template<typename _InputIterator , typename _Size , typename _OutputIterator > pair<_InputIterator, _OutputIterator> __gnu_cxx::copy_n (_InputIterator__first, _Size__count, _OutputIterator__result) [inline]¶
Copies the range [first,first+count) into [result,result+count). Parameters:first An input iterator.
count The number of elements to copy.
result An output iterator.
Returns:
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
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).
Definition at line 119 of file ext/algorithm.
References std::__iterator_category().
template<typename _InputIterator , typename _Distance > void __gnu_cxx::distance (_InputIterator__first, _InputIterator__last, _Distance &__n) [inline]¶
This is an SGI extension. TodoDoc me! See doc/doxygen/TODO and
http://gcc.gnu.org/ml/libstdc++/2002-02/msg00003.html for more.
template<class _Tp > _Tp __gnu_cxx::identity_element (std::plus< _Tp >) [inline]¶
An SGI extension . Definition at line 87 of file ext/functional.template<class _Tp > _Tp __gnu_cxx::identity_element (std::multiplies< _Tp >) [inline]¶
An SGI extension . Definition at line 93 of file ext/functional.template<typename _ForwardIter , typename _Tp > void __gnu_cxx::iota (_ForwardIter__first, _ForwardIter__last, _Tp__value)¶
This is an SGI extension. TodoDoc me! See doc/doxygen/TODO and
http://gcc.gnu.org/ml/libstdc++/2002-02/msg00003.html for more.
template<typename _RandomAccessIterator > bool __gnu_cxx::is_heap (_RandomAccessIterator__first, _RandomAccessIterator__last) [inline]¶
This is an SGI extension. TodoDoc me! See doc/doxygen/TODO and
http://gcc.gnu.org/ml/libstdc++/2002-02/msg00003.html for more.
template<typename _RandomAccessIterator , typename _StrictWeakOrdering > bool __gnu_cxx::is_heap (_RandomAccessIterator__first, _RandomAccessIterator__last, _StrictWeakOrdering__comp) [inline]¶
This is an SGI extension. TodoDoc me! See doc/doxygen/TODO and
http://gcc.gnu.org/ml/libstdc++/2002-02/msg00003.html for more.
template<typename _ForwardIterator > bool __gnu_cxx::is_sorted (_ForwardIterator__first, _ForwardIterator__last)¶
This is an SGI extension. TodoDoc me! See doc/doxygen/TODO and
http://gcc.gnu.org/ml/libstdc++/2002-02/msg00003.html for more.
template<typename _ForwardIterator , typename _StrictWeakOrdering > bool __gnu_cxx::is_sorted (_ForwardIterator__first, _ForwardIterator__last, _StrictWeakOrdering__comp)¶
This is an SGI extension. TodoDoc me! See doc/doxygen/TODO and
http://gcc.gnu.org/ml/libstdc++/2002-02/msg00003.html for more.
template<typename _InputIterator1 , typename _InputIterator2 > int __gnu_cxx::lexicographical_compare_3way (_InputIterator1__first1, _InputIterator1__last1, _InputIterator2__first2, _InputIterator2__last2)¶
memcmp on steroids. Parameters:first1 An input iterator.
last1 An input iterator.
first2 An input iterator.
last2 An input iterator.
Returns:
An int, as with 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.
Definition at line 199 of file ext/algorithm.
template<typename _Tp , typename _Integer , typename _MonoidOperation > _Tp __gnu_cxx::power (_Tp__x, _Integer__n, _MonoidOperation__monoid_op) [inline]¶
This is an SGI extension. TodoDoc me! See doc/doxygen/TODO and
http://gcc.gnu.org/ml/libstdc++/2002-02/msg00003.html for more.
template<typename _Tp , typename _Integer > _Tp __gnu_cxx::power (_Tp__x, _Integer__n) [inline]¶
This is an SGI extension. TodoDoc me! See doc/doxygen/TODO and
http://gcc.gnu.org/ml/libstdc++/2002-02/msg00003.html for more.
template<typename _InputIterator , typename _RandomAccessIterator > _RandomAccessIterator __gnu_cxx::random_sample (_InputIterator__first, _InputIterator__last, _RandomAccessIterator__out_first, _RandomAccessIterator__out_last) [inline]¶
This is an SGI extension. TodoDoc me! See doc/doxygen/TODO and
http://gcc.gnu.org/ml/libstdc++/2002-02/msg00003.html for more.
template<typename _InputIterator , typename _RandomAccessIterator , typename _RandomNumberGenerator > _RandomAccessIterator __gnu_cxx::random_sample (_InputIterator__first, _InputIterator__last, _RandomAccessIterator__out_first, _RandomAccessIterator__out_last, _RandomNumberGenerator &__rand) [inline]¶
This is an SGI extension. TodoDoc me! See doc/doxygen/TODO and
http://gcc.gnu.org/ml/libstdc++/2002-02/msg00003.html for more.
template<typename _ForwardIterator , typename _OutputIterator , typename _Distance > _OutputIterator __gnu_cxx::random_sample_n (_ForwardIterator__first, _ForwardIterator__last, _OutputIterator__out, const _Distance__n)¶
This is an SGI extension. TodoDoc me! See doc/doxygen/TODO and
http://gcc.gnu.org/ml/libstdc++/2002-02/msg00003.html for more.
template<typename _ForwardIterator , typename _OutputIterator , typename _Distance , typename _RandomNumberGenerator > _OutputIterator __gnu_cxx::random_sample_n (_ForwardIterator__first, _ForwardIterator__last, _OutputIterator__out, const _Distance__n, _RandomNumberGenerator &__rand)¶
This is an SGI extension. TodoDoc me! See doc/doxygen/TODO and
http://gcc.gnu.org/ml/libstdc++/2002-02/msg00003.html for more.
template<typename _InputIter , typename _Size , typename _ForwardIter > pair<_InputIter, _ForwardIter> __gnu_cxx::uninitialized_copy_n (_InputIter__first, _Size__count, _ForwardIter__result) [inline]¶
Copies the range [first,last) into result. Parameters:first An input iterator.
last An input iterator.
result An output iterator.
Returns:
result + (first - last)
Like copy(), but does not require an initialized output range.
Definition at line 121 of file ext/memory.
References std::__iterator_category().
Author¶
Generated automatically by Doxygen for libstdc++ from the source code.Thu Aug 2 2012 | libstdc++ |