Add STLport 5.1.4
authorScott Wood <scott@thor.buserror.net>
Sun, 25 Nov 2007 21:35:31 +0000 (15:35 -0600)
committerScott Wood <scott@thor.buserror.net>
Sun, 25 Nov 2007 21:35:31 +0000 (15:35 -0600)
378 files changed:
doc/attributions
include/c++/stl/algorithm [new file with mode: 0644]
include/c++/stl/assert.h [new file with mode: 0644]
include/c++/stl/bitset [new file with mode: 0644]
include/c++/stl/cassert [new file with mode: 0644]
include/c++/stl/cctype [new file with mode: 0644]
include/c++/stl/cerrno [new file with mode: 0644]
include/c++/stl/cfloat [new file with mode: 0644]
include/c++/stl/ciso646 [new file with mode: 0644]
include/c++/stl/climits [new file with mode: 0644]
include/c++/stl/clocale [new file with mode: 0644]
include/c++/stl/cmath [new file with mode: 0644]
include/c++/stl/complex [new file with mode: 0644]
include/c++/stl/csetjmp [new file with mode: 0644]
include/c++/stl/csignal [new file with mode: 0644]
include/c++/stl/cstdarg [new file with mode: 0644]
include/c++/stl/cstddef [new file with mode: 0644]
include/c++/stl/cstdio [new file with mode: 0644]
include/c++/stl/cstdlib [new file with mode: 0644]
include/c++/stl/cstring [new file with mode: 0644]
include/c++/stl/ctime [new file with mode: 0644]
include/c++/stl/ctype.h [new file with mode: 0644]
include/c++/stl/cwchar [new file with mode: 0644]
include/c++/stl/cwctype [new file with mode: 0644]
include/c++/stl/deque [new file with mode: 0644]
include/c++/stl/errno.h [new file with mode: 0644]
include/c++/stl/exception [new file with mode: 0644]
include/c++/stl/exception.h [new file with mode: 0644]
include/c++/stl/float.h [new file with mode: 0644]
include/c++/stl/fstream [new file with mode: 0644]
include/c++/stl/fstream.h [new file with mode: 0644]
include/c++/stl/functional [new file with mode: 0644]
include/c++/stl/hash_map [new file with mode: 0644]
include/c++/stl/hash_set [new file with mode: 0644]
include/c++/stl/iomanip [new file with mode: 0644]
include/c++/stl/iomanip.h [new file with mode: 0644]
include/c++/stl/ios [new file with mode: 0644]
include/c++/stl/ios.h [new file with mode: 0644]
include/c++/stl/iosfwd [new file with mode: 0644]
include/c++/stl/iostream [new file with mode: 0644]
include/c++/stl/iostream.h [new file with mode: 0644]
include/c++/stl/iso646.h [new file with mode: 0644]
include/c++/stl/istream [new file with mode: 0644]
include/c++/stl/istream.h [new file with mode: 0644]
include/c++/stl/iterator [new file with mode: 0644]
include/c++/stl/limits [new file with mode: 0644]
include/c++/stl/limits.h [new file with mode: 0644]
include/c++/stl/list [new file with mode: 0644]
include/c++/stl/locale [new file with mode: 0644]
include/c++/stl/locale.h [new file with mode: 0644]
include/c++/stl/map [new file with mode: 0644]
include/c++/stl/math.h [new file with mode: 0644]
include/c++/stl/mem.h [new file with mode: 0644]
include/c++/stl/memory [new file with mode: 0644]
include/c++/stl/new [new file with mode: 0644]
include/c++/stl/new.h [new file with mode: 0644]
include/c++/stl/numeric [new file with mode: 0644]
include/c++/stl/ostream [new file with mode: 0644]
include/c++/stl/ostream.h [new file with mode: 0644]
include/c++/stl/pthread.h [new file with mode: 0644]
include/c++/stl/pthread_alloc [new file with mode: 0644]
include/c++/stl/queue [new file with mode: 0644]
include/c++/stl/rlocks.h [new file with mode: 0644]
include/c++/stl/rope [new file with mode: 0644]
include/c++/stl/set [new file with mode: 0644]
include/c++/stl/setjmp.h [new file with mode: 0644]
include/c++/stl/signal.h [new file with mode: 0644]
include/c++/stl/slist [new file with mode: 0644]
include/c++/stl/sstream [new file with mode: 0644]
include/c++/stl/stack [new file with mode: 0644]
include/c++/stl/stdarg.h [new file with mode: 0644]
include/c++/stl/stddef.h [new file with mode: 0644]
include/c++/stl/stdexcept [new file with mode: 0644]
include/c++/stl/stdio.h [new file with mode: 0644]
include/c++/stl/stdiostream.h [new file with mode: 0644]
include/c++/stl/stdlib.h [new file with mode: 0644]
include/c++/stl/stl/_abbrevs.h [new file with mode: 0644]
include/c++/stl/stl/_algo.c [new file with mode: 0644]
include/c++/stl/stl/_algo.h [new file with mode: 0644]
include/c++/stl/stl/_algobase.c [new file with mode: 0644]
include/c++/stl/stl/_algobase.h [new file with mode: 0644]
include/c++/stl/stl/_alloc.c [new file with mode: 0644]
include/c++/stl/stl/_alloc.h [new file with mode: 0644]
include/c++/stl/stl/_alloc_old.h [new file with mode: 0644]
include/c++/stl/stl/_auto_ptr.h [new file with mode: 0644]
include/c++/stl/stl/_bitset.c [new file with mode: 0644]
include/c++/stl/stl/_bitset.h [new file with mode: 0644]
include/c++/stl/stl/_bvector.h [new file with mode: 0644]
include/c++/stl/stl/_carray.h [new file with mode: 0644]
include/c++/stl/stl/_cctype.h [new file with mode: 0644]
include/c++/stl/stl/_check_config.h [new file with mode: 0644]
include/c++/stl/stl/_clocale.h [new file with mode: 0644]
include/c++/stl/stl/_cmath.h [new file with mode: 0644]
include/c++/stl/stl/_codecvt.h [new file with mode: 0644]
include/c++/stl/stl/_collate.h [new file with mode: 0644]
include/c++/stl/stl/_complex.c [new file with mode: 0644]
include/c++/stl/stl/_complex.h [new file with mode: 0644]
include/c++/stl/stl/_config_compat_post.h [new file with mode: 0644]
include/c++/stl/stl/_construct.h [new file with mode: 0644]
include/c++/stl/stl/_csetjmp.h [new file with mode: 0644]
include/c++/stl/stl/_csignal.h [new file with mode: 0644]
include/c++/stl/stl/_cstdarg.h [new file with mode: 0644]
include/c++/stl/stl/_cstddef.h [new file with mode: 0644]
include/c++/stl/stl/_cstdio.h [new file with mode: 0644]
include/c++/stl/stl/_cstdlib.h [new file with mode: 0644]
include/c++/stl/stl/_cstring.h [new file with mode: 0644]
include/c++/stl/stl/_ctime.h [new file with mode: 0644]
include/c++/stl/stl/_ctraits_fns.h [new file with mode: 0644]
include/c++/stl/stl/_ctype.h [new file with mode: 0644]
include/c++/stl/stl/_cwchar.h [new file with mode: 0644]
include/c++/stl/stl/_cwctype.h [new file with mode: 0644]
include/c++/stl/stl/_deque.c [new file with mode: 0644]
include/c++/stl/stl/_deque.h [new file with mode: 0644]
include/c++/stl/stl/_epilog.h [new file with mode: 0644]
include/c++/stl/stl/_exception.h [new file with mode: 0644]
include/c++/stl/stl/_fstream.c [new file with mode: 0644]
include/c++/stl/stl/_fstream.h [new file with mode: 0644]
include/c++/stl/stl/_function.h [new file with mode: 0644]
include/c++/stl/stl/_function_adaptors.h [new file with mode: 0644]
include/c++/stl/stl/_function_base.h [new file with mode: 0644]
include/c++/stl/stl/_hash_fun.h [new file with mode: 0644]
include/c++/stl/stl/_hash_map.h [new file with mode: 0644]
include/c++/stl/stl/_hash_set.h [new file with mode: 0644]
include/c++/stl/stl/_hashtable.c [new file with mode: 0644]
include/c++/stl/stl/_hashtable.h [new file with mode: 0644]
include/c++/stl/stl/_heap.c [new file with mode: 0644]
include/c++/stl/stl/_heap.h [new file with mode: 0644]
include/c++/stl/stl/_ios.c [new file with mode: 0644]
include/c++/stl/stl/_ios.h [new file with mode: 0644]
include/c++/stl/stl/_ios_base.h [new file with mode: 0644]
include/c++/stl/stl/_ioserr.h [new file with mode: 0644]
include/c++/stl/stl/_iosfwd.h [new file with mode: 0644]
include/c++/stl/stl/_iostream_string.h [new file with mode: 0644]
include/c++/stl/stl/_istream.c [new file with mode: 0644]
include/c++/stl/stl/_istream.h [new file with mode: 0644]
include/c++/stl/stl/_istreambuf_iterator.h [new file with mode: 0644]
include/c++/stl/stl/_iterator.h [new file with mode: 0644]
include/c++/stl/stl/_iterator_base.h [new file with mode: 0644]
include/c++/stl/stl/_iterator_old.h [new file with mode: 0644]
include/c++/stl/stl/_limits.c [new file with mode: 0644]
include/c++/stl/stl/_limits.h [new file with mode: 0644]
include/c++/stl/stl/_list.c [new file with mode: 0644]
include/c++/stl/stl/_list.h [new file with mode: 0644]
include/c++/stl/stl/_locale.h [new file with mode: 0644]
include/c++/stl/stl/_map.h [new file with mode: 0644]
include/c++/stl/stl/_mbstate_t.h [new file with mode: 0644]
include/c++/stl/stl/_messages_facets.h [new file with mode: 0644]
include/c++/stl/stl/_monetary.c [new file with mode: 0644]
include/c++/stl/stl/_monetary.h [new file with mode: 0644]
include/c++/stl/stl/_move_construct_fwk.h [new file with mode: 0644]
include/c++/stl/stl/_new.h [new file with mode: 0644]
include/c++/stl/stl/_null_stream.h [new file with mode: 0644]
include/c++/stl/stl/_num_get.c [new file with mode: 0644]
include/c++/stl/stl/_num_get.h [new file with mode: 0644]
include/c++/stl/stl/_num_put.c [new file with mode: 0644]
include/c++/stl/stl/_num_put.h [new file with mode: 0644]
include/c++/stl/stl/_numeric.c [new file with mode: 0644]
include/c++/stl/stl/_numeric.h [new file with mode: 0644]
include/c++/stl/stl/_numpunct.h [new file with mode: 0644]
include/c++/stl/stl/_ostream.c [new file with mode: 0644]
include/c++/stl/stl/_ostream.h [new file with mode: 0644]
include/c++/stl/stl/_ostreambuf_iterator.h [new file with mode: 0644]
include/c++/stl/stl/_pair.h [new file with mode: 0644]
include/c++/stl/stl/_prolog.h [new file with mode: 0644]
include/c++/stl/stl/_pthread_alloc.h [new file with mode: 0644]
include/c++/stl/stl/_ptrs_specialize.h [new file with mode: 0644]
include/c++/stl/stl/_queue.h [new file with mode: 0644]
include/c++/stl/stl/_range_errors.h [new file with mode: 0644]
include/c++/stl/stl/_raw_storage_iter.h [new file with mode: 0644]
include/c++/stl/stl/_relops_cont.h [new file with mode: 0644]
include/c++/stl/stl/_relops_hash_cont.h [new file with mode: 0644]
include/c++/stl/stl/_rope.c [new file with mode: 0644]
include/c++/stl/stl/_rope.h [new file with mode: 0644]
include/c++/stl/stl/_set.h [new file with mode: 0644]
include/c++/stl/stl/_slist.c [new file with mode: 0644]
include/c++/stl/stl/_slist.h [new file with mode: 0644]
include/c++/stl/stl/_slist_base.c [new file with mode: 0644]
include/c++/stl/stl/_slist_base.h [new file with mode: 0644]
include/c++/stl/stl/_sparc_atomic.h [new file with mode: 0644]
include/c++/stl/stl/_sstream.c [new file with mode: 0644]
include/c++/stl/stl/_sstream.h [new file with mode: 0644]
include/c++/stl/stl/_stack.h [new file with mode: 0644]
include/c++/stl/stl/_stdexcept.h [new file with mode: 0644]
include/c++/stl/stl/_stdexcept_base.h [new file with mode: 0644]
include/c++/stl/stl/_stlport_version.h [new file with mode: 0644]
include/c++/stl/stl/_stream_iterator.h [new file with mode: 0644]
include/c++/stl/stl/_streambuf.c [new file with mode: 0644]
include/c++/stl/stl/_streambuf.h [new file with mode: 0644]
include/c++/stl/stl/_string.c [new file with mode: 0644]
include/c++/stl/stl/_string.h [new file with mode: 0644]
include/c++/stl/stl/_string_base.h [new file with mode: 0644]
include/c++/stl/stl/_string_fwd.h [new file with mode: 0644]
include/c++/stl/stl/_string_hash.h [new file with mode: 0644]
include/c++/stl/stl/_string_io.c [new file with mode: 0644]
include/c++/stl/stl/_string_io.h [new file with mode: 0644]
include/c++/stl/stl/_string_npos.h [new file with mode: 0644]
include/c++/stl/stl/_string_operators.h [new file with mode: 0644]
include/c++/stl/stl/_string_sum.h [new file with mode: 0644]
include/c++/stl/stl/_string_sum_methods.h [new file with mode: 0644]
include/c++/stl/stl/_string_workaround.h [new file with mode: 0644]
include/c++/stl/stl/_strstream.h [new file with mode: 0644]
include/c++/stl/stl/_tempbuf.c [new file with mode: 0644]
include/c++/stl/stl/_tempbuf.h [new file with mode: 0644]
include/c++/stl/stl/_threads.c [new file with mode: 0644]
include/c++/stl/stl/_threads.h [new file with mode: 0644]
include/c++/stl/stl/_time_facets.c [new file with mode: 0644]
include/c++/stl/stl/_time_facets.h [new file with mode: 0644]
include/c++/stl/stl/_tree.c [new file with mode: 0644]
include/c++/stl/stl/_tree.h [new file with mode: 0644]
include/c++/stl/stl/_typeinfo.h [new file with mode: 0644]
include/c++/stl/stl/_uninitialized.h [new file with mode: 0644]
include/c++/stl/stl/_unordered_map.h [new file with mode: 0644]
include/c++/stl/stl/_unordered_set.h [new file with mode: 0644]
include/c++/stl/stl/_valarray.c [new file with mode: 0644]
include/c++/stl/stl/_valarray.h [new file with mode: 0644]
include/c++/stl/stl/_vector.c [new file with mode: 0644]
include/c++/stl/stl/_vector.h [new file with mode: 0644]
include/c++/stl/stl/boost_type_traits.h [new file with mode: 0644]
include/c++/stl/stl/c_locale.h [new file with mode: 0644]
include/c++/stl/stl/char_traits.h [new file with mode: 0644]
include/c++/stl/stl/concept_checks.h [new file with mode: 0644]
include/c++/stl/stl/config/_aix.h [new file with mode: 0644]
include/c++/stl/stl/config/_apcc.h [new file with mode: 0644]
include/c++/stl/stl/config/_apple.h [new file with mode: 0644]
include/c++/stl/stl/config/_as400.h [new file with mode: 0644]
include/c++/stl/stl/config/_auto_link.h [new file with mode: 0644]
include/c++/stl/stl/config/_bc.h [new file with mode: 0644]
include/c++/stl/stl/config/_como.h [new file with mode: 0644]
include/c++/stl/stl/config/_cray.h [new file with mode: 0644]
include/c++/stl/stl/config/_cygwin.h [new file with mode: 0644]
include/c++/stl/stl/config/_dec.h [new file with mode: 0644]
include/c++/stl/stl/config/_dec_vms.h [new file with mode: 0644]
include/c++/stl/stl/config/_detect_dll_or_lib.h [new file with mode: 0644]
include/c++/stl/stl/config/_dm.h [new file with mode: 0644]
include/c++/stl/stl/config/_epilog.h [new file with mode: 0644]
include/c++/stl/stl/config/_evc.h [new file with mode: 0644]
include/c++/stl/stl/config/_freebsd.h [new file with mode: 0644]
include/c++/stl/stl/config/_fujitsu.h [new file with mode: 0644]
include/c++/stl/stl/config/_gcc.h [new file with mode: 0644]
include/c++/stl/stl/config/_hpacc.h [new file with mode: 0644]
include/c++/stl/stl/config/_hpux.h [new file with mode: 0644]
include/c++/stl/stl/config/_ibm.h [new file with mode: 0644]
include/c++/stl/stl/config/_icc.h [new file with mode: 0644]
include/c++/stl/stl/config/_intel.h [new file with mode: 0644]
include/c++/stl/stl/config/_kai.h [new file with mode: 0644]
include/c++/stl/stl/config/_linux.h [new file with mode: 0644]
include/c++/stl/stl/config/_mac.h [new file with mode: 0644]
include/c++/stl/stl/config/_macosx.h [new file with mode: 0644]
include/c++/stl/stl/config/_mlc.h [new file with mode: 0644]
include/c++/stl/stl/config/_msvc.h [new file with mode: 0644]
include/c++/stl/stl/config/_mwccnlm.h [new file with mode: 0644]
include/c++/stl/stl/config/_mwerks.h [new file with mode: 0644]
include/c++/stl/stl/config/_native_headers.h [new file with mode: 0644]
include/c++/stl/stl/config/_netware.h [new file with mode: 0644]
include/c++/stl/stl/config/_openbsd.h [new file with mode: 0644]
include/c++/stl/stl/config/_prolog.h [new file with mode: 0644]
include/c++/stl/stl/config/_sgi.h [new file with mode: 0644]
include/c++/stl/stl/config/_solaris.h [new file with mode: 0644]
include/c++/stl/stl/config/_sunprocc.h [new file with mode: 0644]
include/c++/stl/stl/config/_symantec.h [new file with mode: 0644]
include/c++/stl/stl/config/_system.h [new file with mode: 0644]
include/c++/stl/stl/config/_warnings_off.h [new file with mode: 0644]
include/c++/stl/stl/config/_watcom.h [new file with mode: 0644]
include/c++/stl/stl/config/_windows.h [new file with mode: 0644]
include/c++/stl/stl/config/compat.h [new file with mode: 0644]
include/c++/stl/stl/config/features.h [new file with mode: 0644]
include/c++/stl/stl/config/host.h [new file with mode: 0644]
include/c++/stl/stl/config/stl_confix.h [new file with mode: 0644]
include/c++/stl/stl/config/stl_mycomp.h [new file with mode: 0644]
include/c++/stl/stl/config/user_config.h [new file with mode: 0644]
include/c++/stl/stl/debug/_debug.c [new file with mode: 0644]
include/c++/stl/stl/debug/_debug.h [new file with mode: 0644]
include/c++/stl/stl/debug/_deque.h [new file with mode: 0644]
include/c++/stl/stl/debug/_hashtable.h [new file with mode: 0644]
include/c++/stl/stl/debug/_iterator.h [new file with mode: 0644]
include/c++/stl/stl/debug/_list.h [new file with mode: 0644]
include/c++/stl/stl/debug/_slist.h [new file with mode: 0644]
include/c++/stl/stl/debug/_string.h [new file with mode: 0644]
include/c++/stl/stl/debug/_string_sum_methods.h [new file with mode: 0644]
include/c++/stl/stl/debug/_tree.h [new file with mode: 0644]
include/c++/stl/stl/debug/_vector.h [new file with mode: 0644]
include/c++/stl/stl/msl_string.h [new file with mode: 0644]
include/c++/stl/stl/pointers/_deque.h [new file with mode: 0644]
include/c++/stl/stl/pointers/_list.h [new file with mode: 0644]
include/c++/stl/stl/pointers/_set.h [new file with mode: 0644]
include/c++/stl/stl/pointers/_slist.h [new file with mode: 0644]
include/c++/stl/stl/pointers/_tools.h [new file with mode: 0644]
include/c++/stl/stl/pointers/_vector.h [new file with mode: 0644]
include/c++/stl/stl/type_manips.h [new file with mode: 0644]
include/c++/stl/stl/type_traits.h [new file with mode: 0644]
include/c++/stl/streambuf [new file with mode: 0644]
include/c++/stl/streambuf.h [new file with mode: 0644]
include/c++/stl/string [new file with mode: 0644]
include/c++/stl/string.h [new file with mode: 0644]
include/c++/stl/strstream [new file with mode: 0644]
include/c++/stl/strstream.h [new file with mode: 0644]
include/c++/stl/time.h [new file with mode: 0644]
include/c++/stl/typeinfo [new file with mode: 0644]
include/c++/stl/typeinfo.h [new file with mode: 0644]
include/c++/stl/unordered_map [new file with mode: 0644]
include/c++/stl/unordered_set [new file with mode: 0644]
include/c++/stl/using/cstring [new file with mode: 0644]
include/c++/stl/using/export [new file with mode: 0644]
include/c++/stl/using/fstream [new file with mode: 0644]
include/c++/stl/using/h/fstream.h [new file with mode: 0644]
include/c++/stl/using/h/iomanip.h [new file with mode: 0644]
include/c++/stl/using/h/iostream.h [new file with mode: 0644]
include/c++/stl/using/h/ostream.h [new file with mode: 0644]
include/c++/stl/using/h/streambuf.h [new file with mode: 0644]
include/c++/stl/using/h/strstream.h [new file with mode: 0644]
include/c++/stl/using/iomanip [new file with mode: 0644]
include/c++/stl/using/ios [new file with mode: 0644]
include/c++/stl/using/iosfwd [new file with mode: 0644]
include/c++/stl/using/iostream [new file with mode: 0644]
include/c++/stl/using/istream [new file with mode: 0644]
include/c++/stl/using/locale [new file with mode: 0644]
include/c++/stl/using/ostream [new file with mode: 0644]
include/c++/stl/using/sstream [new file with mode: 0644]
include/c++/stl/using/streambuf [new file with mode: 0644]
include/c++/stl/using/strstream [new file with mode: 0644]
include/c++/stl/utility [new file with mode: 0644]
include/c++/stl/valarray [new file with mode: 0644]
include/c++/stl/vector [new file with mode: 0644]
include/c++/stl/wchar.h [new file with mode: 0644]
include/c++/stl/wctype.h [new file with mode: 0644]
lib/c++/stlport/_stdio_file.h [new file with mode: 0644]
lib/c++/stlport/acquire_release.h [new file with mode: 0644]
lib/c++/stlport/aligned_buffer.h [new file with mode: 0644]
lib/c++/stlport/allocators.cpp [new file with mode: 0644]
lib/c++/stlport/bitset.cpp [new file with mode: 0644]
lib/c++/stlport/c_locale.c [new file with mode: 0644]
lib/c++/stlport/c_locale.h [new file with mode: 0644]
lib/c++/stlport/c_locale_dummy/c_locale_dummy.c [new file with mode: 0644]
lib/c++/stlport/c_locale_glibc/c_locale_glibc.c [new file with mode: 0644]
lib/c++/stlport/c_locale_glibc/c_locale_glibc2.c [new file with mode: 0644]
lib/c++/stlport/c_locale_glibc/gcc_localeinfo.h [new file with mode: 0644]
lib/c++/stlport/c_locale_win32/c_locale_win32.c [new file with mode: 0644]
lib/c++/stlport/codecvt.cpp [new file with mode: 0644]
lib/c++/stlport/collate.cpp [new file with mode: 0644]
lib/c++/stlport/complex.cpp [new file with mode: 0644]
lib/c++/stlport/complex_io.cpp [new file with mode: 0644]
lib/c++/stlport/complex_trig.cpp [new file with mode: 0644]
lib/c++/stlport/ctype.cpp [new file with mode: 0644]
lib/c++/stlport/cxa.c [new file with mode: 0644]
lib/c++/stlport/dll_main.cpp [new file with mode: 0644]
lib/c++/stlport/facets_byname.cpp [new file with mode: 0644]
lib/c++/stlport/fstream.cpp [new file with mode: 0644]
lib/c++/stlport/fstream_impl.h [new file with mode: 0644]
lib/c++/stlport/ios.cpp [new file with mode: 0644]
lib/c++/stlport/iostream.cpp [new file with mode: 0644]
lib/c++/stlport/istream.cpp [new file with mode: 0644]
lib/c++/stlport/locale.cpp [new file with mode: 0644]
lib/c++/stlport/locale_catalog.cpp [new file with mode: 0644]
lib/c++/stlport/locale_impl.cpp [new file with mode: 0644]
lib/c++/stlport/locale_impl.h [new file with mode: 0644]
lib/c++/stlport/lock_free_slist.h [new file with mode: 0644]
lib/c++/stlport/message_facets.h [new file with mode: 0644]
lib/c++/stlport/messages.cpp [new file with mode: 0644]
lib/c++/stlport/monetary.cpp [new file with mode: 0644]
lib/c++/stlport/num_get.cpp [new file with mode: 0644]
lib/c++/stlport/num_get_float.cpp [new file with mode: 0644]
lib/c++/stlport/num_put.cpp [new file with mode: 0644]
lib/c++/stlport/num_put_float.cpp [new file with mode: 0644]
lib/c++/stlport/numpunct.cpp [new file with mode: 0644]
lib/c++/stlport/ostream.cpp [new file with mode: 0644]
lib/c++/stlport/sparc_atomic.s [new file with mode: 0644]
lib/c++/stlport/sparc_atomic64.s [new file with mode: 0644]
lib/c++/stlport/sstream.cpp [new file with mode: 0644]
lib/c++/stlport/stdio_streambuf.cpp [new file with mode: 0644]
lib/c++/stlport/stdio_streambuf.h [new file with mode: 0644]
lib/c++/stlport/stlport.rc [new file with mode: 0644]
lib/c++/stlport/stlport_prefix.h [new file with mode: 0644]
lib/c++/stlport/string.cpp [new file with mode: 0644]
lib/c++/stlport/strstream.cpp [new file with mode: 0644]
lib/c++/stlport/time_facets.cpp [new file with mode: 0644]
lib/c++/stlport/uint64.h [new file with mode: 0644]
lib/c++/stlport/vc_warning_disable.h [new file with mode: 0644]
lib/c++/stlport/warning_disable.h [new file with mode: 0644]

index ad569c6831ad0e625edce9a923d2298ed9830a19..5f7efd68f7a11ed1029342e54b9a02ef02099ebb 100644 (file)
@@ -6,6 +6,12 @@ project; add-on components which have been separated out due to
 license compatibility issues or for other reasons will have their
 attributions within the component in question.
 
+This file represents a good faith attempt to extract all of the
+per-file attributions and copyright notices related to code that
+actually gets built for PolIntOS; it is provided "as is", and no
+claim is made that it is 100% complete and accurate.  If in doubt,
+refer to the individual files.
+
 Original code written by Scott Wood
 ===================================
 
@@ -52,3 +58,49 @@ Portions of the C library which come from newlib
    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS   
    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
+
+C++ Standard Template Library (STLport)
+=======================================
+
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Copyright (c) 1996-1999
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Copyright (c) 1997
+ * Moscow Center for SPARC Technology
+ *
+ * Copyright (c) 1998
+ * Mark of the Unicorn, Inc.
+ *
+ * Copyright (c) 2000
+ * Pavel Kuznetsov
+ *
+ * Copyright (c) 2001
+ * Meridian'93
+ *
+ * Copyright (c) 1999-2003
+ * Boris Fomitchev
+ *
+ * Copyright (c) 2003-2006
+ * Francis Dumont
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted 
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ * Some files contain this text instead:
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  <INSERT COPYRIGHT HOLDER> makes no
+ * representations about the suitability of this software for any
+ * purpose.  It is provided "as is" without express or implied warranty.
diff --git a/include/c++/stl/algorithm b/include/c++/stl/algorithm
new file mode 100644 (file)
index 0000000..1695735
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Copyright (c) 1997
+ * Moscow Center for SPARC Technology
+ *
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_ALGORITHM
+#define _STLP_ALGORITHM
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x1
+#  include <stl/_prolog.h>
+#endif
+
+#ifdef _STLP_PRAGMA_ONCE
+#  pragma once
+#endif
+
+#ifndef _STLP_INTERNAL_CSTDIO
+// remove() conflicts, <cstdio> should always go first
+#  include <stl/_cstdio.h>
+#endif
+
+#ifndef _STLP_INTERNAL_ALGO_H
+#  include <stl/_algo.h>
+#endif
+
+#if defined (_STLP_IMPORT_VENDOR_STD)
+#  include _STLP_NATIVE_HEADER(algorithm)
+#endif /* _STLP_IMPORT_VENDOR_STD */
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x1 )
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_ALGORITHM */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/assert.h b/include/c++/stl/assert.h
new file mode 100644 (file)
index 0000000..28d0109
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#if !defined (_STLP_OUTERMOST_HEADER_ID)
+#  define _STLP_OUTERMOST_HEADER_ID 0x202
+#  include <stl/_prolog.h>
+#elif (_STLP_OUTERMOST_HEADER_ID == 0x202) && ! defined (_STLP_DONT_POP_HEADER_ID)
+#  define _STLP_DONT_POP_HEADER_ID
+#endif
+
+/* evc3 doesn't have assert.h; macro assert() is defined in stl_evc.h */
+#ifndef _STLP_WCE_EVC3
+#  include _STLP_NATIVE_C_HEADER(assert.h)
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x202)
+#  if ! defined (_STLP_DONT_POP_HEADER_ID)
+#    include <stl/_epilog.h>
+#    undef  _STLP_OUTERMOST_HEADER_ID
+#  endif
+#  undef  _STLP_DONT_POP_HEADER_ID
+#endif
+
+/* Local Variables:
+ * mode:C++
+ * End:
+ */
diff --git a/include/c++/stl/bitset b/include/c++/stl/bitset
new file mode 100644 (file)
index 0000000..15466e5
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 1998
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_BITSET
+#define _STLP_BITSET
+
+// This implementation of bitset<> has a second template parameter,
+// _WordT, which defaults to unsigned long.  *YOU SHOULD NOT USE
+// THIS FEATURE*.  It is experimental, and it may be removed in
+// future releases.
+
+// A bitset of size N, using words of type _WordT, will have
+// N % (sizeof(_WordT) * CHAR_BIT) unused bits.  (They are the high-
+// order bits in the highest word.)  It is a class invariant
+// of class bitset<> that those unused bits are always zero.
+
+// Most of the actual code isn't contained in bitset<> itself, but in the
+// base class _Base_bitset.  The base class works with whole words, not with
+// individual bits.  This allows us to specialize _Base_bitset for the
+// important special case where the bitset is only a single word.
+
+// The C++ standard does not define the precise semantics of operator[].
+// In this implementation the const version of operator[] is equivalent
+// to test(), except that it does no range checking.  The non-const version
+// returns a reference to a bit, again without doing any range checking.
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x2
+#  include <stl/_prolog.h>
+#endif
+
+#ifdef _STLP_PRAGMA_ONCE
+#  pragma once
+#endif
+
+#include <stl/_bitset.h>
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x2 )
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_BITSET */
+
+// Local Variables:
+// mode:C++
+// End:
+
diff --git a/include/c++/stl/cassert b/include/c++/stl/cassert
new file mode 100644 (file)
index 0000000..51757de
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x103
+#  include <stl/_prolog.h>
+#elif (_STLP_OUTERMOST_HEADER_ID == 0x103) && ! defined (_STLP_DONT_POP_HEADER_ID)
+#   define _STLP_DONT_POP_HEADER_ID
+#endif
+
+#if !defined (_STLP_WCE_EVC3)
+#  if defined (_STLP_USE_NEW_C_HEADERS)
+#    include _STLP_NATIVE_CPP_C_HEADER(cassert)
+#  else
+#    include <assert.h>
+#  endif
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x103 )
+#  if !defined (_STLP_DONT_POP_HEADER_ID)
+#    include <stl/_epilog.h>
+#    undef _STLP_OUTERMOST_HEADER_ID
+#  else
+#    undef _STLP_DONT_POP_HEADER_ID
+#  endif
+#endif
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/cctype b/include/c++/stl/cctype
new file mode 100644 (file)
index 0000000..646c686
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_CCTYPE
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x104
+#  define _STLP_CCTYPE
+#  include <stl/_prolog.h>
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID != 0x104 )
+#  include _STLP_NATIVE_CPP_C_HEADER(cctype)
+#else
+#  ifndef _STLP_INTERNAL_CCTYPE
+#    include <stl/_cctype.h>
+#  endif
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x104 )
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_CCTYPE */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/cerrno b/include/c++/stl/cerrno
new file mode 100644 (file)
index 0000000..83b3960
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_CERRNO
+# define _STLP_CERRNO
+
+# ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x105
+#  include <stl/_prolog.h>
+# endif
+
+# ifndef _STLP_WCE
+# if defined (_STLP_USE_NEW_C_HEADERS)
+#  include _STLP_NATIVE_CPP_C_HEADER(cerrno)
+# else
+#  include <errno.h>
+# endif
+# endif
+
+#ifndef errno
+
+# if defined (_STLP_IMPORT_VENDOR_CSTD) && \
+  ! defined (__IBMCPP__) && ! defined(__hpux) && ! defined(__MWERKS__) && !defined(_STLP_WCE)
+_STLP_BEGIN_NAMESPACE
+using _STLP_VENDOR_CSTD::errno;
+_STLP_END_NAMESPACE
+# endif /* _STLP_IMPORT_VENDOR_CSTD */
+
+#endif
+
+# if (_STLP_OUTERMOST_HEADER_ID == 0x105 )
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+# endif
+
+#endif /* _STLP_CERRNO */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/cfloat b/include/c++/stl/cfloat
new file mode 100644 (file)
index 0000000..8a76a10
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_CFLOAT
+#define _STLP_CFLOAT
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x106
+#  include <stl/_prolog.h>
+#endif
+
+// Borland defines some implementation constants in std:: namespace,
+// we do not want to import them.
+#if defined  (_STLP_USE_NEW_C_HEADERS) && !defined (__BORLANDC__)
+#  include _STLP_NATIVE_CPP_C_HEADER(cfloat)
+#else
+#  include <float.h>
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x106 )
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_CFLOAT */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/ciso646 b/include/c++/stl/ciso646
new file mode 100644 (file)
index 0000000..901f36f
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_CISO646
+#define _STLP_CISO646
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x107
+#  include <stl/_prolog.h>
+#endif
+
+#if !defined(_STLP_WCE_EVC3) && !defined (N_PLAT_NLM) && !defined (__BORLANDC__)
+#  if defined (_STLP_USE_NEW_C_HEADERS)
+#    include _STLP_NATIVE_CPP_C_HEADER(ciso646)
+#  else
+#    include <iso646.h>
+#  endif /* _STLP_USE_NEW_C_HEADERS */
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x107 )
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_CISO646 */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/climits b/include/c++/stl/climits
new file mode 100644 (file)
index 0000000..bdd4ab4
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_CLIMITS
+# define _STLP_CLIMITS
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x108
+#  include <stl/_prolog.h>
+#endif
+
+#if defined (__SUNPRO_CC) && ((__SUNPRO_CC == 0x500) && (__SUNPRO_CC_COMPAT > 4))
+#  include </usr/include/limits.h>
+#elif defined (_STLP_USE_NEW_C_HEADERS)
+#  include _STLP_NATIVE_CPP_C_HEADER(climits)
+#else
+#  if defined (__BORLANDC__)
+#    include _STLP_NATIVE_C_HEADER(limits.h)
+#  else
+#    include <limits.h>
+#  endif
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID ==  0x108 )
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_CLIMITS */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/clocale b/include/c++/stl/clocale
new file mode 100644 (file)
index 0000000..4e9ff7a
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_CLOCALE
+#define _STLP_CLOCALE
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID  0x109
+#  include <stl/_prolog.h>
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID != 0x109 )
+#  include _STLP_NATIVE_CPP_C_HEADER(clocale)
+#else
+#  ifndef _STLP_INTERNAL_CLOCALE
+#    include <stl/_clocale.h>
+#  endif
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x109 )
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_CLOCALE */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/cmath b/include/c++/stl/cmath
new file mode 100644 (file)
index 0000000..ec319b0
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_CMATH
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID  0x110
+#  define _STLP_CMATH
+#  include <stl/_prolog.h>
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID != 0x110)
+#  include _STLP_NATIVE_CPP_C_HEADER(cmath)
+#else
+#  ifndef _STLP_INTERNAL_CMATH
+#    include <stl/_cmath.h>
+#  endif
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID ==  0x110 )
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_CMATH */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/complex b/include/c++/stl/complex
new file mode 100644 (file)
index 0000000..d373824
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 1999
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_COMPLEX
+#define _STLP_COMPLEX
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID  0x10
+#  include <stl/_prolog.h>
+#endif
+
+// This header declares the template class complex, as described in
+// in the draft C++ standard.  Single-precision complex numbers
+// are complex<float>, double-precision are complex<double>, and
+// quad precision are complex<long double>.
+
+// Note that the template class complex is declared within namespace
+// std, as called for by the draft C++ standard
+
+#ifndef _STLP_INTERNAL_COMPLEX
+#  include <stl/_complex.h>
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID ==  0x10 )
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_COMPLEX */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/csetjmp b/include/c++/stl/csetjmp
new file mode 100644 (file)
index 0000000..068d0b3
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_CSETJMP
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x111
+#  define _STLP_CSETJMP
+#  include <stl/_prolog.h>
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID != 0x111)
+#  include _STLP_NATIVE_CPP_C_HEADER(csetjmp)
+#else
+#  ifndef _STLP_INTERNAL_CSETJMP
+#    include <stl/_csetjmp.h>
+#  endif
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x111 )
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_CSETJMP */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/csignal b/include/c++/stl/csignal
new file mode 100644 (file)
index 0000000..9142648
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_CSIGNAL
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x112
+#  define _STLP_CSIGNAL
+#  include <stl/_prolog.h>
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID != 0x112)
+#  include _STLP_NATIVE_CPP_C_HEADER(csignal)
+#else
+#  ifndef _STLP_INTERNAL_CSIGNAL
+#    include <stl/_csignal.h>
+#  endif
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x112 )
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_CSIGNAL */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/cstdarg b/include/c++/stl/cstdarg
new file mode 100644 (file)
index 0000000..20141ec
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ */
+
+#ifndef _STLP_CSTDARG
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x113
+#  define _STLP_CSTDARG
+#  include <stl/_prolog.h>
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID != 0x113)
+#  include _STLP_NATIVE_CPP_C_HEADER(cstdarg)
+#else
+#  ifndef _STLP_INTERNAL_CSTDARG
+#    include <stl/_cstdarg.h>
+#  endif
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x113 )
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_CSTDARG */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/cstddef b/include/c++/stl/cstddef
new file mode 100644 (file)
index 0000000..24d1527
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_CSTDDEF
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x114
+#  define _STLP_CSTDDEF
+#  include <stl/_prolog.h>
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID != 0x114)
+#  include _STLP_NATIVE_CPP_C_HEADER(cstddef)
+#else
+#  ifndef _STLP_INTERNAL_CSTDDEF
+#    include <stl/_cstddef.h>
+#  endif
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x114 )
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_CSTDDEF */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/cstdio b/include/c++/stl/cstdio
new file mode 100644 (file)
index 0000000..83eff86
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_CSTDIO
+#define _STLP_CSTDIO
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x15
+#  define _STLP_CSTDIO
+#  include <stl/_prolog.h>
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID != 0x15)
+#  include _STLP_NATIVE_CPP_C_HEADER(cstdio)
+#else
+#  ifndef _STLP_INTERNAL_CSTDIO
+#    include <stl/_cstdio.h>
+#  endif
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x15)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/cstdlib b/include/c++/stl/cstdlib
new file mode 100644 (file)
index 0000000..4718fbb
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_CSTDLIB
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x116
+#  define _STLP_CSTDLIB
+#  include <stl/_prolog.h>
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID != 0x116)
+#  include _STLP_NATIVE_CPP_C_HEADER(cstdlib)
+#else
+#  ifndef _STLP_INTERNAL_CSTDLIB
+#    include <stl/_cstdlib.h>
+#  endif
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x116)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_CSTDLIB */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/cstring b/include/c++/stl/cstring
new file mode 100644 (file)
index 0000000..34d3bdb
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_CSTRING
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x117
+#  define _STLP_CSTRING
+#  include <stl/_prolog.h>
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID != 0x117)
+#  include _STLP_NATIVE_CPP_C_HEADER(cstring)
+#else
+#  ifndef _STLP_INTERNAL_CSTRING
+#    include <stl/_cstring.h>
+#  endif
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x117)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_CSTRING */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/ctime b/include/c++/stl/ctime
new file mode 100644 (file)
index 0000000..0f9c37b
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ */
+
+#ifndef _STLP_CTIME
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x118
+#  define _STLP_CTIME
+#  include <stl/_prolog.h>
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID != 0x118)
+#  include _STLP_NATIVE_CPP_C_HEADER(ctime)
+#else
+#  ifndef _STLP_INTERNAL_CTIME
+#    include <stl/_ctime.h>
+#  endif
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x118)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_CTIME */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/ctype.h b/include/c++/stl/ctype.h
new file mode 100644 (file)
index 0000000..a3a8032
--- /dev/null
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_CTYPE_H
+
+/* Workaround for a "misbehaviour" when compiling resource scripts using
+ * eMbedded Visual C++. The standard .rc file includes windows header files,
+ * which in turn include ctype.h, which results in warnings and errors
+ */
+#if !defined(RC_INVOKED)
+
+#  if !defined (_STLP_OUTERMOST_HEADER_ID)
+#    define _STLP_OUTERMOST_HEADER_ID 0x219
+#    include <stl/_prolog.h>
+#  elif (_STLP_OUTERMOST_HEADER_ID == 0x219)
+#    define _STLP_DONT_POP_HEADER_ID
+#    define _STLP_CTYPE_H
+#  endif
+
+#  if defined(_STLP_WCE_EVC3)
+struct _exception;
+#  endif
+
+#  include _STLP_NATIVE_C_HEADER(ctype.h)
+
+/* on evc4 including ctype.h also defines setjmp macro */
+#  if defined (_STLP_WCE)
+#    define _STLP_NATIVE_SETJMP_H_INCLUDED
+#  endif
+
+#  ifndef _STLP_CTYPE_H_SEEN
+#    define _STLP_CTYPE_H_SEEN
+
+/* Undef convenience interfaces */
+#    undef isspace
+#    undef isprint
+#    undef iscntrl
+#    undef isupper
+#    undef islower
+#    undef isalpha
+#    undef isdigit
+#    undef ispunct
+#    undef isxdigit
+#    undef isalnum
+#    undef isgraph
+#    undef toupper
+#    undef tolower
+
+#    if defined (UNDER_CE)
+
+#      if (_WIN32_WCE < 300)     /* Only wide chars for older versions */
+#        define _isctype iswctype
+#      endif
+
+__inline int (isalpha)(int c) { return _isctype(c, _ALPHA); }
+__inline int (isupper)(int c) { return _isctype(c, _UPPER); }
+__inline int (islower)(int c) { return _isctype(c, _LOWER); }
+__inline int (isdigit)(int c) { return _isctype(c, _DIGIT); }
+__inline int (isxdigit)(int c) { return _isctype(c, _HEX); }
+__inline int (isspace)(int c) { return _isctype(c, _SPACE); }
+__inline int (ispunct)(int c) { return _isctype(c, _PUNCT); }
+__inline int (isalnum)(int c) { return _isctype(c, _ALPHA|_DIGIT); }
+__inline int (isprint)(int c) { return _isctype(c, _BLANK|_PUNCT|_ALPHA|_DIGIT); }
+__inline int (isgraph)(int c) { return _isctype(c, _PUNCT|_ALPHA|_DIGIT); }
+__inline int (iscntrl)(int c) { return _isctype(c, _CONTROL); }
+__inline int (isascii)(int c) { return ((unsigned)(c) < 0x80); }
+
+#      undef _isctype
+
+__inline int (iswalpha)(int c) { return iswctype(c, _ALPHA); }
+__inline int (iswupper)(int c) { return iswctype(c, _UPPER); }
+__inline int (iswlower)(int c) { return iswctype(c, _LOWER); }
+__inline int (iswdigit)(int c) { return iswctype(c, _DIGIT); }
+__inline int (iswxdigit)(int c) { return iswctype(c, _HEX); }
+__inline int (iswspace)(int c) { return iswctype(c, _SPACE); }
+__inline int (iswpunct)(int c) { return iswctype(c, _PUNCT); }
+__inline int (iswalnum)(int c) { return iswctype(c, _ALPHA|_DIGIT); }
+__inline int (iswprint)(int c) { return iswctype(c, _BLANK|_PUNCT|_ALPHA|_DIGIT); }
+__inline int (iswgraph)(int c) { return iswctype(c, _PUNCT|_ALPHA|_DIGIT); }
+__inline int (iswcntrl)(int c) { return iswctype(c, _CONTROL); }
+__inline int (iswascii)(int c) { return ((unsigned)(c) < 0x80); }
+
+#    endif /* UNDER_CE */
+
+#  endif /* _STLP_CTYPE_H_SEEN */
+
+#  if (_STLP_OUTERMOST_HEADER_ID == 0x219)
+#    if ! defined (_STLP_DONT_POP_HEADER_ID)
+#      include <stl/_epilog.h>
+#      undef  _STLP_OUTERMOST_HEADER_ID
+#    else
+#      undef  _STLP_DONT_POP_HEADER_ID
+#    endif
+#  endif
+
+#endif /* RC_INVOKED */
+
+#endif /* _STLP_CTYPE_H */
diff --git a/include/c++/stl/cwchar b/include/c++/stl/cwchar
new file mode 100644 (file)
index 0000000..85b99f8
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_CWCHAR
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x120
+#  define _STLP_CWCHAR
+#  include <stl/_prolog.h>
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID != 0x120)
+#  include _STLP_NATIVE_CPP_C_HEADER(cwchar)
+#else
+#  ifndef _STLP_INTERNAL_CWCHAR
+#    include <stl/_cwchar.h>
+#  endif
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x120)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_CWCHAR */
+
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/cwctype b/include/c++/stl/cwctype
new file mode 100644 (file)
index 0000000..29f0859
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_CWCTYPE
+#define _STLP_CWCTYPE
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x121
+#  include <stl/_prolog.h>
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID != 0x121)
+#  include _STLP_NATIVE_CPP_C_HEADER(cwctype)
+#else
+#  ifndef _STLP_INTERNAL_CWCTYPE
+#    include <stl/_cwctype.h>
+#  endif
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x121)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_CWCTYPE */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/deque b/include/c++/stl/deque
new file mode 100644 (file)
index 0000000..8fdf513
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Copyright (c) 1997
+ * Moscow Center for SPARC Technology
+ *
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_DEQUE
+#define _STLP_DEQUE
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x22
+#  include <stl/_prolog.h>
+#endif
+
+#ifdef _STLP_PRAGMA_ONCE
+#  pragma once
+#endif
+
+#ifndef _STLP_INTERNAL_DEQUE_H
+#  include <stl/_deque.h>
+#endif
+
+#if defined (_STLP_IMPORT_VENDOR_STD)
+#  include _STLP_NATIVE_HEADER(deque)
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x22)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_DEQUE */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/errno.h b/include/c++/stl/errno.h
new file mode 100644 (file)
index 0000000..27037ea
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#if !defined (_STLP_OUTERMOST_HEADER_ID)
+#  define _STLP_OUTERMOST_HEADER_ID 0x205
+#  include <stl/_prolog.h>
+#elif (_STLP_OUTERMOST_HEADER_ID == 0x205) && !defined (_STLP_DONT_POP_HEADER_ID)
+#  define _STLP_DONT_POP_HEADER_ID
+#endif
+
+#ifdef _STLP_WCE
+// only show message when directly including this file in a non-library build
+#  if !defined(__BUILDING_STLPORT) && (_STLP_OUTERMOST_HEADER_ID == 0x205)
+#    pragma message("eMbedded Visual C++ 3 and .NET don't have a errno.h header; STLport won't include native errno.h here")
+#  endif
+#else
+#  ifndef errno
+/* We define the following macro first to guaranty the header reentrancy: */
+#    define _STLP_NATIVE_ERRNO_H_INCLUDED
+#    include _STLP_NATIVE_C_HEADER(errno.h)
+#  endif /* errno */
+
+#  if !defined (_STLP_NATIVE_ERRNO_H_INCLUDED)
+/* If errno has been defined before inclusion of native errno.h including it from STLport errno.h
+ * becomes impossible because if:
+ * #define errno foo
+ * then
+ * #include _STLP_NATIVE_C_HEADER(errno.h)
+ * becomes:
+ * #include _STLP_NATIVE_C_HEADER(foo.h)
+ *
+ * To fix this problem you have to find where this definition comes from and include errno.h before it.
+ */
+#    error errno has been defined before inclusion of errno.h header.
+#  endif
+
+#  ifdef __cplusplus
+#    ifndef errno /* errno still not defined */
+_STLP_BEGIN_NAMESPACE
+#      if !defined (__BORLANDC__)
+using ::errno;
+#      else
+using _STLP_VENDOR_CSTD::errno;
+#      endif
+_STLP_END_NAMESPACE
+#   endif /* errno */
+#  endif /* __cplusplus */
+
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x205)
+#  if ! defined (_STLP_DONT_POP_HEADER_ID)
+#    include <stl/_epilog.h>
+#    undef  _STLP_OUTERMOST_HEADER_ID
+#  endif
+#  undef  _STLP_DONT_POP_HEADER_ID
+#endif
+
+/* Local Variables:
+ * mode:C++
+ * End:
+ */
diff --git a/include/c++/stl/exception b/include/c++/stl/exception
new file mode 100644 (file)
index 0000000..a8e8cd7
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ */
+
+// This header exists solely for portability.  Normally it just includes
+// the native header <exception>.
+
+#ifndef _STLP_EXCEPTION
+
+#if !defined (_STLP_OUTERMOST_HEADER_ID)
+#  define _STLP_OUTERMOST_HEADER_ID 0x423
+#  include <stl/_prolog.h>
+#elif (_STLP_OUTERMOST_HEADER_ID == 0x423)
+#  define _STLP_DONT_POP_HEADER_ID
+#  define _STLP_EXCEPTION
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID != 0x423) || defined (_STLP_DONT_POP_HEADER_ID)
+/* If we are here it means that we are in an include called 
+ * from the native lib which means that we can simply forward this
+ * call to the native exception header:
+ */
+#  include _STLP_NATIVE_CPP_RUNTIME_HEADER(exception)
+#else
+#  include <stl/_exception.h>
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x423)
+#  if !defined(_STLP_DONT_POP_HEADER_ID)
+#    include <stl/_epilog.h>
+#    undef  _STLP_OUTERMOST_HEADER_ID
+#  else
+#    undef  _STLP_DONT_POP_HEADER_ID
+#  endif
+#endif
+
+#endif /* _STLP_EXCEPTION */
+
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/exception.h b/include/c++/stl/exception.h
new file mode 100644 (file)
index 0000000..c5937ab
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_OLDSTD_exception
+#define _STLP_OLDSTD_exception
+
+#if !defined (_STLP_OUTERMOST_HEADER_ID)
+#  define _STLP_OUTERMOST_HEADER_ID 0x824
+#  include <stl/_prolog.h>
+#endif
+
+#if defined (__BORLANDC__) || defined (_MSC_VER)
+#  include <exception>
+#else
+#  include _STLP_NATIVE_CPP_RUNTIME_HEADER(exception.h)
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x824)
+#  include <stl/_epilog.h>
+#  undef  _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_OLDSTD_exception */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/float.h b/include/c++/stl/float.h
new file mode 100644 (file)
index 0000000..67adb57
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#if !defined (_STLP_OUTERMOST_HEADER_ID)
+#  define _STLP_OUTERMOST_HEADER_ID 0x203
+#  include <stl/_prolog.h>
+#elif (_STLP_OUTERMOST_HEADER_ID == 0x203) && !defined (_STLP_DONT_POP_HEADER_ID)
+#  define _STLP_DONT_POP_HEADER_ID
+#elif (_STLP_OUTERMOST_HEADER_ID == 0x203)
+#  error This header is only reentrant once, it should be modified if it has to be included more.
+#endif
+
+#if defined (_STLP_WCE_EVC3)
+struct _exception;
+#endif
+
+#include _STLP_NATIVE_C_HEADER(float.h)
+
+#if defined(__BORLANDC__) && defined (__cplusplus) && (__BORLANDC__ >= 0x560)
+_STLP_BEGIN_NAMESPACE
+using ::_max_dble;
+using ::_max_flt;
+using ::_max_ldble;
+using ::_tiny_ldble;
+_STLP_END_NAMESPACE
+#endif
+
+#if defined (__BORLANDC__) && defined (__cplusplus) && !defined (_STLP_BCC_FPU_BUG)
+#  define _STLP_BCC_FPU_BUG
+// Ignore FPU exceptions, set FPU precision to 53 bits for floatio_test and cmath_test
+static unsigned int _bcc_fpu_bug = _control87(PC_53|MCW_EM, MCW_PC|MCW_EM);
+template <class _Fp>
+int __fpclass(_Fp __val)
+{ int __f = _fpclass(__val); _control87(PC_53|MCW_EM, MCW_PC|MCW_EM); return __f; }
+#  define _fpclass __fpclass
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x203)
+#  if ! defined (_STLP_DONT_POP_HEADER_ID)
+#    include <stl/_epilog.h>
+#    undef  _STLP_OUTERMOST_HEADER_ID
+#  endif
+#  undef  _STLP_DONT_POP_HEADER_ID
+#endif
diff --git a/include/c++/stl/fstream b/include/c++/stl/fstream
new file mode 100644 (file)
index 0000000..efdf645
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 1999
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+
+// This header defines classes basic_filebuf, basic_ifstream,
+// basic_ofstream, and basic_fstream.  These classes represent
+// streambufs and streams whose sources or destinations are files.
+
+#ifndef _STLP_FSTREAM
+#define _STLP_FSTREAM
+
+# ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x1025
+#  include <stl/_prolog.h>
+# endif
+
+#ifdef _STLP_PRAGMA_ONCE
+# pragma once
+#endif
+
+# include <stl/_ioserr.h>
+# include <stl/_fstream.h>
+
+# if (_STLP_OUTERMOST_HEADER_ID == 0x1025)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+# endif
+
+#endif /* _STLP_FSTREAM */
+
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/fstream.h b/include/c++/stl/fstream.h
new file mode 100644 (file)
index 0000000..4640033
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_FSTREAM_H
+#define _STLP_FSTREAM_H
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x2026
+#  include <stl/_prolog.h>
+#endif
+
+#include <fstream>
+
+// get desired pollution
+#include <iostream.h>
+
+#ifndef _STLP_HAS_NO_NAMESPACES
+#  include <using/fstream>
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x2026)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_FSTREAM_H */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/functional b/include/c++/stl/functional
new file mode 100644 (file)
index 0000000..d074103
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_FUNCTIONAL
+#define _STLP_FUNCTIONAL
+
+# ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x27
+#  include <stl/_prolog.h>
+# endif
+
+# ifdef _STLP_PRAGMA_ONCE
+#  pragma once
+# endif
+
+# if defined (_STLP_IMPORT_VENDOR_STD)
+#  include _STLP_NATIVE_HEADER(functional)
+# endif
+
+# ifndef _STLP_INTERNAL_FUNCTION_H
+#  include <stl/_function.h>
+# endif
+
+# if (_STLP_OUTERMOST_HEADER_ID == 0x27)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+# endif
+
+#endif /* _STLP_FUNCTIONAL */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/hash_map b/include/c++/stl/hash_map
new file mode 100644 (file)
index 0000000..0e2422d
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_HASH_MAP
+#define _STLP_HASH_MAP
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x4028
+#  include <stl/_prolog.h>
+#endif
+
+#ifdef _STLP_PRAGMA_ONCE
+#  pragma once
+#endif
+
+#if defined (_STLP_NO_EXTENSIONS)
+/* Comment following if you want to use hash constainers even if you ask for
+ * no extension.
+ */
+#  error The hash_map and hash_multimap class are STLport extensions.
+#endif
+
+#include <stl/_hash_map.h>
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x4028)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_HASH_MAP */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/hash_set b/include/c++/stl/hash_set
new file mode 100644 (file)
index 0000000..0fc89ec
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_HASH_SET
+#define _STLP_HASH_SET
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x4029
+#  include <stl/_prolog.h>
+#endif
+
+#ifdef _STLP_PRAGMA_ONCE
+#  pragma once
+#endif
+
+#if defined (_STLP_NO_EXTENSIONS)
+/* Comment following if you want to use hash constainers even if you ask for
+ * no extension.
+ */
+#  error The hash_set and hash_multiset class are STLport extensions.
+#endif
+
+#include <stl/_hash_set.h>
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x4029)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_HASH_SET */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/iomanip b/include/c++/stl/iomanip
new file mode 100644 (file)
index 0000000..6956190
--- /dev/null
@@ -0,0 +1,175 @@
+/*
+ * Copyright (c) 1999
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_IOMANIP
+#define _STLP_IOMANIP
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x1030
+#  include <stl/_prolog.h>
+#endif
+
+#ifdef _STLP_PRAGMA_ONCE
+#  pragma once
+#endif
+
+#include <stl/_ioserr.h>
+#include <stl/_istream.h>              // Includes <ostream> and <ios>
+
+_STLP_BEGIN_NAMESPACE
+
+//----------------------------------------------------------------------
+// Machinery for defining manipulators.
+
+// Class that calls one of ios_base's single-argument member functions.
+template <class _Arg>
+struct _Ios_Manip_1 {
+   typedef _Arg (ios_base::*__f_ptr_type)(_Arg);
+
+  _Ios_Manip_1(__f_ptr_type __f, const _Arg& __arg)
+    : _M_f(__f), _M_arg(__arg) {}
+
+  void operator()(ios_base& __ios) const
+  { (__ios.*_M_f)(_M_arg); }
+
+  __f_ptr_type _M_f;
+  _Arg _M_arg;
+};
+
+// Class that calls one of ios_base's two-argument member functions.
+struct _Ios_Setf_Manip {
+  ios_base::fmtflags _M_flag;
+  ios_base::fmtflags _M_mask;
+  bool _M_two_args;
+
+  _Ios_Setf_Manip(ios_base::fmtflags __f)
+    : _M_flag(__f), _M_mask(0), _M_two_args(false) {}
+
+  _Ios_Setf_Manip(ios_base::fmtflags __f, ios_base::fmtflags __m)
+    : _M_flag(__f), _M_mask(__m), _M_two_args(true) {}
+
+  void operator()(ios_base& __ios) const {
+    if (_M_two_args)
+      __ios.setf(_M_flag, _M_mask);
+    else
+      __ios.setf(_M_flag);
+  }
+};
+
+
+template <class _CharT, class _Traits, class _Arg>
+inline basic_istream<_CharT, _Traits>& _STLP_CALL
+operator>>(basic_istream<_CharT, _Traits>& __istr,
+           const _Ios_Manip_1<_Arg>& __f) {
+  __f(__istr);
+  return __istr;
+}
+
+template <class _CharT, class _Traits, class _Arg>
+inline basic_ostream<_CharT, _Traits>& _STLP_CALL
+operator<<(basic_ostream<_CharT, _Traits>& __os,
+           const _Ios_Manip_1<_Arg>& __f) {
+  __f(__os);
+  return __os;
+}
+
+template <class _CharT, class _Traits>
+inline basic_istream<_CharT, _Traits>& _STLP_CALL
+operator>>(basic_istream<_CharT, _Traits>& __istr, const _Ios_Setf_Manip& __f) {
+  __f(__istr);
+  return __istr;
+}
+
+template <class _CharT, class _Traits>
+inline basic_ostream<_CharT, _Traits>& _STLP_CALL
+operator<<(basic_ostream<_CharT, _Traits>& __os, const _Ios_Setf_Manip& __f) {
+  __f(__os);
+  return __os;
+}
+
+//----------------------------------------------------------------------
+// The ios_base manipulators.
+inline _Ios_Setf_Manip  _STLP_CALL resetiosflags(ios_base::fmtflags __mask)
+{ return _Ios_Setf_Manip(0, __mask); }
+
+inline _Ios_Setf_Manip _STLP_CALL setiosflags(ios_base::fmtflags __flag)
+{ return _Ios_Setf_Manip(__flag); }
+
+inline _Ios_Setf_Manip _STLP_CALL setbase(int __n) {
+  ios_base::fmtflags __base = __n == 8  ? ios_base::oct :
+                              __n == 10 ? ios_base::dec :
+                              __n == 16 ? ios_base::hex :
+                              ios_base::fmtflags(0);
+  return _Ios_Setf_Manip(__base, ios_base::basefield);
+}
+
+inline _Ios_Manip_1<streamsize> _STLP_CALL
+setprecision(int __n) {
+  _Ios_Manip_1<streamsize>::__f_ptr_type __f = &ios_base::precision;
+  return _Ios_Manip_1<streamsize>(__f, __n);
+}
+
+inline _Ios_Manip_1<streamsize>  _STLP_CALL
+setw(int __n) {
+  _Ios_Manip_1<streamsize>::__f_ptr_type __f = &ios_base::width;  
+  return _Ios_Manip_1<streamsize>(__f, __n);
+}
+
+//----------------------------------------------------------------------
+// setfill, a manipulator that operates on basic_ios<> instead of ios_base.
+
+template <class _CharT>
+struct _Setfill_Manip {
+  _Setfill_Manip(_CharT __c) : _M_c(__c) {}
+  _CharT _M_c;
+};
+
+template <class _CharT, class _CharT2, class _Traits>
+inline basic_ostream<_CharT, _Traits>& _STLP_CALL
+operator<<(basic_ostream<_CharT, _Traits>& __os,
+           const _Setfill_Manip<_CharT2>& __m) {
+  __os.fill(__m._M_c);
+  return __os;
+}
+
+template <class _CharT, class _CharT2, class _Traits>
+inline basic_istream<_CharT, _Traits>& _STLP_CALL
+operator>>(basic_istream<_CharT, _Traits>& __is,
+           const _Setfill_Manip<_CharT2>& __m) {
+  __is.fill(__m._M_c);
+  return __is;
+}
+
+template <class _CharT>
+inline _Setfill_Manip<_CharT> _STLP_CALL
+setfill(_CharT __c) {
+  return _Setfill_Manip<_CharT>(__c);
+}
+
+_STLP_END_NAMESPACE
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x1030)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_IOMANIP */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/iomanip.h b/include/c++/stl/iomanip.h
new file mode 100644 (file)
index 0000000..1bfb0d2
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_IOMANIP_H
+#define _STLP_IOMANIP_H
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x2031
+#  include <stl/_prolog.h>
+#endif
+
+#include <stl/_ioserr.h>
+
+#include <iomanip>
+
+#ifndef _STLP_HAS_NO_NAMESPACES
+#  ifdef _STLP_BROKEN_USING_DIRECTIVE
+_STLP_USING_NAMESPACE(stlport)
+#  else
+using _STLP_STD::setiosflags;
+using _STLP_STD::resetiosflags;
+using _STLP_STD::setbase;
+using _STLP_STD::setfill;
+using _STLP_STD::setprecision;
+using _STLP_STD::setw;
+#  endif
+#endif /* _STLP_HAS_NO_NAMESPACES */
+
+// get all the pollution we want
+#include <iostream.h>
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x2031)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_IOMANIP_H */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/ios b/include/c++/stl/ios
new file mode 100644 (file)
index 0000000..2a923ad
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 1999
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_IOS
+#define _STLP_IOS
+
+# ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x1032
+#  include <stl/_prolog.h>
+# endif
+
+# ifdef _STLP_PRAGMA_ONCE
+#  pragma once
+# endif
+
+# include <stl/_ioserr.h>
+# include <stl/_ios.h>
+
+# if (_STLP_OUTERMOST_HEADER_ID == 0x1032)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+# endif
+
+#endif /* _STLP_IOS */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/ios.h b/include/c++/stl/ios.h
new file mode 100644 (file)
index 0000000..90ccfbb
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_IOS_H
+#define _STLP_IOS_H
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x1033
+#  include <stl/_prolog.h>
+#endif
+
+#include <ios>
+
+#if defined (_STLP_USE_NAMESPACES)
+#  include <using/ios>
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x1033)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_IOS_H */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/iosfwd b/include/c++/stl/iosfwd
new file mode 100644 (file)
index 0000000..0a44982
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 1999
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_IOSFWD
+#define _STLP_IOSFWD
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x1034
+#  include <stl/_prolog.h>
+#endif
+
+#ifdef _STLP_PRAGMA_ONCE
+#  pragma once
+#endif
+
+#if !defined (_STLP_USE_NO_IOSTREAMS)
+
+#  if defined (_STLP_HAS_WCHAR_T) && !defined (_STLP_INTERNAL_CWCHAR)
+#    include <stl/_cwchar.h>
+#  endif /* _STLP_HAS_WCHAR_T && !_STLP_CWCHAR */      
+
+#  include <stl/_iosfwd.h>
+#else
+#  include <stl/char_traits.h>
+#endif /* _STLP_USE_NO_IOSTREAMS */
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x1034)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_IOSFWD */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/iostream b/include/c++/stl/iostream
new file mode 100644 (file)
index 0000000..05289e4
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 1999
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_IOSTREAM
+#define _STLP_IOSTREAM
+
+# ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x1037
+#  include <stl/_prolog.h>
+# endif
+
+# ifdef _STLP_PRAGMA_ONCE
+#  pragma once
+# endif
+
+#include <stl/_ioserr.h>
+
+#ifdef _STLP_REDIRECT_STDSTREAMS
+// for ofstream redirection
+# include <fstream>
+#endif
+
+#include <stl/_iosfwd.h>
+#include <stl/_istream.h>
+
+_STLP_BEGIN_NAMESPACE
+
+#ifndef _STLP_USE_NAMESPACES
+// in case of SGI iostreams, we have to rename our streams not to clash with those
+// provided in native lib
+# define cin _STLP_cin
+# define cout _STLP_cout
+# define cerr _STLP_cerr
+# define clog _STLP_clog
+#endif
+
+// Note: cin and wcin are both associated with stdio.  The C standard
+// (Amendment 1, section 4.6.2.1) says that it is an error to mix
+// wide- and narrow-oriented I/O on the same stream.  This implies
+// that it is an error to use both cin and wcin in the same C++
+// program; the same applies to cout and wcout, and cerr/clog and
+// wcerr/wclog.
+
+# ifdef _STLP_REDIRECT_STDSTREAMS
+extern _STLP_DECLSPEC istream cin;
+extern _STLP_DECLSPEC ofstream cout;
+extern _STLP_DECLSPEC ofstream cerr;
+extern _STLP_DECLSPEC ofstream clog;
+# else
+extern _STLP_DECLSPEC istream cin;
+extern _STLP_DECLSPEC ostream cout;
+extern _STLP_DECLSPEC ostream cerr;
+extern _STLP_DECLSPEC ostream clog;
+# endif
+
+# ifndef _STLP_NO_WCHAR_T
+extern _STLP_DECLSPEC wistream wcin;
+extern _STLP_DECLSPEC wostream wcout;
+extern _STLP_DECLSPEC wostream wcerr;
+extern _STLP_DECLSPEC wostream wclog;
+# endif
+
+_STLP_END_NAMESPACE
+
+//# elif defined ( _STLP_USE_NO_IOSTREAMS )
+//#  include <stl/_null_stream.h>
+
+# if (_STLP_OUTERMOST_HEADER_ID == 0x1037)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+# endif
+
+#endif /* _STLP_IOSTREAM */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/iostream.h b/include/c++/stl/iostream.h
new file mode 100644 (file)
index 0000000..2e7a7a9
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_IOSTREAM_H
+#define _STLP_IOSTREAM_H
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x2035
+#  include <stl/_prolog.h>
+#endif
+
+#include <iostream>
+
+// Those should be included all separately, as they do contain using declarations
+#include <streambuf.h>
+#include <ostream.h>
+#include <istream.h>
+
+#ifndef _STLP_HAS_NO_NAMESPACES
+
+#  ifdef _STLP_BROKEN_USING_DIRECTIVE
+_STLP_USING_NAMESPACE(stlport)
+#  else
+using _STLP_STD::cin;
+using _STLP_STD::cout;
+using _STLP_STD::clog;
+using _STLP_STD::cerr;
+using _STLP_STD::iostream;
+#    ifndef _STLP_NO_WCHAR_T
+using _STLP_STD::wcin;
+using _STLP_STD::wcout;
+using _STLP_STD::wclog;
+using _STLP_STD::wcerr;
+#    endif
+#  endif
+#endif /* _STLP_HAS_NO_NAMESPACES */
+
+// Obsolete classes for old-style backwards compatibility
+
+
+class istream_withassign : public istream {
+ public:
+  istream_withassign() : istream((streambuf*)0) {}
+  ~istream_withassign() {}
+
+  istream_withassign& operator=(istream& __s) {
+    ios::init(__s.rdbuf());
+    return *this;
+  }
+  istream_withassign& operator=(streambuf* __s) {
+    ios::init(__s);
+    return *this;
+  }
+};
+
+class ostream_withassign : public ostream {
+ public:
+  ostream_withassign() : ostream((streambuf*)0) {}
+  ~ostream_withassign() {}
+
+  ostream_withassign& operator=(ostream& __s) {
+    ios::init(__s.rdbuf());
+    return *this;
+  }
+  ostream_withassign& operator=(streambuf* __s) {
+    ios::init(__s);
+    return *this;
+  }
+};
+
+class iostream_withassign : public iostream {
+ public:
+  iostream_withassign() : iostream((streambuf*)0) {}
+  ~iostream_withassign() {}
+  iostream_withassign & operator=(ios& __i) {
+    ios::init(__i.rdbuf());
+    return *this;
+  }
+  iostream_withassign & operator=(streambuf* __s) {
+    ios::init(__s);
+    return *this;
+  }
+} ;
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x2035)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_IOSTREAM_H */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/iso646.h b/include/c++/stl/iso646.h
new file mode 100644 (file)
index 0000000..058ed3b
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#if !defined (_STLP_OUTERMOST_HEADER_ID)
+#  define _STLP_OUTERMOST_HEADER_ID 0x204
+#  include <stl/_prolog.h>
+#elif (_STLP_OUTERMOST_HEADER_ID == 0x204) && !defined (_STLP_DONT_POP_HEADER_ID)
+#  define _STLP_DONT_POP_HEADER_ID
+#endif
+
+/* evc3 doesn't have iso646.h */
+#if !defined (_STLP_WCE_EVC3) && !defined (N_PLAT_NLM) && !defined (__BORLANDC__)
+#  include _STLP_NATIVE_C_HEADER(iso646.h)
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x204)
+#  if ! defined (_STLP_DONT_POP_HEADER_ID)
+#    include <stl/_epilog.h>
+#    undef  _STLP_OUTERMOST_HEADER_ID
+#  endif
+#  undef  _STLP_DONT_POP_HEADER_ID
+#endif
+
+/* Local Variables:
+ * mode:C++
+ * End:
+ */
diff --git a/include/c++/stl/istream b/include/c++/stl/istream
new file mode 100644 (file)
index 0000000..9c288ba
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 1999
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_ISTREAM
+#define _STLP_ISTREAM
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x1036
+#  include <stl/_prolog.h>
+#endif
+
+#ifdef _STLP_PRAGMA_ONCE
+#  pragma once
+#endif
+
+#include <stl/_ioserr.h>
+
+#ifndef _STLP_INTERNAL_ISTREAM
+#  include <stl/_istream.h>
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x1036)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_ISTREAM */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/istream.h b/include/c++/stl/istream.h
new file mode 100644 (file)
index 0000000..d382d96
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_ISTREAM_H
+#define _STLP_ISTREAM_H
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x2037
+#  include <stl/_prolog.h>
+#endif
+
+#include <stl/_ioserr.h>
+
+#include <istream>
+
+#ifndef _STLP_HAS_NO_NAMESPACES
+#  ifdef _STLP_BROKEN_USING_DIRECTIVE
+_STLP_USING_NAMESPACE(stlport)
+#  else
+using _STLP_STD::basic_istream;
+using _STLP_STD::basic_iostream;
+using _STLP_STD::istream;
+using _STLP_STD::iostream;
+using _STLP_STD::ios;
+#    ifndef _STLP_NO_WCHAR_T
+using _STLP_STD::wistream;
+using _STLP_STD::wiostream;
+#    endif
+using _STLP_STD::ws;
+#  endif
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x2037)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_ISTREAM_H */
diff --git a/include/c++/stl/iterator b/include/c++/stl/iterator
new file mode 100644 (file)
index 0000000..b08caf4
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Copyright (c) 1997
+ * Moscow Center for SPARC Technology
+ *
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_ITERATOR
+#define _STLP_ITERATOR
+
+# ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x38
+#  include <stl/_prolog.h>
+# endif
+
+# ifdef _STLP_PRAGMA_ONCE
+#  pragma once
+# endif
+
+#if defined (_STLP_IMPORT_VENDOR_STD)
+# include _STLP_NATIVE_HEADER(iterator)
+#endif /* IMPORT */
+
+# ifndef _STLP_INTERNAL_ITERATOR_H
+#  include <stl/_iterator.h>
+# endif
+
+# ifndef _STLP_INTERNAL_STREAM_ITERATOR_H
+#  include <stl/_stream_iterator.h>
+# endif
+
+# if (_STLP_OUTERMOST_HEADER_ID == 0x38)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+# endif
+
+#endif /* _STLP_ITERATOR */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/limits b/include/c++/stl/limits
new file mode 100644 (file)
index 0000000..c0db9eb
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_LIMITS
+#define _STLP_LIMITS
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x39
+#  include <stl/_prolog.h>
+#endif
+
+#ifdef _STLP_PRAGMA_ONCE
+#  pragma once
+#endif
+
+#ifndef _STLP_INTERNAL_LIMITS
+#  include <stl/_limits.h>
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x39)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_LIMITS */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/limits.h b/include/c++/stl/limits.h
new file mode 100644 (file)
index 0000000..9353af1
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#if !defined (_STLP_OUTERMOST_HEADER_ID)
+#  define _STLP_OUTERMOST_HEADER_ID 0x201
+#  include <stl/_prolog.h>
+#elif (_STLP_OUTERMOST_HEADER_ID == 0x201) && ! defined (_STLP_DONT_POP_HEADER_ID)
+#  define _STLP_DONT_POP_HEADER_ID
+#endif
+
+#if defined(_STLP_WCE_EVC3)
+struct _exception;
+#endif
+
+#include _STLP_NATIVE_C_HEADER(limits.h)
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x201)
+#  if ! defined (_STLP_DONT_POP_HEADER_ID)
+#    include <stl/_epilog.h>
+#    undef  _STLP_OUTERMOST_HEADER_ID
+#  endif
+#  undef  _STLP_DONT_POP_HEADER_ID
+#endif
diff --git a/include/c++/stl/list b/include/c++/stl/list
new file mode 100644 (file)
index 0000000..a638f04
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Copyright (c) 1997
+ * Moscow Center for SPARC Technology
+ *
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_LIST
+#define _STLP_LIST
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x40
+#  include <stl/_prolog.h>
+#endif
+
+#ifdef _STLP_PRAGMA_ONCE
+#  pragma once
+#endif
+
+#ifndef _STLP_INTERNAL_LIST_H
+#  include <stl/_list.h>
+#endif
+
+#if defined (_STLP_IMPORT_VENDOR_STD)
+#  include _STLP_NATIVE_HEADER(list)
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x40)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_LIST */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/locale b/include/c++/stl/locale
new file mode 100644 (file)
index 0000000..289bfe3
--- /dev/null
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 1999
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+#ifndef _STLP_LOCALE
+#define _STLP_LOCALE
+
+// Basic framework: class locale and class locale::facet
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x1041
+#  include <stl/_prolog.h>
+#endif
+
+#ifdef _STLP_PRAGMA_ONCE
+#  pragma once
+#endif
+
+#include <stl/_ioserr.h>
+
+// Individual facets
+#ifndef _STLP_INTERNAL_CTYPE_H
+#  include <stl/_ctype.h>
+#endif
+
+#ifndef _STLP_INTERNAL_CODECVT_H
+#  include <stl/_codecvt.h>
+#endif
+
+#ifndef _STLP_INTERNAL_COLLATE_H
+#  include <stl/_collate.h>
+#endif
+
+#ifndef _STLP_INTERNAL_NUM_PUT_H
+#  include <stl/_num_put.h>
+#endif
+
+#ifndef _STLP_INTERNAL_NUM_GET_H
+#  include <stl/_num_get.h>
+#endif
+
+// those never included separately anyway
+#include <stl/_monetary.h>
+#include <stl/_time_facets.h>
+#include <stl/_messages_facets.h>
+
+// some stuff for streambuf iterators ended up defined there
+// Strictly speaking, _istream.h portion is only required for <iterator>, but it may break too many
+// programs if we omit it
+#ifndef _STLP_ISTREAM_H
+#  include <stl/_istream.h>
+#endif
+
+// Convenience interfaces
+#undef isspace
+#undef isprint
+#undef iscntrl
+#undef isupper
+#undef islower
+#undef isalpha
+#undef isdigit
+#undef ispunct
+#undef isxdigit
+#undef isalnum
+#undef isgraph
+#undef toupper
+#undef tolower
+
+_STLP_BEGIN_NAMESPACE
+
+template <class _CharT> 
+inline bool isspace (_CharT c, const locale& loc)
+{ return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::space, c); }
+
+template <class _CharT> 
+inline bool isprint (_CharT c, const locale& loc)
+{ return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::print, c); }
+
+template <class _CharT> 
+inline bool iscntrl (_CharT c, const locale& loc)
+{ return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::cntrl, c); }
+
+template <class _CharT> 
+inline bool isupper (_CharT c, const locale& loc)
+{ return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::upper, c); }
+
+template <class _CharT> 
+inline bool islower (_CharT c, const locale& loc)
+{ return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::lower, c); }
+
+template <class _CharT> 
+inline bool isalpha (_CharT c, const locale& loc)
+{ return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::alpha, c); }
+
+template <class _CharT> 
+inline bool isdigit (_CharT c, const locale& loc)
+{ return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::digit, c); }
+
+template <class _CharT> 
+inline bool ispunct (_CharT c, const locale& loc)
+{ return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::punct, c); }
+
+template <class _CharT> 
+inline bool isxdigit (_CharT c, const locale& loc)
+{ return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::xdigit, c); }
+
+template <class _CharT> 
+inline bool isalnum (_CharT c, const locale& loc)
+{ return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::alnum, c); }
+
+template <class _CharT> 
+inline bool isgraph (_CharT c, const locale& loc)
+{ return (use_facet<ctype<_CharT> >(loc)).is(ctype_base::graph, c); }
+
+template <class _CharT>
+inline _CharT toupper(_CharT c, const locale& loc)
+{ return (use_facet<ctype<_CharT> >(loc)).toupper(c); }
+
+template <class _CharT>
+inline _CharT tolower(_CharT c, const locale& loc)
+{ return (use_facet<ctype<_CharT> >(loc)).tolower(c); }
+
+_STLP_END_NAMESPACE
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x1041)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_LOCALE */
+
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/locale.h b/include/c++/stl/locale.h
new file mode 100644 (file)
index 0000000..9bf7691
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#if !defined (_STLP_OUTERMOST_HEADER_ID)
+#  define _STLP_OUTERMOST_HEADER_ID 0x242
+#  include <stl/_prolog.h>
+#elif (_STLP_OUTERMOST_HEADER_ID == 0x242)
+#  if !defined (_STLP_DONT_POP_HEADER_ID)
+#    define _STLP_DONT_POP_HEADER_ID
+#  else
+#    error STLport include schema violation
+#  endif
+#endif
+
+/* evc3 doesn't have locale.h */
+#ifndef _STLP_WCE_EVC3
+#  include _STLP_NATIVE_C_HEADER(locale.h)
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x242)
+#  if !defined (_STLP_DONT_POP_HEADER_ID)
+#    include <stl/_epilog.h>
+#    undef  _STLP_OUTERMOST_HEADER_ID
+#  else
+#    undef  _STLP_DONT_POP_HEADER_ID
+#  endif
+#endif
+
+/* Local Variables:
+ * mode:C++
+ * End:
+ */
diff --git a/include/c++/stl/map b/include/c++/stl/map
new file mode 100644 (file)
index 0000000..e18a89b
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Copyright (c) 1997
+ * Moscow Center for SPARC Technology
+ *
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_MAP
+#define _STLP_MAP
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x43
+#  include <stl/_prolog.h>
+#endif
+
+#ifdef _STLP_PRAGMA_ONCE
+#  pragma once
+#endif
+
+#include <stl/_map.h>
+
+#if defined (_STLP_IMPORT_VENDOR_STD)
+#  include _STLP_NATIVE_HEADER(map)
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x43)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_MAP */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/math.h b/include/c++/stl/math.h
new file mode 100644 (file)
index 0000000..57bf541
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#if !defined (_STLP_OUTERMOST_HEADER_ID)
+#  define _STLP_OUTERMOST_HEADER_ID 0x244
+#  include <stl/_prolog.h>
+#elif (_STLP_OUTERMOST_HEADER_ID == 0x244) && !defined (_STLP_DONT_POP_HEADER_ID)
+#  define _STLP_DONT_POP_HEADER_ID
+#endif
+
+#if !defined (exception) && (!defined (__KCC) || (__KCC_VERSION < 4000)) && \
+    !(defined(__IBMCPP__) && (500 <= __IBMCPP__)) && !defined(_STLP_WCE_EVC3)
+#  define _STLP_EXCEPTION_WAS_REDEFINED 1
+#  define exception __math_exception
+#endif
+
+#include _STLP_NATIVE_C_HEADER(math.h)
+
+#if defined (_STLP_EXCEPTION_WAS_REDEFINED)
+#  undef exception
+#  undef _STLP_EXCEPTION_WAS_REDEFINED
+#endif
+
+#ifdef _STLP_WCE_EVC3
+#  undef _exception
+#  define _exception exception
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x244)
+#  if ! defined (_STLP_DONT_POP_HEADER_ID)
+#    include <stl/_epilog.h>
+#    undef  _STLP_OUTERMOST_HEADER_ID
+#  else
+#    undef  _STLP_DONT_POP_HEADER_ID
+#  endif
+#endif
+
+/* Local Variables:
+ * mode:C++
+ * End:
+ */
diff --git a/include/c++/stl/mem.h b/include/c++/stl/mem.h
new file mode 100644 (file)
index 0000000..d8b3935
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_mem_h
+
+#if !defined (_STLP_OUTERMOST_HEADER_ID)
+#  define _STLP_OUTERMOST_HEADER_ID 0x245
+#  include <stl/_prolog.h>
+#elif (_STLP_OUTERMOST_HEADER_ID == 0x245) && !defined (_STLP_DONT_POP_HEADER_ID)
+#  define _STLP_DONT_POP_HEADER_ID
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID != 0x245) || defined (_STLP_DONT_POP_HEADER_ID)
+#  include _STLP_NATIVE_C_HEADER(mem.h)
+#else
+#  if defined (__BORLANDC__) && defined (__USING_CNAME__)
+#    define _USING_CNAME_WAS_UNDEFINED
+#    undef __USING_CNAME__
+#  endif
+
+#  include _STLP_NATIVE_C_HEADER(mem.h)
+
+#  if defined (__BORLANDC__) && defined (_USING_CNAME_WAS_UNDEFINED)
+#    define __USING_CNAME__
+#    define _STLP_mem_h 1
+#    undef _USING_CNAME_WAS_UNDEFINED
+#  endif
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x245)
+#  if !defined (_STLP_DONT_POP_HEADER_ID)
+#    include <stl/_epilog.h>
+#    undef  _STLP_OUTERMOST_HEADER_ID
+#  endif
+#  undef  _STLP_DONT_POP_HEADER_ID
+#endif
+
+#endif /* _STLP_mem_h */
+
+/* Local Variables:
+ * mode:C++
+ * End:
+ */
diff --git a/include/c++/stl/memory b/include/c++/stl/memory
new file mode 100644 (file)
index 0000000..89af883
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 1997-1999
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_MEMORY
+#define _STLP_MEMORY
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x46
+#  include <stl/_prolog.h>
+#endif
+
+#ifdef _STLP_PRAGMA_ONCE
+#  pragma once
+#endif
+
+#ifndef _STLP_INTERNAL_ALLOC_H
+#  include <stl/_alloc.h>
+#endif
+
+#ifndef _STLP_INTERNAL_TEMPBUF_H
+#  include <stl/_tempbuf.h>
+#endif
+
+#ifndef _STLP_INTERNAL_RAW_STORAGE_ITER_H
+#  include <stl/_raw_storage_iter.h>
+#endif
+
+#include <stl/_auto_ptr.h>
+
+#if defined (_STLP_IMPORT_VENDOR_STD)
+
+#  if defined (__MSL__)
+#    include _STLP_NATIVE_HEADER(limits)
+#  endif
+
+#  include _STLP_NATIVE_HEADER(memory)
+
+#  if defined (__MSL__) && (__MSL__ >= 0x2405   && __MSL__ < 0x5201) 
+/*  980401 vss  MSL 2.4  Pro 3 Release  */  
+#    include <new_mem.h>
+#  endif
+
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x46)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_MEMORY */
+
+// Local Variables:
+// mode:C++
+// End:
+
diff --git a/include/c++/stl/new b/include/c++/stl/new
new file mode 100644 (file)
index 0000000..e013dab
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_NEW_HEADER
+#define _STLP_NEW_HEADER
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x447
+#  include <stl/_prolog.h>
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID != 0x447)
+#  include _STLP_NATIVE_CPP_RUNTIME_HEADER(new)
+#else
+#  ifndef _STLP_NEW_H_HEADER
+#    include <stl/_new.h>
+#  endif
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x447)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_NEW */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/new.h b/include/c++/stl/new.h
new file mode 100644 (file)
index 0000000..6489b5d
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#if !defined (_STLP_OUTERMOST_HEADER_ID)
+#  define _STLP_OUTERMOST_HEADER_ID 0x848
+#  include <stl/_prolog.h>
+#elif (_STLP_OUTERMOST_HEADER_ID == 0x848) && ! defined (_STLP_DONT_POP_HEADER_ID)
+#  define _STLP_DONT_POP_HEADER_ID
+#endif
+
+#if !defined(_STLP_NO_NEW_HEADER)
+#  if defined (__BORLANDC__)
+#    include <new>
+#  elif defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 800 && !defined(_MSC_VER))
+#    include _STLP_NATIVE_OLD_STREAMS_HEADER(new.h)
+#  else
+#    if defined (__GNUC__) && (__GNUC__ >= 3)
+#      include _STLP_NATIVE_OLD_STREAMS_HEADER(new.h)
+#    else
+#      include _STLP_NATIVE_CPP_RUNTIME_HEADER(new.h)
+#    endif
+#  endif
+#endif /* !defined(_STLP_NO_NEW_HEADER) */
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x848)
+#  if ! defined (_STLP_DONT_POP_HEADER_ID)
+#    include <stl/_epilog.h>
+#    undef  _STLP_OUTERMOST_HEADER_ID
+#  else
+#    undef  _STLP_DONT_POP_HEADER_ID
+#  endif
+#endif
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/numeric b/include/c++/stl/numeric
new file mode 100644 (file)
index 0000000..8a32cfe
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_NUMERIC
+#define _STLP_NUMERIC
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x49
+#  include <stl/_prolog.h>
+#endif
+
+#ifdef _STLP_PRAGMA_ONCE
+#  pragma once
+#endif
+
+#ifndef _STLP_INTERNAL_NUMERIC_H
+#  include <stl/_numeric.h>
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x49)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_NUMERIC */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/ostream b/include/c++/stl/ostream
new file mode 100644 (file)
index 0000000..0cf823f
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 1999
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+#ifndef _STLP_OSTREAM
+#define _STLP_OSTREAM
+
+# ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x1050
+#  include <stl/_prolog.h>
+# endif
+
+# ifdef _STLP_PRAGMA_ONCE
+#  pragma once
+# endif
+
+# include <stl/_ioserr.h>
+# include <stl/_ostream.h>
+
+# if (_STLP_OUTERMOST_HEADER_ID == 0x1050)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+# endif
+
+#endif /* _STLP_OSTREAM */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/ostream.h b/include/c++/stl/ostream.h
new file mode 100644 (file)
index 0000000..b6a7664
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_OSTREAM_H
+#define _STLP_OSTREAM_H
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x2051
+#  include <stl/_prolog.h>
+#endif
+
+#include <stl/_ioserr.h>
+
+#include <ostream>
+
+#ifdef _STLP_USE_NAMESPACES
+#  include <using/ostream>
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x2051)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_OSTREAM_H */
diff --git a/include/c++/stl/pthread.h b/include/c++/stl/pthread.h
new file mode 100644 (file)
index 0000000..57c0c24
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+# if !defined (_STLP_OUTERMOST_HEADER_ID)
+#  define _STLP_OUTERMOST_HEADER_ID 0x280
+#  include <stl/_prolog.h>
+# elif (_STLP_OUTERMOST_HEADER_ID == 0x280) && ! defined (_STLP_DONT_POP_HEADER_ID)
+#  define _STLP_DONT_POP_HEADER_ID
+# endif
+
+# if defined (__SUNPRO_CC) || defined (__HP_aCC)
+# include "/usr/include/pthread.h"
+# else
+# include _STLP_NATIVE_C_HEADER(pthread.h)
+# endif
+
+# if (_STLP_OUTERMOST_HEADER_ID == 0x280)
+#  if ! defined (_STLP_DONT_POP_HEADER_ID)
+#   include <stl/_epilog.h>
+#   undef  _STLP_OUTERMOST_HEADER_ID
+#  else
+#   undef  _STLP_DONT_POP_HEADER_ID
+#  endif
+# endif
+
+/*
+ Local Variables:
+ mode:C++
+ End:
+*/
diff --git a/include/c++/stl/pthread_alloc b/include/c++/stl/pthread_alloc
new file mode 100644 (file)
index 0000000..c5ccbcb
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Copyright (c) 1997
+ * Moscow Center for SPARC Technology
+ *
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_PTHREAD_ALLOC
+#define _STLP_PTHREAD_ALLOC
+
+# ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x52
+#  include <stl/_prolog.h>
+# endif
+
+# ifdef _STLP_PRAGMA_ONCE
+#  pragma once
+# endif
+
+# include <stl/_pthread_alloc.h>
+
+# if (_STLP_OUTERMOST_HEADER_ID == 0x52)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+# endif
+
+#endif /* _STLP_PTHREAD_ALLOC */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/queue b/include/c++/stl/queue
new file mode 100644 (file)
index 0000000..190bc06
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Copyright (c) 1997
+ * Moscow Center for SPARC Technology
+ *
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_QUEUE
+#define _STLP_QUEUE
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x53
+#  include <stl/_prolog.h>
+#endif
+
+#ifdef _STLP_PRAGMA_ONCE
+#  pragma once
+#endif
+
+#ifndef _STLP_INTERNAL_QUEUE_H
+#  include <stl/_queue.h>
+#endif
+
+#ifndef _STLP_FUNCTIONAL
+#  include <functional>
+#endif
+
+#if defined (_STLP_IMPORT_VENDOR_STD)
+#  include _STLP_NATIVE_HEADER(queue)
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x53)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_QUEUE */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/rlocks.h b/include/c++/stl/rlocks.h
new file mode 100644 (file)
index 0000000..84db1f4
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef _STLP_misc_rlocks_h
+# define _STLP_misc_rlocks_h
+# if (__SUNPRO_CC >= 0x500 )
+#  include <../CCios/rlocks.h>
+# elif defined (__SUNPRO_CC)
+#  include <../CC/rlocks.h>
+# else
+#  error "This file is for SUN CC only. Please remove it if it causes any harm for other compilers."
+# endif
+#endif
+
diff --git a/include/c++/stl/rope b/include/c++/stl/rope
new file mode 100644 (file)
index 0000000..4faa36b
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose.  It is provided "as is" without express or implied warranty.
+ */
+
+#ifndef _STLP_ROPE
+#define _STLP_ROPE
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x54
+#  include <stl/_prolog.h>
+#endif
+
+#ifdef _STLP_PRAGMA_ONCE
+#  pragma once
+#endif
+
+#if defined (_STLP_NO_EXTENSIONS)
+/* Comment following if you want to use rope class even if you ask for
+ * no extension.
+ */
+#  error The rope class is a STLport extension.
+#endif
+
+#include <stl/_rope.h>
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x54)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_ROPE */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/set b/include/c++/stl/set
new file mode 100644 (file)
index 0000000..4c3dd2d
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Copyright (c) 1997
+ * Moscow Center for SPARC Technology
+ *
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_SET
+#define _STLP_SET
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x55
+#  include <stl/_prolog.h>
+#endif
+
+#ifdef _STLP_PRAGMA_ONCE
+#  pragma once
+#endif
+
+#include <stl/_set.h>
+
+#if defined (_STLP_IMPORT_VENDOR_STD)
+#  include _STLP_NATIVE_HEADER(set)
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x55)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_SET */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/setjmp.h b/include/c++/stl/setjmp.h
new file mode 100644 (file)
index 0000000..dabef16
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_SETJMP_H
+
+#if !defined (_STLP_OUTERMOST_HEADER_ID)
+#  define _STLP_OUTERMOST_HEADER_ID 0x256
+#  include <stl/_prolog.h>
+#elif (_STLP_OUTERMOST_HEADER_ID == 0x256) && !defined (_STLP_DONT_POP_HEADER_ID)
+#  define _STLP_DONT_POP_HEADER_ID
+#  define _STLP_SETJMP_H
+#endif
+
+#if defined(_STLP_WCE_EVC3)
+struct _exception;
+#endif
+
+#if !defined (setjmp)
+#  define _STLP_NATIVE_SETJMP_H_INCLUDED
+#  include _STLP_NATIVE_C_HEADER(setjmp.h)
+#endif
+
+#if !defined (_STLP_NATIVE_SETJMP_H_INCLUDED)
+/* See errno.h file for a description of this problem. */
+#  error setjmp has been defined before inclusion of setjmp.h header.
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x256)
+#  if ! defined (_STLP_DONT_POP_HEADER_ID)
+#    include <stl/_epilog.h>
+#    undef  _STLP_OUTERMOST_HEADER_ID
+#  else
+#    undef  _STLP_DONT_POP_HEADER_ID
+#  endif
+#endif
+#endif /* _STLP_SETJMP_H */
diff --git a/include/c++/stl/signal.h b/include/c++/stl/signal.h
new file mode 100644 (file)
index 0000000..7b3c70a
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#if !defined (_STLP_OUTERMOST_HEADER_ID)
+#  define _STLP_OUTERMOST_HEADER_ID 0x257
+#  include <stl/_prolog.h>
+#elif (_STLP_OUTERMOST_HEADER_ID == 0x257) && ! defined (_STLP_DONT_POP_HEADER_ID)
+#  define _STLP_DONT_POP_HEADER_ID
+#endif
+
+/* evc3 and evc4 don't have signal.h */
+#ifndef _STLP_WCE
+#  include _STLP_NATIVE_C_HEADER(signal.h)
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x257)
+#  if ! defined (_STLP_DONT_POP_HEADER_ID)
+#    include <stl/_epilog.h>
+#    undef  _STLP_OUTERMOST_HEADER_ID
+#  endif
+#  undef  _STLP_DONT_POP_HEADER_ID
+#endif
+
+/* Local Variables:
+ * mode:C++
+ * End:
+ */
diff --git a/include/c++/stl/slist b/include/c++/stl/slist
new file mode 100644 (file)
index 0000000..c1930e4
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose.  It is provided "as is" without express or implied warranty.
+ *
+ */
+
+#ifndef _STLP_SLIST
+#define _STLP_SLIST
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x58
+#  include <stl/_prolog.h>
+#endif
+
+#ifdef _STLP_PRAGMA_ONCE
+#  pragma once
+#endif
+
+#if defined (_STLP_NO_EXTENSIONS)
+/* Comment following if you want to use the slist constainer even if you ask for
+ * no extension.
+ */
+#  error The slist class is an STLport extension.
+#endif
+
+#ifndef _STLP_INTERNAL_SLIST_H
+#  include <stl/_slist.h>
+#endif
+
+#if defined (_STLP_IMPORT_VENDOR_STD)
+//This is not a Standard header, it might failed for most of
+//the compilers so we comment it for the moment. Should be uncommented
+//on a compiler basis.
+//#  include _STLP_NATIVE_HEADER(slist)
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x58)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_SLIST */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/sstream b/include/c++/stl/sstream
new file mode 100644 (file)
index 0000000..e2b325e
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 1999
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+// This header defines classes basic_stringbuf, basic_istringstream,
+// basic_ostringstream, and basic_stringstream.  These classes
+// represent streamsbufs and streams whose sources or destinations are
+// C++ strings.
+
+#ifndef _STLP_SSTREAM
+#define _STLP_SSTREAM
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x1059
+#  include <stl/_prolog.h>
+#endif
+
+#ifdef _STLP_PRAGMA_ONCE
+#  pragma once
+#endif
+
+#include <stl/_ioserr.h>
+
+#include <stl/_sstream.h>
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x1059)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_SSTREAM */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/stack b/include/c++/stl/stack
new file mode 100644 (file)
index 0000000..d19106b
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Copyright (c) 1997
+ * Moscow Center for SPARC Technology
+ *
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_STACK
+#define _STLP_STACK
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x60
+#  include <stl/_prolog.h>
+#endif
+
+#ifdef _STLP_PRAGMA_ONCE
+#  pragma once
+#endif
+
+#ifndef _STLP_INTERNAL_STACK_H
+#  include <stl/_stack.h>
+#endif
+
+#if defined (_STLP_IMPORT_VENDOR_STD)
+#  include _STLP_NATIVE_HEADER(stack)
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x60)
+#  include <stl/_epilog.h>
+#  undef _STLP_OUTERMOST_HEADER_ID
+#endif
+
+#endif /* _STLP_STACK */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/stdarg.h b/include/c++/stl/stdarg.h
new file mode 100644 (file)
index 0000000..e8605cc
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+/* Workaround for a "misbehaviour" when compiling resource scripts using
+ * eMbedded Visual C++. The standard .rc file includes windows header files,
+ * which in turn include stdarg.h, which results in warnings and errors
+ */
+#if !defined (RC_INVOKED)
+
+#  if !defined (_STLP_OUTERMOST_HEADER_ID)
+#    define _STLP_OUTERMOST_HEADER_ID 0x261
+#    include <stl/_prolog.h>
+#  elif (_STLP_OUTERMOST_HEADER_ID == 0x261) && !defined (_STLP_DONT_POP_HEADER_ID)
+#    define _STLP_DONT_POP_HEADER_ID
+#  endif
+
+#  if defined(_STLP_WCE_EVC3)
+struct _exception;
+#  endif
+
+#  include _STLP_NATIVE_C_HEADER(stdarg.h)
+
+#  if (_STLP_OUTERMOST_HEADER_ID == 0x261)
+#    if !defined (_STLP_DONT_POP_HEADER_ID)
+#      include <stl/_epilog.h>
+#      undef  _STLP_OUTERMOST_HEADER_ID
+#    else
+#      undef  _STLP_DONT_POP_HEADER_ID
+#    endif
+#  endif
+#endif /* RC_INVOKED */
diff --git a/include/c++/stl/stddef.h b/include/c++/stl/stddef.h
new file mode 100644 (file)
index 0000000..01c449f
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_OUTERMOST_HEADER_ID
+#  define _STLP_OUTERMOST_HEADER_ID 0x262
+#  include <stl/_prolog.h>
+#elif (_STLP_OUTERMOST_HEADER_ID == 0x262) && ! defined (_STLP_DONT_POP_HEADER_ID)
+#  define _STLP_DONT_POP_HEADER_ID
+#endif
+
+#  if defined (_MSC_VER) || defined (__DMC__)
+/* Native stddef.h contains errno macro definition making inclusion of native
+ * errno.h in STLport errno.h impossible. We are then forced to include errno.h
+ * first.
+ */
+#    include "errno.h"
+#  endif
+
+#  include _STLP_NATIVE_C_HEADER(stddef.h)
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x262)
+#  if ! defined (_STLP_DONT_POP_HEADER_ID)
+#    include <stl/_epilog.h>
+#    undef  _STLP_OUTERMOST_HEADER_ID
+#  else
+#    undef  _STLP_DONT_POP_HEADER_ID
+#  endif
+#endif
+
diff --git a/include/c++/stl/stdexcept b/include/c++/stl/stdexcept
new file mode 100644 (file)
index 0000000..b00331f
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_STDEXCEPT
+
+#if !defined (_STLP_OUTERMOST_HEADER_ID)
+#  define _STLP_OUTERMOST_HEADER_ID 0x63
+#  include <stl/_prolog.h>
+#elif (_STLP_OUTERMOST_HEADER_ID == 0x63) && ! defined (_STLP_DONT_POP_HEADER_ID)
+#  define _STLP_DONT_POP_HEADER_ID
+#  define _STLP_STDEXCEPT
+#endif
+
+#ifdef _STLP_PRAGMA_ONCE
+#  pragma once
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID != 0x63) || defined (_STLP_DONT_POP_HEADER_ID)
+#  include _STLP_NATIVE_HEADER(stdexcept)
+#else
+#  ifndef _STLP_INTERNAL_STDEXCEPT
+#    include <stl/_stdexcept.h>
+#  endif
+#endif
+
+#if (_STLP_OUTERMOST_HEADER_ID == 0x63)
+#  if !defined (_STLP_DONT_POP_HEADER_ID)
+#    include <stl/_epilog.h>
+#    undef  _STLP_OUTERMOST_HEADER_ID
+#  else
+#    undef  _STLP_DONT_POP_HEADER_ID
+#  endif
+#endif
+
+#endif /* _STLP_STDEXCEPT */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/stdio.h b/include/c++/stl/stdio.h
new file mode 100644 (file)
index 0000000..271f37b
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+/* Workaround for a "misbehaviour" when compiling resource scripts using
+ * eMbedded Visual C++. The standard .rc file includes windows header files,
+ * which in turn include stdarg.h, which results in warnings and errors
+ */
+#if !defined(RC_INVOKED)
+
+#  ifndef _STLP_OUTERMOST_HEADER_ID
+#    define _STLP_OUTERMOST_HEADER_ID 0x264
+#    include <stl/_prolog.h>
+#  elif (_STLP_OUTERMOST_HEADER_ID == 0x264) && !defined (_STLP_DONT_POP_HEADER_ID)
+#    define _STLP_DONT_POP_HEADER_ID
+#  endif
+
+#    if defined(_STLP_WCE_EVC3)
+struct _exception;
+#    endif
+#    include _STLP_NATIVE_C_HEADER(stdio.h)
+
+#    if defined (__SUNPRO_CC) && !defined (_STRUCT_FILE)
+#      define _STRUCT_FILE
+#    endif
+
+#    if (defined (__MWERKS__) && !defined (N_PLAT_NLM))  || defined (__BORLANDC__)
+#      undef stdin
+#      undef stdout
+#      undef stderr
+#      if defined (__MWERKS__)
+#      define stdin   (&_STLP_VENDOR_CSTD::__files[0])
+#      define stdout  (&_STLP_VENDOR_CSTD::__files[1])
+#      define stderr  (&_STLP_VENDOR_CSTD::__files[2])
+#      elif defined (__BORLANDC__)
+#        define stdin   (&_STLP_VENDOR_CSTD::_streams[0])
+#        define stdout  (&_STLP_VENDOR_CSTD::_streams[1])
+#        define stderr  (&_STLP_VENDOR_CSTD::_streams[2])
+#      endif
+#    endif
+
+#  if (_STLP_OUTERMOST_HEADER_ID == 0x264)
+#    if !defined (_STLP_DONT_POP_HEADER_ID)
+#      include <stl/_epilog.h>
+#      undef  _STLP_OUTERMOST_HEADER_ID
+#    else
+#      undef  _STLP_DONT_POP_HEADER_ID
+#    endif
+#  endif
+
+#endif /* RC_INVOKED */
diff --git a/include/c++/stl/stdiostream.h b/include/c++/stl/stdiostream.h
new file mode 100644 (file)
index 0000000..80a5c67
--- /dev/null
@@ -0,0 +1,10 @@
+#ifndef _STLP_misc_stdiostream_h
+# define _STLP_misc_stdiostream_h
+# if (__SUNPRO_CC >= 0x500 )
+#  include <../CCios/stdiostream.h>
+# else if defined (__SUNPRO_CC)
+#  include <../CC/stdiostream.h>
+# else
+#  error "This file is for SUN CC only. Please remove it if it causes any harm for other compilers."
+# endif
+#endif
diff --git a/include/c++/stl/stdlib.h b/include/c++/stl/stdlib.h
new file mode 100644 (file)
index 0000000..3a415ee
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+/* Workaround for a "misbehaviour" when compiling resource scripts using
+ * eMbedded Visual C++. The standard .rc file includes windows header files,
+ * which in turn include stdlib.h, which results in warnings and errors
+ */
+#if !defined (RC_INVOKED)
+
+#  if !defined (_STLP_OUTERMOST_HEADER_ID)
+#    define _STLP_OUTERMOST_HEADER_ID 0x265
+#    include <stl/_prolog.h>
+#  elif (_STLP_OUTERMOST_HEADER_ID == 0x265) && !defined (_STLP_DONT_POP_HEADER_ID)
+#    define _STLP_DONT_POP_HEADER_ID
+#  endif
+
+#  if defined (_MSC_VER) || (defined (__GNUC__) && defined (__MINGW32__)) || \
+      defined (__BORLANDC__) || defined (__DMC__) || \
+      (defined (__HP_aCC) && defined (_REENTRANT))
+/* Native stdlib.h contains errno macro definition making inclusion of native
+ * errno.h in STLport errno.h impossible. We are then forced to include errno.h
+ * first.
+ */
+#    include "errno.h"
+#  endif
+
+/*
+ forward-declaration for _exception struct; prevents warning message
+ ../include/stdlib.h(817) : warning C4115: '_exception' : named type definition in parentheses
+*/
+#  if defined(_STLP_WCE_EVC3)
+struct _exception;
+#  endif
+
+#  include _STLP_NATIVE_C_HEADER(stdlib.h)
+
+/* on evc3/evc4 including stdlib.h also defines setjmp macro */
+#  if defined (_STLP_WCE)
+#    define _STLP_NATIVE_SETJMP_H_INCLUDED
+#  endif
+
+#  if (_STLP_OUTERMOST_HEADER_ID == 0x265)
+#    if ! defined (_STLP_DONT_POP_HEADER_ID)
+#      include <stl/_epilog.h>
+#      undef  _STLP_OUTERMOST_HEADER_ID
+#    else
+#      undef  _STLP_DONT_POP_HEADER_ID
+#    endif
+#  endif
+
+#endif /* RC_INVOKED */
+
+/*
+  Local Variables:
+  mode:C++
+  End:
+*/
diff --git a/include/c++/stl/stl/_abbrevs.h b/include/c++/stl/stl/_abbrevs.h
new file mode 100644 (file)
index 0000000..c4acac8
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ *
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+/* NOTE: This is an internal header file, included by other STL headers.
+ *   You should not attempt to use it directly.
+ */
+
+#ifndef _STLP_INTERNAL_ABBREVS_H
+# define _STLP_INTERNAL_ABBREVS_H
+
+// ugliness is intentional - to reduce conflicts
+#  define input_iterator_tag             _In__ItT
+#  define output_iterator_tag            _Ou__ItT
+#  define bidirectional_iterator_tag     _Bd__ItT
+#  define random_access_iterator_tag     _Ra__ItT
+#  define input_iterator                 _In__It
+#  define output_iterator                _Ou__It
+#  define bidirectional_iterator         _Bd__It
+#  define random_access_iterator         _Ra__It
+#  define reverse_bidirectional_iterator _rBd__It
+#  define reverse_iterator               _r__It
+#  define back_insert_iterator           _bI__It
+#  define front_insert_iterator          _fI__It
+#  define raw_storage_iterator           _rS__It
+#  define _Const_traits                  _C_Tr
+#  define _Const_Const_traits            _CC_Tr
+#  define _Nonconst_traits               _N_Tr
+#  define _Nonconst_Const_traits         _NC_Tr
+
+// ugliness is intentional - to reduce conflicts probability
+#  define __malloc_alloc    M__A
+#  define __node_alloc      D__A
+#  define __new_alloc       N__A
+#  define __debug_alloc     G__A
+#  define _STLP_alloc_proxy P__A
+
+#  define _Deque_iterator_base     _Dq__ItB
+#  define _Deque_iterator          _Dq__It
+
+#  define _Select1st                  _S1st
+#  define _Select2nd                  _S2nd
+#  define __move_source               __m_s
+#  define _Vector_nonconst_traits     _V_nct
+
+#  define _Ht_iterator                _Ht_It
+
+#  define _List_node_base          _L__NB
+#  define _List_iterator_base      _L__ItB
+#  define _List_iterator           _L__It
+
+#  define _Slist_iterator_base     _SL__ItB
+#  define _Slist_iterator          _SL__It
+
+#  define _Rb_tree_node_base       _rbT__NB
+#  define _Rb_tree_node            _rbT__N
+#  define _Rb_tree_base_iterator   _rbT__It
+#  define _Rb_tree_base            _rbT__B
+
+#  if defined (__DMC__) && defined (_STLP_DEBUG)
+#    define _NonDbg_hashtable      _Nd_Ht
+#    define _DBG_iter              _d__It
+#  endif
+#endif
+
diff --git a/include/c++/stl/stl/_algo.c b/include/c++/stl/stl/_algo.c
new file mode 100644 (file)
index 0000000..79745ba
--- /dev/null
@@ -0,0 +1,2012 @@
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Copyright (c) 1997
+ * Moscow Center for SPARC Technology
+ *
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+#ifndef _STLP_ALGO_C
+#define _STLP_ALGO_C
+
+#if !defined (_STLP_INTERNAL_ALGO_H)
+#  include <stl/_algo.h>
+#endif
+
+#ifndef _STLP_INTERNAL_TEMPBUF_H
+#  include <stl/_tempbuf.h>
+#endif
+
+_STLP_BEGIN_NAMESPACE
+
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _BidirectionalIter, class _Distance, class _Compare>
+void __merge_without_buffer(_BidirectionalIter __first,
+                            _BidirectionalIter __middle,
+                            _BidirectionalIter __last,
+                            _Distance __len1, _Distance __len2,
+                            _Compare __comp);
+
+
+template <class _BidirectionalIter1, class _BidirectionalIter2,
+          class _BidirectionalIter3, class _Compare>
+_BidirectionalIter3 __merge_backward(_BidirectionalIter1 __first1,
+                                     _BidirectionalIter1 __last1,
+                                     _BidirectionalIter2 __first2,
+                                     _BidirectionalIter2 __last2,
+                                     _BidirectionalIter3 __result,
+                                     _Compare __comp);
+
+template <class _Tp>
+#if !(defined (__SUNPRO_CC) && (__SUNPRO_CC < 0x420 ))
+inline
+#endif
+const _Tp& __median(const _Tp& __a, const _Tp& __b, const _Tp& __c) {
+  if (__a < __b)
+    if (__b < __c)
+      return __b;
+    else if (__a < __c)
+      return __c;
+    else
+      return __a;
+  else if (__a < __c)
+    return __a;
+  else if (__b < __c)
+    return __c;
+  else
+    return __b;
+}
+
+template <class _Tp, class _Compare>
+#if !(defined (__SUNPRO_CC) && (__SUNPRO_CC < 0x420 ))
+inline
+#endif
+const _Tp&
+__median(const _Tp& __a, const _Tp& __b, const _Tp& __c, _Compare __comp) {
+  if (__comp(__a, __b)) {
+    _STLP_VERBOSE_ASSERT(!__comp(__b, __a), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
+    if (__comp(__b, __c)) {
+      _STLP_VERBOSE_ASSERT(!__comp(__c, __b), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
+      return __b;
+    }
+    else if (__comp(__a, __c)) {
+      _STLP_VERBOSE_ASSERT(!__comp(__c, __a), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
+      return __c;
+    }
+    else
+      return __a;
+  }
+  else if (__comp(__a, __c)) {
+    _STLP_VERBOSE_ASSERT(!__comp(__c, __a), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
+    return __a;
+  }
+  else if (__comp(__b, __c)) {
+    _STLP_VERBOSE_ASSERT(!__comp(__c, __b), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
+    return __c;
+  }
+  else
+    return __b;
+}
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+template <class _ForwardIter1, class _ForwardIter2>
+_ForwardIter1 search(_ForwardIter1 __first1, _ForwardIter1 __last1,
+                     _ForwardIter2 __first2, _ForwardIter2 __last2) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first1, __last1))
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first2, __last2))
+  // Test for empty ranges
+  if (__first1 == __last1 || __first2 == __last2)
+    return __first1;
+
+  // Test for a pattern of length 1.
+  _ForwardIter2 __p1(__first2);
+
+  if ( ++__p1 == __last2 )
+    return find(__first1, __last1, *__first2);
+
+  // General case.
+
+  for ( ; ; ) { // __first1 != __last1 will be checked in find below
+    __first1 = find(__first1, __last1, *__first2);
+    if (__first1 == __last1)
+      return __last1;
+
+    _ForwardIter2 __p = __p1;
+    _ForwardIter1 __current = __first1;
+    if (++__current == __last1)
+      return __last1;
+
+    while (*__current == *__p) {
+      if (++__p == __last2)
+        return __first1;
+      if (++__current == __last1)
+        return __last1;
+    }
+
+    ++__first1;
+  }
+  return __first1;
+}
+
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _RandomAccessIter, class _Integer, class _Tp,
+          class _BinaryPred, class _Distance>
+_RandomAccessIter __search_n(_RandomAccessIter __first, _RandomAccessIter __last,
+                             _Integer __count, const _Tp& __val, _BinaryPred __pred,
+                             _Distance*, const random_access_iterator_tag &)
+{
+  _Distance __tailSize = __last - __first;
+  const _Distance __pattSize = __count;
+  const _Distance __skipOffset = __pattSize - 1;
+  _RandomAccessIter __backTrack;
+  _Distance __remainder, __prevRemainder;
+
+  for ( _RandomAccessIter __lookAhead = __first + __skipOffset; __tailSize >= __pattSize; __lookAhead += __pattSize ) { // the main loop...
+    //__lookAhead here is always pointing to the last element of next possible match.
+    __tailSize -= __pattSize;
+
+    while ( !__pred(*__lookAhead, __val) ) { // the skip loop...
+      if (__tailSize < __pattSize)
+        return __last;
+
+      __lookAhead += __pattSize;
+      __tailSize -= __pattSize;
+    }
+
+    if ( __skipOffset == 0 ) {
+      return (__lookAhead - __skipOffset); //Success
+    }
+
+    __remainder = __skipOffset;
+
+    for (__backTrack = __lookAhead; __pred(*--__backTrack, __val); ) {
+      if (--__remainder == 0)
+        return (__lookAhead - __skipOffset); //Success
+    }
+
+    if (__remainder > __tailSize)
+      return __last; //failure
+
+    __lookAhead += __remainder;
+    __tailSize -= __remainder;
+
+    while ( __pred(*__lookAhead, __val) ) {
+      __prevRemainder = __remainder;
+      __backTrack = __lookAhead;
+
+      do {
+        if (--__remainder == 0)
+          return (__lookAhead - __skipOffset); //Success
+      } while (__pred(*--__backTrack, __val));
+
+      //adjust remainder for next comparison
+      __remainder += __pattSize - __prevRemainder;
+
+      if (__remainder > __tailSize)
+        return __last; //failure
+
+      __lookAhead += __remainder;
+      __tailSize -= __remainder;
+    }
+
+    //__lookAhead here is always pointing to the element of the last mismatch.
+  }
+
+  return __last; //failure
+}
+
+template <class _ForwardIter, class _Integer, class _Tp,
+          class _Distance, class _BinaryPred>
+_ForwardIter __search_n(_ForwardIter __first, _ForwardIter __last,
+                        _Integer __count, const _Tp& __val, _BinaryPred __pred,
+                        _Distance*, const forward_iterator_tag &) {
+  for (; (__first != __last) && !__pred(*__first, __val); ++__first) {}
+  while (__first != __last) {
+    _Integer __n = __count - 1;
+    _ForwardIter __i = __first;
+    ++__i;
+    while (__i != __last && __n != 0 && __pred(*__i, __val)) {
+      ++__i;
+      --__n;
+    }
+    if (__n == 0)
+      return __first;
+    else if (__i != __last)
+      for (__first = ++__i; (__first != __last) && !__pred(*__first, __val); ++__first) {}
+    else
+      break;
+  }
+  return __last;
+}
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+// search_n.  Search for __count consecutive copies of __val.
+template <class _ForwardIter, class _Integer, class _Tp>
+_ForwardIter search_n(_ForwardIter __first, _ForwardIter __last,
+                      _Integer __count, const _Tp& __val) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  if (__count <= 0)
+    return __first;
+  if (__count == 1)
+    //We use find when __count == 1 to use potential find overload.
+    return find(__first, __last, __val);
+  return _STLP_PRIV __search_n(__first, __last, __count, __val, equal_to<_Tp>(),
+                               _STLP_DISTANCE_TYPE(__first, _ForwardIter),
+                               _STLP_ITERATOR_CATEGORY(__first, _ForwardIter));
+}
+
+template <class _ForwardIter, class _Integer, class _Tp, class _BinaryPred>
+_ForwardIter search_n(_ForwardIter __first, _ForwardIter __last,
+                      _Integer __count, const _Tp& __val,
+                      _BinaryPred __binary_pred) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  if (__count <= 0)
+    return __first;
+  return _STLP_PRIV __search_n(__first, __last, __count, __val, __binary_pred,
+                               _STLP_DISTANCE_TYPE(__first, _ForwardIter),
+                               _STLP_ITERATOR_CATEGORY(__first, _ForwardIter));
+}
+
+template <class _ForwardIter1, class _ForwardIter2>
+_ForwardIter1
+find_end(_ForwardIter1 __first1, _ForwardIter1 __last1,
+         _ForwardIter2 __first2, _ForwardIter2 __last2) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first1, __last1))
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first2, __last2))
+  return _STLP_PRIV __find_end(__first1, __last1, __first2, __last2,
+#if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION)
+                               _STLP_ITERATOR_CATEGORY(__first1, _ForwardIter1),
+                               _STLP_ITERATOR_CATEGORY(__first2, _ForwardIter2),
+#else
+                               forward_iterator_tag(),
+                               forward_iterator_tag(),
+#endif
+                               _STLP_PRIV __equal_to(_STLP_VALUE_TYPE(__first1, _ForwardIter1))
+    );
+}
+
+// unique and unique_copy
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _InputIterator, class _OutputIterator, class _BinaryPredicate,
+          class _Tp>
+_STLP_INLINE_LOOP _OutputIterator
+__unique_copy(_InputIterator __first, _InputIterator __last,
+              _OutputIterator __result,
+              _BinaryPredicate __binary_pred, _Tp*) {
+  _Tp __val = *__first;
+  *__result = __val;
+  while (++__first != __last)
+    if (!__binary_pred(__val, *__first)) {
+      __val = *__first;
+      *++__result = __val;
+    }
+  return ++__result;
+}
+
+template <class _InputIter, class _OutputIter, class _BinaryPredicate>
+inline _OutputIter
+__unique_copy(_InputIter __first, _InputIter __last,_OutputIter __result,
+              _BinaryPredicate __binary_pred, const output_iterator_tag &) {
+  return __unique_copy(__first, __last, __result, __binary_pred, _STLP_VALUE_TYPE(__first, _InputIter));
+}
+
+template <class _InputIter, class _ForwardIter, class _BinaryPredicate>
+_STLP_INLINE_LOOP _ForwardIter
+__unique_copy(_InputIter __first, _InputIter __last, _ForwardIter __result,
+              _BinaryPredicate __binary_pred, const forward_iterator_tag &) {
+  *__result = *__first;
+  while (++__first != __last)
+    if (!__binary_pred(*__result, *__first)) *++__result = *__first;
+  return ++__result;
+}
+
+#if defined (_STLP_NONTEMPL_BASE_MATCH_BUG)
+template <class _InputIterator, class _BidirectionalIterator, class _BinaryPredicate>
+inline _BidirectionalIterator
+__unique_copy(_InputIterator __first, _InputIterator __last,
+              _BidirectionalIterator __result, _BinaryPredicate __binary_pred,
+              const bidirectional_iterator_tag &) {
+  return __unique_copy(__first, __last, __result, __binary_pred, forward_iterator_tag());
+}
+
+template <class _InputIterator, class _RandomAccessIterator, class _BinaryPredicate>
+inline _RandomAccessIterator
+__unique_copy(_InputIterator __first, _InputIterator __last,
+              _RandomAccessIterator __result, _BinaryPredicate __binary_pred,
+              const random_access_iterator_tag &) {
+  return __unique_copy(__first, __last, __result, __binary_pred, forward_iterator_tag());
+}
+#endif /* _STLP_NONTEMPL_BASE_MATCH_BUG */
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+template <class _InputIter, class _OutputIter>
+_OutputIter
+unique_copy(_InputIter __first, _InputIter __last, _OutputIter __result) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  if (__first == __last) return __result;
+  return _STLP_PRIV __unique_copy(__first, __last, __result,
+                                  _STLP_PRIV __equal_to(_STLP_VALUE_TYPE(__first, _InputIter)),
+                                  _STLP_ITERATOR_CATEGORY(__result, _OutputIter));
+}
+
+template <class _InputIter, class _OutputIter, class _BinaryPredicate>
+_OutputIter
+unique_copy(_InputIter __first, _InputIter __last,_OutputIter __result,
+            _BinaryPredicate __binary_pred) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  if (__first == __last) return __result;
+  return _STLP_PRIV __unique_copy(__first, __last, __result, __binary_pred,
+                                  _STLP_ITERATOR_CATEGORY(__result, _OutputIter));
+}
+
+// rotate and rotate_copy, and their auxiliary functions
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _ForwardIter, class _Distance>
+_ForwardIter __rotate_aux(_ForwardIter __first,
+                          _ForwardIter __middle,
+                          _ForwardIter __last,
+                          _Distance*,
+                          const forward_iterator_tag &) {
+  if (__first == __middle)
+    return __last;
+  if (__last  == __middle)
+    return __first;
+
+  _ForwardIter __first2 = __middle;
+  do {
+    swap(*__first++, *__first2++);
+    if (__first == __middle)
+      __middle = __first2;
+  } while (__first2 != __last);
+
+  _ForwardIter __new_middle = __first;
+
+  __first2 = __middle;
+
+  while (__first2 != __last) {
+    swap (*__first++, *__first2++);
+    if (__first == __middle)
+      __middle = __first2;
+    else if (__first2 == __last)
+      __first2 = __middle;
+  }
+
+  return __new_middle;
+}
+
+template <class _BidirectionalIter, class _Distance>
+_BidirectionalIter __rotate_aux(_BidirectionalIter __first,
+                                _BidirectionalIter __middle,
+                                _BidirectionalIter __last,
+                                _Distance*,
+                                const bidirectional_iterator_tag &) {
+  if (__first == __middle)
+    return __last;
+  if (__last  == __middle)
+    return __first;
+
+  __reverse(__first,  __middle, bidirectional_iterator_tag());
+  __reverse(__middle, __last,   bidirectional_iterator_tag());
+
+  while (__first != __middle && __middle != __last)
+    swap (*__first++, *--__last);
+
+  if (__first == __middle) {
+    __reverse(__middle, __last,   bidirectional_iterator_tag());
+    return __last;
+  }
+  else {
+    __reverse(__first,  __middle, bidirectional_iterator_tag());
+    return __first;
+  }
+}
+
+template <class _RandomAccessIter, class _Distance, class _Tp>
+_RandomAccessIter __rotate_aux(_RandomAccessIter __first,
+                               _RandomAccessIter __middle,
+                               _RandomAccessIter __last,
+                               _Distance *, _Tp *) {
+
+  _Distance __n = __last   - __first;
+  _Distance __k = __middle - __first;
+  _Distance __l = __n - __k;
+  _RandomAccessIter __result = __first + (__last - __middle);
+
+  if (__k == 0)  /* __first == middle */
+    return __last;
+
+  if (__k == __l) {
+    swap_ranges(__first, __middle, __middle);
+    return __result;
+  }
+
+  _Distance __d = __gcd(__n, __k);
+
+  for (_Distance __i = 0; __i < __d; __i++) {
+    _Tp __tmp = *__first;
+    _RandomAccessIter __p = __first;
+
+    if (__k < __l) {
+      for (_Distance __j = 0; __j < __l/__d; __j++) {
+        if (__p > __first + __l) {
+          *__p = *(__p - __l);
+          __p -= __l;
+        }
+
+        *__p = *(__p + __k);
+        __p += __k;
+      }
+    }
+
+    else {
+      for (_Distance __j = 0; __j < __k/__d - 1; __j ++) {
+        if (__p < __last - __k) {
+          *__p = *(__p + __k);
+          __p += __k;
+        }
+
+        *__p = * (__p - __l);
+        __p -= __l;
+      }
+    }
+
+    *__p = __tmp;
+    ++__first;
+  }
+
+  return __result;
+}
+
+template <class _RandomAccessIter, class _Distance>
+inline _RandomAccessIter
+__rotate_aux(_RandomAccessIter __first, _RandomAccessIter __middle, _RandomAccessIter __last,
+             _Distance * __dis, const random_access_iterator_tag &) {
+  return __rotate_aux(__first, __middle, __last,
+                      __dis, _STLP_VALUE_TYPE(__first, _RandomAccessIter));
+}
+
+template <class _ForwardIter>
+_ForwardIter
+__rotate(_ForwardIter __first, _ForwardIter __middle, _ForwardIter __last) {
+  _STLP_DEBUG_CHECK(__check_range(__first, __middle))
+  _STLP_DEBUG_CHECK(__check_range(__middle, __last))
+  return __rotate_aux(__first, __middle, __last,
+                      _STLP_DISTANCE_TYPE(__first, _ForwardIter),
+                      _STLP_ITERATOR_CATEGORY(__first, _ForwardIter));
+}
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+template <class _ForwardIter>
+void rotate(_ForwardIter __first, _ForwardIter __middle, _ForwardIter __last) {
+  _STLP_PRIV __rotate(__first, __middle, __last);
+}
+
+// Return a random number in the range [0, __n).  This function encapsulates
+// whether we're using rand (part of the standard C library) or lrand48
+// (not standard, but a much better choice whenever it's available).
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _Distance>
+inline _Distance __random_number(_Distance __n) {
+#ifdef _STLP_NO_DRAND48
+  return rand() % __n;
+#else
+  return lrand48() % __n;
+#endif
+}
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+template <class _RandomAccessIter>
+void random_shuffle(_RandomAccessIter __first,
+                    _RandomAccessIter __last) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  if (__first == __last) return;
+  for (_RandomAccessIter __i = __first + 1; __i != __last; ++__i)
+    iter_swap(__i, __first + _STLP_PRIV __random_number((__i - __first) + 1));
+}
+
+template <class _RandomAccessIter, class _RandomNumberGenerator>
+void random_shuffle(_RandomAccessIter __first, _RandomAccessIter __last,
+                    _RandomNumberGenerator &__rand) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  if (__first == __last) return;
+  for (_RandomAccessIter __i = __first + 1; __i != __last; ++__i)
+    iter_swap(__i, __first + __rand((__i - __first) + 1));
+}
+
+#if !defined (_STLP_NO_EXTENSIONS)
+// random_sample and random_sample_n (extensions, not part of the standard).
+template <class _ForwardIter, class _OutputIter, class _Distance>
+_OutputIter random_sample_n(_ForwardIter __first, _ForwardIter __last,
+                            _OutputIter __out_ite, const _Distance __n) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  _Distance __remaining = distance(__first, __last);
+  _Distance __m = (min) (__n, __remaining);
+
+  while (__m > 0) {
+    if (_STLP_PRIV __random_number(__remaining) < __m) {
+      *__out_ite = *__first;
+      ++__out_ite;
+      --__m;
+    }
+
+    --__remaining;
+    ++__first;
+  }
+  return __out_ite;
+}
+
+
+template <class _ForwardIter, class _OutputIter, class _Distance,
+          class _RandomNumberGenerator>
+_OutputIter random_sample_n(_ForwardIter __first, _ForwardIter __last,
+                            _OutputIter __out_ite, const _Distance __n,
+                            _RandomNumberGenerator& __rand) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  _Distance __remaining = distance(__first, __last);
+  _Distance __m = (min) (__n, __remaining);
+
+  while (__m > 0) {
+    if (__rand(__remaining) < __m) {
+      *__out_ite = *__first;
+      ++__out_ite;
+      --__m;
+    }
+
+    --__remaining;
+    ++__first;
+  }
+  return __out_ite;
+}
+
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _InputIter, class _RandomAccessIter, class _Distance>
+_RandomAccessIter __random_sample(_InputIter __first, _InputIter __last,
+                                  _RandomAccessIter __out_ite,
+                                  const _Distance __n) {
+  _Distance __m = 0;
+  _Distance __t = __n;
+  for ( ; __first != __last && __m < __n; ++__m, ++__first)
+    __out_ite[__m] = *__first;
+
+  while (__first != __last) {
+    ++__t;
+    _Distance __M = __random_number(__t);
+    if (__M < __n)
+      __out_ite[__M] = *__first;
+    ++__first;
+  }
+
+  return __out_ite + __m;
+}
+
+template <class _InputIter, class _RandomAccessIter,
+          class _RandomNumberGenerator, class _Distance>
+_RandomAccessIter __random_sample(_InputIter __first, _InputIter __last,
+                                  _RandomAccessIter __out_ite,
+                                  _RandomNumberGenerator& __rand,
+                                  const _Distance __n) {
+  _Distance __m = 0;
+  _Distance __t = __n;
+  for ( ; __first != __last && __m < __n; ++__m, ++__first)
+    __out_ite[__m] = *__first;
+
+  while (__first != __last) {
+    ++__t;
+    _Distance __M = __rand(__t);
+    if (__M < __n)
+      __out_ite[__M] = *__first;
+    ++__first;
+  }
+
+  return __out_ite + __m;
+}
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+template <class _InputIter, class _RandomAccessIter>
+_RandomAccessIter
+random_sample(_InputIter __first, _InputIter __last,
+              _RandomAccessIter __out_first, _RandomAccessIter __out_last) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__out_first, __out_last))
+  return _STLP_PRIV __random_sample(__first, __last,
+                                    __out_first, __out_last - __out_first);
+}
+
+template <class _InputIter, class _RandomAccessIter, class _RandomNumberGenerator>
+_RandomAccessIter
+random_sample(_InputIter __first, _InputIter __last,
+              _RandomAccessIter __out_first, _RandomAccessIter __out_last,
+              _RandomNumberGenerator& __rand) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__out_first, __out_last))
+  return _STLP_PRIV __random_sample(__first, __last,
+                                    __out_first, __rand,
+                                    __out_last - __out_first);
+}
+
+#endif /* _STLP_NO_EXTENSIONS */
+
+// partition, stable_partition, and their auxiliary functions
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _ForwardIter, class _Predicate>
+_STLP_INLINE_LOOP _ForwardIter __partition(_ForwardIter __first,
+                                           _ForwardIter __last,
+                                           _Predicate   __pred,
+                                           const forward_iterator_tag &) {
+  if (__first == __last) return __first;
+
+  while (__pred(*__first))
+    if (++__first == __last) return __first;
+
+  _ForwardIter __next = __first;
+
+  while (++__next != __last) {
+    if (__pred(*__next)) {
+      swap(*__first, *__next);
+      ++__first;
+    }
+  }
+  return __first;
+}
+
+template <class _BidirectionalIter, class _Predicate>
+_STLP_INLINE_LOOP _BidirectionalIter __partition(_BidirectionalIter __first,
+                                                 _BidirectionalIter __last,
+                                                 _Predicate __pred,
+                                                 const bidirectional_iterator_tag &) {
+  for (;;) {
+    for (;;) {
+      if (__first == __last)
+        return __first;
+      else if (__pred(*__first))
+        ++__first;
+      else
+        break;
+    }
+    --__last;
+    for (;;) {
+      if (__first == __last)
+        return __first;
+      else if (!__pred(*__last))
+        --__last;
+      else
+        break;
+    }
+    iter_swap(__first, __last);
+    ++__first;
+  }
+}
+
+#if defined (_STLP_NONTEMPL_BASE_MATCH_BUG)
+template <class _BidirectionalIter, class _Predicate>
+inline
+_BidirectionalIter __partition(_BidirectionalIter __first,
+                               _BidirectionalIter __last,
+                               _Predicate __pred,
+                               const random_access_iterator_tag &) {
+  return __partition(__first, __last, __pred, bidirectional_iterator_tag());
+}
+#endif
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+template <class _ForwardIter, class _Predicate>
+_ForwardIter partition(_ForwardIter __first, _ForwardIter __last, _Predicate   __pred) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  return _STLP_PRIV __partition(__first, __last, __pred, _STLP_ITERATOR_CATEGORY(__first, _ForwardIter));
+}
+
+
+/* __pred_of_first: false if we know that __pred(*__first) is false,
+ *                  true when we don't know the result of __pred(*__first).
+ * __not_pred_of_before_last: true if we know that __pred(*--__last) is true,
+ *                            false when we don't know the result of __pred(*--__last).
+ */
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _ForwardIter, class _Predicate, class _Distance>
+_ForwardIter __inplace_stable_partition(_ForwardIter __first,
+                                        _ForwardIter __last,
+                                        _Predicate __pred, _Distance __len,
+                                        bool __pred_of_first, bool __pred_of_before_last) {
+  if (__len == 1)
+    return (__pred_of_first && (__pred_of_before_last || __pred(*__first))) ? __last : __first;
+  _ForwardIter __middle = __first;
+  _Distance __half_len = __len / 2;
+  advance(__middle, __half_len);
+  return __rotate(__inplace_stable_partition(__first, __middle, __pred, __half_len, __pred_of_first, false),
+                  __middle,
+                  __inplace_stable_partition(__middle, __last, __pred, __len - __half_len, true, __pred_of_before_last));
+}
+
+template <class _ForwardIter, class _Pointer, class _Predicate,
+          class _Distance>
+_ForwardIter __stable_partition_adaptive(_ForwardIter __first,
+                                         _ForwardIter __last,
+                                         _Predicate __pred, _Distance __len,
+                                         _Pointer __buffer, _Distance __buffer_size,
+                                         bool __pred_of_first, bool __pred_of_before_last) {
+  if (__len <= __buffer_size) {
+    _ForwardIter __result1 = __first;
+    _Pointer __result2 = __buffer;
+    if ((__first != __last) && (!__pred_of_first || __pred(*__first))) {
+      *__result2 = *__first;
+      ++__result2; ++__first; --__len;
+    }
+    for (; __first != __last ; ++__first, --__len) {
+      if (((__len == 1) && (__pred_of_before_last || __pred(*__first))) ||
+          ((__len != 1) && __pred(*__first))){
+        *__result1 = *__first;
+        ++__result1;
+      }
+      else {
+        *__result2 = *__first;
+        ++__result2;
+      }
+    }
+    copy(__buffer, __result2, __result1);
+    return __result1;
+  }
+  else {
+    _ForwardIter __middle = __first;
+    _Distance __half_len = __len / 2;
+    advance(__middle, __half_len);
+    return __rotate(__stable_partition_adaptive(
+                          __first, __middle, __pred,
+                          __half_len, __buffer, __buffer_size,
+                          __pred_of_first, false),
+                    __middle,
+                    __stable_partition_adaptive(
+                          __middle, __last, __pred,
+                          __len - __half_len, __buffer, __buffer_size,
+                          true, __pred_of_before_last));
+  }
+}
+
+template <class _ForwardIter, class _Predicate, class _Tp, class _Distance>
+inline _ForwardIter
+__stable_partition_aux_aux(_ForwardIter __first, _ForwardIter __last,
+                           _Predicate __pred, _Tp*, _Distance*, bool __pred_of_before_last = false) {
+  _Temporary_buffer<_ForwardIter, _Tp> __buf(__first, __last);
+  _STLP_MPWFIX_TRY    //*TY 06/01/2000 - they forget to call dtor for _Temporary_buffer if no try/catch block is present
+  return (__buf.size() > 0) ?
+    __stable_partition_adaptive(__first, __last, __pred,
+                                _Distance(__buf.requested_size()),
+                                __buf.begin(), __buf.size(),
+                                false, __pred_of_before_last)  :
+    __inplace_stable_partition(__first, __last, __pred,
+                               _Distance(__buf.requested_size()),
+                               false, __pred_of_before_last);
+  _STLP_MPWFIX_CATCH  //*TY 06/01/2000 - they forget to call dtor for _Temporary_buffer if no try/catch block is present
+}
+
+template <class _ForwardIter, class _Predicate>
+_ForwardIter
+__stable_partition_aux(_ForwardIter __first, _ForwardIter __last, _Predicate __pred,
+                       const forward_iterator_tag &) {
+  return __stable_partition_aux_aux(__first, __last, __pred,
+                                    _STLP_VALUE_TYPE(__first, _ForwardIter),
+                                    _STLP_DISTANCE_TYPE(__first, _ForwardIter));
+}
+
+template <class _BidirectIter, class _Predicate>
+_BidirectIter
+__stable_partition_aux(_BidirectIter __first, _BidirectIter __last, _Predicate __pred,
+                       const bidirectional_iterator_tag &) {
+  for (--__last;;) {
+    if (__first == __last)
+      return __first;
+    else if (!__pred(*__last))
+      --__last;
+    else
+      break;
+  }
+  ++__last;
+  //Here we know that __pred(*--__last) is true
+  return __stable_partition_aux_aux(__first, __last, __pred,
+                                    _STLP_VALUE_TYPE(__first, _BidirectIter),
+                                    _STLP_DISTANCE_TYPE(__first, _BidirectIter), true);
+}
+
+#if defined (_STLP_NONTEMPL_BASE_MATCH_BUG)
+template <class _BidirectIter, class _Predicate>
+_BidirectIter
+__stable_partition_aux(_BidirectIter __first, _BidirectIter __last, _Predicate __pred,
+                       const random_access_iterator_tag &) {
+  return __stable_partition_aux(__first, __last, __pred, bidirectional_iterator_tag());
+}
+#endif
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+template <class _ForwardIter, class _Predicate>
+_ForwardIter
+stable_partition(_ForwardIter __first, _ForwardIter __last, _Predicate __pred) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  for (;;) {
+    if (__first == __last)
+      return __first;
+    else if (__pred(*__first))
+      ++__first;
+    else
+      break;
+  }
+  return _STLP_PRIV __stable_partition_aux(__first, __last, __pred,
+                                           _STLP_ITERATOR_CATEGORY(__first, _ForwardIter));
+}
+
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _RandomAccessIter, class _Tp, class _Compare>
+_RandomAccessIter __unguarded_partition(_RandomAccessIter __first,
+                                        _RandomAccessIter __last,
+                                        _Tp __pivot, _Compare __comp) {
+  for (;;) {
+    while (__comp(*__first, __pivot)) {
+      _STLP_VERBOSE_ASSERT(!__comp(__pivot, *__first), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
+      ++__first;
+    }
+    --__last;
+    while (__comp(__pivot, *__last)) {
+      _STLP_VERBOSE_ASSERT(!__comp(*__last, __pivot), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
+      --__last;
+    }
+    if (!(__first < __last))
+      return __first;
+    iter_swap(__first, __last);
+    ++__first;
+  }
+}
+
+// sort() and its auxiliary functions.
+#define __stl_threshold  16
+
+template <class _RandomAccessIter, class _Tp, class _Compare>
+void __unguarded_linear_insert(_RandomAccessIter __last, _Tp __val,
+                               _Compare __comp) {
+  _RandomAccessIter __next = __last;
+  --__next;
+  while (__comp(__val, *__next)) {
+    _STLP_VERBOSE_ASSERT(!__comp(*__next, __val), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
+    *__last = *__next;
+    __last = __next;
+    --__next;
+  }
+  *__last = __val;
+}
+
+template <class _RandomAccessIter, class _Tp, class _Compare>
+inline void __linear_insert(_RandomAccessIter __first,
+                            _RandomAccessIter __last, _Tp __val, _Compare __comp) {
+  //*TY 12/26/1998 - added __val as a paramter
+  //  _Tp __val = *__last;        //*TY 12/26/1998 - __val supplied by caller
+  if (__comp(__val, *__first)) {
+    _STLP_VERBOSE_ASSERT(!__comp(*__first, __val), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
+    copy_backward(__first, __last, __last + 1);
+    *__first = __val;
+  }
+  else
+    __unguarded_linear_insert(__last, __val, __comp);
+}
+
+template <class _RandomAccessIter, class _Tp, class _Compare>
+void __insertion_sort(_RandomAccessIter __first,
+                      _RandomAccessIter __last,
+                      _Tp *, _Compare __comp) {
+  if (__first == __last) return;
+  for (_RandomAccessIter __i = __first + 1; __i != __last; ++__i)
+    __linear_insert<_RandomAccessIter, _Tp, _Compare>(__first, __i, *__i, __comp);  //*TY 12/26/1998 - supply *__i as __val
+}
+
+template <class _RandomAccessIter, class _Tp, class _Compare>
+void __unguarded_insertion_sort_aux(_RandomAccessIter __first,
+                                    _RandomAccessIter __last,
+                                    _Tp*, _Compare __comp) {
+  for (_RandomAccessIter __i = __first; __i != __last; ++__i)
+    __unguarded_linear_insert<_RandomAccessIter, _Tp, _Compare>(__i, *__i, __comp);
+}
+
+template <class _RandomAccessIter, class _Compare>
+inline void __unguarded_insertion_sort(_RandomAccessIter __first,
+                                       _RandomAccessIter __last,
+                                       _Compare __comp) {
+  __unguarded_insertion_sort_aux(__first, __last, _STLP_VALUE_TYPE(__first, _RandomAccessIter), __comp);
+}
+
+template <class _RandomAccessIter, class _Compare>
+void __final_insertion_sort(_RandomAccessIter __first,
+                            _RandomAccessIter __last, _Compare __comp) {
+  if (__last - __first > __stl_threshold) {
+    __insertion_sort(__first, __first + __stl_threshold, _STLP_VALUE_TYPE(__first,_RandomAccessIter), __comp);
+    __unguarded_insertion_sort(__first + __stl_threshold, __last, __comp);
+  }
+  else
+    __insertion_sort(__first, __last, _STLP_VALUE_TYPE(__first,_RandomAccessIter), __comp);
+}
+
+template <class _RandomAccessIter, class _Tp, class _Size, class _Compare>
+void __introsort_loop(_RandomAccessIter __first,
+                      _RandomAccessIter __last, _Tp*,
+                      _Size __depth_limit, _Compare __comp) {
+  while (__last - __first > __stl_threshold) {
+    if (__depth_limit == 0) {
+      partial_sort(__first, __last, __last, __comp);
+      return;
+    }
+    --__depth_limit;
+    _RandomAccessIter __cut =
+      __unguarded_partition(__first, __last,
+                            _Tp(__median(*__first,
+                                         *(__first + (__last - __first)/2),
+                                         *(__last - 1), __comp)),
+       __comp);
+    __introsort_loop(__cut, __last, (_Tp*) 0, __depth_limit, __comp);
+    __last = __cut;
+  }
+}
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+template <class _RandomAccessIter>
+void sort(_RandomAccessIter __first, _RandomAccessIter __last) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  if (__first != __last) {
+    _STLP_PRIV __introsort_loop(__first, __last,
+                                _STLP_VALUE_TYPE(__first, _RandomAccessIter),
+                                _STLP_PRIV __lg(__last - __first) * 2,
+                                _STLP_PRIV __less(_STLP_VALUE_TYPE(__first, _RandomAccessIter)));
+    _STLP_PRIV __final_insertion_sort(__first, __last,
+                                      _STLP_PRIV __less(_STLP_VALUE_TYPE(__first, _RandomAccessIter)));
+  }
+}
+
+template <class _RandomAccessIter, class _Compare>
+void sort(_RandomAccessIter __first, _RandomAccessIter __last, _Compare __comp) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  if (__first != __last) {
+    _STLP_PRIV __introsort_loop(__first, __last,
+                                _STLP_VALUE_TYPE(__first, _RandomAccessIter),
+                                _STLP_PRIV __lg(__last - __first) * 2, __comp);
+    _STLP_PRIV __final_insertion_sort(__first, __last, __comp);
+  }
+}
+
+// stable_sort() and its auxiliary functions.
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _RandomAccessIter, class _Compare>
+void __inplace_stable_sort(_RandomAccessIter __first,
+                           _RandomAccessIter __last, _Compare __comp) {
+  if (__last - __first < 15) {
+    __insertion_sort(__first, __last, _STLP_VALUE_TYPE(__first,_RandomAccessIter), __comp);
+    return;
+  }
+  _RandomAccessIter __middle = __first + (__last - __first) / 2;
+  __inplace_stable_sort(__first, __middle, __comp);
+  __inplace_stable_sort(__middle, __last, __comp);
+  __merge_without_buffer(__first, __middle, __last,
+                         __middle - __first,
+                         __last - __middle,
+                         __comp);
+}
+
+template <class _RandomAccessIter1, class _RandomAccessIter2,
+          class _Distance, class _Compare>
+void __merge_sort_loop(_RandomAccessIter1 __first,
+                       _RandomAccessIter1 __last,
+                       _RandomAccessIter2 __result, _Distance __step_size,
+                       _Compare __comp) {
+  _Distance __two_step = 2 * __step_size;
+
+  while (__last - __first >= __two_step) {
+    __result = merge(__first, __first + __step_size,
+                     __first + __step_size, __first + __two_step,
+                     __result,
+                     __comp);
+    __first += __two_step;
+  }
+  __step_size = (min) (_Distance(__last - __first), __step_size);
+
+  merge(__first, __first + __step_size,
+        __first + __step_size, __last,
+        __result,
+        __comp);
+}
+
+const int __stl_chunk_size = 7;
+
+template <class _RandomAccessIter, class _Distance, class _Compare>
+void __chunk_insertion_sort(_RandomAccessIter __first,
+                            _RandomAccessIter __last,
+                            _Distance __chunk_size, _Compare __comp) {
+  while (__last - __first >= __chunk_size) {
+    __insertion_sort(__first, __first + __chunk_size,
+                     _STLP_VALUE_TYPE(__first,_RandomAccessIter), __comp);
+    __first += __chunk_size;
+  }
+  __insertion_sort(__first, __last, _STLP_VALUE_TYPE(__first,_RandomAccessIter), __comp);
+}
+
+template <class _RandomAccessIter, class _Pointer, class _Distance,
+          class _Compare>
+void __merge_sort_with_buffer(_RandomAccessIter __first,
+                              _RandomAccessIter __last, _Pointer __buffer,
+                              _Distance*, _Compare __comp) {
+  _Distance __len = __last - __first;
+  _Pointer __buffer_last = __buffer + __len;
+
+  _Distance __step_size = __stl_chunk_size;
+  __chunk_insertion_sort(__first, __last, __step_size, __comp);
+
+  while (__step_size < __len) {
+    __merge_sort_loop(__first, __last, __buffer, __step_size, __comp);
+    __step_size *= 2;
+    __merge_sort_loop(__buffer, __buffer_last, __first, __step_size, __comp);
+    __step_size *= 2;
+  }
+}
+
+template <class _BidirectionalIter1, class _BidirectionalIter2,
+          class _Distance>
+_BidirectionalIter1 __rotate_adaptive(_BidirectionalIter1 __first,
+                                      _BidirectionalIter1 __middle,
+                                      _BidirectionalIter1 __last,
+                                      _Distance __len1, _Distance __len2,
+                                      _BidirectionalIter2 __buffer,
+                                      _Distance __buffer_size) {
+  if (__len1 > __len2 && __len2 <= __buffer_size) {
+    _BidirectionalIter2 __buffer_end = copy(__middle, __last, __buffer);
+    copy_backward(__first, __middle, __last);
+    return copy(__buffer, __buffer_end, __first);
+  }
+  else if (__len1 <= __buffer_size) {
+    _BidirectionalIter2 __buffer_end = copy(__first, __middle, __buffer);
+    copy(__middle, __last, __first);
+    return copy_backward(__buffer, __buffer_end, __last);
+  }
+  else
+    return __rotate(__first, __middle, __last);
+}
+
+template <class _BidirectionalIter, class _Distance, class _Pointer,
+          class _Compare>
+void __merge_adaptive(_BidirectionalIter __first,
+                      _BidirectionalIter __middle,
+                      _BidirectionalIter __last,
+                      _Distance __len1, _Distance __len2,
+                      _Pointer __buffer, _Distance __buffer_size,
+                      _Compare __comp) {
+  if (__len1 <= __len2 && __len1 <= __buffer_size) {
+    _Pointer __buffer_end = copy(__first, __middle, __buffer);
+    merge(__buffer, __buffer_end, __middle, __last, __first, __comp);
+  }
+  else if (__len2 <= __buffer_size) {
+    _Pointer __buffer_end = copy(__middle, __last, __buffer);
+    __merge_backward(__first, __middle, __buffer, __buffer_end, __last,
+                     __comp);
+  }
+  else {
+    _BidirectionalIter __first_cut = __first;
+    _BidirectionalIter __second_cut = __middle;
+    _Distance __len11 = 0;
+    _Distance __len22 = 0;
+    if (__len1 > __len2) {
+      __len11 = __len1 / 2;
+      advance(__first_cut, __len11);
+      __second_cut = lower_bound(__middle, __last, *__first_cut, __comp);
+      __len22 += distance(__middle, __second_cut);
+    }
+    else {
+      __len22 = __len2 / 2;
+      advance(__second_cut, __len22);
+      __first_cut = upper_bound(__first, __middle, *__second_cut, __comp);
+      __len11 += distance(__first, __first_cut);
+    }
+    _BidirectionalIter __new_middle =
+      __rotate_adaptive(__first_cut, __middle, __second_cut, __len1 - __len11,
+                        __len22, __buffer, __buffer_size);
+    __merge_adaptive(__first, __first_cut, __new_middle, __len11,
+                     __len22, __buffer, __buffer_size, __comp);
+    __merge_adaptive(__new_middle, __second_cut, __last, __len1 - __len11,
+                     __len2 - __len22, __buffer, __buffer_size, __comp);
+  }
+}
+
+template <class _RandomAccessIter, class _Pointer, class _Distance,
+          class _Compare>
+void __stable_sort_adaptive(_RandomAccessIter __first,
+                            _RandomAccessIter __last, _Pointer __buffer,
+                            _Distance __buffer_size, _Compare __comp) {
+  _Distance __len = (__last - __first + 1) / 2;
+  _RandomAccessIter __middle = __first + __len;
+  if (__len > __buffer_size) {
+    __stable_sort_adaptive(__first, __middle, __buffer, __buffer_size,
+                           __comp);
+    __stable_sort_adaptive(__middle, __last, __buffer, __buffer_size,
+                           __comp);
+  }
+  else {
+    __merge_sort_with_buffer(__first, __middle, __buffer, (_Distance*)0,
+                               __comp);
+    __merge_sort_with_buffer(__middle, __last, __buffer, (_Distance*)0,
+                               __comp);
+  }
+  __merge_adaptive(__first, __middle, __last, _Distance(__middle - __first),
+                   _Distance(__last - __middle), __buffer, __buffer_size,
+                   __comp);
+}
+
+template <class _RandomAccessIter, class _Tp, class _Distance, class _Compare>
+void __stable_sort_aux(_RandomAccessIter __first,
+                       _RandomAccessIter __last, _Tp*, _Distance*,
+                       _Compare __comp) {
+  _Temporary_buffer<_RandomAccessIter, _Tp> buf(__first, __last);
+  if (buf.begin() == 0)
+    __inplace_stable_sort(__first, __last, __comp);
+  else
+    __stable_sort_adaptive(__first, __last, buf.begin(),
+                           _Distance(buf.size()),
+                           __comp);
+}
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+template <class _RandomAccessIter>
+void stable_sort(_RandomAccessIter __first,
+                 _RandomAccessIter __last) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  _STLP_PRIV __stable_sort_aux(__first, __last,
+                               _STLP_VALUE_TYPE(__first, _RandomAccessIter),
+                               _STLP_DISTANCE_TYPE(__first, _RandomAccessIter),
+                               _STLP_PRIV __less(_STLP_VALUE_TYPE(__first, _RandomAccessIter)));
+}
+
+template <class _RandomAccessIter, class _Compare>
+void stable_sort(_RandomAccessIter __first,
+                 _RandomAccessIter __last, _Compare __comp) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  _STLP_PRIV __stable_sort_aux(__first, __last,
+                               _STLP_VALUE_TYPE(__first, _RandomAccessIter),
+                               _STLP_DISTANCE_TYPE(__first, _RandomAccessIter),
+                               __comp);
+}
+
+// partial_sort, partial_sort_copy, and auxiliary functions.
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _RandomAccessIter, class _Tp, class _Compare>
+void __partial_sort(_RandomAccessIter __first, _RandomAccessIter __middle,
+                    _RandomAccessIter __last, _Tp*, _Compare __comp) {
+  make_heap(__first, __middle, __comp);
+  for (_RandomAccessIter __i = __middle; __i < __last; ++__i) {
+    if (__comp(*__i, *__first)) {
+      _STLP_VERBOSE_ASSERT(!__comp(*__first, *__i), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
+      __pop_heap(__first, __middle, __i, _Tp(*__i), __comp,
+                 _STLP_DISTANCE_TYPE(__first, _RandomAccessIter));
+    }
+  }
+  sort_heap(__first, __middle, __comp);
+}
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+template <class _RandomAccessIter>
+void partial_sort(_RandomAccessIter __first,_RandomAccessIter __middle,
+                  _RandomAccessIter __last) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __middle))
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__middle, __last))
+  _STLP_PRIV __partial_sort(__first, __middle, __last, _STLP_VALUE_TYPE(__first, _RandomAccessIter),
+                            _STLP_PRIV __less(_STLP_VALUE_TYPE(__first, _RandomAccessIter)));
+}
+
+template <class _RandomAccessIter, class _Compare>
+void partial_sort(_RandomAccessIter __first,_RandomAccessIter __middle,
+                  _RandomAccessIter __last, _Compare __comp) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __middle))
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__middle, __last))
+  _STLP_PRIV __partial_sort(__first, __middle, __last, _STLP_VALUE_TYPE(__first, _RandomAccessIter), __comp);
+}
+
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _InputIter, class _RandomAccessIter, class _Compare,
+          class _Distance, class _Tp>
+_RandomAccessIter __partial_sort_copy(_InputIter __first,
+                                      _InputIter __last,
+                                      _RandomAccessIter __result_first,
+                                      _RandomAccessIter __result_last,
+                                      _Compare __comp, _Distance*, _Tp*) {
+  if (__result_first == __result_last) return __result_last;
+  _RandomAccessIter __result_real_last = __result_first;
+  while(__first != __last && __result_real_last != __result_last) {
+    *__result_real_last = *__first;
+    ++__result_real_last;
+    ++__first;
+  }
+  make_heap(__result_first, __result_real_last, __comp);
+  while (__first != __last) {
+    if (__comp(*__first, *__result_first)) {
+      _STLP_VERBOSE_ASSERT(!__comp(*__result_first, *__first), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
+      __adjust_heap(__result_first, _Distance(0),
+                    _Distance(__result_real_last - __result_first),
+                    _Tp(*__first),
+                    __comp);
+    }
+    ++__first;
+  }
+  sort_heap(__result_first, __result_real_last, __comp);
+  return __result_real_last;
+}
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+template <class _InputIter, class _RandomAccessIter>
+_RandomAccessIter
+partial_sort_copy(_InputIter __first, _InputIter __last,
+                  _RandomAccessIter __result_first, _RandomAccessIter __result_last) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__result_first, __result_last))
+  return _STLP_PRIV __partial_sort_copy(__first, __last, __result_first, __result_last,
+                                        _STLP_PRIV __less(_STLP_VALUE_TYPE(__first, _InputIter)),
+                                        _STLP_DISTANCE_TYPE(__result_first, _RandomAccessIter),
+                                        _STLP_VALUE_TYPE(__first, _InputIter));
+}
+
+template <class _InputIter, class _RandomAccessIter, class _Compare>
+_RandomAccessIter
+partial_sort_copy(_InputIter __first, _InputIter __last,
+                  _RandomAccessIter __result_first,
+                  _RandomAccessIter __result_last, _Compare __comp) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__result_first, __result_last))
+  return _STLP_PRIV __partial_sort_copy(__first, __last, __result_first, __result_last,
+                                        __comp,
+                                        _STLP_DISTANCE_TYPE(__result_first, _RandomAccessIter),
+                                        _STLP_VALUE_TYPE(__first, _InputIter));
+}
+
+// nth_element() and its auxiliary functions.
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _RandomAccessIter, class _Tp, class _Compare>
+void __nth_element(_RandomAccessIter __first, _RandomAccessIter __nth,
+                   _RandomAccessIter __last, _Tp*, _Compare __comp) {
+  while (__last - __first > 3) {
+    _RandomAccessIter __cut =
+      __unguarded_partition(__first, __last,
+                            _Tp(__median(*__first,
+                                         *(__first + (__last - __first)/2),
+                                         *(__last - 1),
+                                         __comp)),
+                            __comp);
+    if (__cut <= __nth)
+      __first = __cut;
+    else
+      __last = __cut;
+  }
+  __insertion_sort(__first, __last, _STLP_VALUE_TYPE(__first,_RandomAccessIter), __comp);
+}
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+template <class _RandomAccessIter>
+void nth_element(_RandomAccessIter __first, _RandomAccessIter __nth,
+                 _RandomAccessIter __last) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __nth))
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__nth, __last))
+  _STLP_PRIV __nth_element(__first, __nth, __last, _STLP_VALUE_TYPE(__first, _RandomAccessIter),
+                           _STLP_PRIV __less(_STLP_VALUE_TYPE(__first, _RandomAccessIter)));
+}
+
+template <class _RandomAccessIter, class _Compare>
+void nth_element(_RandomAccessIter __first, _RandomAccessIter __nth,
+                 _RandomAccessIter __last, _Compare __comp) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __nth))
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__nth, __last))
+  _STLP_PRIV __nth_element(__first, __nth, __last, _STLP_VALUE_TYPE(__first, _RandomAccessIter), __comp);
+}
+
+// Binary search (lower_bound, upper_bound, equal_range, binary_search).
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _ForwardIter, class _Tp,
+          class _Compare1, class _Compare2, class _Distance>
+_ForwardIter __upper_bound(_ForwardIter __first, _ForwardIter __last, const _Tp& __val,
+                           _Compare1 __comp1, _Compare2 __comp2, _Distance*) {
+  _Distance __len = distance(__first, __last);
+  _Distance __half;
+
+  while (__len > 0) {
+    __half = __len >> 1;
+    _ForwardIter __middle = __first;
+    advance(__middle, __half);
+    if (__comp2(__val, *__middle)) {
+      _STLP_VERBOSE_ASSERT(!__comp1(*__middle, __val), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
+      __len = __half;
+    }
+    else {
+      __first = __middle;
+      ++__first;
+      __len = __len - __half - 1;
+    }
+  }
+  return __first;
+}
+
+template <class _ForwardIter, class _Tp,
+          class _Compare1, class _Compare2, class _Distance>
+pair<_ForwardIter, _ForwardIter>
+__equal_range(_ForwardIter __first, _ForwardIter __last, const _Tp& __val,
+              _Compare1 __comp1, _Compare2 __comp2, _Distance* __dist) {
+  _Distance __len = distance(__first, __last);
+  _Distance __half;
+
+  while (__len > 0) {
+    __half = __len >> 1;
+    _ForwardIter __middle = __first;
+    advance(__middle, __half);
+    if (__comp1(*__middle, __val)) {
+      _STLP_VERBOSE_ASSERT(!__comp2(__val, *__middle), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
+      __first = __middle;
+      ++__first;
+      __len = __len - __half - 1;
+    }
+    else if (__comp2(__val, *__middle)) {
+      _STLP_VERBOSE_ASSERT(!__comp1(*__middle, __val), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
+      __len = __half;
+    }
+    else {
+      _ForwardIter __left = __lower_bound(__first, __middle, __val, __comp1, __comp2, __dist);
+      //Small optim: If lower_bound haven't found an equivalent value
+      //there is no need to call upper_bound.
+      if (__comp1(*__left, __val)) {
+        _STLP_VERBOSE_ASSERT(!__comp2(__val, *__left), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
+        return pair<_ForwardIter, _ForwardIter>(__left, __left);
+      }
+      advance(__first, __len);
+      _ForwardIter __right = __upper_bound(++__middle, __first, __val, __comp1, __comp2, __dist);
+      return pair<_ForwardIter, _ForwardIter>(__left, __right);
+    }
+  }
+  return pair<_ForwardIter, _ForwardIter>(__first, __first);
+}
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+template <class _InputIter1, class _InputIter2, class _OutputIter>
+_OutputIter merge(_InputIter1 __first1, _InputIter1 __last1,
+                  _InputIter2 __first2, _InputIter2 __last2,
+                  _OutputIter __result) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first1, __last1))
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first2, __last2))
+  while (__first1 != __last1 && __first2 != __last2) {
+    if (*__first2 < *__first1) {
+      *__result = *__first2;
+      ++__first2;
+    }
+    else {
+      *__result = *__first1;
+      ++__first1;
+    }
+    ++__result;
+  }
+  return copy(__first2, __last2, copy(__first1, __last1, __result));
+}
+
+template <class _InputIter1, class _InputIter2, class _OutputIter,
+          class _Compare>
+_OutputIter merge(_InputIter1 __first1, _InputIter1 __last1,
+                  _InputIter2 __first2, _InputIter2 __last2,
+                  _OutputIter __result, _Compare __comp) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first1, __last1))
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first2, __last2))
+  while (__first1 != __last1 && __first2 != __last2) {
+    if (__comp(*__first2, *__first1)) {
+      _STLP_VERBOSE_ASSERT(!__comp(*__first1, *__first2), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
+      *__result = *__first2;
+      ++__first2;
+    }
+    else {
+      *__result = *__first1;
+      ++__first1;
+    }
+    ++__result;
+  }
+  return copy(__first2, __last2, copy(__first1, __last1, __result));
+}
+
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _BidirectionalIter, class _Distance, class _Compare>
+void __merge_without_buffer(_BidirectionalIter __first,
+                            _BidirectionalIter __middle,
+                            _BidirectionalIter __last,
+                            _Distance __len1, _Distance __len2,
+                            _Compare __comp) {
+  if (__len1 == 0 || __len2 == 0)
+    return;
+  if (__len1 + __len2 == 2) {
+    if (__comp(*__middle, *__first)) {
+      _STLP_VERBOSE_ASSERT(!__comp(*__first, *__middle), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
+      iter_swap(__first, __middle);
+    }
+    return;
+  }
+  _BidirectionalIter __first_cut = __first;
+  _BidirectionalIter __second_cut = __middle;
+  _Distance __len11 = 0;
+  _Distance __len22 = 0;
+  if (__len1 > __len2) {
+    __len11 = __len1 / 2;
+    advance(__first_cut, __len11);
+    __second_cut = lower_bound(__middle, __last, *__first_cut, __comp);
+    __len22 += distance(__middle, __second_cut);
+  }
+  else {
+    __len22 = __len2 / 2;
+    advance(__second_cut, __len22);
+    __first_cut = upper_bound(__first, __middle, *__second_cut, __comp);
+    __len11 +=distance(__first, __first_cut);
+  }
+  _BidirectionalIter __new_middle
+    = __rotate(__first_cut, __middle, __second_cut);
+  __merge_without_buffer(__first, __first_cut, __new_middle, __len11, __len22,
+                         __comp);
+  __merge_without_buffer(__new_middle, __second_cut, __last, __len1 - __len11,
+                         __len2 - __len22, __comp);
+}
+
+template <class _BidirectionalIter1, class _BidirectionalIter2,
+          class _BidirectionalIter3, class _Compare>
+_BidirectionalIter3 __merge_backward(_BidirectionalIter1 __first1,
+                                     _BidirectionalIter1 __last1,
+                                     _BidirectionalIter2 __first2,
+                                     _BidirectionalIter2 __last2,
+                                     _BidirectionalIter3 __result,
+                                     _Compare __comp) {
+  if (__first1 == __last1)
+    return copy_backward(__first2, __last2, __result);
+  if (__first2 == __last2)
+    return copy_backward(__first1, __last1, __result);
+  --__last1;
+  --__last2;
+  for (;;) {
+    if (__comp(*__last2, *__last1)) {
+      _STLP_VERBOSE_ASSERT(!__comp(*__last1, *__last2), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
+      *--__result = *__last1;
+      if (__first1 == __last1)
+        return copy_backward(__first2, ++__last2, __result);
+      --__last1;
+    }
+    else {
+      *--__result = *__last2;
+      if (__first2 == __last2)
+        return copy_backward(__first1, ++__last1, __result);
+      --__last2;
+    }
+  }
+}
+
+template <class _BidirectionalIter, class _Tp,
+          class _Distance, class _Compare>
+inline void __inplace_merge_aux(_BidirectionalIter __first,
+                                _BidirectionalIter __middle,
+                                _BidirectionalIter __last, _Tp*, _Distance*,
+                                _Compare __comp) {
+  _Distance __len1 = distance(__first, __middle);
+  _Distance __len2 = distance(__middle, __last);
+
+  _Temporary_buffer<_BidirectionalIter, _Tp> __buf(__first, __last);
+  if (__buf.begin() == 0)
+    __merge_without_buffer(__first, __middle, __last, __len1, __len2, __comp);
+  else
+    __merge_adaptive(__first, __middle, __last, __len1, __len2,
+                     __buf.begin(), _Distance(__buf.size()),
+                     __comp);
+}
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+template <class _BidirectionalIter>
+void inplace_merge(_BidirectionalIter __first,
+                   _BidirectionalIter __middle,
+                   _BidirectionalIter __last) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __middle))
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__middle, __last))
+  if (__first == __middle || __middle == __last)
+    return;
+  _STLP_PRIV __inplace_merge_aux(__first, __middle, __last,
+                                 _STLP_VALUE_TYPE(__first, _BidirectionalIter), _STLP_DISTANCE_TYPE(__first, _BidirectionalIter),
+                                 _STLP_PRIV __less(_STLP_VALUE_TYPE(__first, _BidirectionalIter)));
+}
+
+template <class _BidirectionalIter, class _Compare>
+void inplace_merge(_BidirectionalIter __first,
+                   _BidirectionalIter __middle,
+                   _BidirectionalIter __last, _Compare __comp) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __middle))
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__middle, __last))
+  if (__first == __middle || __middle == __last)
+    return;
+  _STLP_PRIV __inplace_merge_aux(__first, __middle, __last,
+                                 _STLP_VALUE_TYPE(__first, _BidirectionalIter), _STLP_DISTANCE_TYPE(__first, _BidirectionalIter),
+                                 __comp);
+}
+
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _InputIter1, class _InputIter2, class _Compare>
+bool __includes(_InputIter1 __first1, _InputIter1 __last1,
+                _InputIter2 __first2, _InputIter2 __last2, _Compare __comp) {
+  _STLP_DEBUG_CHECK(__check_range(__first1, __last1))
+  _STLP_DEBUG_CHECK(__check_range(__first2, __last2))
+  while (__first1 != __last1 && __first2 != __last2)
+    if (__comp(*__first2, *__first1)) {
+      _STLP_VERBOSE_ASSERT(!__comp(*__first1, *__first2), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
+      return false;
+    }
+    else if (__comp(*__first1, *__first2))
+      ++__first1;
+    else
+      ++__first1, ++__first2;
+
+  return __first2 == __last2;
+}
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+template <class _InputIter1, class _InputIter2, class _Compare>
+bool includes(_InputIter1 __first1, _InputIter1 __last1,
+              _InputIter2 __first2, _InputIter2 __last2, _Compare __comp) {
+  return _STLP_PRIV __includes(__first1, __last1, __first2, __last2, __comp);
+}
+
+template <class _InputIter1, class _InputIter2>
+bool includes(_InputIter1 __first1, _InputIter1 __last1,
+              _InputIter2 __first2, _InputIter2 __last2) {
+  return _STLP_PRIV __includes(__first1, __last1, __first2, __last2,
+                               _STLP_PRIV __less(_STLP_VALUE_TYPE(__first1, _InputIter1)));
+}
+
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _InputIter1, class _InputIter2, class _OutputIter,
+          class _Compare>
+_OutputIter __set_union(_InputIter1 __first1, _InputIter1 __last1,
+                        _InputIter2 __first2, _InputIter2 __last2,
+                        _OutputIter __result, _Compare __comp) {
+  _STLP_DEBUG_CHECK(__check_range(__first1, __last1))
+  _STLP_DEBUG_CHECK(__check_range(__first2, __last2))
+  while (__first1 != __last1 && __first2 != __last2) {
+    if (__comp(*__first1, *__first2)) {
+      _STLP_VERBOSE_ASSERT(!__comp(*__first2, *__first1), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
+      *__result = *__first1;
+      ++__first1;
+    }
+    else if (__comp(*__first2, *__first1)) {
+      _STLP_VERBOSE_ASSERT(!__comp(*__first1, *__first2), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
+      *__result = *__first2;
+      ++__first2;
+    }
+    else {
+      *__result = *__first1;
+      ++__first1;
+      ++__first2;
+    }
+    ++__result;
+  }
+  return copy(__first2, __last2, copy(__first1, __last1, __result));
+}
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+template <class _InputIter1, class _InputIter2, class _OutputIter>
+_OutputIter set_union(_InputIter1 __first1, _InputIter1 __last1,
+                      _InputIter2 __first2, _InputIter2 __last2,
+                      _OutputIter __result) {
+  return _STLP_PRIV __set_union(__first1, __last1, __first2, __last2, __result,
+                                _STLP_PRIV __less(_STLP_VALUE_TYPE(__first1, _InputIter1)));
+}
+
+template <class _InputIter1, class _InputIter2, class _OutputIter,
+          class _Compare>
+_OutputIter set_union(_InputIter1 __first1, _InputIter1 __last1,
+                      _InputIter2 __first2, _InputIter2 __last2,
+                      _OutputIter __result, _Compare __comp) {
+  return _STLP_PRIV __set_union(__first1, __last1, __first2, __last2, __result, __comp);
+}
+
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _InputIter1, class _InputIter2, class _OutputIter,
+          class _Compare>
+_OutputIter __set_intersection(_InputIter1 __first1, _InputIter1 __last1,
+                               _InputIter2 __first2, _InputIter2 __last2,
+                               _OutputIter __result, _Compare __comp) {
+  _STLP_DEBUG_CHECK(__check_range(__first1, __last1))
+  _STLP_DEBUG_CHECK(__check_range(__first2, __last2))
+  while (__first1 != __last1 && __first2 != __last2)
+    if (__comp(*__first1, *__first2)) {
+      _STLP_VERBOSE_ASSERT(!__comp(*__first2, *__first1), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
+      ++__first1;
+    }
+    else if (__comp(*__first2, *__first1))
+      ++__first2;
+    else {
+      *__result = *__first1;
+      ++__first1;
+      ++__first2;
+      ++__result;
+    }
+  return __result;
+}
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+template <class _InputIter1, class _InputIter2, class _OutputIter>
+_OutputIter set_intersection(_InputIter1 __first1, _InputIter1 __last1,
+                             _InputIter2 __first2, _InputIter2 __last2,
+                             _OutputIter __result) {
+  return _STLP_PRIV __set_intersection(__first1, __last1, __first2, __last2, __result,
+                                       _STLP_PRIV __less(_STLP_VALUE_TYPE(__first1, _InputIter1)));
+}
+
+template <class _InputIter1, class _InputIter2, class _OutputIter,
+          class _Compare>
+_OutputIter set_intersection(_InputIter1 __first1, _InputIter1 __last1,
+                             _InputIter2 __first2, _InputIter2 __last2,
+                             _OutputIter __result, _Compare __comp) {
+  return _STLP_PRIV __set_intersection(__first1, __last1, __first2, __last2, __result, __comp);
+}
+
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _InputIter1, class _InputIter2, class _OutputIter,
+          class _Compare>
+_OutputIter __set_difference(_InputIter1 __first1, _InputIter1 __last1,
+                             _InputIter2 __first2, _InputIter2 __last2,
+                             _OutputIter __result, _Compare __comp) {
+  _STLP_DEBUG_CHECK(__check_range(__first1, __last1))
+  _STLP_DEBUG_CHECK(__check_range(__first2, __last2))
+  while (__first1 != __last1 && __first2 != __last2)
+    if (__comp(*__first1, *__first2)) {
+      _STLP_VERBOSE_ASSERT(!__comp(*__first2, *__first1), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
+      *__result = *__first1;
+      ++__first1;
+      ++__result;
+    }
+    else if (__comp(*__first2, *__first1))
+      ++__first2;
+    else {
+      ++__first1;
+      ++__first2;
+    }
+  return copy(__first1, __last1, __result);
+}
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+template <class _InputIter1, class _InputIter2, class _OutputIter>
+_OutputIter set_difference(_InputIter1 __first1, _InputIter1 __last1,
+                           _InputIter2 __first2, _InputIter2 __last2,
+                           _OutputIter __result) {
+  return _STLP_PRIV __set_difference(__first1, __last1, __first2, __last2, __result,
+                                     _STLP_PRIV __less(_STLP_VALUE_TYPE(__first1, _InputIter1)));
+}
+
+template <class _InputIter1, class _InputIter2, class _OutputIter,
+          class _Compare>
+_OutputIter set_difference(_InputIter1 __first1, _InputIter1 __last1,
+                           _InputIter2 __first2, _InputIter2 __last2,
+                           _OutputIter __result, _Compare __comp) {
+  return _STLP_PRIV __set_difference(__first1, __last1, __first2, __last2, __result, __comp);
+}
+
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _InputIter1, class _InputIter2, class _OutputIter, class _Compare>
+_OutputIter
+__set_symmetric_difference(_InputIter1 __first1, _InputIter1 __last1,
+                           _InputIter2 __first2, _InputIter2 __last2,
+                           _OutputIter __result, _Compare __comp) {
+  _STLP_DEBUG_CHECK(__check_range(__first1, __last1))
+  _STLP_DEBUG_CHECK(__check_range(__first2, __last2))
+  while (__first1 != __last1 && __first2 != __last2) {
+    if (__comp(*__first1, *__first2)) {
+      _STLP_VERBOSE_ASSERT(!__comp(*__first2, *__first1), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
+      *__result = *__first1;
+      ++__first1;
+      ++__result;
+    }
+    else if (__comp(*__first2, *__first1)) {
+      *__result = *__first2;
+      ++__first2;
+      ++__result;
+    }
+    else {
+      ++__first1;
+      ++__first2;
+    }
+  }
+  return copy(__first2, __last2, copy(__first1, __last1, __result));
+}
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+template <class _InputIter1, class _InputIter2, class _OutputIter>
+_OutputIter
+set_symmetric_difference(_InputIter1 __first1, _InputIter1 __last1,
+                         _InputIter2 __first2, _InputIter2 __last2,
+                         _OutputIter __result) {
+  return _STLP_PRIV __set_symmetric_difference(__first1, __last1, __first2, __last2, __result,
+                                               _STLP_PRIV __less(_STLP_VALUE_TYPE(__first1, _InputIter1)));
+}
+
+template <class _InputIter1, class _InputIter2, class _OutputIter, class _Compare>
+_OutputIter
+set_symmetric_difference(_InputIter1 __first1, _InputIter1 __last1,
+                         _InputIter2 __first2, _InputIter2 __last2,
+                         _OutputIter __result,
+                         _Compare __comp) {
+  return _STLP_PRIV __set_symmetric_difference(__first1, __last1, __first2, __last2, __result, __comp);
+}
+
+// min_element and max_element, with and without an explicitly supplied
+// comparison function.
+
+template <class _ForwardIter>
+_ForwardIter max_element(_ForwardIter __first, _ForwardIter __last) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  if (__first == __last) return __first;
+  _ForwardIter __result = __first;
+  while (++__first != __last)
+    if (*__result < *__first)
+      __result = __first;
+  return __result;
+}
+
+template <class _ForwardIter, class _Compare>
+_ForwardIter max_element(_ForwardIter __first, _ForwardIter __last,
+                         _Compare __comp) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  if (__first == __last) return __first;
+  _ForwardIter __result = __first;
+  while (++__first != __last) {
+    if (__comp(*__result, *__first)) {
+      _STLP_VERBOSE_ASSERT(!__comp(*__first, *__result), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
+      __result = __first;
+    }
+  }
+  return __result;
+}
+
+template <class _ForwardIter>
+_ForwardIter min_element(_ForwardIter __first, _ForwardIter __last) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  if (__first == __last) return __first;
+  _ForwardIter __result = __first;
+  while (++__first != __last)
+    if (*__first < *__result)
+      __result = __first;
+  return __result;
+}
+
+template <class _ForwardIter, class _Compare>
+_ForwardIter min_element(_ForwardIter __first, _ForwardIter __last,
+                         _Compare __comp) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  if (__first == __last) return __first;
+  _ForwardIter __result = __first;
+  while (++__first != __last) {
+    if (__comp(*__first, *__result)) {
+      _STLP_VERBOSE_ASSERT(!__comp(*__result, *__first), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
+      __result = __first;
+    }
+  }
+  return __result;
+}
+
+// next_permutation and prev_permutation, with and without an explicitly
+// supplied comparison function.
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _BidirectionalIter, class _Compare>
+bool __next_permutation(_BidirectionalIter __first, _BidirectionalIter __last,
+                        _Compare __comp) {
+  _STLP_DEBUG_CHECK(__check_range(__first, __last))
+  if (__first == __last)
+    return false;
+  _BidirectionalIter __i = __first;
+  ++__i;
+  if (__i == __last)
+    return false;
+  __i = __last;
+  --__i;
+
+  for(;;) {
+    _BidirectionalIter __ii = __i;
+    --__i;
+    if (__comp(*__i, *__ii)) {
+      _STLP_VERBOSE_ASSERT(!__comp(*__ii, *__i), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
+      _BidirectionalIter __j = __last;
+      while (!__comp(*__i, *--__j)) {}
+      iter_swap(__i, __j);
+      reverse(__ii, __last);
+      return true;
+    }
+    if (__i == __first) {
+      reverse(__first, __last);
+      return false;
+    }
+  }
+#if defined (_STLP_NEED_UNREACHABLE_RETURN)
+    return false;
+#endif
+}
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+template <class _BidirectionalIter>
+bool next_permutation(_BidirectionalIter __first, _BidirectionalIter __last) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  return _STLP_PRIV __next_permutation(__first, __last,
+                                       _STLP_PRIV __less(_STLP_VALUE_TYPE(__first, _BidirectionalIter)));
+}
+
+template <class _BidirectionalIter, class _Compare>
+bool next_permutation(_BidirectionalIter __first, _BidirectionalIter __last,
+                      _Compare __comp) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  return _STLP_PRIV __next_permutation(__first, __last, __comp);
+}
+
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _BidirectionalIter, class _Compare>
+bool __prev_permutation(_BidirectionalIter __first, _BidirectionalIter __last,
+                        _Compare __comp) {
+  if (__first == __last)
+    return false;
+  _BidirectionalIter __i = __first;
+  ++__i;
+  if (__i == __last)
+    return false;
+  __i = __last;
+  --__i;
+
+  for(;;) {
+    _BidirectionalIter __ii = __i;
+    --__i;
+    if (__comp(*__ii, *__i)) {
+      _STLP_VERBOSE_ASSERT(!__comp(*__i, *__ii), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
+      _BidirectionalIter __j = __last;
+      while (!__comp(*--__j, *__i)) {}
+      iter_swap(__i, __j);
+      reverse(__ii, __last);
+      return true;
+    }
+    if (__i == __first) {
+      reverse(__first, __last);
+      return false;
+    }
+  }
+#if defined (_STLP_NEED_UNREACHABLE_RETURN)
+    return false;
+#endif
+}
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+template <class _BidirectionalIter>
+bool prev_permutation(_BidirectionalIter __first, _BidirectionalIter __last) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  return _STLP_PRIV __prev_permutation(__first, __last,
+                                       _STLP_PRIV __less(_STLP_VALUE_TYPE(__first, _BidirectionalIter)));
+}
+
+template <class _BidirectionalIter, class _Compare>
+bool prev_permutation(_BidirectionalIter __first, _BidirectionalIter __last,
+                      _Compare __comp) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  return _STLP_PRIV __prev_permutation(__first, __last, __comp);
+}
+
+#if !defined (_STLP_NO_EXTENSIONS)
+
+// is_heap, a predicate testing whether or not a range is
+// a heap.  This function is an extension, not part of the C++
+// standard.
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _RandomAccessIter, class _Distance, class _StrictWeakOrdering>
+bool __is_heap(_RandomAccessIter __first, _StrictWeakOrdering __comp,
+               _Distance __n) {
+  _Distance __parent = 0;
+  for (_Distance __child = 1; __child < __n; ++__child) {
+    if (__comp(__first[__parent], __first[__child])) {
+      _STLP_VERBOSE_ASSERT(!__comp(__first[__child], __first[__parent]), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
+      return false;
+    }
+    if ((__child & 1) == 0)
+      ++__parent;
+  }
+  return true;
+}
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+template <class _RandomAccessIter>
+bool is_heap(_RandomAccessIter __first, _RandomAccessIter __last) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  return _STLP_PRIV __is_heap(__first, _STLP_PRIV __less(_STLP_VALUE_TYPE(__first, _RandomAccessIter)), __last - __first);
+}
+
+template <class _RandomAccessIter, class _StrictWeakOrdering>
+bool is_heap(_RandomAccessIter __first, _RandomAccessIter __last,
+             _StrictWeakOrdering __comp) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  return _STLP_PRIV __is_heap(__first, __comp, __last - __first);
+}
+
+
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _ForwardIter, class _StrictWeakOrdering>
+bool __is_sorted(_ForwardIter __first, _ForwardIter __last,
+                 _StrictWeakOrdering __comp) {
+  _STLP_DEBUG_CHECK(__check_range(__first, __last))
+  if (__first == __last)
+    return true;
+
+  _ForwardIter __next = __first;
+  for (++__next; __next != __last; __first = __next, ++__next) {
+    if (__comp(*__next, *__first)) {
+      _STLP_VERBOSE_ASSERT(!__comp(*__first, *__next), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
+      return false;
+    }
+  }
+
+  return true;
+}
+
+_STLP_MOVE_TO_STD_NAMESPACE
+#endif /* _STLP_NO_EXTENSIONS */
+
+_STLP_END_NAMESPACE
+
+#undef __stl_threshold
+
+#endif /* _STLP_ALGO_C */
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/stl/_algo.h b/include/c++/stl/stl/_algo.h
new file mode 100644 (file)
index 0000000..d6513fc
--- /dev/null
@@ -0,0 +1,760 @@
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Copyright (c) 1997
+ * Moscow Center for SPARC Technology
+ *
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+/* NOTE: This is an internal header file, included by other STL headers.
+ *   You should not attempt to use it directly.
+ */
+
+#ifndef _STLP_INTERNAL_ALGO_H
+#define _STLP_INTERNAL_ALGO_H
+
+#ifndef _STLP_INTERNAL_ALGOBASE_H
+#  include <stl/_algobase.h>
+#endif
+
+#ifndef _STLP_INTERNAL_HEAP_H
+#  include <stl/_heap.h>
+#endif
+
+#ifndef _STLP_INTERNAL_ITERATOR_H
+#  include <stl/_iterator.h>
+#endif
+
+#ifndef _STLP_INTERNAL_FUNCTION_BASE_H
+#  include <stl/_function_base.h>
+#endif
+
+#if defined (__SUNPRO_CC) && !defined (_STLP_INTERNAL_CSTDIO)
+// remove() conflict
+#  include <stl/_cstdio.h>
+#endif
+
+_STLP_BEGIN_NAMESPACE
+
+// for_each.  Apply a function to every element of a range.
+template <class _InputIter, class _Function>
+_STLP_INLINE_LOOP _Function
+for_each(_InputIter __first, _InputIter __last, _Function __f) {
+  for ( ; __first != __last; ++__first)
+    __f(*__first);
+  return __f;
+}
+
+// count_if
+template <class _InputIter, class _Predicate>
+_STLP_INLINE_LOOP _STLP_DIFFERENCE_TYPE(_InputIter)
+count_if(_InputIter __first, _InputIter __last, _Predicate __pred) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  _STLP_DIFFERENCE_TYPE(_InputIter) __n = 0;
+  for ( ; __first != __last; ++__first) {
+    if (__pred(*__first))
+      ++__n;
+  }
+  return __n;
+}
+
+// adjacent_find.
+
+template <class _ForwardIter, class _BinaryPredicate>
+_STLP_INLINE_LOOP _ForwardIter
+adjacent_find(_ForwardIter __first, _ForwardIter __last,
+              _BinaryPredicate __binary_pred) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  if (__first == __last)
+    return __last;
+  _ForwardIter __next = __first;
+  while(++__next != __last) {
+    if (__binary_pred(*__first, *__next))
+      return __first;
+    __first = __next;
+  }
+  return __last;
+}
+
+template <class _ForwardIter>
+_STLP_INLINE_LOOP _ForwardIter
+adjacent_find(_ForwardIter __first, _ForwardIter __last) {
+  return adjacent_find(__first, __last,
+                       _STLP_PRIV __equal_to(_STLP_VALUE_TYPE(__first, _ForwardIter)));
+}
+
+#if !defined (_STLP_NO_ANACHRONISMS)
+template <class _InputIter, class _Tp, class _Size>
+_STLP_INLINE_LOOP void
+count(_InputIter __first, _InputIter __last, const _Tp& __val, _Size& __n) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+    for ( ; __first != __last; ++__first)
+      if (*__first == __val)
+        ++__n;
+}
+
+template <class _InputIter, class _Predicate, class _Size>
+_STLP_INLINE_LOOP void
+count_if(_InputIter __first, _InputIter __last, _Predicate __pred, _Size& __n) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  for ( ; __first != __last; ++__first)
+    if (__pred(*__first))
+      ++__n;
+}
+#endif
+
+template <class _ForwardIter1, class _ForwardIter2>
+_ForwardIter1 search(_ForwardIter1 __first1, _ForwardIter1 __last1,
+                     _ForwardIter2 __first2, _ForwardIter2 __last2);
+
+// search_n.  Search for __count consecutive copies of __val.
+template <class _ForwardIter, class _Integer, class _Tp>
+_ForwardIter search_n(_ForwardIter __first, _ForwardIter __last,
+                      _Integer __count, const _Tp& __val);
+template <class _ForwardIter, class _Integer, class _Tp, class _BinaryPred>
+_ForwardIter search_n(_ForwardIter __first, _ForwardIter __last,
+                      _Integer __count, const _Tp& __val, _BinaryPred __binary_pred);
+
+template <class _InputIter, class _ForwardIter>
+inline _InputIter find_first_of(_InputIter __first1, _InputIter __last1,
+                                _ForwardIter __first2, _ForwardIter __last2) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first1, __last1))
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first2, __last2))
+  return _STLP_PRIV __find_first_of(__first1, __last1, __first2, __last2,
+                                    _STLP_PRIV __equal_to(_STLP_VALUE_TYPE(__first1, _InputIter)));
+}
+
+template <class _InputIter, class _ForwardIter, class _BinaryPredicate>
+inline _InputIter
+find_first_of(_InputIter __first1, _InputIter __last1,
+              _ForwardIter __first2, _ForwardIter __last2, _BinaryPredicate __comp) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first1, __last1))
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first2, __last2))
+  return _STLP_PRIV __find_first_of(__first1, __last1, __first2, __last2, __comp);
+}
+
+template <class _ForwardIter1, class _ForwardIter2>
+_ForwardIter1
+find_end(_ForwardIter1 __first1, _ForwardIter1 __last1,
+         _ForwardIter2 __first2, _ForwardIter2 __last2);
+
+// swap_ranges
+template <class _ForwardIter1, class _ForwardIter2>
+_STLP_INLINE_LOOP _ForwardIter2
+swap_ranges(_ForwardIter1 __first1, _ForwardIter1 __last1, _ForwardIter2 __first2) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first1, __last1))
+  for ( ; __first1 != __last1; ++__first1, ++__first2)
+    iter_swap(__first1, __first2);
+  return __first2;
+}
+
+// transform
+template <class _InputIter, class _OutputIter, class _UnaryOperation>
+_STLP_INLINE_LOOP _OutputIter
+transform(_InputIter __first, _InputIter __last, _OutputIter __result, _UnaryOperation __opr) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  for ( ; __first != __last; ++__first, ++__result)
+    *__result = __opr(*__first);
+  return __result;
+}
+template <class _InputIter1, class _InputIter2, class _OutputIter, class _BinaryOperation>
+_STLP_INLINE_LOOP _OutputIter
+transform(_InputIter1 __first1, _InputIter1 __last1,
+          _InputIter2 __first2, _OutputIter __result,_BinaryOperation __binary_op) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first1, __last1))
+  for ( ; __first1 != __last1; ++__first1, ++__first2, ++__result)
+    *__result = __binary_op(*__first1, *__first2);
+  return __result;
+}
+
+// replace_if, replace_copy, replace_copy_if
+
+template <class _ForwardIter, class _Predicate, class _Tp>
+_STLP_INLINE_LOOP void
+replace_if(_ForwardIter __first, _ForwardIter __last, _Predicate __pred, const _Tp& __new_value) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  for ( ; __first != __last; ++__first)
+    if (__pred(*__first))
+      *__first = __new_value;
+}
+
+template <class _InputIter, class _OutputIter, class _Tp>
+_STLP_INLINE_LOOP  _OutputIter
+replace_copy(_InputIter __first, _InputIter __last,_OutputIter __result,
+             const _Tp& __old_value, const _Tp& __new_value) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  for ( ; __first != __last; ++__first, ++__result)
+    *__result = *__first == __old_value ? __new_value : *__first;
+  return __result;
+}
+
+template <class _Iterator, class _OutputIter, class _Predicate, class _Tp>
+_STLP_INLINE_LOOP _OutputIter
+replace_copy_if(_Iterator __first, _Iterator __last,
+                _OutputIter __result,
+                _Predicate __pred, const _Tp& __new_value) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  for ( ; __first != __last; ++__first, ++__result)
+    *__result = __pred(*__first) ? __new_value : *__first;
+  return __result;
+}
+
+// generate and generate_n
+
+template <class _ForwardIter, class _Generator>
+_STLP_INLINE_LOOP void
+generate(_ForwardIter __first, _ForwardIter __last, _Generator __gen) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  for ( ; __first != __last; ++__first)
+    *__first = __gen();
+}
+
+template <class _OutputIter, class _Size, class _Generator>
+_STLP_INLINE_LOOP void
+generate_n(_OutputIter __first, _Size __n, _Generator __gen) {
+  for ( ; __n > 0; --__n, ++__first)
+    *__first = __gen();
+}
+
+// remove, remove_if, remove_copy, remove_copy_if
+
+template <class _InputIter, class _OutputIter, class _Tp>
+_STLP_INLINE_LOOP _OutputIter
+remove_copy(_InputIter __first, _InputIter __last,_OutputIter __result, const _Tp& __val) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  for ( ; __first != __last; ++__first) {
+    if (!(*__first == __val)) {
+      *__result = *__first;
+      ++__result;
+    }
+  }
+  return __result;
+}
+
+template <class _InputIter, class _OutputIter, class _Predicate>
+_STLP_INLINE_LOOP _OutputIter
+remove_copy_if(_InputIter __first, _InputIter __last, _OutputIter __result, _Predicate __pred) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  for ( ; __first != __last; ++__first) {
+    if (!__pred(*__first)) {
+      *__result = *__first;
+      ++__result;
+    }
+  }
+  return __result;
+}
+
+template <class _ForwardIter, class _Tp>
+_STLP_INLINE_LOOP _ForwardIter
+remove(_ForwardIter __first, _ForwardIter __last, const _Tp& __val) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  __first = find(__first, __last, __val);
+  if (__first == __last)
+    return __first;
+  else {
+    _ForwardIter __next = __first;
+    return remove_copy(++__next, __last, __first, __val);
+  }
+}
+
+template <class _ForwardIter, class _Predicate>
+_STLP_INLINE_LOOP _ForwardIter
+remove_if(_ForwardIter __first, _ForwardIter __last, _Predicate __pred) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  __first = find_if(__first, __last, __pred);
+  if ( __first == __last )
+    return __first;
+  else {
+    _ForwardIter __next = __first;
+    return remove_copy_if(++__next, __last, __first, __pred);
+  }
+}
+
+// unique and unique_copy
+template <class _InputIter, class _OutputIter>
+_OutputIter unique_copy(_InputIter __first, _InputIter __last, _OutputIter __result);
+
+template <class _InputIter, class _OutputIter, class _BinaryPredicate>
+_OutputIter unique_copy(_InputIter __first, _InputIter __last,_OutputIter __result,
+                        _BinaryPredicate __binary_pred);
+
+template <class _ForwardIter>
+inline _ForwardIter unique(_ForwardIter __first, _ForwardIter __last) {
+  __first = adjacent_find(__first, __last);
+  return unique_copy(__first, __last, __first);
+}
+
+template <class _ForwardIter, class _BinaryPredicate>
+inline _ForwardIter unique(_ForwardIter __first, _ForwardIter __last,
+                           _BinaryPredicate __binary_pred) {
+  __first = adjacent_find(__first, __last, __binary_pred);
+  return unique_copy(__first, __last, __first, __binary_pred);
+}
+
+// reverse and reverse_copy, and their auxiliary functions
+
+template <class _BidirectionalIter>
+_STLP_INLINE_LOOP void
+__reverse(_BidirectionalIter __first, _BidirectionalIter __last, const bidirectional_iterator_tag &) {
+  for (; __first != __last && __first != --__last; ++__first)
+    iter_swap(__first,__last);
+}
+
+
+template <class _RandomAccessIter>
+_STLP_INLINE_LOOP void
+__reverse(_RandomAccessIter __first, _RandomAccessIter __last, const random_access_iterator_tag &) {
+  for (; __first < __last; ++__first)
+    iter_swap(__first, --__last);
+}
+
+template <class _BidirectionalIter>
+inline void
+reverse(_BidirectionalIter __first, _BidirectionalIter __last) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  __reverse(__first, __last, _STLP_ITERATOR_CATEGORY(__first, _BidirectionalIter));
+}
+
+template <class _BidirectionalIter, class _OutputIter>
+_STLP_INLINE_LOOP
+_OutputIter reverse_copy(_BidirectionalIter __first,
+                         _BidirectionalIter __last,
+                         _OutputIter __result) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  while (__first != __last) {
+    --__last;
+    *__result = *__last;
+    ++__result;
+  }
+  return __result;
+}
+
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+// rotate and rotate_copy, and their auxiliary functions
+template <class _EuclideanRingElement>
+_STLP_INLINE_LOOP
+_EuclideanRingElement __gcd(_EuclideanRingElement __m,
+                            _EuclideanRingElement __n) {
+  while (__n != 0) {
+    _EuclideanRingElement __t = __m % __n;
+    __m = __n;
+    __n = __t;
+  }
+  return __m;
+}
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+template <class _ForwardIter>
+void rotate(_ForwardIter __first, _ForwardIter __middle, _ForwardIter __last);
+
+template <class _ForwardIter, class _OutputIter>
+inline _OutputIter rotate_copy(_ForwardIter __first, _ForwardIter __middle,
+                               _ForwardIter __last, _OutputIter __result) {
+  return copy(__first, __middle, copy(__middle, __last, __result));
+}
+
+// random_shuffle
+
+template <class _RandomAccessIter>
+void random_shuffle(_RandomAccessIter __first, _RandomAccessIter __last);
+
+template <class _RandomAccessIter, class _RandomNumberGenerator>
+void random_shuffle(_RandomAccessIter __first, _RandomAccessIter __last,
+                    _RandomNumberGenerator& __rand);
+
+#if !defined (_STLP_NO_EXTENSIONS)
+// random_sample and random_sample_n (extensions, not part of the standard).
+
+template <class _ForwardIter, class _OutputIter, class _Distance>
+_OutputIter random_sample_n(_ForwardIter __first, _ForwardIter __last,
+                            _OutputIter __out_ite, const _Distance __n);
+
+template <class _ForwardIter, class _OutputIter, class _Distance,
+          class _RandomNumberGenerator>
+_OutputIter random_sample_n(_ForwardIter __first, _ForwardIter __last,
+                            _OutputIter __out_ite, const _Distance __n,
+                            _RandomNumberGenerator& __rand);
+
+template <class _InputIter, class _RandomAccessIter>
+_RandomAccessIter
+random_sample(_InputIter __first, _InputIter __last,
+              _RandomAccessIter __out_first, _RandomAccessIter __out_last);
+
+template <class _InputIter, class _RandomAccessIter,
+          class _RandomNumberGenerator>
+_RandomAccessIter
+random_sample(_InputIter __first, _InputIter __last,
+              _RandomAccessIter __out_first, _RandomAccessIter __out_last,
+              _RandomNumberGenerator& __rand);
+
+#endif /* _STLP_NO_EXTENSIONS */
+
+// partition, stable_partition, and their auxiliary functions
+
+template <class _ForwardIter, class _Predicate>
+_ForwardIter partition(_ForwardIter __first, _ForwardIter __last, _Predicate   __pred);
+
+template <class _ForwardIter, class _Predicate>
+_ForwardIter
+stable_partition(_ForwardIter __first, _ForwardIter __last, _Predicate __pred);
+
+// sort() and its auxiliary functions.
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _Size>
+inline _Size __lg(_Size __n) {
+  _Size __k;
+  for (__k = 0; __n != 1; __n >>= 1) ++__k;
+  return __k;
+}
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+template <class _RandomAccessIter>
+void sort(_RandomAccessIter __first, _RandomAccessIter __last);
+template <class _RandomAccessIter, class _Compare>
+void sort(_RandomAccessIter __first, _RandomAccessIter __last, _Compare __comp);
+
+// stable_sort() and its auxiliary functions.
+template <class _RandomAccessIter>
+void stable_sort(_RandomAccessIter __first,
+                 _RandomAccessIter __last);
+
+template <class _RandomAccessIter, class _Compare>
+void stable_sort(_RandomAccessIter __first,
+                 _RandomAccessIter __last, _Compare __comp);
+
+// partial_sort, partial_sort_copy, and auxiliary functions.
+
+template <class _RandomAccessIter>
+void partial_sort(_RandomAccessIter __first, _RandomAccessIter __middle,
+                  _RandomAccessIter __last);
+
+template <class _RandomAccessIter, class _Compare>
+void partial_sort(_RandomAccessIter __first,_RandomAccessIter __middle,
+                  _RandomAccessIter __last, _Compare __comp);
+
+template <class _InputIter, class _RandomAccessIter>
+_RandomAccessIter
+partial_sort_copy(_InputIter __first, _InputIter __last,
+                  _RandomAccessIter __result_first, _RandomAccessIter __result_last);
+
+template <class _InputIter, class _RandomAccessIter, class _Compare>
+_RandomAccessIter
+partial_sort_copy(_InputIter __first, _InputIter __last,
+                  _RandomAccessIter __result_first,
+                  _RandomAccessIter __result_last, _Compare __comp);
+
+// nth_element() and its auxiliary functions.
+template <class _RandomAccessIter>
+void nth_element(_RandomAccessIter __first, _RandomAccessIter __nth,
+                 _RandomAccessIter __last);
+
+template <class _RandomAccessIter, class _Compare>
+void nth_element(_RandomAccessIter __first, _RandomAccessIter __nth,
+                 _RandomAccessIter __last, _Compare __comp);
+
+// auxiliary class for lower_bound, etc.
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _T1, class _T2>
+struct __less_2 {
+  bool operator() (const _T1& __x, const _T2& __y) const { return __x < __y ; }
+};
+
+template <class _T1, class _T2>
+__less_2<_T1,_T2> __less2(_T1*, _T2* ) { return __less_2<_T1, _T2>(); }
+
+#if defined (_STLP_FUNCTION_PARTIAL_ORDER)
+template <class _Tp>
+less<_Tp> __less2(_Tp*, _Tp* ) { return less<_Tp>(); }
+#endif
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+// Binary search (lower_bound, upper_bound, equal_range, binary_search).
+template <class _ForwardIter, class _Tp>
+inline _ForwardIter lower_bound(_ForwardIter __first, _ForwardIter __last,
+                                   const _Tp& __val) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  return _STLP_PRIV __lower_bound(__first, __last, __val,
+                                  _STLP_PRIV __less2(_STLP_VALUE_TYPE(__first, _ForwardIter), (_Tp*)0),
+                                  _STLP_PRIV __less2((_Tp*)0, _STLP_VALUE_TYPE(__first, _ForwardIter)),
+                                  _STLP_DISTANCE_TYPE(__first, _ForwardIter));
+}
+
+template <class _ForwardIter, class _Tp, class _Compare>
+inline _ForwardIter lower_bound(_ForwardIter __first, _ForwardIter __last,
+                                const _Tp& __val, _Compare __comp) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  return _STLP_PRIV __lower_bound(__first, __last, __val, __comp, __comp,
+                                  _STLP_DISTANCE_TYPE(__first, _ForwardIter));
+}
+
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _ForwardIter, class _Tp, class _Compare1, class _Compare2, class _Distance>
+_ForwardIter __upper_bound(_ForwardIter __first, _ForwardIter __last, const _Tp& __val,
+                           _Compare1 __comp1, _Compare2 __comp2, _Distance*);
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+template <class _ForwardIter, class _Tp>
+inline _ForwardIter upper_bound(_ForwardIter __first, _ForwardIter __last,
+                                const _Tp& __val) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  return _STLP_PRIV __upper_bound(__first, __last, __val,
+                                  _STLP_PRIV __less2(_STLP_VALUE_TYPE(__first, _ForwardIter), (_Tp*)0),
+                                  _STLP_PRIV __less2((_Tp*)0, _STLP_VALUE_TYPE(__first, _ForwardIter)),
+                                  _STLP_DISTANCE_TYPE(__first, _ForwardIter));
+}
+
+template <class _ForwardIter, class _Tp, class _Compare>
+inline _ForwardIter upper_bound(_ForwardIter __first, _ForwardIter __last,
+                                const _Tp& __val, _Compare __comp) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  return _STLP_PRIV __upper_bound(__first, __last, __val, __comp, __comp,
+                                  _STLP_DISTANCE_TYPE(__first, _ForwardIter));
+}
+
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _ForwardIter, class _Tp, class _Compare1, class _Compare2, class _Distance>
+pair<_ForwardIter, _ForwardIter>
+__equal_range(_ForwardIter __first, _ForwardIter __last, const _Tp& __val,
+              _Compare1 __comp1, _Compare2 __comp2, _Distance*);
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+template <class _ForwardIter, class _Tp>
+inline pair<_ForwardIter, _ForwardIter>
+equal_range(_ForwardIter __first, _ForwardIter __last, const _Tp& __val) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  return _STLP_PRIV __equal_range(__first, __last, __val,
+                                  _STLP_PRIV __less2(_STLP_VALUE_TYPE(__first, _ForwardIter), (_Tp*)0),
+                                  _STLP_PRIV __less2((_Tp*)0, _STLP_VALUE_TYPE(__first, _ForwardIter)),
+                                  _STLP_DISTANCE_TYPE(__first, _ForwardIter));
+}
+
+template <class _ForwardIter, class _Tp, class _Compare>
+inline pair<_ForwardIter, _ForwardIter>
+equal_range(_ForwardIter __first, _ForwardIter __last, const _Tp& __val,
+            _Compare __comp) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  return _STLP_PRIV __equal_range(__first, __last, __val, __comp, __comp,
+                                  _STLP_DISTANCE_TYPE(__first, _ForwardIter));
+}
+
+template <class _ForwardIter, class _Tp>
+inline bool binary_search(_ForwardIter __first, _ForwardIter __last,
+                   const _Tp& __val) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  _ForwardIter __i = _STLP_PRIV __lower_bound(__first, __last, __val,
+                                              _STLP_PRIV __less2(_STLP_VALUE_TYPE(__first, _ForwardIter), (_Tp*)0),
+                                              _STLP_PRIV __less2((_Tp*)0, _STLP_VALUE_TYPE(__first, _ForwardIter)),
+                                              _STLP_DISTANCE_TYPE(__first, _ForwardIter));
+  return __i != __last && !(__val < *__i);
+}
+
+template <class _ForwardIter, class _Tp, class _Compare>
+inline bool binary_search(_ForwardIter __first, _ForwardIter __last,
+                          const _Tp& __val,
+                          _Compare __comp) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  _ForwardIter __i = _STLP_PRIV __lower_bound(__first, __last, __val, __comp, __comp,
+                                              _STLP_DISTANCE_TYPE(__first, _ForwardIter));
+  return __i != __last && !__comp(__val, *__i);
+}
+
+// merge, with and without an explicitly supplied comparison function.
+
+template <class _InputIter1, class _InputIter2, class _OutputIter>
+_OutputIter merge(_InputIter1 __first1, _InputIter1 __last1,
+                  _InputIter2 __first2, _InputIter2 __last2,
+                  _OutputIter __result);
+
+template <class _InputIter1, class _InputIter2, class _OutputIter,
+          class _Compare>
+_OutputIter merge(_InputIter1 __first1, _InputIter1 __last1,
+                  _InputIter2 __first2, _InputIter2 __last2,
+                  _OutputIter __result, _Compare __comp);
+
+
+// inplace_merge and its auxiliary functions.
+
+
+template <class _BidirectionalIter>
+void inplace_merge(_BidirectionalIter __first,
+                   _BidirectionalIter __middle,
+                   _BidirectionalIter __last) ;
+
+template <class _BidirectionalIter, class _Compare>
+void inplace_merge(_BidirectionalIter __first,
+                   _BidirectionalIter __middle,
+                   _BidirectionalIter __last, _Compare __comp);
+
+// Set algorithms: includes, set_union, set_intersection, set_difference,
+// set_symmetric_difference.  All of these algorithms have the precondition
+// that their input ranges are sorted and the postcondition that their output
+// ranges are sorted.
+
+template <class _InputIter1, class _InputIter2>
+bool includes(_InputIter1 __first1, _InputIter1 __last1,
+              _InputIter2 __first2, _InputIter2 __last2);
+
+template <class _InputIter1, class _InputIter2, class _Compare>
+bool includes(_InputIter1 __first1, _InputIter1 __last1,
+              _InputIter2 __first2, _InputIter2 __last2, _Compare __comp);
+
+template <class _InputIter1, class _InputIter2, class _OutputIter>
+_OutputIter set_union(_InputIter1 __first1, _InputIter1 __last1,
+                      _InputIter2 __first2, _InputIter2 __last2,
+                      _OutputIter __result);
+
+template <class _InputIter1, class _InputIter2, class _OutputIter,
+          class _Compare>
+_OutputIter set_union(_InputIter1 __first1, _InputIter1 __last1,
+                      _InputIter2 __first2, _InputIter2 __last2,
+                      _OutputIter __result, _Compare __comp);
+
+template <class _InputIter1, class _InputIter2, class _OutputIter>
+_OutputIter set_intersection(_InputIter1 __first1, _InputIter1 __last1,
+                             _InputIter2 __first2, _InputIter2 __last2,
+                             _OutputIter __result);
+
+template <class _InputIter1, class _InputIter2, class _OutputIter,
+          class _Compare>
+_OutputIter set_intersection(_InputIter1 __first1, _InputIter1 __last1,
+                             _InputIter2 __first2, _InputIter2 __last2,
+                             _OutputIter __result, _Compare __comp);
+
+
+
+template <class _InputIter1, class _InputIter2, class _OutputIter>
+_OutputIter set_difference(_InputIter1 __first1, _InputIter1 __last1,
+                           _InputIter2 __first2, _InputIter2 __last2,
+                           _OutputIter __result);
+
+template <class _InputIter1, class _InputIter2, class _OutputIter,
+          class _Compare>
+_OutputIter set_difference(_InputIter1 __first1, _InputIter1 __last1,
+                           _InputIter2 __first2, _InputIter2 __last2,
+                           _OutputIter __result, _Compare __comp);
+
+template <class _InputIter1, class _InputIter2, class _OutputIter>
+_OutputIter
+set_symmetric_difference(_InputIter1 __first1, _InputIter1 __last1,
+                         _InputIter2 __first2, _InputIter2 __last2,
+                         _OutputIter __result);
+
+
+template <class _InputIter1, class _InputIter2, class _OutputIter,
+          class _Compare>
+_OutputIter
+set_symmetric_difference(_InputIter1 __first1, _InputIter1 __last1,
+                         _InputIter2 __first2, _InputIter2 __last2,
+                         _OutputIter __result,
+                         _Compare __comp);
+
+
+// min_element and max_element, with and without an explicitly supplied
+// comparison function.
+
+template <class _ForwardIter>
+_ForwardIter max_element(_ForwardIter __first, _ForwardIter __last);
+template <class _ForwardIter, class _Compare>
+_ForwardIter max_element(_ForwardIter __first, _ForwardIter __last,
+                            _Compare __comp);
+
+template <class _ForwardIter>
+_ForwardIter min_element(_ForwardIter __first, _ForwardIter __last);
+
+template <class _ForwardIter, class _Compare>
+_ForwardIter min_element(_ForwardIter __first, _ForwardIter __last,
+                            _Compare __comp);
+
+// next_permutation and prev_permutation, with and without an explicitly
+// supplied comparison function.
+
+template <class _BidirectionalIter>
+bool next_permutation(_BidirectionalIter __first, _BidirectionalIter __last);
+
+template <class _BidirectionalIter, class _Compare>
+bool next_permutation(_BidirectionalIter __first, _BidirectionalIter __last,
+                      _Compare __comp);
+
+
+template <class _BidirectionalIter>
+bool prev_permutation(_BidirectionalIter __first, _BidirectionalIter __last);
+
+
+template <class _BidirectionalIter, class _Compare>
+bool prev_permutation(_BidirectionalIter __first, _BidirectionalIter __last,
+                      _Compare __comp);
+
+#if !defined (_STLP_NO_EXTENSIONS)
+// is_heap, a predicate testing whether or not a range is
+// a heap.  This function is an extension, not part of the C++
+// standard.
+
+template <class _RandomAccessIter>
+bool is_heap(_RandomAccessIter __first, _RandomAccessIter __last);
+
+template <class _RandomAccessIter, class _StrictWeakOrdering>
+bool is_heap(_RandomAccessIter __first, _RandomAccessIter __last,
+             _StrictWeakOrdering __comp);
+
+// is_sorted, a predicated testing whether a range is sorted in
+// nondescending order.  This is an extension, not part of the C++
+// standard.
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _ForwardIter, class _StrictWeakOrdering>
+bool __is_sorted(_ForwardIter __first, _ForwardIter __last,
+                 _StrictWeakOrdering __comp);
+
+_STLP_MOVE_TO_STD_NAMESPACE
+template <class _ForwardIter>
+inline bool is_sorted(_ForwardIter __first, _ForwardIter __last) {
+  return _STLP_PRIV __is_sorted(__first, __last,
+                                _STLP_PRIV __less(_STLP_VALUE_TYPE(__first, _ForwardIter)));
+}
+
+template <class _ForwardIter, class _StrictWeakOrdering>
+inline bool is_sorted(_ForwardIter __first, _ForwardIter __last,
+                      _StrictWeakOrdering __comp) {
+  return _STLP_PRIV __is_sorted(__first, __last, __comp);
+}
+#endif
+
+_STLP_END_NAMESPACE
+
+#if !defined (_STLP_LINK_TIME_INSTANTIATION)
+#  include <stl/_algo.c>
+#endif
+
+#endif /* _STLP_INTERNAL_ALGO_H */
+
+// Local Variables:
+// mode:C++
+// End:
+
diff --git a/include/c++/stl/stl/_algobase.c b/include/c++/stl/stl/_algobase.c
new file mode 100644 (file)
index 0000000..8a1f657
--- /dev/null
@@ -0,0 +1,403 @@
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Copyright (c) 1997
+ * Moscow Center for SPARC Technology
+ *
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+#ifndef _STLP_ALGOBASE_C
+#define _STLP_ALGOBASE_C
+
+#ifndef _STLP_INTERNAL_ALGOBASE_H
+#  include <stl/_algobase.h>
+#endif
+
+_STLP_BEGIN_NAMESPACE
+
+template <class _InputIter1, class _InputIter2>
+bool lexicographical_compare(_InputIter1 __first1, _InputIter1 __last1,
+                             _InputIter2 __first2, _InputIter2 __last2) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first1, __last1))
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first2, __last2))
+  for ( ; __first1 != __last1 && __first2 != __last2
+        ; ++__first1, ++__first2) {
+    if (*__first1 < *__first2) {
+      return true;
+    }
+    if (*__first2 < *__first1)
+      return false;
+  }
+  return __first1 == __last1 && __first2 != __last2;
+}
+
+template <class _InputIter1, class _InputIter2, class _Compare>
+bool lexicographical_compare(_InputIter1 __first1, _InputIter1 __last1,
+                             _InputIter2 __first2, _InputIter2 __last2,
+                             _Compare __comp) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first1, __last1))
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first2, __last2))
+  for ( ; __first1 != __last1 && __first2 != __last2
+        ; ++__first1, ++__first2) {
+    if (__comp(*__first1, *__first2)) {
+      return true;
+    }
+    if (__comp(*__first2, *__first1))
+      return false;
+  }
+  return __first1 == __last1 && __first2 != __last2;
+}
+
+#if !defined (_STLP_NO_EXTENSIONS)
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _InputIter1, class _InputIter2>
+int __lexicographical_compare_3way(_InputIter1 __first1, _InputIter1 __last1,
+                                   _InputIter2 __first2, _InputIter2 __last2) {
+  while (__first1 != __last1 && __first2 != __last2) {
+    if (*__first1 < *__first2) {
+      _STLP_VERBOSE_ASSERT(!(*__first2 < *__first1), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
+      return -1;
+    }
+    if (*__first2 < *__first1)
+      return 1;
+    ++__first1;
+    ++__first2;
+  }
+  if (__first2 == __last2) {
+    return !(__first1 == __last1);
+  }
+  else {
+    return -1;
+  }
+}
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+template <class _InputIter1, class _InputIter2>
+int lexicographical_compare_3way(_InputIter1 __first1, _InputIter1 __last1,
+                                 _InputIter2 __first2, _InputIter2 __last2) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first1, __last1))
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first2, __last2))
+  return _STLP_PRIV __lexicographical_compare_3way(__first1, __last1, __first2, __last2);
+}
+#endif
+
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _RandomAccessIter, class _Tp>
+_STLP_INLINE_LOOP _RandomAccessIter __find(_RandomAccessIter __first, _RandomAccessIter __last,
+                                           const _Tp& __val,
+                                           const random_access_iterator_tag &) {
+  _STLP_DIFFERENCE_TYPE(_RandomAccessIter) __trip_count = (__last - __first) >> 2;
+
+  for ( ; __trip_count > 0 ; --__trip_count) {
+    if (*__first == __val) return __first;
+    ++__first;
+
+    if (*__first == __val) return __first;
+    ++__first;
+
+    if (*__first == __val) return __first;
+    ++__first;
+
+    if (*__first == __val) return __first;
+    ++__first;
+  }
+
+  switch (__last - __first) {
+  case 3:
+    if (*__first == __val) return __first;
+    ++__first;
+  case 2:
+    if (*__first == __val) return __first;
+    ++__first;
+  case 1:
+    if (*__first == __val) return __first;
+    //++__first;
+  case 0:
+  default:
+    return __last;
+  }
+}
+
+inline char*
+__find(char* __first, char* __last, char __val, const random_access_iterator_tag &) {
+  void *res =  memchr(__first, __val, __last - __first);
+  return res != 0 ? __STATIC_CAST(char*, res) : __last;
+}
+inline const char*
+__find(const char* __first, const char* __last, char __val, const random_access_iterator_tag &) {
+  const void *res =  memchr(__first, __val, __last - __first);
+  return res != 0 ? __STATIC_CAST(const char*, res) : __last;
+}
+
+template <class _RandomAccessIter, class _Predicate>
+_STLP_INLINE_LOOP _RandomAccessIter __find_if(_RandomAccessIter __first, _RandomAccessIter __last,
+                                              _Predicate __pred,
+                                              const random_access_iterator_tag &) {
+  _STLP_DIFFERENCE_TYPE(_RandomAccessIter) __trip_count = (__last - __first) >> 2;
+
+  for ( ; __trip_count > 0 ; --__trip_count) {
+    if (__pred(*__first)) return __first;
+    ++__first;
+
+    if (__pred(*__first)) return __first;
+    ++__first;
+
+    if (__pred(*__first)) return __first;
+    ++__first;
+
+    if (__pred(*__first)) return __first;
+    ++__first;
+  }
+
+  switch(__last - __first) {
+  case 3:
+    if (__pred(*__first)) return __first;
+    ++__first;
+  case 2:
+    if (__pred(*__first)) return __first;
+    ++__first;
+  case 1:
+    if (__pred(*__first)) return __first;
+      //++__first;
+  case 0:
+  default:
+    return __last;
+  }
+}
+
+template <class _InputIter, class _Tp>
+_STLP_INLINE_LOOP _InputIter __find(_InputIter __first, _InputIter __last,
+                                    const _Tp& __val,
+                                    const input_iterator_tag &) {
+  while (__first != __last && !(*__first == __val)) ++__first;
+  return __first;
+}
+
+template <class _InputIter, class _Predicate>
+_STLP_INLINE_LOOP _InputIter __find_if(_InputIter __first, _STLP_MPW_EXTRA_CONST _InputIter __last,
+                                       _Predicate __pred,
+                                       const input_iterator_tag &) {
+  while (__first != __last && !__pred(*__first))
+    ++__first;
+  return __first;
+}
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+template <class _InputIter, class _Predicate>
+_InputIter find_if(_InputIter __first, _InputIter __last,
+                   _Predicate __pred) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  return _STLP_PRIV __find_if(__first, __last, __pred, _STLP_ITERATOR_CATEGORY(__first, _InputIter));
+}
+
+template <class _InputIter, class _Tp>
+_InputIter find(_InputIter __first, _InputIter __last, const _Tp& __val) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  return _STLP_PRIV __find(__first, __last, __val, _STLP_ITERATOR_CATEGORY(__first, _InputIter));
+}
+
+template <class _ForwardIter1, class _ForwardIter2, class _BinaryPred>
+_ForwardIter1 search(_ForwardIter1 __first1, _ForwardIter1 __last1,
+                     _ForwardIter2 __first2, _ForwardIter2 __last2,
+                     _BinaryPred  __pred) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first1, __last1))
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first2, __last2))
+  // Test for empty ranges
+  if (__first1 == __last1 || __first2 == __last2)
+    return __first1;
+
+  // Test for a pattern of length 1.
+  _ForwardIter2 __p1(__first2);
+
+  if ( ++__p1 == __last2 ) {
+    while (__first1 != __last1 && !__pred(*__first1, *__first2)) {
+      ++__first1;
+    }
+    return __first1;
+  }
+
+  // General case.
+
+  for ( ; ; ) { // __first1 != __last1 will be checked below
+    while (__first1 != __last1 && !__pred(*__first1, *__first2)) {
+      ++__first1;
+    }
+    if (__first1 == __last1) {
+      return __last1;
+    }
+    _ForwardIter2 __p = __p1;
+    _ForwardIter1 __current = __first1;
+    if (++__current == __last1) return __last1;
+
+    while (__pred(*__current, *__p)) {
+      if (++__p == __last2)
+        return __first1;
+      if (++__current == __last1)
+        return __last1;
+    }
+
+    ++__first1;
+  }
+  return __first1;
+}
+
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+// find_first_of, with and without an explicitly supplied comparison function.
+template <class _InputIter, class _ForwardIter, class _BinaryPredicate>
+_InputIter __find_first_of(_InputIter __first1, _InputIter __last1,
+                           _ForwardIter __first2, _ForwardIter __last2,
+                           _BinaryPredicate __comp) {
+  for ( ; __first1 != __last1; ++__first1) {
+    for (_ForwardIter __iter = __first2; __iter != __last2; ++__iter) {
+      if (__comp(*__first1, *__iter)) {
+        return __first1;
+      }
+    }
+  }
+  return __last1;
+}
+
+// find_end, with and without an explicitly supplied comparison function.
+// Search [first2, last2) as a subsequence in [first1, last1), and return
+// the *last* possible match.  Note that find_end for bidirectional iterators
+// is much faster than for forward iterators.
+
+// find_end for forward iterators.
+template <class _ForwardIter1, class _ForwardIter2,
+  class _BinaryPredicate>
+_ForwardIter1 __find_end(_ForwardIter1 __first1, _ForwardIter1 __last1,
+                         _ForwardIter2 __first2, _ForwardIter2 __last2,
+                         const forward_iterator_tag &, const forward_iterator_tag &,
+                         _BinaryPredicate __comp) {
+  if (__first2 == __last2)
+    return __last1;
+  else {
+    _ForwardIter1 __result = __last1;
+    for (;;) {
+      _ForwardIter1 __new_result = search(__first1, __last1, __first2, __last2, __comp);
+      if (__new_result == __last1)
+        return __result;
+      else {
+        __result = __new_result;
+        __first1 = __new_result;
+        ++__first1;
+      }
+    }
+  }
+}
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+// find_end for bidirectional iterators.  Requires partial specialization.
+#if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION)
+
+#  ifndef _STLP_INTERNAL_ITERATOR_H
+_STLP_END_NAMESPACE
+#    include <stl/_iterator.h>
+_STLP_BEGIN_NAMESPACE
+#  endif /*_STLP_INTERNAL_ITERATOR_H*/
+
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _BidirectionalIter1, class _BidirectionalIter2,
+          class _BinaryPredicate>
+_BidirectionalIter1
+__find_end(_BidirectionalIter1 __first1, _BidirectionalIter1 __last1,
+           _BidirectionalIter2 __first2, _BidirectionalIter2 __last2,
+           const bidirectional_iterator_tag &, const bidirectional_iterator_tag &,
+           _BinaryPredicate __comp) {
+  typedef reverse_iterator<_BidirectionalIter1> _RevIter1;
+  typedef reverse_iterator<_BidirectionalIter2> _RevIter2;
+
+  _RevIter1 __rlast1(__first1);
+  _RevIter2 __rlast2(__first2);
+  _RevIter1 __rresult = search(_RevIter1(__last1), __rlast1,
+                               _RevIter2(__last2), __rlast2,
+                               __comp);
+
+  if (__rresult == __rlast1)
+    return __last1;
+  else {
+    _BidirectionalIter1 __result = __rresult.base();
+    advance(__result, -distance(__first2, __last2));
+    return __result;
+  }
+}
+
+_STLP_MOVE_TO_STD_NAMESPACE
+#endif /* _STLP_CLASS_PARTIAL_SPECIALIZATION */
+
+template <class _ForwardIter1, class _ForwardIter2,
+          class _BinaryPredicate>
+_ForwardIter1
+find_end(_ForwardIter1 __first1, _ForwardIter1 __last1,
+         _ForwardIter2 __first2, _ForwardIter2 __last2,
+         _BinaryPredicate __comp) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first1, __last1))
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first2, __last2))
+  return _STLP_PRIV __find_end(__first1, __last1, __first2, __last2,
+#if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION)
+                               _STLP_ITERATOR_CATEGORY(__first1, _ForwardIter1),
+                               _STLP_ITERATOR_CATEGORY(__first2, _ForwardIter2),
+#else
+                               forward_iterator_tag(),
+                               forward_iterator_tag(),
+#endif
+                               __comp);
+}
+
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _ForwardIter, class _Tp, class _Compare1, class _Compare2, class _Distance>
+_ForwardIter __lower_bound(_ForwardIter __first, _ForwardIter __last, const _Tp& __val,
+                           _Compare1 __comp1, _Compare2 __comp2, _Distance*) {
+  _Distance __len = distance(__first, __last);
+  _Distance __half;
+  _ForwardIter __middle;
+
+  while (__len > 0) {
+    __half = __len >> 1;
+    __middle = __first;
+    advance(__middle, __half);
+    if (__comp1(*__middle, __val)) {
+      _STLP_VERBOSE_ASSERT(!__comp2(__val, *__middle), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
+      __first = __middle;
+      ++__first;
+      __len = __len - __half - 1;
+    }
+    else
+      __len = __half;
+  }
+  return __first;
+}
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+_STLP_END_NAMESPACE
+
+#endif /* _STLP_ALGOBASE_C */
+
+// Local Variables:
+// mode:C++
+// End:
diff --git a/include/c++/stl/stl/_algobase.h b/include/c++/stl/stl/_algobase.h
new file mode 100644 (file)
index 0000000..6864223
--- /dev/null
@@ -0,0 +1,670 @@
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Copyright (c) 1996,1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Copyright (c) 1997
+ * Moscow Center for SPARC Technology
+ *
+ * Copyright (c) 1999
+ * Boris Fomitchev
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
+ * or implied. Any use is at your own risk.
+ *
+ * Permission to use or copy this software for any purpose is hereby granted
+ * without fee, provided the above notices are retained on all copies.
+ * Permission to modify the code and to distribute modified code is granted,
+ * provided the above notices are retained, and a notice that the code was
+ * modified is included with the above copyright notice.
+ *
+ */
+
+/* NOTE: This is an internal header file, included by other STL headers.
+ *   You should not attempt to use it directly.
+ */
+
+#ifndef _STLP_INTERNAL_ALGOBASE_H
+#define _STLP_INTERNAL_ALGOBASE_H
+
+#ifndef _STLP_INTERNAL_CSTDDEF
+#  include <stl/_cstddef.h>
+#endif
+
+#ifndef _STLP_INTERNAL_CSTRING
+#  include <stl/_cstring.h>
+#endif
+
+#ifndef _STLP_CLIMITS
+#  include <climits>
+#endif
+
+#ifndef _STLP_INTERNAL_CSTDLIB
+#  include <stl/_cstdlib.h>
+#endif
+
+#ifndef _STLP_INTERNAL_PAIR_H
+#  include <stl/_pair.h>
+#endif
+
+#ifndef _STLP_INTERNAL_ITERATOR_BASE_H
+#  include <stl/_iterator_base.h>
+#endif
+
+#ifndef _STLP_TYPE_TRAITS_H
+#  include <stl/type_traits.h>
+#endif
+
+_STLP_BEGIN_NAMESPACE
+
+#if defined(_STLP_USE_PARTIAL_SPEC_WORKAROUND) && !defined(_STLP_FUNCTION_TMPL_PARTIAL_ORDER)
+_STLP_MOVE_TO_PRIV_NAMESPACE
+template <class _Tp>
+inline void __swap_aux(_Tp& __a, _Tp& __b, const __true_type& /*SwapImplemented*/) {
+  __a.swap(__b);
+}
+
+template <class _Tp>
+inline void __swap_aux(_Tp& __a, _Tp& __b, const __false_type& /*SwapImplemented*/) {
+  _Tp __tmp = __a;
+  __a = __b;
+  __b = __tmp;
+}
+_STLP_MOVE_TO_STD_NAMESPACE
+#endif /* _STLP_USE_PARTIAL_SPEC_WORKAROUND */
+
+// swap and iter_swap
+template <class _Tp>
+inline void swap(_Tp& __a, _Tp& __b) {
+#if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND) && !defined (_STLP_FUNCTION_TMPL_PARTIAL_ORDER)
+#  if !defined(__BORLANDC__)
+  typedef typename _SwapImplemented<_Tp>::_Ret _Implemented;
+#  else
+  enum { _Is = _SwapImplemented<_Tp>::_Is };
+  typedef typename __bool2type<_Is>::_Ret _Implemented;
+#  endif
+  _STLP_PRIV __swap_aux(__a, __b, _Implemented());
+#else
+  _Tp __tmp = __a;
+  __a = __b;
+  __b = __tmp;
+#endif /* _STLP_USE_PARTIAL_SPEC_WORKAROUND */
+}
+
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _ForwardIter1, class _ForwardIter2, class _Value>
+inline void __iter_swap_aux_aux(_ForwardIter1& __i1, _ForwardIter2& __i2, _Value *) {
+  _Value tmp = *__i1;
+  *__i1 = *__i2;
+  *__i2 = tmp;
+}
+
+template <class _ForwardIter1, class _ForwardIter2>
+inline void __iter_swap_aux(_ForwardIter1& __i1, _ForwardIter2& __i2, const __true_type& /*OKToSwap*/) {
+  swap(*__i1, *__i2);
+}
+
+template <class _ForwardIter1, class _ForwardIter2>
+inline void __iter_swap_aux(_ForwardIter1& __i1, _ForwardIter2& __i2, const __false_type& /*OKToSwap*/) {
+  __iter_swap_aux_aux( __i1, __i2, _STLP_VALUE_TYPE(__i1,_ForwardIter1) );
+}
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+template <class _ForwardIter1, class _ForwardIter2>
+inline void iter_swap(_ForwardIter1 __i1, _ForwardIter2 __i2) {
+  // swap(*__i1, *__i2);
+  _STLP_PRIV __iter_swap_aux( __i1, __i2, _IsOKToSwap(_STLP_VALUE_TYPE(__i1, _ForwardIter1), _STLP_VALUE_TYPE(__i2, _ForwardIter2),
+                                                      _STLP_IS_REF_TYPE_REAL_REF(__i1, _ForwardIter1),
+                                                      _STLP_IS_REF_TYPE_REAL_REF(__i2, _ForwardIter2))._Answer());
+}
+
+//--------------------------------------------------
+// min and max
+
+#if !defined (__BORLANDC__) || defined (_STLP_USE_OWN_NAMESPACE)
+#  if (defined (__BORLANDC__) && (__BORLANDC__ < 0x580)) && !defined (__STDC__)
+//In not ANSI mode Borland import min/max in global namespace which conflict
+//with STLport min/max when user does a 'using namespace std' in its code
+//(see test/unit/alg_test.cpp). To avoid this clash we simply import Borland min/max
+//in STLport namespace.
+using _STLP_VENDOR_STD::min;
+using _STLP_VENDOR_STD::max;
+#  else
+template <class _Tp>
+inline const _Tp& (min)(const _Tp& __a, const _Tp& __b) { return __b < __a ? __b : __a; }
+template <class _Tp>
+inline const _Tp& (max)(const _Tp& __a, const _Tp& __b) {  return  __a < __b ? __b : __a; }
+#  endif
+#endif
+
+# if defined (__BORLANDC__) && defined (_STLP_USE_OWN_NAMESPACE)
+inline unsigned long (min) (unsigned long __a, unsigned long __b) { return __b < __a ? __b : __a; }
+inline unsigned long (max) (unsigned long __a, unsigned long __b) {  return  __a < __b ? __b : __a; }
+# endif
+
+template <class _Tp, class _Compare>
+inline const _Tp& (min)(const _Tp& __a, const _Tp& __b, _Compare __comp) {
+  return __comp(__b, __a) ? __b : __a;
+}
+
+template <class _Tp, class _Compare>
+inline const _Tp& (max)(const _Tp& __a, const _Tp& __b, _Compare __comp) {
+  return __comp(__a, __b) ? __b : __a;
+}
+
+//--------------------------------------------------
+// copy
+
+// All of these auxiliary functions serve two purposes.  (1) Replace
+// calls to copy with memmove whenever possible.  (Memmove, not memcpy,
+// because the input and output ranges are permitted to overlap.)
+// (2) If we're using random access iterators, then write the loop as
+// a for loop with an explicit count.
+
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _InputIter, class _OutputIter, class _Distance>
+inline _OutputIter __copy(_InputIter __first, _InputIter __last,
+                          _OutputIter __result, const input_iterator_tag &, _Distance*) {
+  for ( ; __first != __last; ++__result, ++__first)
+    *__result = *__first;
+  return __result;
+}
+
+#if defined (_STLP_NONTEMPL_BASE_MATCH_BUG)
+template <class _InputIter, class _OutputIter, class _Distance>
+inline _OutputIter __copy(_InputIter __first, _InputIter __last,
+                          _OutputIter __result, const forward_iterator_tag &, _Distance* ) {
+  for ( ; __first != __last; ++__result, ++__first)
+    *__result = *__first;
+  return __result;
+}
+
+template <class _InputIter, class _OutputIter, class _Distance>
+inline _OutputIter __copy(_InputIter __first, _InputIter __last,
+                          _OutputIter __result, const bidirectional_iterator_tag &, _Distance* ) {
+  for ( ; __first != __last; ++__result, ++__first)
+    *__result = *__first;
+  return __result;
+}
+#endif
+
+template <class _RandomAccessIter, class _OutputIter, class _Distance>
+inline _OutputIter
+__copy(_RandomAccessIter __first, _RandomAccessIter __last,
+       _OutputIter __result, const random_access_iterator_tag &, _Distance*) {
+  for (_Distance __n = __last - __first; __n > 0; --__n) {
+    *__result = *__first;
+    ++__first;
+    ++__result;
+  }
+  return __result;
+}
+
+inline void*
+__copy_trivial(const void* __first, const void* __last, void* __result) {
+  size_t __n = (const char*)__last - (const char*)__first;
+  return __n ? (void *)((char*)memmove(__result, __first, __n) + __n) : __result;
+}
+
+//--------------------------------------------------
+// copy_backward auxiliary functions
+
+template <class _BidirectionalIter1, class _BidirectionalIter2,
+          class _Distance>
+inline _BidirectionalIter2 __copy_backward(_BidirectionalIter1 __first,
+                                           _BidirectionalIter1 __last,
+                                           _BidirectionalIter2 __result,
+                                           const bidirectional_iterator_tag &,
+                                           _Distance*) {
+  while (__first != __last)
+    *--__result = *--__last;
+  return __result;
+}
+
+template <class _RandomAccessIter, class _BidirectionalIter, class _Distance>
+inline _BidirectionalIter __copy_backward(_RandomAccessIter __first,
+                                          _RandomAccessIter __last,
+                                          _BidirectionalIter __result,
+                                          const random_access_iterator_tag &,
+                                          _Distance*) {
+  for (_Distance __n = __last - __first; __n > 0; --__n)
+    *--__result = *--__last;
+  return __result;
+}
+
+inline void*
+__copy_trivial_backward(const void* __first, const void* __last, void* __result) {
+  const ptrdiff_t _Num = (const char*)__last - (const char*)__first;
+  return (_Num > 0) ? memmove((char*)__result - _Num, __first, _Num) : __result ;
+}
+
+template <class _InputIter, class _OutputIter>
+inline _OutputIter __copy_ptrs(_InputIter __first, _InputIter __last, _OutputIter __result,
+                               const __false_type& /*IsOKToMemCpy*/) {
+  return __copy(__first, __last, __result, random_access_iterator_tag(), (ptrdiff_t*)0);
+}
+template <class _InputIter, class _OutputIter>
+inline _OutputIter __copy_ptrs(_InputIter __first, _InputIter __last, _OutputIter __result,
+                               const __true_type& /*IsOKToMemCpy*/) {
+  // we know they all pointers, so this cast is OK
+  //  return (_OutputIter)__copy_trivial(&(*__first), &(*__last), &(*__result));
+  return (_OutputIter)__copy_trivial(__first, __last, __result);
+}
+
+template <class _InputIter, class _OutputIter>
+inline _OutputIter __copy_aux(_InputIter __first, _InputIter __last, _OutputIter __result,
+                              const __true_type& /*BothPtrType*/) {
+  return __copy_ptrs(__first, __last, __result,
+                     _UseTrivialCopy(_STLP_VALUE_TYPE(__first, _InputIter),
+                                     _STLP_VALUE_TYPE(__result, _OutputIter))._Answer());
+}
+
+template <class _InputIter, class _OutputIter>
+inline _OutputIter __copy_aux(_InputIter __first, _InputIter __last, _OutputIter __result,
+                              const __false_type& /*BothPtrType*/) {
+  return __copy(__first, __last, __result,
+                _STLP_ITERATOR_CATEGORY(__first, _InputIter),
+                _STLP_DISTANCE_TYPE(__first, _InputIter));
+}
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+template <class _InputIter, class _OutputIter>
+inline _OutputIter copy(_InputIter __first, _InputIter __last, _OutputIter __result) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  return _STLP_PRIV __copy_aux(__first, __last, __result, _BothPtrType< _InputIter, _OutputIter>::_Answer());
+}
+
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _InputIter, class _OutputIter>
+inline _OutputIter __copy_backward_ptrs(_InputIter __first, _InputIter __last,
+                                        _OutputIter __result, const __false_type& /*TrivialAssignment*/) {
+  return __copy_backward(__first, __last, __result, _STLP_ITERATOR_CATEGORY(__first, _InputIter), _STLP_DISTANCE_TYPE(__first, _InputIter));
+}
+template <class _InputIter, class _OutputIter>
+inline _OutputIter __copy_backward_ptrs(_InputIter __first, _InputIter __last,
+                                        _OutputIter __result, const __true_type& /*TrivialAssignment*/) {
+  return (_OutputIter)__copy_trivial_backward(__first, __last, __result);
+}
+
+template <class _InputIter, class _OutputIter>
+inline _OutputIter __copy_backward_aux(_InputIter __first, _InputIter __last, _OutputIter __result, const __false_type&) {
+  return __copy_backward(__first, __last, __result, _STLP_ITERATOR_CATEGORY(__first,_InputIter), _STLP_DISTANCE_TYPE(__first, _InputIter));
+}
+
+template <class _InputIter, class _OutputIter>
+inline _OutputIter __copy_backward_aux(_InputIter __first, _InputIter __last, _OutputIter __result, const __true_type&) {
+  return __copy_backward_ptrs(__first, __last, __result,
+                              _UseTrivialCopy(_STLP_VALUE_TYPE(__first, _InputIter),
+                                              _STLP_VALUE_TYPE(__result, _OutputIter))._Answer());
+}
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+template <class _InputIter, class _OutputIter>
+inline _OutputIter copy_backward(_InputIter __first, _InputIter __last, _OutputIter __result) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  return _STLP_PRIV __copy_backward_aux(__first, __last, __result, _BothPtrType< _InputIter, _OutputIter>::_Answer() );
+}
+
+#if !defined (_STLP_CLASS_PARTIAL_SPECIALIZATION) && !defined (_STLP_SIMULATE_PARTIAL_SPEC_FOR_TYPE_TRAITS)
+#  define _STLP_DECLARE_COPY_TRIVIAL(_Tp)                                       \
+inline _Tp* copy(const _Tp* __first, const _Tp* __last, _Tp* __result)          \
+{ return (_Tp*)__copy_trivial(__first, __last, __result); }                     \
+inline _Tp* copy_backward(const _Tp* __first, const _Tp* __last, _Tp* __result) \
+{ return (_Tp*)__copy_trivial_backward(__first, __last, __result); }
+
+_STLP_DECLARE_COPY_TRIVIAL(char)
+#  if !defined (_STLP_NO_SIGNED_BUILTINS)
+_STLP_DECLARE_COPY_TRIVIAL(signed char)
+#  endif
+_STLP_DECLARE_COPY_TRIVIAL(unsigned char)
+_STLP_DECLARE_COPY_TRIVIAL(short)
+_STLP_DECLARE_COPY_TRIVIAL(unsigned short)
+_STLP_DECLARE_COPY_TRIVIAL(int)
+_STLP_DECLARE_COPY_TRIVIAL(unsigned int)
+_STLP_DECLARE_COPY_TRIVIAL(long)
+_STLP_DECLARE_COPY_TRIVIAL(unsigned long)
+#  if !defined(_STLP_NO_WCHAR_T) && !defined (_STLP_WCHAR_T_IS_USHORT)
+_STLP_DECLARE_COPY_TRIVIAL(wchar_t)
+#  endif
+#  if defined (_STLP_LONG_LONG)
+_STLP_DECLARE_COPY_TRIVIAL(_STLP_LONG_LONG)
+_STLP_DECLARE_COPY_TRIVIAL(unsigned _STLP_LONG_LONG)
+#  endif
+_STLP_DECLARE_COPY_TRIVIAL(float)
+_STLP_DECLARE_COPY_TRIVIAL(double)
+#  if !defined (_STLP_NO_LONG_DOUBLE)
+_STLP_DECLARE_COPY_TRIVIAL(long double)
+#  endif
+#  undef _STLP_DECLARE_COPY_TRIVIAL
+#endif /* _STLP_CLASS_PARTIAL_SPECIALIZATION */
+
+//--------------------------------------------------
+// copy_n (not part of the C++ standard)
+
+#if !defined (_STLP_NO_EXTENSIONS)
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _InputIter, class _Size, class _OutputIter>
+_STLP_INLINE_LOOP pair<_InputIter, _OutputIter>
+__copy_n(_InputIter __first, _Size __count,
+         _OutputIter __result,
+         const input_iterator_tag &) {
+  for ( ; __count > 0; --__count) {
+    *__result = *__first;
+    ++__first;
+    ++__result;
+  }
+  return pair<_InputIter, _OutputIter>(__first, __result);
+}
+
+template <class _RAIter, class _Size, class _OutputIter>
+inline pair<_RAIter, _OutputIter>
+__copy_n(_RAIter __first, _Size __count,
+         _OutputIter __result,
+         const random_access_iterator_tag &) {
+  _RAIter __last = __first + __count;
+  return pair<_RAIter, _OutputIter>(__last, copy(__first, __last, __result));
+}
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+template <class _InputIter, class _Size, class _OutputIter>
+inline pair<_InputIter, _OutputIter>
+copy_n(_InputIter __first, _Size __count, _OutputIter __result) {
+  _STLP_FIX_LITERAL_BUG(__first)
+  return _STLP_PRIV __copy_n(__first, __count, __result, _STLP_ITERATOR_CATEGORY(__first, _InputIter));
+}
+#endif
+
+//--------------------------------------------------
+// fill and fill_n
+template <class _ForwardIter, class _Tp>
+_STLP_INLINE_LOOP
+void fill(_ForwardIter __first, _ForwardIter __last, const _Tp& __val) {
+  _STLP_DEBUG_CHECK(_STLP_PRIV __check_range(__first, __last))
+  for ( ; __first != __last; ++__first)
+    *__first = __val;
+}
+
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _OutputIter, class _Size, class _Tp>
+_STLP_INLINE_LOOP
+_OutputIter __fill_n(_OutputIter __first, _Size __n, const _Tp& __val) {
+  _STLP_FIX_LITERAL_BUG(__first)
+  for ( ; __n > 0; --__n, ++__first)
+    *__first = __val;
+  return __first;
+}
+
+_STLP_MOVE_TO_STD_NAMESPACE
+
+template <class _OutputIter, class _Size, class _Tp>
+_STLP_INLINE_LOOP
+void fill_n(_OutputIter __first, _Size __n, const _Tp& __val) {
+  _STLP_FIX_LITERAL_BUG(__first)
+  _STLP_PRIV __fill_n(__first, __n, __val);
+}
+
+// Specialization: for one-byte types we can use memset.
+inline void fill(unsigned char* __first, unsigned char* __last,
+                 const unsigned char& __val) {
+  unsigned char __tmp = __val;
+  memset(__first, __tmp, __last - __first);
+}
+#if !defined (_STLP_NO_SIGNED_BUILTINS)
+inline void fill(signed char* __first, signed char* __last,
+                 const signed char& __val) {
+  signed char __tmp = __val;
+  memset(__first, __STATIC_CAST(unsigned char,__tmp), __last - __first);
+}
+#endif
+inline void fill(char* __first, char* __last, const char& __val) {
+  char __tmp = __val;
+  memset(__first, __STATIC_CAST(unsigned char,__tmp), __last - __first);
+}
+
+#if defined (_STLP_FUNCTION_TMPL_PARTIAL_ORDER)
+_STLP_MOVE_TO_PRIV_NAMESPACE
+
+template <class _Size>
+inline unsigned char* __fill_n(unsigned char* __first, _Size __n,
+                             const unsigned char& __val) {
+  fill(__first, __first + __n, __val);
+  return __first + __n;
+}
+
+template <class _Size>
+inline signed char* __fill_n(char* __first, _Size __n,
+                           const signed char& __val) {
+  fill(__first, __first + __n, __val);
+  return __first + __n;
+}
+
+template <class _Size>
+inline char* __fill_n(char* __first, _Size __n, const char& __val) {
+  fill(__first, __first + __n, __val);
+  return __first + __n;
+}
+
+_STLP_MOVE_TO_STD_NAMESPACE
+#endif /* _STLP_FUNCTION_TMPL_PARTIAL_ORDER */
+
+
+//--------------------------------------------------
+// equal and mismatch