.TH "SGIextensions" 3cxx "Tue Jul 18 2023" "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME SGIextensions \- SGI .SH SYNOPSIS .br .PP .SS "Classes" .in +1c .ti -1c .RI "class \fB__gnu_cxx::binary_compose< _Operation1, _Operation2, _Operation3 >\fP" .br .RI "An \fBSGI extension \fP\&. " .ti -1c .RI "struct \fB__gnu_cxx::constant_binary_fun< _Result, _Arg1, _Arg2 >\fP" .br .RI "An \fBSGI extension \fP\&. " .ti -1c .RI "struct \fB__gnu_cxx::constant_unary_fun< _Result, _Argument >\fP" .br .RI "An \fBSGI extension \fP\&. " .ti -1c .RI "struct \fB__gnu_cxx::constant_void_fun< _Result >\fP" .br .RI "An \fBSGI extension \fP\&. " .ti -1c .RI "class \fB__gnu_cxx::hash_map< _Key, _Tp, _HashFn, _EqualKey, _Alloc >\fP" .br .ti -1c .RI "class \fB__gnu_cxx::hash_multimap< _Key, _Tp, _HashFn, _EqualKey, _Alloc >\fP" .br .ti -1c .RI "class \fB__gnu_cxx::hash_multiset< _Value, _HashFcn, _EqualKey, _Alloc >\fP" .br .ti -1c .RI "class \fB__gnu_cxx::hash_set< _Value, _HashFcn, _EqualKey, _Alloc >\fP" .br .ti -1c .RI "struct \fB__gnu_cxx::project1st< _Arg1, _Arg2 >\fP" .br .RI "An \fBSGI extension \fP\&. " .ti -1c .RI "struct \fB__gnu_cxx::project2nd< _Arg1, _Arg2 >\fP" .br .RI "An \fBSGI extension \fP\&. " .ti -1c .RI "struct \fB__gnu_cxx::rb_tree< _Key, _Value, _KeyOfValue, _Compare, _Alloc >\fP" .br .ti -1c .RI "class \fB__gnu_cxx::rope< _CharT, _Alloc >\fP" .br .ti -1c .RI "struct \fB__gnu_cxx::select1st< _Pair >\fP" .br .RI "An \fBSGI extension \fP\&. " .ti -1c .RI "struct \fB__gnu_cxx::select2nd< _Pair >\fP" .br .RI "An \fBSGI extension \fP\&. " .ti -1c .RI "class \fB__gnu_cxx::slist< _Tp, _Alloc >\fP" .br .ti -1c .RI "class \fB__gnu_cxx::subtractive_rng\fP" .br .ti -1c .RI "struct \fB__gnu_cxx::temporary_buffer< _ForwardIterator, _Tp >\fP" .br .ti -1c .RI "class \fB__gnu_cxx::unary_compose< _Operation1, _Operation2 >\fP" .br .RI "An \fBSGI extension \fP\&. " .in -1c .SS "Functions" .in +1c .ti -1c .RI "template const _Tp & \fB__gnu_cxx::__median\fP (const _Tp &__a, const _Tp &__b, const _Tp &__c)" .br .RI "Find the median of three values\&. " .ti -1c .RI "template const _Tp & \fB__gnu_cxx::__median\fP (const _Tp &__a, const _Tp &__b, const _Tp &__c, _Compare __comp)" .br .RI "Find the median of three values using a predicate for comparison\&. " .ti -1c .RI "size_t \fBstd::bitset< _Nb >::_Find_first\fP () const noexcept" .br .RI "Finds the index of the first 'on' bit\&. " .ti -1c .RI "size_t \fBstd::bitset< _Nb >::_Find_next\fP (size_t __prev) const noexcept" .br .RI "Finds the index of the next 'on' bit after prev\&. " .ti -1c .RI "template \fBunary_compose\fP< _Operation1, _Operation2 > \fB__gnu_cxx::compose1\fP (const _Operation1 &__fn1, const _Operation2 &__fn2)" .br .RI "An \fBSGI extension \fP\&. " .ti -1c .RI "template \fBbinary_compose\fP< _Operation1, _Operation2, _Operation3 > \fB__gnu_cxx::compose2\fP (const _Operation1 &__fn1, const _Operation2 &__fn2, const _Operation3 &__fn3)" .br .RI "An \fBSGI extension \fP\&. " .ti -1c .RI "template \fBconstant_void_fun\fP< _Result > \fB__gnu_cxx::constant0\fP (const _Result &__val)" .br .RI "An \fBSGI extension \fP\&. " .ti -1c .RI "template \fBconstant_unary_fun\fP< _Result, _Result > \fB__gnu_cxx::constant1\fP (const _Result &__val)" .br .RI "An \fBSGI extension \fP\&. " .ti -1c .RI "template \fBconstant_binary_fun\fP< _Result, _Result, _Result > \fB__gnu_cxx::constant2\fP (const _Result &__val)" .br .RI "An \fBSGI extension \fP\&. " .ti -1c .RI "template \fBstd::pair\fP< _InputIterator, _OutputIterator > \fB__gnu_cxx::copy_n\fP (_InputIterator __first, _Size __count, _OutputIterator __result)" .br .RI "Copies the range [first,first+count) into [result,result+count)\&. " .ti -1c .RI "template void \fB__gnu_cxx::distance\fP (_InputIterator __first, _InputIterator __last, _Distance &__n)" .br .ti -1c .RI "template _Tp \fB__gnu_cxx::identity_element\fP (\fBstd::multiplies\fP< _Tp >)" .br .RI "An \fBSGI extension \fP\&. " .ti -1c .RI "template _Tp \fB__gnu_cxx::identity_element\fP (\fBstd::plus\fP< _Tp >)" .br .RI "An \fBSGI extension \fP\&. " .ti -1c .RI "template int \fB__gnu_cxx::lexicographical_compare_3way\fP (_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2)" .br .RI "\fCmemcmp\fP on steroids\&. " .ti -1c .RI "template _Tp \fB__gnu_cxx::power\fP (_Tp __x, _Integer __n)" .br .ti -1c .RI "template _Tp \fB__gnu_cxx::power\fP (_Tp __x, _Integer __n, _MonoidOperation __monoid_op)" .br .ti -1c .RI "template _RandomAccessIterator \fB__gnu_cxx::random_sample\fP (_InputIterator __first, _InputIterator __last, _RandomAccessIterator __out_first, _RandomAccessIterator __out_last)" .br .ti -1c .RI "template _RandomAccessIterator \fB__gnu_cxx::random_sample\fP (_InputIterator __first, _InputIterator __last, _RandomAccessIterator __out_first, _RandomAccessIterator __out_last, _RandomNumberGenerator &__rand)" .br .ti -1c .RI "template _OutputIterator \fB__gnu_cxx::random_sample_n\fP (_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __out, const _Distance __n)" .br .ti -1c .RI "template _OutputIterator \fB__gnu_cxx::random_sample_n\fP (_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __out, const _Distance __n, _RandomNumberGenerator &__rand)" .br .ti -1c .RI "template \fBstd::pair\fP< _InputIter, _ForwardIter > \fB__gnu_cxx::uninitialized_copy_n\fP (_InputIter __first, _Size __count, _ForwardIter __result)" .br .RI "Copies the range [first,last) into result\&. " .in -1c .in +1c .ti -1c .RI "\fBbitset\fP< _Nb > & \fBstd::bitset< _Nb >::_Unchecked_set\fP (size_t __pos) noexcept" .br .ti -1c .RI "\fBbitset\fP< _Nb > & \fBstd::bitset< _Nb >::_Unchecked_set\fP (size_t __pos, int __val) noexcept" .br .ti -1c .RI "\fBbitset\fP< _Nb > & \fBstd::bitset< _Nb >::_Unchecked_reset\fP (size_t __pos) noexcept" .br .ti -1c .RI "\fBbitset\fP< _Nb > & \fBstd::bitset< _Nb >::_Unchecked_flip\fP (size_t __pos) noexcept" .br .ti -1c .RI "constexpr bool \fBstd::bitset< _Nb >::_Unchecked_test\fP (size_t __pos) const noexcept" .br .in -1c .SH "Detailed Description" .PP Because libstdc++ based its implementation of the STL subsections of the library on the SGI 3\&.3 implementation, we inherited their extensions as well\&. .PP They are additionally documented in the \fConline documentation\fP, a copy of which is also shipped with the library source code (in \&.\&.\&./docs/html/documentation\&.html)\&. You can also read the documentation \fCon SGI's site\fP, which is still running even though the code is not maintained\&. .PP \fBNB\fP that the following notes are pulled from various comments all over the place, so they may seem stilted\&. .PP .PP The \fCidentity_element\fP 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\&. .PP As an extension to the binders, SGI provided composition functors and wrapper functions to aid in their creation\&. The \fCunary_compose\fP functor is constructed from two functions/functors, \fCf\fP and \fCg\fP\&. Calling \fCoperator()\fP with a single argument \fCx\fP returns \fCf(g(x))\fP\&. The function \fCcompose1\fP takes the two functions and constructs a \fCunary_compose\fP variable for you\&. .PP \fCbinary_compose\fP is constructed from three functors, \fCf\fP, \fCg1\fP, and \fCg2\fP\&. Its \fCoperator()\fP returns \fCf\fP(g1(x),g2(x))\&. The function compose2 takes f, g1, and g2, and constructs the \fCbinary_compose\fP instance for you\&. For example, if \fCf\fP returns an int, then .PP .nf int answer = (compose2(f,g1,g2))(x); .fi .PP is equivalent to .PP .nf int temp1 = g1(x); int temp2 = g2(x); int answer = f(temp1,temp2); .fi .PP But the first form is more compact, and can be passed around as a functor to other algorithms\&. .PP As an extension, SGI provided a functor called \fCidentity\fP\&. When a functor is required but no operations are desired, this can be used as a pass-through\&. Its \fCoperator()\fP returns its argument unchanged\&. .PP \fCselect1st\fP and \fCselect2nd\fP are extensions provided by SGI\&. Their \fCoperator()s\fP take a \fCstd::pair\fP as an argument, and return either the first member or the second member, respectively\&. They can be used (especially with the composition functors) to \fIstrip\fP data from a sequence before performing the remainder of an algorithm\&. .PP The \fCoperator()\fP of the \fCproject1st\fP functor takes two arbitrary arguments and returns the first one, while \fCproject2nd\fP returns the second one\&. They are extensions provided by SGI\&. .PP These three functors are each constructed from a single arbitrary variable/value\&. Later, their \fCoperator()s\fP completely ignore any arguments passed, and return the stored value\&. .IP "\(bu" 2 \fCconstant_void_fun's\fP \fCoperator()\fP takes no arguments .IP "\(bu" 2 \fCconstant_unary_fun's\fP \fCoperator()\fP takes one argument (ignored) .IP "\(bu" 2 \fCconstant_binary_fun's\fP \fCoperator()\fP takes two arguments (ignored) .PP .PP The helper creator functions \fCconstant0\fP, \fCconstant1\fP, and \fCconstant2\fP each take a \fIresult\fP argument and construct variables of the appropriate functor type\&. .SH "Function Documentation" .PP .SS "template const _Tp & __gnu_cxx::__median (const _Tp & __a, const _Tp & __b, const _Tp & __c)" .PP Find the median of three values\&. .PP \fBParameters\fP .RS 4 \fI__a\fP A value\&. .br \fI__b\fP A value\&. .br \fI__c\fP A value\&. .RE .PP \fBReturns\fP .RS 4 One of \fCa\fP, \fCb\fP or \fCc\fP\&. .RE .PP If \fC{l\fP,m,n} is some convolution of \fC{a\fP,b,c} such that \fCl<=m<=n\fP then the value returned will be \fCm\fP\&. This is an SGI extension\&. .SS "template const _Tp & __gnu_cxx::__median (const _Tp & __a, const _Tp & __b, const _Tp & __c, _Compare __comp)" .PP Find the median of three values using a predicate for comparison\&. .PP \fBParameters\fP .RS 4 \fI__a\fP A value\&. .br \fI__b\fP A value\&. .br \fI__c\fP A value\&. .br \fI__comp\fP A binary predicate\&. .RE .PP \fBReturns\fP .RS 4 One of \fCa\fP, \fCb\fP or \fCc\fP\&. .RE .PP If \fC{l\fP,m,n} is some convolution of \fC{a\fP,b,c} such that \fCcomp(l,m)\fP and \fCcomp(m,n)\fP are both true then the value returned will be \fCm\fP\&. This is an SGI extension\&. .SS "template size_t \fBstd::bitset\fP< _Nb >::_Find_first () const\fC [inline]\fP, \fC [noexcept]\fP" .PP Finds the index of the first 'on' bit\&. .PP \fBReturns\fP .RS 4 The index of the first bit set, or size() if not found\&. .RE .PP \fBSee also\fP .RS 4 _Find_next .RE .PP .SS "template size_t \fBstd::bitset\fP< _Nb >::_Find_next (size_t __prev) const\fC [inline]\fP, \fC [noexcept]\fP" .PP Finds the index of the next 'on' bit after prev\&. .PP \fBReturns\fP .RS 4 The index of the next bit set, or size() if not found\&. .RE .PP \fBParameters\fP .RS 4 \fI__prev\fP Where to start searching\&. .RE .PP \fBSee also\fP .RS 4 _Find_first .RE .PP .SS "template \fBbitset\fP< _Nb > & \fBstd::bitset\fP< _Nb >::_Unchecked_flip (size_t __pos)\fC [inline]\fP, \fC [noexcept]\fP" These versions of single-bit set, reset, flip, and test are extensions from the SGI version\&. They do no range checking\&. .SS "template \fBbitset\fP< _Nb > & \fBstd::bitset\fP< _Nb >::_Unchecked_reset (size_t __pos)\fC [inline]\fP, \fC [noexcept]\fP" These versions of single-bit set, reset, flip, and test are extensions from the SGI version\&. They do no range checking\&. .SS "template \fBbitset\fP< _Nb > & \fBstd::bitset\fP< _Nb >::_Unchecked_set (size_t __pos)\fC [inline]\fP, \fC [noexcept]\fP" These versions of single-bit set, reset, flip, and test are extensions from the SGI version\&. They do no range checking\&. .SS "template \fBbitset\fP< _Nb > & \fBstd::bitset\fP< _Nb >::_Unchecked_set (size_t __pos, int __val)\fC [inline]\fP, \fC [noexcept]\fP" These versions of single-bit set, reset, flip, and test are extensions from the SGI version\&. They do no range checking\&. .SS "template constexpr bool \fBstd::bitset\fP< _Nb >::_Unchecked_test (size_t __pos) const\fC [inline]\fP, \fC [constexpr]\fP, \fC [noexcept]\fP" These versions of single-bit set, reset, flip, and test are extensions from the SGI version\&. They do no range checking\&. .SS "template \fBunary_compose\fP< _Operation1, _Operation2 > __gnu_cxx::compose1 (const _Operation1 & __fn1, const _Operation2 & __fn2)\fC [inline]\fP" .PP An \fBSGI extension \fP\&. .SS "template \fBbinary_compose\fP< _Operation1, _Operation2, _Operation3 > __gnu_cxx::compose2 (const _Operation1 & __fn1, const _Operation2 & __fn2, const _Operation3 & __fn3)\fC [inline]\fP" .PP An \fBSGI extension \fP\&. .SS "template \fBconstant_void_fun\fP< _Result > __gnu_cxx::constant0 (const _Result & __val)\fC [inline]\fP" .PP An \fBSGI extension \fP\&. .SS "template \fBconstant_unary_fun\fP< _Result, _Result > __gnu_cxx::constant1 (const _Result & __val)\fC [inline]\fP" .PP An \fBSGI extension \fP\&. .SS "template \fBconstant_binary_fun\fP< _Result, _Result, _Result > __gnu_cxx::constant2 (const _Result & __val)\fC [inline]\fP" .PP An \fBSGI extension \fP\&. .SS "template \fBstd::pair\fP< _InputIterator, _OutputIterator > __gnu_cxx::copy_n (_InputIterator __first, _Size __count, _OutputIterator __result)\fC [inline]\fP" .PP Copies the range [first,first+count) into [result,result+count)\&. .PP \fBParameters\fP .RS 4 \fI__first\fP An input iterator\&. .br \fI__count\fP The number of elements to copy\&. .br \fI__result\fP An output iterator\&. .RE .PP \fBReturns\fP .RS 4 A std::pair composed of first+count and result+count\&. .RE .PP This is an SGI extension\&. This inline function will boil down to a call to \fCmemmove\fP 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)\&. .SS "template void __gnu_cxx::distance (_InputIterator __first, _InputIterator __last, _Distance & __n)\fC [inline]\fP" This is an SGI extension\&. .PP \fBTodo\fP .RS 4 Needs documentation! See http://gcc.gnu.org/onlinedocs/libstdc++/manual/documentation_style.html .RE .PP .SS "template _Tp __gnu_cxx::identity_element (\fBstd::multiplies\fP< _Tp >)\fC [inline]\fP" .PP An \fBSGI extension \fP\&. .SS "template _Tp __gnu_cxx::identity_element (\fBstd::plus\fP< _Tp >)\fC [inline]\fP" .PP An \fBSGI extension \fP\&. .SS "template int __gnu_cxx::lexicographical_compare_3way (_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2)" .PP \fCmemcmp\fP on steroids\&. .PP \fBParameters\fP .RS 4 \fI__first1\fP An input iterator\&. .br \fI__last1\fP An input iterator\&. .br \fI__first2\fP An input iterator\&. .br \fI__last2\fP An input iterator\&. .RE .PP \fBReturns\fP .RS 4 An int, as with \fCmemcmp\fP\&. .RE .PP The return value will be less than zero if the first range is \fIlexigraphically less than\fP the second, greater than zero if the second range is \fIlexigraphically less than\fP the first, and zero otherwise\&. This is an SGI extension\&. .SS "template _Tp __gnu_cxx::power (_Tp __x, _Integer __n)\fC [inline]\fP" This is an SGI extension\&. .PP \fBTodo\fP .RS 4 Needs documentation! See http://gcc.gnu.org/onlinedocs/libstdc++/manual/documentation_style.html .RE .PP .SS "template _Tp __gnu_cxx::power (_Tp __x, _Integer __n, _MonoidOperation __monoid_op)\fC [inline]\fP" This is an SGI extension\&. .PP \fBTodo\fP .RS 4 Needs documentation! See http://gcc.gnu.org/onlinedocs/libstdc++/manual/documentation_style.html .RE .PP .SS "template _RandomAccessIterator __gnu_cxx::random_sample (_InputIterator __first, _InputIterator __last, _RandomAccessIterator __out_first, _RandomAccessIterator __out_last)\fC [inline]\fP" This is an SGI extension\&. .PP \fBTodo\fP .RS 4 Needs documentation! See http://gcc.gnu.org/onlinedocs/libstdc++/manual/documentation_style.html .RE .PP .SS "template _RandomAccessIterator __gnu_cxx::random_sample (_InputIterator __first, _InputIterator __last, _RandomAccessIterator __out_first, _RandomAccessIterator __out_last, _RandomNumberGenerator & __rand)\fC [inline]\fP" This is an SGI extension\&. .PP \fBTodo\fP .RS 4 Needs documentation! See http://gcc.gnu.org/onlinedocs/libstdc++/manual/documentation_style.html .RE .PP .SS "template _OutputIterator __gnu_cxx::random_sample_n (_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __out, const _Distance __n)" This is an SGI extension\&. .PP \fBTodo\fP .RS 4 Needs documentation! See http://gcc.gnu.org/onlinedocs/libstdc++/manual/documentation_style.html .RE .PP .SS "template _OutputIterator __gnu_cxx::random_sample_n (_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __out, const _Distance __n, _RandomNumberGenerator & __rand)" This is an SGI extension\&. .PP \fBTodo\fP .RS 4 Needs documentation! See http://gcc.gnu.org/onlinedocs/libstdc++/manual/documentation_style.html .RE .PP .SS "template \fBstd::pair\fP< _InputIter, _ForwardIter > __gnu_cxx::uninitialized_copy_n (_InputIter __first, _Size __count, _ForwardIter __result)\fC [inline]\fP" .PP Copies the range [first,last) into result\&. .PP \fBParameters\fP .RS 4 \fI__first\fP An input iterator\&. .br \fI__count\fP Length .br \fI__result\fP An output iterator\&. .RE .PP \fBReturns\fP .RS 4 __result + (__first + __count) .RE .PP Like copy(), but does not require an initialized output range\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.