Initial full mirror of c:\VWE (source + assets + toolchain + outputs) via Git LFS

Complete disaster-recovery snapshot: engine/game source, game data assets,
VC6 toolchain + DX SDKs, build outputs, deployed game, and _UNUSED archive.
Large binaries in Git LFS; text preserved byte-for-byte (core.autocrlf=false,
no eol attributes). See RECOVERY.md for the one-clone rebuild procedure.
This commit is contained in:
Cyd
2026-06-24 21:28:16 -05:00
commit 2b8ca921cb
66341 changed files with 7923174 additions and 0 deletions
@@ -0,0 +1,75 @@
/*
*
* 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 __SGI_STL_ALGORITHM
#define __SGI_STL_ALGORITHM
#ifndef __SGI_STL_INTERNAL_ALGOBASE_H
# include <stl_algobase.h>
#endif
# ifndef __STLPORT_CSTDIO
// remove() conflicts, <cstdio> should always go first
# include <cstdio>
# endif
#if defined (__STL_IMPORT_VENDOR_STD)
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_ALGORITHM
# define __STLPORT_NATIVE_PASS
# endif
# ifdef __MSL__ // dwa 2/28/99 - help MSL get its own headers and prevent it from including ours
# include __STL_NATIVE_HEADER(algobase.h)
# ifndef __SGI_STL_ALGOBASE_H
# define __SGI_STL_ALGOBASE_H
# endif
# include __STL_NATIVE_HEADER(heap.h)
# ifndef __SGI_STL_HEAP_H
# define __SGI_STL_HEAP_H
# endif
# endif
# include __STL_NATIVE_HEADER(algorithm)
# if defined ( __STL_RESUME_STD_FOR_ALGORITHM )
# undef __STL_RESUME_STD_FOR_ALGORITHM
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
#endif /* __STL_IMPORT_VENDOR_STD */
# ifndef __SGI_STL_INTERNAL_ALGO_H
# include <stl_algo.h>
# endif
#endif /* __SGI_STL_ALGORITHM */
// Local Variables:
// mode:C++
// End:
@@ -0,0 +1,67 @@
/*
* 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 __SGI_STL_BITSET
#define __SGI_STL_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.
# include <stl_bitset.h>
#if defined (__STL_WHOLE_NATIVE_STD)
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_BITSET
# define __STLPORT_NATIVE_PASS
# endif
# include __STL_NATIVE_HEADER(bitset)
# if defined ( __STL_RESUME_STD_FOR_BITSET )
# undef __STL_RESUME_STD_FOR_BITSET
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
#endif
#endif /* __SGI_STL_BITSET */
// Local Variables:
// mode:C++
// End:
@@ -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 __STLPORT_CASSERT
# define __STLPORT_CASSERT
# ifndef __STL_CONFIG_H
# include <stl_config.h>
# endif
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_CASSERT
# define __STLPORT_NATIVE_PASS
# endif
# if defined (__STL_USE_NEW_C_HEADERS) || defined (__IN_STLPORT_CASSERT)
# include __STL_NATIVE_CPP_C_HEADER(cassert)
# else
# include <assert.h>
# endif
# if defined ( __STL_RESUME_STD_FOR_CASSERT )
# undef __STL_RESUME_STD_FOR_CASSERT
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
#endif /* __STLPORT_CASSERT */
// Local Variables:
// mode:C++
// End:
@@ -0,0 +1,82 @@
/*
* 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 __STLPORT_CCTYPE
# define __STLPORT_CCTYPE
# ifndef __STL_CONFIG_H
# include <stl_config.h>
# endif
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_CCTYPE
# define __STLPORT_NATIVE_PASS
# endif
# if defined (__STL_USE_NEW_C_HEADERS) || defined (__IN_STLPORT_CCTYPE)
# include __STL_NATIVE_CPP_C_HEADER(cctype)
# else
# include <ctype.h>
// 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
# endif /* __STL_USE_NEW_C_HEADERS */
# if defined ( __STL_RESUME_STD_FOR_CCTYPE )
# undef __STL_RESUME_STD_FOR_CCTYPE
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
# ifdef __STL_IMPORT_VENDOR_CSTD
__STL_BEGIN_NAMESPACE
using __STL_VENDOR_CSTD::isalnum;
using __STL_VENDOR_CSTD::isalpha;
using __STL_VENDOR_CSTD::iscntrl;
using __STL_VENDOR_CSTD::isdigit;
using __STL_VENDOR_CSTD::isgraph;
using __STL_VENDOR_CSTD::islower;
using __STL_VENDOR_CSTD::isprint;
using __STL_VENDOR_CSTD::ispunct;
using __STL_VENDOR_CSTD::isspace;
using __STL_VENDOR_CSTD::isupper;
using __STL_VENDOR_CSTD::isxdigit;
using __STL_VENDOR_CSTD::tolower;
using __STL_VENDOR_CSTD::toupper;
__STL_END_NAMESPACE
# endif /* __STL_IMPORT_VENDOR_CSTD*/
#endif /* __STLPORT_CCTYPE */
// Local Variables:
// mode:C++
// End:
@@ -0,0 +1,58 @@
/*
* 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 __STLPORT_CERRNO
# define __STLPORT_CERRNO
# ifndef __STL_CONFIG_H
# include <stl_config.h>
# endif
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_CERRNO
# define __STLPORT_NATIVE_PASS
# endif
# if defined (__STL_USE_NEW_C_HEADERS) || defined (__IN_STLPORT_CERRNO)
# include __STL_NATIVE_CPP_C_HEADER(cerrno)
# else
# include <errno.h>
# endif
# if defined ( __STL_RESUME_STD_FOR_CERRNO )
# undef __STL_RESUME_STD_FOR_CERRNO
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
# ifdef __STL_IMPORT_VENDOR_CSTD
__STL_BEGIN_NAMESPACE
// some compilers define this as a macro.
#ifndef errno
using __STL_VENDOR_CSTD::errno;
#endif
__STL_END_NAMESPACE
#endif /* __STL_IMPORT_VENDOR_CSTD */
#endif /* __STLPORT_CERRNO */
// Local Variables:
// mode:C++
// End:
@@ -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 __STLPORT_CFLOAT
# define __STLPORT_CFLOAT
# ifndef __STL_CONFIG_H
# include <stl_config.h>
# endif
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_CFLOAT
# define __STLPORT_NATIVE_PASS
# endif
# if defined (__STL_USE_NEW_C_HEADERS) || defined (__IN_STLPORT_CFLOAT)
# include __STL_NATIVE_CPP_C_HEADER(cfloat)
# else
# include <float.h>
# endif
# if defined ( __STL_RESUME_STD_FOR_CFLOAT )
# undef __STL_RESUME_STD_FOR_CFLOAT
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
# ifdef __STL_IMPORT_VENDOR_CSTD
__STL_BEGIN_NAMESPACE
// those are often macros
__STL_END_NAMESPACE
#endif /* __STL_IMPORT_VENDOR_CSTD */
#endif /* __STLPORT_CFLOAT */
// Local Variables:
// mode:C++
// End:
@@ -0,0 +1,196 @@
/*
* 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 __SGI_STL_CHAR_TRAITS_H
#define __SGI_STL_CHAR_TRAITS_H
#if ! defined (__STLPORT_CSTDDEF)
# include <cstddef>
#endif
# if defined (__STL_HAS_WCHAR_T) && !defined (__STLPORT_CWCHAR)
# include <cwchar>
# endif
#ifndef __SGI_STL_INTERNAL_FUNCTION_H
# include <stl_function.h>
#endif
// Define char_traits
// If we import new iostreams from vendor library, just do it
#if defined (__STL_USE_NEW_IOSTREAMS) && (defined (__STLPORT_NEW_IOSTREAMS) || !defined(__STL_STD_REBUILD))
# include <iosfwd>
# if defined (__STL_IMPORT_VENDOR_STD) && !defined (__STL_BROKEN_USING_DIRECTIVE)
__STL_BEGIN_NAMESPACE
using __STL_VENDOR_STD::char_traits;
__STL_END_NAMESPACE
# endif /* __STL_IMPORT_VENDOR_STD */
#endif
// used to be "else"
# if defined (__STLPORT_NEW_IOSTREAMS) || defined (__STL_STD_REBUILD) || ! defined (__STL_USE_NEW_IOSTREAMS)
#if ! defined (__STLPORT_CSTRING)
# include <cstring>
#endif
__STL_BEGIN_NAMESPACE
// Class __char_traits_base.
template <class _CharT, class _IntT> struct __char_traits_base {
typedef _CharT char_type;
typedef _IntT int_type;
#ifdef __STL_USE_NEW_IOSTREAMS
typedef streamoff off_type;
typedef streampos pos_type;
# ifdef __STL_NO_MBSTATE_T
typedef char state_type;
# else
typedef mbstate_t state_type;
# endif
#endif /* __STL_USE_NEW_IOSTREAMS */
static void assign(char_type& __c1, const char_type& __c2) { __c1 = __c2; }
static bool eq(const _CharT& __c1, const _CharT& __c2)
{ return __c1 == __c2; }
static bool lt(const _CharT& __c1, const _CharT& __c2)
{ return __c1 < __c2; }
static int compare(const _CharT* __s1, const _CharT* __s2, size_t __n) {
for (size_t __i = 0; __i < __n; ++__i)
if (!eq(__s1[__i], __s2[__i]))
return __s1[__i] < __s2[__i] ? -1 : 1;
return 0;
}
static size_t length(const _CharT* __s) {
# ifdef __STL_DEFAULT_CONSTRUCTOR_BUG
const _CharT _NullChar = _CharT(0);
# else
const _CharT _NullChar = _CharT();
# endif
size_t __i;
for (__i = 0; !eq(__s[__i], _NullChar); ++__i)
{}
return __i;
}
static const _CharT* find(const _CharT* __s, size_t __n, const _CharT& __c)
{
for ( ; __n > 0 ; ++__s, --__n)
if (eq(*__s, __c))
return __s;
return 0;
}
static _CharT* move(_CharT* __s1, const _CharT* __s2, size_t __n) {
memmove(__s1, __s2, __n * sizeof(_CharT));
return __s1;
}
static _CharT* copy(_CharT* __s1, const _CharT* __s2, size_t __n) {
memcpy(__s1, __s2, __n * sizeof(_CharT));
return __s1;
}
static _CharT* assign(_CharT* __s, size_t __n, _CharT __c) {
for (size_t __i = 0; __i < __n; ++__i)
__s[__i] = __c;
return __s;
}
static int_type not_eof(const int_type& __c) {
return !eq_int_type(__c, eof()) ? __c : 0;
}
static char_type to_char_type(const int_type& __c) {
// return __STATIC_CAST(char_type,__c);
return (char_type)__c;
}
static int_type to_int_type(const char_type& __c) {
// return __STATIC_CAST(int_type,__c);
return (int_type)__c;
}
static bool eq_int_type(const int_type& __c1, const int_type& __c2) {
return __c1 == __c2;
}
static int_type eof() {
return (int_type)-1;
// return __STATIC_CAST(int_type,-1);
}
};
// Generic char_traits class. Note that this class is provided only
// as a base for explicit specialization; it is unlikely to be useful
// as is for any particular user-defined type. In particular, it
// *will not work* for a non-POD type.
template <class _CharT> struct char_traits
: public __char_traits_base<_CharT, _CharT>
{};
// Specialization for char.
__STL_TEMPLATE_NULL struct __STL_CLASS_DECLSPEC char_traits<char>
: public __char_traits_base<char, int>
{
typedef char char_type;
typedef int int_type;
#ifdef __STL_USE_NEW_IOSTREAMS
typedef streamoff off_type;
# ifndef __STL_NO_MBSTATE_T
typedef streampos pos_type;
typedef mbstate_t state_type;
# endif
#endif /* __STL_USE_NEW_IOSTREAMS */
static int compare(const char* __s1, const char* __s2, size_t __n)
{ return memcmp(__s1, __s2, __n); }
static size_t length(const char* __s) { return strlen(__s); }
static void assign(char& __c1, const char& __c2) { __c1 = __c2; }
static char* assign(char* __s, size_t __n, char __c)
{ memset(__s, __c, __n); return __s; }
};
# if defined (__STL_HAS_WCHAR_T)
// Specialization for wchar_t.
__STL_TEMPLATE_NULL struct __STL_CLASS_DECLSPEC char_traits<wchar_t>
: public __char_traits_base<wchar_t, wint_t>
{};
# endif
__STL_END_NAMESPACE
# endif /* REBUILD */
#endif /* __SGI_STL_CHAR_TRAITS_H */
// Local Variables:
// mode:C++
// End:
@@ -0,0 +1,61 @@
/*
* 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 __STLPORT_CLIMITS
# define __STLPORT_CLIMITS
# define __IN_STLPORT_CLIMITS 1
# ifndef __STL_CONFIG_H
# include <stl_config.h>
# endif
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_CLIMITS
# define __STLPORT_NATIVE_PASS
# endif
# if defined (__SUNPRO_CC) && (__SUNPRO_CC == 0x500)
# include </usr/include/limits.h>
# elif defined (__STL_USE_NEW_C_HEADERS)
# include __STL_NATIVE_CPP_C_HEADER(climits)
# else
# include __STL_NATIVE_C_HEADER(limits.h)
# endif
# if defined ( __STL_RESUME_STD_FOR_CLIMITS )
# undef __STL_RESUME_STD_FOR_CLIMITS
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
# ifdef __STL_IMPORT_VENDOR_CSTD
__STL_BEGIN_NAMESPACE
// those are often macros
__STL_END_NAMESPACE
#endif /* __STL_IMPORT_VENDOR_CSTD */
# undef __IN_STLPORT_CLIMITS
#endif /* __STLPORT_CLIMITS */
// Local Variables:
// mode:C++
// End:
@@ -0,0 +1,61 @@
/*
* 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 __STLPORT_CLOCALE
# define __STLPORT_CLOCALE
# define __IN_STLPORT_CLOCALE
# ifndef __STL_CONFIG_H
# include <stl_config.h>
# endif
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_CLOCALE
# define __STLPORT_NATIVE_PASS
# endif
# if defined (__STL_USE_NEW_C_HEADERS)
# include __STL_NATIVE_CPP_C_HEADER(clocale)
# else
# include __STL_NATIVE_C_HEADER(locale.h)
# endif
# if defined ( __STL_RESUME_STD_FOR_CLOCALE )
# undef __STL_RESUME_STD_FOR_CLOCALE
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
# ifdef __STL_IMPORT_VENDOR_CSTD
__STL_BEGIN_NAMESPACE
using __STL_VENDOR_CSTD::lconv;
using __STL_VENDOR_CSTD::localeconv;
using __STL_VENDOR_CSTD::setlocale;
__STL_END_NAMESPACE
#endif /* __STL_IMPORT_VENDOR_CSTD */
# undef __IN_STLPORT_CLOCALE
#endif /* __STLPORT_CLOCALE */
// Local Variables:
// mode:C++
// End:
+75
View File
@@ -0,0 +1,75 @@
/*
* 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 __STLPORT_CMATH
# define __STLPORT_CMATH
# ifndef __STL_CONFIG_H
# include <stl_config.h>
# endif
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_CMATH
# define __STLPORT_NATIVE_PASS
# endif
# if defined (__STL_USE_NEW_C_HEADERS)
# include __STL_NATIVE_CPP_C_HEADER(cmath)
# else
# include <math.h>
# endif
# if defined ( __STL_RESUME_STD_FOR_CMATH )
# undef __STL_RESUME_STD_FOR_CMATH
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
# ifdef __STL_IMPORT_VENDOR_CSTD
__STL_BEGIN_NAMESPACE
using __STL_VENDOR_CSTD::acos;
using __STL_VENDOR_CSTD::asin;
using __STL_VENDOR_CSTD::atan2;
using __STL_VENDOR_CSTD::atan;
using __STL_VENDOR_CSTD::ceil;
using __STL_VENDOR_CSTD::cos;
using __STL_VENDOR_CSTD::cosh;
using __STL_VENDOR_CSTD::exp;
using __STL_VENDOR_CSTD::fabs;
using __STL_VENDOR_CSTD::floor;
using __STL_VENDOR_CSTD::fmod;
using __STL_VENDOR_CSTD::frexp;
using __STL_VENDOR_CSTD::ldexp;
using __STL_VENDOR_CSTD::log10;
using __STL_VENDOR_CSTD::log;
using __STL_VENDOR_CSTD::modf;
using __STL_VENDOR_CSTD::pow;
using __STL_VENDOR_CSTD::sin;
using __STL_VENDOR_CSTD::sinh;
using __STL_VENDOR_CSTD::sqrt;
using __STL_VENDOR_CSTD::tan;
using __STL_VENDOR_CSTD::tanh;
__STL_END_NAMESPACE
#endif /* __STL_IMPORT_VENDOR_CSTD */
#endif /* __STLPORT_CMATH */
// Local Variables:
// mode:C++
// End:
@@ -0,0 +1,95 @@
/*
* 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 __STLPORT_COMPLEX
# define __STLPORT_COMPLEX
# ifndef __STL_CONFIG_H
# include <stl_config.h>
# endif
# if defined __STLPORT_NEW_IOSTREAMS && defined (__STL_USE_OWN_NAMESPACE)
# include <iosfwd>
# endif
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_COMPLEX
# define __STLPORT_NATIVE_PASS
# endif
# if defined __STLPORT_NEW_IOSTREAMS && defined (__STL_USE_OWN_NAMESPACE)
namespace std {
using stlport::allocator;
using stlport::basic_ostringstream;
using stlport::basic_istringstream;
using stlport::basic_istream;
using stlport::basic_iostream;
using stlport::basic_ostream;
using stlport::basic_ios;
using stlport::ios_base;
using stlport::ios;
}
# endif
# include __STL_NATIVE_HEADER(complex)
# if defined ( __STL_RESUME_STD_FOR_COMPLEX )
# undef __STL_RESUME_STD_FOR_COMPLEX
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
# if defined (__STL_USE_OWN_NAMESPACE)
__STL_BEGIN_NAMESPACE
using __STL_VENDOR_STD::complex;
// using __STL_VENDOR_STD::operator<<(basic_ostream<char>&, const complex<double>&);
using __STL_VENDOR_STD::real;
using __STL_VENDOR_STD::imag;
using __STL_VENDOR_STD::abs;
using __STL_VENDOR_STD::arg;
using __STL_VENDOR_STD::norm;
using __STL_VENDOR_STD::conj;
using __STL_VENDOR_STD::polar;
# ifndef __STL_MSVC
using __STL_VENDOR_STD::cos;
using __STL_VENDOR_STD::cosh;
using __STL_VENDOR_STD::exp;
using __STL_VENDOR_STD::log;
using __STL_VENDOR_STD::log10;
using __STL_VENDOR_STD::pow;
using __STL_VENDOR_STD::sin;
using __STL_VENDOR_STD::sinh;
using __STL_VENDOR_STD::sqrt;
using __STL_VENDOR_STD::tan;
using __STL_VENDOR_STD::tanh;
# endif
__STL_END_NAMESPACE
# endif /* USE_OWN_NAMESPACE */
#endif /* __STLPORT_COMPLEX */
// Local Variables:
// mode:C++
// End:
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,14 @@
// STLport config file for Apogee 4.x
# define __STL_NO_NEW_NEW_HEADER 1
# define __STL_HAS_NO_NEW_IOSTREAMS 1
# define __STL_HAS_NO_NEW_C_HEADERS 1
# define __STL_RAND48 1
# define __STL_LONG_LONG 1
# define __STL_NO_BAD_ALLOC 1
# define __STL_NO_MEMBER_TEMPLATE_KEYWORD 1
# define __STL_NON_TYPE_TMPL_PARAM_BUG 1
// # define __STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS 1
# define __STL_NO_EXCEPTION_HEADER 1
@@ -0,0 +1,140 @@
// STLport configuration file
// It is internal STLport header - DO NOT include it directly
// common configuration settings for Apple MPW MrCpp / SCpp
#ifdef qMacApp
# ifndef __CONDITIONALMACROS__ // skip including ConditionalMacros_AC.h if ConditionalMacros.h is already included
# include "CoreSwitches_AC.h"
# include "ConditionalMacros_AC.h"
# include "Types_AC.h"
# define __STL_FILE__ _FILE_AC
# define __STL_DEBUG_MESSAGE
# define __stl_debug_message ProgramBreak_AC
# include <ConditionalMacros.h>
# endif
# include <Types.h>
#else
# include <ConditionalMacros.h>
# include <Types.h>
#endif
#define __STL_UINT32_T UInt32
typedef int wint_t;
#ifndef TYPE_BOOL
# error <ConditionalMacros.h> must be included. (TYPE_BOOL)
#endif
#if !TYPE_BOOL
# define __STL_NO_BOOL
# define __STL_DONT_USE_BOOL_TYPEDEF
#endif
#ifndef TYPE_LONGLONG
# error <ConditionalMacros.h> must be included. (TYPE_LONGLONG)
#endif
#if TYPE_LONGLONG
# define __STL_LONG_LONG
#endif
#if !__option(exceptions)
# define __STL_HAS_NO_EXCEPTIONS
#endif
#define __STL_DEBUG_MESSAGE_POST DebugStr("\pSTL diagnosis issued. See 'stderr' for detail.");
#define __STL_ASSERT_MSG_TRAILER " "
#ifndef __STL_NATIVE_INCLUDE_PATH
# define __STL_NATIVE_INCLUDE_PATH ::CIncludes // expects the alias to {CIncludes} under the same folder as {STL}
#endif
# if !defined(__STL_MAKE_HEADER)
# define __STL_MAKE_HEADER(path, header) <path:header> // Mac uses ":" for directory delimiter
# endif
// Apple MPW SCpp
#if defined (__SC__)
# define __STL_NO_EXCEPTION_SPEC // known limitation
# define __STL_NO_MUTABLE // known limitation
# define __STL_HAS_NO_NAMESPACES // known limitation
# define __STL_NO_TYPENAME // known limitation
# define __STL_NO_EXPLICIT // known limitation
# define __STL_NO_BAD_ALLOC // known limitation
# define __STL_HAS_NO_NEW_C_HEADERS // known limitation
# define __STL_NO_NEW_NEW_HEADER // known limitation
# define __STL_HAS_NO_NEW_IOSTREAMS // known limitation
# define __STL_LIMITED_DEFAULT_TEMPLATES // known limitation
# define __STL_NO_MEMBER_TEMPLATES // known limitation
# define __STL_NO_MEMBER_TEMPLATE_CLASSES // known limitation
# define __STL_NO_FRIEND_TEMPLATES // known limitation
# define __STL_NO_PARTIAL_SPECIALIZATION_SYNTAX // known limitation
# define __STL_NO_CLASS_PARTIAL_SPECIALIZATION // known limitation
# define __STL_NO_FUNCTION_TMPL_PARTIAL_ORDER // known limitation
# define __STL_NATIVE_HEADER(header) <::CIncludes:##header##> // since SCpp has problem expanding symbols recursively
# define __STL_NATIVE_C_HEADER(header) <::CIncludes:##header##>
# define __STL_NATIVE_CPP_C_HEADER(header) <::CIncludes:##header##>
# define __STL_GLOBAL_NESTED_RETURN_TYPE_PARAM_BUG
# define __STL_DEFAULT_PARAM_CONSTRUCTOR_BUG
# define __STL_BOGUS_TEMPLATE_TYPE_MATCHING_BUG
# define __STL_MPW_EXTRA_CONST const
# define __STL_NON_TYPE_TMPL_PARAM_BUG
# define __STL_THROW_RETURN_BUG
# define __SGI_STL_NO_ARROW_OPERATOR
# define __STL_NO_PROXY_ARROW_OPERATOR
# define __STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS
# define __STL_USE_ABBREVS // known limitation
// Note : this line is dangerous, since it remanes the public class.
// Only use it if experience major difficulties with symbol length
// during compilation.
// # define allocator _Al
#endif // defined (__SC__)
// Apple MPW MrCpp 4.1.0
#if defined (__MRC__)
# define __STL_NO_TYPENAME // known limitation
# define __STL_BROKEN_USING_DIRECTIVE // known limitation
# define __STL_NO_BAD_ALLOC // known limitation
# define __STL_HAS_NO_NEW_C_HEADERS // known limitation
# define __STL_NO_NEW_NEW_HEADER // known limitation
# define __STL_HAS_NO_NEW_IOSTREAMS // known limitation
# define __STL_LIMITED_DEFAULT_TEMPLATES // known limitation
# define __STL_NO_MEMBER_TEMPLATES // known limitation
# define __STL_NO_MEMBER_TEMPLATE_CLASSES // known limitation
# define __STL_NO_FRIEND_TEMPLATES // known limitation
# define __STL_NO_PARTIAL_SPECIALIZATION_SYNTAX // known limitation
# define __STL_NO_CLASS_PARTIAL_SPECIALIZATION // known limitation
# define __STL_NO_FUNCTION_TMPL_PARTIAL_ORDER // known limitation
# define __STL_HAS_NO_NAMESPACES //*TY 08/01/1999 - still active bug under MrCpp 4.1.0a8
# define __STL_NO_EXPLICIT //*TY 08/01/1999 - still active bug under MrCpp 4.1.0a8
# define __STL_NON_TYPE_TMPL_PARAM_BUG //*TY 08/01/1999 - still active bug under MrCpp 4.1.0a8
# define __STL_THROW_RETURN_BUG //*TY 08/01/1999 - still active bug under MrCpp 4.1.0a8
# define __SGI_STL_NO_ARROW_OPERATOR //*TY 08/01/1999 - still active bug under MrCpp 4.1.0a8
# define __STL_NO_PROXY_ARROW_OPERATOR //*TY 08/01/1999 - still active bug under MrCpp 4.1.0a8
# define __STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS //*TY 08/01/1999 - still active bug under MrCpp 4.1.0a8
#endif // defined (__MRC__)
// temporal. workaround for stl_config.h problem
#ifdef __STL_NO_MUTABLE
# define __STL_NEED_MUTABLE //*TY 08/01/1999 - should correct stl_config.h, stl_iterator.h, stldebug.c
#endif
#ifdef __STL_NO_TYPENAME
# define __STL_NEED_TYPENAME //*TY 08/01/1999 - should correct stl_config.h
#endif
#ifdef __STL_NO_EXPLICIT
# define __STL_NEED_EXPLICIT //*TY 08/01/1999 - should correct stl_config.h
#endif
@@ -0,0 +1,53 @@
// STLport configuration file
// It is internal STLport header - DO NOT include it directly
// AS/400 C++ config
# define __STL_NO_BOOL
# define __STL_LIMITED_DEFAULT_TEMPLATES
# define __STL_HAS_NO_NAMESPACES
# define __STL_NEED_TYPENAME
# define __STL_NEED_EXPLICIT
# define __STL_HAS_NO_EXCEPTIONS
# define __STL_NO_EXCEPTION_SPEC
# define __SGI_STL_NO_ARROW_OPERATOR
# define __STL_NO_NEW_STYLE_CASTS
# define __STL_NEED_MUTABLE
# define __STL_NO_PARTIAL_SPECIALIZATION_SYNTAX
# define __STL_NO_BAD_ALLOC
# define __STL_NO_MEMBER_TEMPLATES
# define __STL_NO_MEMBER_TEMPLATE_CLASSES
# define __STL_NO_MEMBER_TEMPLATE_KEYWORD
# define __STL_NO_FRIEND_TEMPLATES
# define __STL_NO_QUALIFIED_FRIENDS
# define __STL_NO_CLASS_PARTIAL_SPECIALIZATION
# define __STL_NO_FUNCTION_TMPL_PARTIAL_ORDER
# define __STL_NO_METHOD_SPECIALIZATION
# define __STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS
# define __STL_NO_EXCEPTION_HEADER
# define __STL_HAS_NO_NEW_IOSTREAMS
# define __STL_HAS_NO_NEW_C_HEADERS
# define __STL_STATIC_CONST_INIT_BUG
# define __STL_THROW_RETURN_BUG
# define __STL_LINK_TIME_INSTANTIATION
# define __STL_NO_TEMPLATE_CONVERSIONS
# define __STL_UNINITIALIZABLE_PRIVATE 1
# define __STL_STATIC_ARRAY_BUG 1
# define __STL_NON_TYPE_TMPL_PARAM_BUG 1
# define __STL_TRIVIAL_DESTRUCTOR_BUG 1
# if defined(_LONG_LONG)
# define __STL_LONG_LONG 1
# endif
// # define __STL_LONG_DOUBLE 1
# if defined(_PTHREADS)
# define _MULTI_THREADED
# endif
// fbp : to fix __partition() problem
# define __STL_NONTEMPL_BASE_MATCH_BUG 1
@@ -0,0 +1,100 @@
// STLport configuration file
// It is internal STLport header - DO NOT include it directly
# define __STL_USING_BASE_MEMBER
// versions ?
# define __STL_EXPORT_DECLSPEC __declspec(dllexport)
# define __STL_IMPORT_DECLSPEC __declspec(dllimport)
# define __STL_CLASS_EXPORT_DECLSPEC __declspec(dllexport)
# define __STL_CLASS_IMPORT_DECLSPEC __declspec(dllimport)
#if ( __BORLANDC__ == 0x540 )
// Borland C++ Builder 4 with Patch#1
// The keyword 'export' is reserved for future use.
// # define __STL_USE_NEWALLOC 1
#endif
#if ( __BORLANDC__ < 0x540 )
// Borland C++ Builder 3 (?)
// those are assumptions, if some of them actually work, please let me know
# define __STL_STATIC_CONST_INIT_BUG 1
// # define __STL_THROW_RETURN_BUG 1
# define __STL_NO_TEMPLATE_CONVERSIONS 1
# define __STL_DEFAULT_CONSTRUCTOR_BUG 1
#endif
// BCB 2 or less (Borland 5.02)
#if ( __BORLANDC__ < 0x530 )
# define __STL_NO_MEMBER_TEMPLATES 1
# define __STL_NO_MEMBER_TEMPLATE_CLASSES 1
# define __STL_NO_MEMBER_TEMPLATE_KEYWORD 1
# define __STL_NO_FRIEND_TEMPLATES 1
# define __STL_NO_QUALIFIED_FRIENDS 1
# define __STL_NO_CLASS_PARTIAL_SPECIALIZATION 1
# define __STL_NO_FUNCTION_TMPL_PARTIAL_ORDER 1
# define __STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS 1
# define __STL_HAS_NO_NEW_IOSTREAMS 1
# define __STL_HAS_NO_NEW_C_HEADERS 1
# define __STL_GLOBAL_VENDOR_CSTD 1
# define __STL_NO_PARTIAL_SPECIALIZATION_SYNTAX 1
# define __STL_LIMITED_DEFAULT_TEMPLATES 1
# define __STL_NO_DEFAULT_NON_TYPE_PARAM 1
# define __STL_NON_TYPE_TMPL_PARAM_BUG 1
# define __STL_MEMBER_SPECIALIZATION_BUG
# define __STL_NO_EXCEPTION_HEADER 1
# define __STL_NO_EXCEPTION_SPEC 1
# define __STL_NO_BAD_ALLOC 1
# define __SGI_STL_NO_ARROW_OPERATOR 1
# define __STL_NO_PROXY_ARROW_OPERATOR 1
#endif
// Borland 5.0x
#if ( __BORLANDC__ < 0x520 )
# define __STL_BROKEN_USING_DIRECTIVE 1
# define __STLPORT_EXPORT_KEYWORD _export
# define __STLPORT_IMPORT_KEYWORD _import
# define __STLPORT_EXPORT_TEMPLATE_KEYWORD _export
# define __STLPORT_IMPORT_TEMPLATE_KEYWORD _import
#endif
#if ( __BORLANDC__ < 0x501 )
# define __STL_NONTEMPL_BASE_MATCH_BUG 1
# define __STL_NO_WCHAR_T 1
#endif
// 4.x
#if ( __BORLANDC__ < 0x500 )
# define __STL_NESTED_TYPE_PARAM_BUG 1
# define __STL_STATIC_ARRAY_BUG 1
# define __STL_NO_BOOL 1
# define __STL_HAS_NO_NAMESPACES 1
# define __STL_NEED_TYPENAME 1
# define __STL_NEED_EXPLICIT 1
# define __STL_NEED_MUTABLE 1
# define __STL_NO_WCHAR_T 1
#endif
//auto enable thread safety and exceptions:
# ifndef _CPPUNWIND
# define __STL_HAS_NO_EXCEPTIONS
# endif
# if defined ( __MT__ ) && !defined (_NOTHREADS) && !defined (_REENTRANT)
# define _REENTRANT 1
# endif
# if defined ( __DEBUG ) &&( __DEBUG > 0 )
# define __STL_DEBUG
# endif
// Stop complaints about functions not inlined
# pragma option -w-inl
// Stop complaints about significant digits
# pragma option -w-sig
// Stop complaint about constant being long
# pragma option -w-cln
@@ -0,0 +1,30 @@
// STLport configuration file
// It is internal STLport header - DO NOT include it directly
// COMO 4.238 with MSVC
# define __STL_UINT32_T unsigned int
// this one is true only with MS
# if defined (_MSC_VER)
# define __STL_WCHAR_T_IS_USHORT 1
# if _MSC_VER <= 1200
# define __STL_VENDOR_GLOBAL_CSTD
# endif
# if _MSC_VER < 1100
# define __STL_NO_BAD_ALLOC 1
# define __STL_NO_EXCEPTION_HEADER 1
# define __STL_HAS_NO_NEW_C_HEADERS 1
# define __STL_NO_NEW_NEW_HEADER 1
# define __STL_NO_NEW_IOSTREAMS 1
# endif
# endif
// # define __STL_NO_FUNCTION_TMPL_PARTIAL_ORDER 1
// # define __STL_NON_TYPE_TMPL_PARAM_BUG 1
// # define __STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS 1
# define __EDG_SWITCHES
@@ -0,0 +1,228 @@
/*
* 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.
*
*/
/*
* STLport configuration file
* It is internal STLport header - DO NOT include it directly
* Purpose of this file : to define STLport settings that depend on
* compiler flags or can be otherwise missed by "configure"
*
*/
#ifndef __STL_CONFIX_H
# define __STL_CONFIX_H
// some fixes to configuration, either "configure"d or
// hardcoded. This also includes modifications
// of STLport switches depending on compiler flags
// Microsoft Visual C++ 4.0, 4.1, 4.2, 5.0
// distinguish real MSC
# if defined(_MSC_VER) && !defined(__MWERKS__) && !defined (__BORLANDC__)
# define __STL_MSVC _MSC_VER
# endif
// sunpro
# if defined (__SUNPRO_CC)
# define __STL_NATIVE_INCLUDE_PATH ../CC
// # ifndef __STL_HAS_NO_NEW_C_HEADERS
// # define __STL_HAS_NO_NEW_C_HEADERS
// # endif
// bit-field problem ?
// # undef __STL_NEED_MUTABLE
// # define __STL_NEED_MUTABLE
# if (__SUNPRO_CC >=0x500)
// # define __STL_NATIVE_HEADER(header) <../CC/##header##>
# define __STL_NATIVE_C_HEADER(header) <../CC/##header##.SUNWCCh>
# define __STL_NATIVE_CPP_C_HEADER(header) <../CC/##header##.SUNWCCh>
# if !defined (__STLPORT_NEW_IOSTREAMS)
# undef __STL_USE_OWN_NAMESPACE
# define __STL_USE_OWN_NAMESPACE 1
# endif
# else
# define wint_t __wint_t
// famous CC 4.2 bug
# define __STL_INLINE_STRING_LITERAL_BUG 1
// /usr/include
# define __STL_NATIVE_C_INCLUDE_PATH ../include
# endif
# endif
// msvc
# if defined(__STL_MSVC)
// fix possible "configure" bugs for VC++ and define things
// not settable with "configure"
#include "..\stl_inc_find.hpp"
//# define __STL_NATIVE_HEADER(x) <D:\Microsoft Visual Studio\VC98\INCLUDE/##x>
//# define __STL_NATIVE_C_HEADER(x) <D:\Microsoft Visual Studio\VC98\INCLUDE/##x>
//# define __STL_NATIVE_CPP_C_HEADER(x) <D:\Microsoft Visual Studio\VC98\INCLUDE/##x>
# define __STL_EXPORT_DECLSPEC __declspec(dllexport)
# define __STL_IMPORT_DECLSPEC __declspec(dllimport)
# define __STL_IMPORT_TEMPLATE_KEYWORD extern
# if (__STL_MSVC > 0x420)
# define __STL_CLASS_EXPORT_DECLSPEC __declspec(dllexport)
# define __STL_CLASS_IMPORT_DECLSPEC __declspec(dllimport)
# endif
# define __STL_NO_TYPENAME_IN_TEMPLATE_HEADER
// fails to properly resolve call to sin() from within sin()
# define __STL_SAME_FUNCTION_NAME_RESOLUTION_BUG
#if __STL_MSVC > 1000
#pragma warning ( disable : 4355) // ignore warning "this used in base member initializer list.
// #pragma warning ( disable : 4251 ) // ignore template classes being exported in .dll's
#pragma warning ( disable : 4284 ) // ignore arrow operator warning
#pragma warning ( disable : 4231 ) // extern before spesialization
#pragma warning ( disable : 4701 )
#endif
# if (__STL_MSVC < 1100)
# undef __STL_DEFAULT_TYPE_PARAM
# undef __STL_HAS_NO_NAMESPACES
# undef __STL_NO_AT_MEMBER_FUNCTION
# undef __STL_NO_MEMBER_TEMPLATES
# undef __STL_NO_MEMBER_TEMPLATE_CLASSES
# define __STL_HAS_NO_NAMESPACES 1
# define __STL_NO_AT_MEMBER_FUNCTION 1
# define __STL_NO_MEMBER_TEMPLATES
# define __STL_NO_MEMBER_TEMPLATE_CLASSES
# elif (__STL_MSVC > 1100)
typedef char __stl_char;
# define __STL_DEFAULTCHAR __stl_char
# endif /* (__STL_MSVC < 1100 ) */
# define __STL_MSVC50_COMPATIBILITY 1
# endif /* __STL_MSVC */
// list of compilers to use SGI string
# if (defined (__sgi) || defined (__GNUC__))
# if !defined (__STL_USE_SGI_STRING)
# define __STL_USE_SGI_STRING 1
# endif
# undef __STL_USE_OWN_NAMESPACE
# endif
# if defined(__hpux) && !defined(__GNUC__)
# define __STL_USING_BASE_MEMBER
// HP aCC with +noeh
# ifdef __HPACC_NOEH
# define __STL_HAS_NO_EXCEPTIONS 1
# endif
# endif
# if defined (__GNUC__)
// strict ANSI prohibits "long long" ( gcc)
# if defined ( __STRICT_ANSI__ )
# undef __STL_LONG_LONG
# endif
# ifndef __EXCEPTIONS
# undef __STL_HAS_NO_EXCEPTIONS
# define __STL_HAS_NO_EXCEPTIONS 1
# endif
#if (__GNUC_MINOR__ < 8)
# define __STL_NATIVE_INCLUDE_PATH ../g++-include
#else
# define __STL_NATIVE_INCLUDE_PATH ../g++
#endif
# define __STL_NATIVE_CPP_C_INCLUDE_PATH __STL_NATIVE_INCLUDE_PATH
# define __STL_NATIVE_C_INCLUDE_PATH ../include
# ifndef __HONOR_STD
# define __STL_VENDOR_GLOBAL_EXCEPT_STD 1
# endif
# endif /* __GNUC */
# if defined(__MINGW32__)
# define __STL_NO_DRAND48
# endif
#if defined (__APOGEE__)
# undef __STL_LINK_TIME_INSTANTIATION
# define __STL_LINK_TIME_INSTANTIATION 1
# define __STL_TYPENAME_ON_RETURN_TYPE typename
# ifdef __STDLIB
# undef __STL_HAS_NO_NEW_IOSTREAMS
# undef __STL_NO_NEW_C_HEADERS
# undef __STL_NO_NEW_NEW_HEADER
# undef __STL_NO_BAD_ALLOC
# undef __STL_LONG_LONG
# else
# undef __STL_NO_EXCEPTION_SPEC
# define __STL_NO_EXCEPTION_SPEC 1
# endif
#endif
// Modena C++ library
#if defined (__MWERKS__) || defined (__KCC)
# include <mcompile.h>
# define __STL_USE_MSIPL 1
# if defined (__KCC) || (defined(__MSL_CPP__) && \
( (__MSL_CPP__ >= 0x5000 && defined( _MSL_NO_MESSAGE_FACET )) || \
(__MSL_CPP__ < 0x5000 && defined( MSIPL_NL_TYPES ))) \
)
# define __STL_NO_NATIVE_MESSAGE_FACET 1
# endif
#endif
// common switches for EDG front-end
# if defined (__EDG_SWITCHES)
# if !(defined(_TYPENAME) || defined (_TYPENAME_IS_KEYWORD))
# undef __STL_NEED_TYPENAME
# define __STL_NEED_TYPENAME 1
# endif
# if !defined(_WCHAR_T_IS_KEYWORD)
# undef __STL_NO_WCHAR_T
# define __STL_NO_WCHAR_T 1
# endif
# ifndef _PARTIAL_SPECIALIZATION_OF_CLASS_TEMPLATES
# undef __STL_NO_CLASS_PARTIAL_SPECIALIZATION
# define __STL_NO_CLASS_PARTIAL_SPECIALIZATION 1
# endif
# ifndef _MEMBER_TEMPLATES
# undef __STL_NO_MEMBER_TEMPLATES
# define __STL_NO_MEMBER_TEMPLATES 1
# undef __STL_NO_MEMBER_TEMPLATE_CLASSES
# define __STL_NO_MEMBER_TEMPLATE_CLASSES 1
# endif
# if !defined(_MEMBER_TEMPLATE_KEYWORD)
# undef __STL_NO_MEMBER_TEMPLATE_KEYWORD
# define __STL_NO_MEMBER_TEMPLATE_KEYWORD 1
# endif
# if !defined (__EXCEPTIONS) && ! defined (_EXCEPTIONS)
# undef __STL_HAS_NO_EXCEPTIONS
# define __STL_HAS_NO_EXCEPTIONS
# endif
# undef __EDG_SWITCHES
# endif /* EDG */
#endif
@@ -0,0 +1,98 @@
# define __STL_NATIVE_HEADER(header) <../cxx/##header>
# define __STL_NATIVE_C_HEADER(x) <../include/##x>
# define __STL_NATIVE_CPP_C_HEADER(header) <../cxx/##header>
#if (__DECCXX_VER < 60000000)
// automatic template instantiation does not
// work with namespaces ;(
# define __STL_HAS_NO_NAMESPACES 1
# define __STL_NO_WCHAR_T 1
# define __STL_NEED_EXPLICIT 1
# define __STL_NO_BOOL 1
# define __STL_NEED_TYPENAME 1
# define __STL_NO_NEW_STYLE_CASTS 1
# define __STL_NEED_MUTABLE 1
# define __STL_NO_BAD_ALLOC 1
# define __STL_NO_NEW_NEW_HEADER 1
# define __STL_NO_PARTIAL_SPECIALIZATION_SYNTAX 1
# define __STL_NO_MEMBER_TEMPLATES 1
# define __STL_NO_MEMBER_TEMPLATE_CLASSES 1
# define __STL_NO_MEMBER_TEMPLATE_KEYWORD 1
# define __STL_NO_FRIEND_TEMPLATES 1
# define __STL_NO_QUALIFIED_FRIENDS 1
# define __STL_NO_CLASS_PARTIAL_SPECIALIZATION 1
# define __STL_NO_FUNCTION_TMPL_PARTIAL_ORDER 1
# define __STL_NON_TYPE_TMPL_PARAM_BUG 1
# define __STL_BROKEN_USING_DIRECTIVE 1
# define __STL_NO_EXCEPTION_HEADER 1
# define __STL_DEFAULT_CONSTRUCTOR_BUG 1
#endif
#ifdef __NO_USE_STD_IOSTREAM
# define __STL_HAS_NO_NEW_IOSTREAMS 1
# else
// default is to use new iostreams, anyway
# ifndef __USE_STD_IOSTREAM
# define __USE_STD_IOSTREAM
# endif
#endif
// # if !defined (__STLPORT_NEW_IOSTREAMS) && ! defined (__STL_DONT_REDEFINE_STD) \
// && ! defined (__STL_REDEFINE_STD)
// # undef __PRAGMA_ENVIRONMENT
// # define __STL_DONT_REDEFINE_STD
// # endif
//# ifndef __STD_STRICT_ANSI_ERRORS
//# endif
#ifndef __EXCEPTIONS
# define __STL_HAS_NO_EXCEPTIONS 1
#endif
# ifdef __IMPLICIT_INCLUDE_ENABLED
#ifndef __STLPORT_IOSTREAMS
// implicit include introduces conflicts
// between stlport and native lib.
# undef __IMPLICIT_INCLUDE_ENABLED
#endif
// but, works with ours ;).
# define __STL_LINK_TIME_INSTANTIATION 1
# endif
# if defined (__IMPLICIT_USING_STD) && !defined (__NO_USE_STD_IOSTREAM)
// we should ban that !
# error "STLport won't work with new iostreams and std:: being implicitly included. Please use -std strict_ansi[_errors] or specify __NO_USE_STD_IOSTREAM"
# endif
# if !(defined (__STD_STRICT_ANSI) || defined (__STD_STRICT_ANSI_ERRORS))
// we want to enforce it
# define __STL_LONG_LONG 1
# endif
// unsigned 32-bit integer type
# define __STL_UINT32_T unsigned int
# define __STL_RAND48 1
# define __STL_TYPENAME_ON_RETURN_TYPE typename
# define __STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS 1
# if (__DECCXX_VER <= 60200000)
# define __STL_HAS_NO_NEW_C_HEADERS 1
# endif
@@ -0,0 +1,84 @@
// STLport configuration file
// It is internal STLport header - DO NOT include it directly
// g++ 2.7.x and above
# define __STL_LONG_LONG 1
// # define __STL_LONG_DOUBLE 1
# define __STL_HAS_NO_NEW_IOSTREAMS 1
# define __STL_VENDOR_GLOBAL_CSTD 1
# define __STL_NO_NATIVE_MBSTATE_T 1
# define __STL_NO_NATIVE_WIDE_FUNCTIONS 1
// gcc fails to initialize builtin types in expr. like this : new(p) char();
# define __STL_DEFAULT_CONSTRUCTOR_BUG 1
// this should always work
# if (__GNUC_MINOR__ < 90) /* egcs 1.1 */
# define __STL_NO_TEMPLATE_CONVERSIONS
// # define __STL_NO_MEMBER_TEMPLATES 1
# define __STL_NO_MEMBER_TEMPLATE_CLASSES 1
# define __STL_NO_FUNCTION_TMPL_PARTIAL_ORDER 1
# define __STL_NO_FRIEND_TEMPLATES 1
# define __STL_HAS_NO_NAMESPACES 1
// DJGPP doesn't seem to implement it in 2.8.x
# ifdef DJGPP
# define __STL_NO_STATIC_TEMPLATE_DATA 1
# endif
# endif
# if __GNUC__ <= 2 && __GNUC_MINOR__ <= 7 && ! defined (__CYGWIN32__)
// Will it work with 2.6 ? I doubt it.
# if ( __GNUC_MINOR__ < 6 )
__GIVE_UP_WITH_STL(GCC_272);
# endif
# define __STL_LIMITED_DEFAULT_TEMPLATES 1
# define __STL_DEFAULT_TYPE_PARAM 1
# define __STL_NO_BAD_ALLOC
# define __SGI_STL_NO_ARROW_OPERATOR 1
# ifndef __STL_NO_STATIC_TEMPLATE_DATA
# define __STL_NO_STATIC_TEMPLATE_DATA
# endif
# define __STL_NO_MEMBER_TEMPLATES 1
# define __STL_NO_CLASS_PARTIAL_SPECIALIZATION 1
# define __STL_NO_METHOD_SPECIALIZATION 1
# if !defined (__CYGWIN32__)
# define __STL_NESTED_TYPE_PARAM_BUG 1
# define __STL_BASE_MATCH_BUG 1
// unused operators are required (forward)
# define __STL_CONST_CONSTRUCTOR_BUG
# define __STL_NO_DEFAULT_NON_TYPE_PARAM
# endif
# define __STL_NO_PARTIAL_SPECIALIZATION_SYNTAX 1
# define __STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS 1
# define __STL_NO_EXCEPTION_HEADER 1
# else /* ! <= 2.7.* */
# endif /* ! <= 2.7.* */
// static template data members workaround strategy for gcc tries
// to use weak symbols.
// if you don't want to use that, #define __STL_WEAK_ATTRIBUTE=0 ( you'll
// have to put "#define __PUT_STATIC_DATA_MEMBERS_HERE" line in one of your
// compilation unit ( or CFLAGS for it ) _before_ including any STL header ).
# if defined (__STL_NO_STATIC_TEMPLATE_DATA) && ! defined (__STL_WEAK_ATTRIBUTE )
// systems using GNU ld or format that supports weak symbols
// may use "weak" attribute
// Linux & Solaris ( x86 & SPARC ) are being auto-recognized here
# if defined(__STL_GNU_LD) || defined(__ELF__) || \
(( defined (__SVR4) || defined ( __svr4__ )) && \
( defined (sun) || defined ( __sun__ )))
# define __STL_WEAK_ATTRIBUTE 1
# endif
# endif /* __STL_WEAK_ATTRIBUTE */
@@ -0,0 +1,87 @@
// STLport configuration file
// It is internal STLport header - DO NOT include it directly
// HP compilers
# if __cplusplus >= 199707L
// it is aCC
// use the most conservative configuration as the base
///# define __STL_DEFAULT_TEMPLATE_PARAM 1
# define __STL_RAND48 1
# define __STL_PARTIAL_SPECIALIZATION_BUG 1
# define __STL_NO_QUALIFIED_FRIENDS 1
# define __STL_LONG_LONG 1
// # define __STL_LONG_DOUBLE 1
# define __STL_CLASS_PARTIAL_SPECIALIZATION 1
// aCC bug ? need explicit args on constructors of partial specialized
// classes
# define __STL_PARTIAL_SPEC_NEEDS_TEMPLATE_ARGS 1
// maybe present in later versions ?
# define __STL_NO_MEMBER_TEMPLATE_CLASSES 1
# define __STL_NO_MEMBER_TEMPLATE_KEYWORD 1
# define __STL_FUNC_PARTIAL_ORDERING 1
# define __STL_METHOD_SPECIALIZATION 1
// ?? fbp: really needed ?
# define __STL_STATIC_ARRAY_BUG 1
// <exception> and stuff is in global namespace
# define __STL_VENDOR_GLOBAL_STD
# define __STL_TYPENAME_ON_RETURN_TYPE typename
# else
// it is HP's old cfront-based compiler.
# define __STL_NO_BOOL 1
# define __STL_DONT_USE_BOOL_TYPEDEF 1
# define __STL_NO_SIGNED_BUILTINS
# define __STL_LIMITED_DEFAULT_TEMPLATES 1
# define __STL_DEFAULT_TYPE_PARAM 1
# define __STL_NO_STATIC_TEMPLATE_DATA 1
# define __STL_HAS_NO_NAMESPACES 1
# define __STL_NEED_TYPENAME 1
# define __STL_NEED_EXPLICIT 1
# define __STL_HAS_NO_EXCEPTIONS 1
# define __STL_NO_EXCEPTION_SPEC 1
# define __SGI_STL_NO_ARROW_OPERATOR 1
# define __STL_NO_NEW_STYLE_CASTS 1
# define __STL_NO_WCHAR_T 1
# define __STL_NEED_MUTABLE 1
# define __STL_NO_PARTIAL_SPECIALIZATION_SYNTAX 1
# define __STL_NO_BAD_ALLOC 1
# define __STL_NO_MEMBER_TEMPLATES 1
# define __STL_NO_MEMBER_TEMPLATE_CLASSES 1
# define __STL_NO_MEMBER_TEMPLATE_KEYWORD 1
# define __STL_NO_FRIEND_TEMPLATES 1
# define __STL_NO_QUALIFIED_FRIENDS 1
# define __STL_NO_CLASS_PARTIAL_SPECIALIZATION 1
# define __STL_NO_FUNCTION_TMPL_PARTIAL_ORDER 1
# define __STL_NO_DEFAULT_NON_TYPE_PARAM 1
# define __STL_NO_METHOD_SPECIALIZATION 1
# define __STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS 1
# define __STL_NO_EXCEPTION_HEADER 1
# define __STL_HAS_NO_NEW_IOSTREAMS 1
# define __STL_HAS_NO_NEW_C_HEADERS 1
# define __STL_STATIC_CONST_INIT_BUG 1
# define __STL_THROW_RETURN_BUG 1
# define __STL_LINK_TIME_INSTANTIATION 1
# define __STL_NO_TEMPLATE_CONVERSIONS 1
# endif /* cfront */
@@ -0,0 +1,82 @@
// STLport configuration file
// It is internal STLport header - DO NOT include it directly
// AIX xlC 3.1 , 3.0.1 ==0x301
// Visual Age C++ 3.x
// OS-390 C++
// fbp : should be version-specific!
# define __STL_NO_BOOL 1
# define __STL_DONT_USE_BOOL_TYPEDEF 1
# define __STL_LIMITED_DEFAULT_TEMPLATES 1
# define __STL_HAS_NO_NAMESPACES 1
# define __STL_NEED_TYPENAME 1
# define __STL_NEED_EXPLICIT 1
// # define __STL_HAS_NO_EXCEPTIONS 1
// # define __STL_NO_EXCEPTION_SPEC 1
# define __SGI_STL_NO_ARROW_OPERATOR 1
# define __STL_NO_PROXY_ARROW_OPERATOR 1
# define __STL_NO_NEW_STYLE_CASTS 1
# define __STL_NO_WCHAR_T 1
# define __STL_NEED_MUTABLE 1
# define __STL_NO_PARTIAL_SPECIALIZATION_SYNTAX 1
# define __STL_NO_BAD_ALLOC 1
# define __STL_NO_MEMBER_TEMPLATES 1
# define __STL_NO_MEMBER_TEMPLATE_CLASSES 1
# define __STL_NO_MEMBER_TEMPLATE_KEYWORD 1
# define __STL_NO_FRIEND_TEMPLATES 1
# define __STL_NO_QUALIFIED_FRIENDS 1
# define __STL_NO_CLASS_PARTIAL_SPECIALIZATION 1
# define __STL_NO_FUNCTION_TMPL_PARTIAL_ORDER 1
# define __STL_NO_DEFAULT_NON_TYPE_PARAM 1
# define __STL_NO_METHOD_SPECIALIZATION 1
# define __STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS 1
# define __STL_NO_EXCEPTION_HEADER 1
# define __STL_HAS_NO_NEW_IOSTREAMS 1
# define __STL_HAS_NO_NEW_C_HEADERS 1
# define __STL_NO_NEW_NEW_HEADER 1
# define __STL_STATIC_CONST_INIT_BUG 1
// # define __STL_THROW_RETURN_BUG 1
// I believe this is true for all IBM compilers
// __TEMPINC__ is set when /Ft+ option is used
# ifdef __TEMPINC__
# define __STL_LINK_TIME_INSTANTIATION 1
# endif
# define __STL_NO_TEMPLATE_CONVERSIONS 1
# define __STL_UNINITIALIZABLE_PRIVATE 1
# define __STL_BASE_TYPEDEF_OUTSIDE_BUG 1
# define __STL_STATIC_ARRAY_BUG 1
// AIX xlC, Visual Age 3.0 for OS/2 and MS
# define __STL_TRIVIAL_DESTRUCTOR_BUG 1
# if ( defined (__MULTI__) && defined (__WINDOWS__))
# define __STL_WIN32THREADS 1 // Only Visual Age 3.5 for Windows
# endif
# define __STL_NON_TYPE_TMPL_PARAM_BUG 1
# define __STL_NONTEMPL_BASE_MATCH_BUG 1
#if __IBMCPP__ < 350
# define __STL_LONG_DOUBLE 1
#endif
#if __IBMCPP__ <= 350
# define __STL_NEED_UNREACHABLE_RETURN 1
#endif
#if __IBMCPP__ >= 350
# define __STL_LONG_LONG 1
#endif
@@ -0,0 +1,58 @@
// STLport configuration file
// It is internal STLport header - DO NOT include it directly
// two levels of macros do not work good with icl.
# define __STL_NATIVE_HEADER(header) <../include/##header>
# define __STL_NATIVE_C_HEADER(header) <../include/##header>
# define __STL_NATIVE_CPP_C_HEADER(header) <../include/##header>
// Intel compiler 4.0
#if (__ICL >= 400)
// # define __STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS 1
// # define __STL_NO_MEMBER_TEMPLATE_KEYWORD 1
# define __STL_LONG_LONG 1
// # define __STL_LONG_DOUBLE 1
# define __STL_WCHAR_T_IS_USHORT 1
# define __STL_DEFAULT_CONSTRUCTOR_BUG 1
# pragma warning(disable:4786)
// <stdio> and the like still put stuff in ::namespace
// up to version 6
# define __STL_VENDOR_GLOBAL_CSTD 1
# if ( _MSC_VER<=1010 )
# define __STL_DONT_USE_BOOL_TYPEDEF 1
# define __STL_NO_BAD_ALLOC
# define __STL_HAS_NO_NEW_IOSTREAMS 1
# define __STL_NO_NEW_NEW_HEADER 1
# else
// # define __STL_YVALS_H 1
# endif /* 1010 */
# if (_MSC_VER < 1100) // MSVC 5.0
# define __STL_NO_BOOL
# define __STL_NEED_EXPLICIT 1
// up to 4.2, library is in global namespace
# define __STL_VENDOR_GLOBAL_STD
# endif /* 1100 */
# if _MSC_VER < 1200 /* VC++ 6.0 */
# define __STL_NON_TYPE_TMPL_PARAM_BUG 1
# endif
// these switches depend on compiler flags
# ifndef _CPPUNWIND
# define __STL_HAS_NO_EXCEPTIONS
# endif
# if defined ( _MT ) && !defined (_NOTHREADS) && !defined (_REENTRANT)
# define _REENTRANT 1
# endif
#else /* __ICL >=400 */
// this should work for older versions
# include <config/stl_msvc.h>
#endif /* __ICL >=400 */
@@ -0,0 +1,26 @@
// STLport config file for KAI C++ compiler
# define __STL_RAND48 1
# ifndef __KAI_STRICT /* _NO_LONGLONG */
# define __STL_LONG_LONG 1
# endif
# if !defined (__EXCEPTIONS) && ! defined (_EXCEPTIONS)
# define __STL_HAS_NO_EXCEPTIONS
# endif
# define __STL_TYPENAME_ON_RETURN_TYPE typename
// # define __STL_LINK_TIME_INSTANTIATION 1
# define __STL_VENDOR_GLOBAL_CSTD 1
# define __STL_NO_NATIVE_WIDE_STREAMS 1
// two levels of macros do not work good with kcc.
# define __STL_NATIVE_HEADER(header) <../include/##header>
# define __STL_NATIVE_C_HEADER(header) <../include/##header>
# define __STL_NATIVE_CPP_C_HEADER(header) <../include/##header>
// KAI C++ uses EDG front-end, but apparently different switches
// # define __EDG_SWITCHES 1
@@ -0,0 +1,82 @@
// STLport configuration file
// It is internal STLport header - DO NOT include it directly
// Microsoft Visual C++ 4.0, 4.1, 4.2, 5.0
// Common features for VC++ 4.0 and higher
# define __STL_NO_FUNCTION_TMPL_PARTIAL_ORDER 1
# define __STL_NO_CLASS_PARTIAL_SPECIALIZATION 1
# define __STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS 1
# define __STL_NO_MEMBER_TEMPLATE_KEYWORD 1
# define __STL_NO_MEMBER_TEMPLATE_CLASSES 1
# define __STL_NO_FRIEND_TEMPLATES
// # define __STL_LONG_DOUBLE 1
# define __STL_WCHAR_T_IS_USHORT 1
// up to VC6 ?
# define __STL_NO_QUALIFIED_FRIENDS 1
# define __STL_DEFAULT_CONSTRUCTOR_BUG 1
# define __STL_STATIC_CONST_INIT_BUG 1
// <NBulteau@jouve.fr> : suppressed "truncated debug info" warning
# pragma warning(disable:4786)
// <stdio> and the like still put stuff in ::namespace
// up to version 6
# define __STL_VENDOR_GLOBAL_CSTD
# define __STL_DONT_USE_BOOL_TYPEDEF 1
# if ( _MSC_VER<=1010 )
// "bool" is reserved in MSVC 4.1 while <yvals.h> absent, so :
// # define __STL_USE_ABBREVS 1
# define __STL_NO_BAD_ALLOC
# define __STL_HAS_NO_NEW_C_HEADERS 1
# define __STL_NO_NEW_NEW_HEADER 1
# define __STL_HAS_NO_NEW_IOSTREAMS 1
# else
// VC++ 4.2 and higher
# define __STL_YVALS_H 1
# endif /* 1010 */
# if (_MSC_VER >= 1100) // MSVC 5.0
// these work, as long they are inline
# define __STL_INLINE_MEMBER_TEMPLATES 1
# else
# define __STL_NO_BOOL 1
# define __STL_NEED_TYPENAME 1
# define __STL_NEED_EXPLICIT 1
# define __STL_NEED_MUTABLE 1
# define __STL_NO_PARTIAL_SPECIALIZATION_SYNTAX
# define __STL_LIMITED_DEFAULT_TEMPLATES 1
# define __STL_NO_MEMBER_TEMPLATES 1
// up to 4.2, library is in global namespace
// # define __STL_NESTED_TYPE_PARAM_BUG
# define __STL_VENDOR_GLOBAL_STD
# define __STL_NONTEMPL_BASE_MATCH_BUG 1
# define __STL_BROKEN_USING_DIRECTIVE 1
# define __SGI_STL_NO_ARROW_OPERATOR
# define __STL_NO_EXCEPTION_SPEC 1
# endif /* 1100 */
# if _MSC_VER < 1200 /* VC++ 6.0 */
# define __STL_NON_TYPE_TMPL_PARAM_BUG 1
# define __STL_THROW_RETURN_BUG 1
# endif
// these switches depend on compiler flags
# ifndef _CPPUNWIND
# define __STL_HAS_NO_EXCEPTIONS 1
# endif
# if defined ( _MT ) && !defined (_NOTHREADS) && !defined (_REENTRANT)
# define _REENTRANT 1
# endif
// If we are under Windows CE, include appropriate config
# ifdef UNDER_CE
# include <config/stl_wince.h>
# endif
@@ -0,0 +1,106 @@
// STLport configuration file
// It is internal STLport header - DO NOT include it directly
//
// Compiler features
//
// *** CodeWarrior Compiler Common Features ***
# if __option(longlong)
# define __STL_LONG_LONG 1
# endif
# define __SGI_STL_USE_AUTO_PTR_CONVERSIONS
// *** CodeWarrior Compiler Common Bugs ***
# define __MSL_FIX_ITERATORS__(myType) // Some MSL headers rely on this
# define __STL_NO_TEMPLATE_CONVERSIONS 1
# define __STL_THROW_RETURN_BUG 1
# define __STL_MEMBER_SPECIALIZATION_BUG 1
# define __STL_NO_MEMBER_TEMPLATE_KEYWORD 1
// *** Version-specific settings ***
# if __MWERKS__ < 0x2300 // CW Pro5 features
# define __STL_INLINE_MEMBER_TEMPLATES 1
# define __STL_RELOPS_IN_STD_BUG 1
# define __STL_DEFAULT_CONSTRUCTOR_BUG 1
# else
# define __STL_TYPENAME_ON_RETURN_TYPE typename
# endif
# if __MWERKS__ < 0x2200 // CW Pro4 features
# define __STL_BROKEN_USING_DIRECTIVE 1
# define __STL_NO_MEMBER_TEMPLATES 1
# define __STL_NO_MEMBER_TEMPLATE_CLASSES 1
# define __STL_NO_MEMBER_TEMPLATE_KEYWORD 1
# define __STL_NO_FRIEND_TEMPLATES 1
# define __STL_NO_QUALIFIED_FRIENDS 1
# define __STL_NO_FUNCTION_TMPL_PARTIAL_ORDER 1
# endif
# if __MWERKS__ < 0x2100 // CW Pro3 features
# define __STL_NO_CLASS_PARTIAL_SPECIALIZATION 1
# define __STL_HAS_NO_NAMESPACES 1
# define __STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS 1
# define __STL_NEED_TYPENAME 1
# define __SGI_STL_NO_ARROW_OPERATOR 1
# define __STL_TEMPLATE_PARAM_SUBTYPE_BUG 1
# define __STL_FORCED_INLINE_INSTANTIATION_BUG 1
# define __STL_MULTI_CONST_TEMPLATE_ARG_BUG 1
# define __STL_INLINE_NAME_RESOLUTION_BUG 1
// *** Metrowerks Standard Library Bug ***
# define __STL_MSVC50_COMPATIBILITY 1
# endif
# if __MWERKS__ < 0x2000 // v. 2.0 features
# define __STL_NO_WCHAR_T 1
# define __STL_NO_DEFAULT_NON_TYPE_PARAM 1
# define __STL_NON_TYPE_TMPL_PARAM_BUG 1 // dwa 8/21/97 - this bug fixed for CWPro2
# define __STL_UNINITIALIZABLE_PRIVATE 1 // dwa 10/23/97 - this bug fixed for CWPro2
# endif
# if __MWERKS__ < 0x1900 // dwa 8/19/97 - 1.9 Compiler feature defines
# define __STL_LIMITED_DEFAULT_TEMPLATES 1
# define __STL_BASE_TYPEDEF_BUG 1
# define __STL_BASE_MATCH_BUG 1
# define __STL_NONTEMPL_BASE_MATCH_BUG 1
# define __STL_DEFAULT_TYPE_PARAM 1 // More limited template parameters
# if __MWERKS__ < 0x1800
__GIVE_UP_WITH_STL(CW_18)
# endif
# endif
// fixes to native inclusion wrappers.
// This is for typical MAC installation. You might have to override it.
# if __MWERKS__ >= 0x2300 // CWPro5 changes paths - dwa 2/28/99
# define __STL_NATIVE_INCLUDE_PATH Macintosh HD:Codewarrior Pro 5:Metrowerks CodeWarrior:MSL:MSL_C++:MSL_Common:Include
# define __STL_NATIVE_C_INCLUDE_PATH Macintosh HD:Codewarrior Pro 5:Metrowerks CodeWarrior:MSL:MSL_C:MSL_Common:Include
# define __STL_NATIVE_HEADER(header) <Macintosh HD:Codewarrior Pro 5:Metrowerks CodeWarrior:MSL:MSL_C++:MSL_Common:Include:##header>
// fbp
# define __STL_NATIVE_CPP_C_HEADER(header) <Macintosh HD:Codewarrior Pro 5:Metrowerks CodeWarrior:MSL:MSL_C:MSL_Common:Include:##header>
# define __STL_NATIVE_C_HEADER(header) <Macintosh HD:Codewarrior Pro 5:Metrowerks CodeWarrior:MSL:MSL_C:MSL_Common:Include:##header>
# else
# define __STL_NATIVE_INCLUDE_PATH Macintosh HD:Codewarrior Pro 4:Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C++:Include
# define __STL_NATIVE_C_INCLUDE_PATH Macintosh HD:Codewarrior Pro 4:Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:MSL Common:Public Includes
# define __STL_NATIVE_HEADER(header) <Macintosh HD:Codewarrior Pro 4:Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C++:Include:##header>
# define __STL_NATIVE_CPP_C_HEADER(header) <Macintosh HD:Codewarrior Pro 4:Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C++:Include:##header>
# define __STL_NATIVE_C_HEADER(header) <Macintosh HD:Codewarrior Pro 4:Metrowerks CodeWarrior:Metrowerks Standard Library:MSL C:MSL Common:Public Includes:##header>
# endif
# define __STL_MAKE_HEADER(path, header) <path:header>
// fbp
# if !defined( __MSL_CPP__ ) || __MSL_CPP__ <= 0x4105
# define __STL_NO_NATIVE_WIDE_STREAMS 1
# endif
@@ -0,0 +1,265 @@
/*
* 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.
*
*/
/*
* Purpose of this file :
*
* A list of COMPILER-SPECIFIC portion of STLport settings.
* This file is provided to help in manulal configuration
* of STLport. This file is being included by stlcomp.h
* when STLport is unable to identify your compiler.
* Please remove the error diagnostic below before adjusting
* macros.
*
*/
# ifndef __STLPORT_MYCOMP_H
# define __STLPORT_MYCOMP_H
// Error diagnostic
# error "Your compiler version is not recognized by STLport. Please edit <config/stl_mycomp.h>
//==========================================================
// the values choosen here as defaults try to give
// maximum functionality on the most conservative settings
// Mostly correct guess, change it for Alpha (and other environments
// that has 64-bit "long")
// # define __STL_UINT32_T unsigned long
// Disables wchar_t functinality
// # define __STL_NO_WCHAR_T 1
// Define if wchar_t is not a unique type, and is actually a typedef to unsigned short.
// # define __STL_WCHAR_T_IS_USHORT 1
// Uncomment if long long is available
// # define __STL_LONG_LONG 1
// Uncomment if long double is not available
// # define __STL_NO_LONG_DOUBLE 1
// Uncomment this if your compiler does not support "typename" keyword
// # define __STL_NEED_TYPENAME 1
// Uncomment this if your compiler does not support "mutable" keyword
// # define __STL_NEED_MUTABLE 1
// Uncomment this if your compiler does not support "explicit" keyword
// # define __STL_NEED_EXPLICIT 1
// Uncomment if new-style-casts like const_cast<> are not available
// # define __STL_NO_NEW_STYLE_CASTS 1
// Uncomment this if your compiler does not have "bool" type
// # define __STL_NO_BOOL 1
// Uncomment this if your compiler does not have "bool" type, but has "bool" keyword reserved
// # define __STL_DONT_USE_BOOL_TYPEDEF 1
// Uncomment this if your compiler does not have "bool" type, but defines "bool" in <yvals.h>
// # define __STL_YVALS_H 1
// Uncomment this if your compiler has limited or no default template arguments for classes
// # define __STL_LIMITED_DEFAULT_TEMPLATES 1
// Uncomment this if your compiler support only complete (not dependent on other parameters)
// types as default parameters for class templates
// # define __STL_DEFAULT_TYPE_PARAM 1
// Uncomment this if your compiler has problem with not-type
// default template parameters
// # define __STL_NO_DEFAULT_NON_TYPE_PARAM 1
// Define if compiler has
// trouble with functions getting non-type-parameterized classes as parameters
// # define __STL_NON_TYPE_TMPL_PARAM_BUG 1
// Uncomment this if your compiler lacks static data members.
// Uncomment next line if your compiler supports __attribute__((weak))
// # define __STL_NO_STATIC_TEMPLATE_DATA 1
// # define __STL_WEAK_ATTRIBUTE 1
// Uncomment this if your compiler does not support namespaces
// # define __STL_HAS_NO_NAMESPACES 1
// Uncomment if "using" keyword does not work with template types
// # define __STL_BROKEN_USING_DIRECTIVE 1
// Uncomment this if your compiler does not support exceptions
// # define __STL_HAS_NO_EXCEPTIONS 1
// Uncomment this if your compiler does not support exception specifications
// # define __STL_NO_EXCEPTION_SPEC
// Define this if your compiler requires return statement after throw()
// # define __STL_THROW_RETURN_BUG 1
// Header <new> that comes with the compiler
// does not define bad_alloc exception
// # define __STL_NO_BAD_ALLOC 1
// Uncomment if member template methods are not available
// # define __STL_NO_MEMBER_TEMPLATES 1
// Uncomment if member template classes are not available
// # define __STL_NO_MEMBER_TEMPLATE_CLASSES 1
// Uncomment if no "template" keyword should be used with member template classes
// # define __STL_NO_MEMBER_TEMPLATE_KEYWORD 1
// Uncomment if friend member templates are not available
// # define __STL_NO_FRIEND_TEMPLATES 1
// Compiler does not accept friend declaration qualified with namespace name.
// # define __STL_NO_QUALIFIED_FRIENDS 1
// Uncomment if partial specialization is not available
// # define __STL_NO_CLASS_PARTIAL_SPECIALIZATION 1
// Define if class being partially specialized require full name (template parameters)
// of itself for method declarations
// # define __STL_PARTIAL_SPEC_NEEDS_TEMPLATE_ARGS
// partial specialization has bugs that prevent you from
// using new-style reverse_iterator
// # define __STL_PARTIAL_SPECIALIZATION_BUG
// Compiler has problems specializing members of partially
// specialized class
// # define __STL_MEMBER_SPECIALIZATION_BUG
// Uncomment if partial order of template functions is not available
// # define __STL_NO_FUNC_PARTIAL_ORDERING 1
// Uncomment if specialization of methods is not allowed
// # define __STL_NO_METHOD_SPECIALIZATION 1
// Uncomment if full specialization does not use partial spec. syntax : template <> struct ....
// # define __STL_NO_PARTIAL_SPECIALIZATION_SYNTAX 1
// Uncomment if compiler does not support explicit template arguments for functions
// # define __STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS
// Uncomment if "__typetraits is being instaniated automatically by the compiler (SGI only ?)
// # define __STL_AUTOMATIC_TYPE_TRAITS 1
// Uncomment this if your compiler can't inline while(), for()
// # define __STL_LOOP_INLINE_PROBLEMS 1
// Define if the compiler fails to match a template function argument of base
// # define __STL_BASE_MATCH_BUG 1
// Define if the compiler fails to match a template function argument of base
// (non-template)
//# define __STL_NONTEMPL_BASE_MATCH_BUG 1
// Define if the compiler rejects outline method definition
// explicitly taking nested types/typedefs
// # define __STL_NESTED_TYPE_PARAM_BUG 1
// Compiler requires typename keyword on outline method definition
// explicitly taking nested types/typedefs
// #define __STL_TYPENAME_ON_RETURN_TYPE
// Define if the baseclass typedefs not visible from outside
// # define __STL_BASE_TYPEDEF_OUTSIDE_BUG 1
// if your compiler have serious problems with typedefs, try this one
// # define __STL_BASE_TYPEDEF_BUG 1
// Uncomment if getting errors compiling mem_fun* adaptors
// # define __STL_MEMBER_POINTER_PARAM_BUG 1
// # define __STL_UNINITIALIZABLE_PRIVATE 1
// Defined if the compiler
// has trouble instantiating static array members with dimension defined as enum
// # define __STL_STATIC_ARRAY_BUG
// * __STL_STATIC_CONST_INIT_BUG: defined if the compiler can't handle a
// constant-initializer in the declaration of a static const data member
// of integer type. (See section 9.4.2, paragraph 4, of the C++ standard.)
// # define __STL_STATIC_CONST_INIT_BUG
// Define if default constructor for builtin integer type fails to initialize it to 0
// # define __STL_DEFAULT_CONSTRUCTOR_BUG 1
// Defined if constructor
// required to explicitly call member's default constructors for const objects
// # define __STL_CONST_CONSTRUCTOR_BUG 1
// Defined if the compiler has trouble calling POD-types constructors/destructors
// # define __STL_TRIVIAL_CONSTRUCTOR_BUG 1
// # define __STL_TRIVIAL_DESTRUCTOR_BUG 1
// Define if having problems specializing maps/sets with
// key type being const
// # define __STL_MULTI_CONST_TEMPLATE_ARG_BUG
// Uncomment this to disable -> operators on all iterators
// # define __SGI_STL_NO_ARROW_OPERATOR 1
// Uncomment this to disble at() member functions for containers
// # define __STL_NO_AT_MEMBER_FUNCTION 1
// Uncomment if native new-style iostreams are not available
// #define __STL_HAS_NO_NEW_IOSTREAMS 1
// Define this if compiler lacks <exception> header
// # define __STL_NO_EXCEPTION_HEADER 1
// Uncomment this if your C library has lrand48() function
// # define __STL_RAND48 1
// Uncomment if native new-style C library headers lile <cstddef>, etc are not available.
// # define __STL_HAS_NO_NEW_C_HEADERS 1
// uncomment if new-style headers <new> is available
// # define __STL_HAS_NEW_NEW_HEADER 1
// uncomment this if <iostream> and other STD headers put their stuff in ::namespace,
// not std::
// # define __STL_VENDOR_GLOBAL_STD
// uncomment this if <cstdio> and the like put stuff in ::namespace,
// not std::
// # define __STL_VENDOR_GLOBAL_CSTD
// Edit relative path below (or put full path) to get native
// compiler headers included. Default is "../include".
// C headers may reside in different directory, so separate macro is provided.
// Hint : never install STLport in the directory that ends with "include"
// # define __STL_NATIVE_INCLUDE_PATH ../include
// # define __STL_NATIVE_C_INCLUDE_PATH ../include
// # define __STL_NATIVE_CPP_C_INCLUDE_PATH ../include
// This macro constructs header path from directory and name.
// You may change it if your compiler does not understand "/".
// # define __STL_MAKE_HEADER(path, header) <path/header>
// This macro constructs native include header path from include path and name.
// You may have do define it if experirncing problems with preprocessor
// # define __STL_NATIVE_HEADER(header) __STL_MAKE_HEADER(__STL_NATIVE_INCLUDE_PATH,header)
// Same for C headers
// __STL_NATIVE_C_HEADER(header)
//==========================================================
# endif
@@ -0,0 +1,38 @@
// SCO UDK 7 compiler (UnixWare 7x, OSR 5, UnixWare 2x)
//# define __SGI_STL_NO_ARROW_OPERATOR 1
//# define __STL_NO_NEW_STYLE_CASTS 1
// # define __STL_NEED_MUTABLE 1
.. # define __STL_NO_BAD_ALLOC 1
// allocator::rebind used not to work properly
// # define __STL_NO_MEMBER_TEMPLATE_CLASSES 1
// # define __STL_NO_MEMBER_TEMPLATE_KEYWORD 1
# define __STL_NO_FRIEND_TEMPLATES 1
# define __STL_NO_QUALIFIED_FRIENDS 1
// # define __STL_NO_DEFAULT_NON_TYPE_PARAM 1
//# define __STL_HAS_NO_NEW_IOSTREAMS 1
//# define __STL_HAS_NO_NEW_C_HEADERS 1
// ???
//# define __STL_STATIC_CONST_INIT_BUG 1
// ???
//# define __STL_LINK_TIME_INSTANTIATION 1
// ???
# define __STL_NO_TEMPLATE_CONVERSIONS 1
# define __STL_LONG_LONG 1
# if defined(_REENTRANT)
# define _UITHREADS /* if UnixWare < 7.0.1 */
# define __STL_UITHREADS
# endif /* _REENTRANT */
@@ -0,0 +1,59 @@
// STLport configuration file
// It is internal STLport header - DO NOT include it directly
# include <standards.h>
# define __EDG_SWITCHES
// any version ???
# define __STL_AUTOMATIC_TYPE_TRAITS 1
# define __STL_USE_SGI_STRING 1
# define __STL_HAS_NO_NEW_C_HEADERS 1
// # if !(_COMPILER_VERSION >= 700)
# define __STL_NO_NEW_NEW_HEADER 1
// # endif
# if !defined(_BOOL)
# define __STL_NO_BOOL
# endif
# if defined(_MIPS_SIM) && _MIPS_SIM == _ABIO32
# define __STL_STATIC_CONST_INIT_BUG
# endif
# if defined(_MIPS_SIM) && _MIPS_SIM != _MIPS_SIM_ABIO32
# define __STL_DEFAULT_CONSTRUCTOR_BUG
# endif
# if !((_COMPILER_VERSION >= 730) && defined(_MIPS_SIM) && _MIPS_SIM != _ABIO32)
# define __STL_NO_MEMBER_TEMPLATE_KEYWORD
# endif
# if !defined(_STANDARD_C_PLUS_PLUS)
# define __STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS
# endif
# if !((_COMPILER_VERSION >= 721) && defined(_NAMESPACES))
# define __STL_HAS_NO_NAMESPACES
# endif
# if (_COMPILER_VERSION < 721)
# define __STL_NO_EXCEPTION_HEADER
# endif
# if _COMPILER_VERSION < 730 || !defined(_STANDARD_C_PLUS_PLUS) || !defined(_NAMESPACES)
# define __STL_NO_BAD_ALLOC
# endif
# if defined(_LONGLONG) && defined(_SGIAPI) && _SGIAPI
# define __STL_LONG_LONG
# endif
# if !(_COMPILER_VERSION >= 730 && defined(_STANDARD_C_PLUS_PLUS))
# define __STL_HAS_NO_NEW_IOSTREAMS
# endif
# if !(_COMPILER_VERSION >= 730 && defined(_STANDARD_C_PLUS_PLUS))
# define __STL_NO_AT_MEMBER_FUNCTION
# endif
// # if !(_COMPILER_VERSION >= 730 && defined(_STANDARD_C_PLUS_PLUS))
# if !(_COMPILER_VERSION >= 721 && defined(_STANDARD_C_PLUS_PLUS))
# define __STL_NO_TEMPLATE_CONVERSIONS
# endif
# if !((_COMPILER_VERSION >= 730) && defined(_MIPS_SIM) && _MIPS_SIM != _ABIO32)
# define __STL_NO_FUNCTION_TMPL_PARTIAL_ORDER
# endif
@@ -0,0 +1,78 @@
// STLport configuration file
// It is internal STLport header - DO NOT include it directly
# define __STL_LONG_LONG 1
// on solaris 2.x only ?
// # define __STL_LONG_DOUBLE 1
# define __STL_RAND48 1
# define __STL_LINK_TIME_INSTANTIATION 1
# define __STL_USING_BASE_MEMBER
# if (__SUNPRO_CC < 0x600)
# define __STL_NO_MEMBER_TEMPLATES 1
# define __STL_NO_MEMBER_TEMPLATE_CLASSES 1
# define __STL_NO_MEMBER_TEMPLATE_KEYWORD 1
# define __STL_NO_FRIEND_TEMPLATES 1
# define __STL_NO_QUALIFIED_FRIENDS 1
# define __STL_NO_CLASS_PARTIAL_SPECIALIZATION 1
# define __STL_NO_FUNCTION_TMPL_PARTIAL_ORDER 1
# define __STL_NON_TYPE_TMPL_PARAM_BUG 1
# define __STL_STATIC_ARRAY_BUG 1
// # define __STL_HAS_NO_NEW_C_HEADERS 1
// no partial , just for explicit one
# define __STL_PARTIAL_SPEC_NEEDS_TEMPLATE_ARGS
# define __STL_STATIC_CONST_INIT_BUG 1
# define __STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS
# endif
// They are present actually, but have problems.
# if ( __SUNPRO_CC <= 0x500 )
# define __STL_HAS_NO_NEW_C_HEADERS 1
# endif
# if ( __SUNPRO_CC < 0x500 )
// 4.2 does not like it
# undef __STL_PARTIAL_SPEC_NEEDS_TEMPLATE_ARGS
# define __STL_NONTEMPL_BASE_MATCH_BUG 1
# define __STL_LIMITED_DEFAULT_TEMPLATES 1
# define __STL_HAS_NO_NEW_IOSTREAMS 1
# define __STL_NO_NEW_NEW_HEADER 1
# define __STL_NO_BOOL 1
# define __STL_HAS_NO_NAMESPACES 1
# define __STL_NEED_TYPENAME 1
# define __STL_NEED_EXPLICIT 1
# define __STL_NEED_MUTABLE 1
# define __STL_NO_EXCEPTION_HEADER 1
# define __STL_NO_BAD_ALLOC 1
# define __STL_UNINITIALIZABLE_PRIVATE 1
# define __STL_NO_BAD_ALLOC 1
# define __SGI_STL_NO_ARROW_OPERATOR 1
# define __STL_DEFAULT_CONSTRUCTOR_BUG 1
# define __STL_GLOBAL_NESTED_RETURN_TYPE_PARAM_BUG 1
# define __STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS
# if ( __SUNPRO_CC < 0x420 )
# define __STL_NO_PARTIAL_SPECIALIZATION_SYNTAX 1
# define __STL_NO_NEW_STYLE_CASTS 1
# define __STL_NO_METHOD_SPECIALIZATION 1
# if ( __SUNPRO_CC > 0x401 )
# if (__SUNPRO_CC==0x410)
# define __STL_BASE_TYPEDEF_OUTSIDE_BUG 1
# endif
# else
// SUNPro C++ 4.0.1
# define __STL_BASE_MATCH_BUG 1
# define __STL_BASE_TYPEDEF_BUG 1
# if ( __SUNPRO_CC < 0x401 )
__GIVE_UP_WITH_STL(SUNPRO_401)
# endif
# endif /* 4.0.1 */
# endif /* 4.2 */
# endif /* < 5.0 */
@@ -0,0 +1,42 @@
// STLport configuration file
// It is internal STLport header - DO NOT include it directly
// if not using maximum ANSI compatibility ( -A -Ab -Aw),
// uncomment the following two lines:
//# define __STL_NO_BOOL 1
//# define __STL_NO_WCHAR_T 1
# define __STL_HAS_NO_NAMESPACES 1
# define __STL_NEED_TYPENAME 1
# define __STL_NEED_EXPLICIT 1
# define __STL_NO_NEW_STYLE_CASTS 1
# define __STL_NEED_MUTABLE 1
# define __STL_NO_PARTIAL_SPECIALIZATION_SYNTAX 1
// # define __STL_NO_BAD_ALLOC 1
# define __STL_NO_MEMBER_TEMPLATES 1
# define __STL_NO_MEMBER_TEMPLATE_CLASSES 1
# define __STL_NO_MEMBER_TEMPLATE_KEYWORD 1
# define __STL_NO_FRIEND_TEMPLATES 1
# define __STL_NO_QUALIFIED_FRIENDS 1
# define __STL_NO_CLASS_PARTIAL_SPECIALIZATION 1
# define __STL_NO_FUNCTION_TMPL_PARTIAL_ORDER 1
// # define __STL_NO_DEFAULT_NON_TYPE_PARAM 1
# define __STL_NO_METHOD_SPECIALIZATION 1
# define __STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS 1
// # define __STL_NO_EXCEPTION_HEADER 1
# define __STL_HAS_NO_NEW_IOSTREAMS 1
# define __STL_HAS_NO_NEW_C_HEADERS 1
# define __STL_STATIC_CONST_INIT_BUG 1
# define __STL_THROW_RETURN_BUG 1
// # define __STL_LINK_TIME_INSTANTIATION 1
# define __STL_NO_TEMPLATE_CONVERSIONS 1
# define __STL_NON_TYPE_TMPL_PARAM_BUG 1
# define __STL_UNINITIALIZABLE_PRIVATE 1
@@ -0,0 +1,53 @@
// STLport configuration file
// It is internal STLport header - DO NOT include it directly
# define __STL_NO_FUNCTION_TMPL_PARTIAL_ORDER 1
# define __STL_NO_CLASS_PARTIAL_SPECIALIZATION 1
# define __STL_NO_MEMBER_TEMPLATE_KEYWORD 1
# define __STL_NO_MEMBER_TEMPLATES 1
# define __STL_NO_FRIEND_TEMPLATES 1
# define __STL_NO_MEMBER_TEMPLATE_CLASSES 1
# define __STL_LIMITED_DEFAULT_TEMPLATES 1
# define __STL_HAS_NO_NAMESPACES 1
# define __STL_NEED_TYPENAME 1
# define __STL_NO_WCHAR_T 1
# define __STL_NO_PARTIAL_SPECIALIZATION_SYNTAX 1
# define __STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS 1
# define __STL_STATIC_CONST_INIT_BUG 1
# define __STL_THROW_RETURN_BUG 1
# define __STL_NO_TEMPLATE_CONVERSIONS 1
# define __STL_BASE_TYPEDEF_OUTSIDE_BUG 1
# define __STL_HAS_NO_NEW_IOSTREAMS 1
# define __STL_HAS_NO_NEW_C_HEADERS 1
# define __STL_NO_NEW_NEW_HEADER 1
# define __STL_NO_DEFAULT_NON_TYPE_PARAM 1
# define __STL_NON_TYPE_TMPL_PARAM_BUG 1
# define __STL_NONTEMPL_BASE_MATCH_BUG
# define __STL_NO_EXCEPTION_HEADER 1
# define __STL_NO_BAD_ALLOC 1
# define __SGI_STL_NO_ARROW_OPERATOR 1
# define __STL_NESTED_TYPE_PARAM_BUG 1
# if (__WATCOM_CPLUSPLUS__ < 1100 )
# define __STL_NO_BOOL 1
# define __STL_NEED_EXPLICIT 1
# define __STL_NEED_MUTABLE 1
# define __STL_NO_NEW_STYLE_CASTS 1
# endif
// Get rid of Watcom's min and max macros
#undef min
#undef max
// for switches (-xs, -xss, -xst)
//
#if !(defined (__SW_XS) || defined (__SW_XSS) || defined(__SW_XST))
# define __STL_HAS_NO_EXCEPTIONS 1
# endif
@@ -0,0 +1,58 @@
/*
* File to have Windows CE Toolkit for VC++ 5.0 working with STLport
* 09 - 03 - 1999
* Origin : Giuseppe Govi - g.govi@iol.it
*/
#ifndef __STL_WINCE_H
#define __STL_WINCE_H
// this flag is being used by STLport
# define __STL_WINCE
// tell other parts no iostreams are desired
# define __STL_NO_IOSTREAMS 1
# undef __STL_HAS_NO_EXCEPTIONS
# define __STL_HAS_NO_EXCEPTIONS
# undef __STL_NO_EXCEPTION_HEADER
# define __STL_NO_EXCEPTION_HEADER
# ifdef __STL_MSVC
# pragma warning (disable: 4786)
# endif
#ifdef __STL_WINCE_USE_OUTPUTDEBUGSTRING
#define __STL_WINCE_TRACE(msg) OutputDebugString(msg)
#else
#define __STL_WINCE_TRACE(msg) MessageBox(NULL,(msg),NULL,MB_OK)
#endif
#ifndef __THROW_BAD_ALLOC
#define __THROW_BAD_ALLOC __STL_WINCE_TRACE(L"out of memory"); ExitThread(1)
#endif
#ifndef _SIZE_T_DEFINED
typedef unsigned int size_t;
#define _SIZE_T_DEFINED
#endif
#ifndef __PLACEMENT_NEW_INLINE
inline void *__cdecl operator new(size_t, void *_P) { return (_P); }
#define __PLACEMENT_NEW_INLINE
#endif
#ifndef _WCHAR_T_DEFINED
typedef unsigned short wchar_t;
#define _WCHAR_T_DEFINED
#endif
//ptrdiff_t is not defined in Windows CE SDK
#ifndef _PTRDIFF_T_DEFINED
typedef int ptrdiff_t;
#define _PTRDIFF_T_DEFINED
#endif
#endif /* __STL_WCE_H */
@@ -0,0 +1,164 @@
/*
* 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.
*
*/
/*
* Purpose of this file :
*
* To hold COMPILER-SPECIFIC portion of STLport settings.
* In general, user should not edit this file unless
* using the compiler not recognized below.
*
* If your compiler is not being recognized yet,
* please look for definitions of macros in stl_mycomp.h,
* copy stl_mycomp.h to stl_YOUR_COMPILER_NAME,
* adjust flags for your compiler, and add <include config/stl_YOUR_COMPILER_NAME>
* to the secton controlled by unique macro defined internaly by your compiler.
*
* NOTE : you may adjust these settings automatically for your
* compiler with the aid of "configure" script that comes with STLport.
*
* To change user-definable settings, please edit <../stl_user_config.h>
*
*/
#ifndef __STLCOMP_H
# define __STLCOMP_H
//==========================================================
// per-version compiler features recognition
//==========================================================
// reporting of incompatibility
# define __GIVE_UP_WITH_STL(message) void give_up() \
{ upgrade_the_compiler_to_use_STL;}
// distinguish real MSC from Metrowerks and Intel
# if defined(_MSC_VER) && !defined(__MWERKS__) && !defined (__ICL) && !defined (__COMO__)
# define __STL_MSVC _MSC_VER
# endif
//==========================================================
// below, configuration for each compiler is being kept
// in separate configuration file.
//==========================================================
# if defined(__sgi) && !defined(__GNUC__)
// SGI CC compilers
# include <config/stl_sgi.h>
# elif (defined(__OS400__))
// AS/400 C++
# include <config/stl_as400.h>
# elif ( defined (__xlC__) && __xlC__ < 0x400 ) || \
(defined(__MVS__) && defined ( __IBMCPP__ ) && (__IBMCPP__ < 23000 )) || \
( defined ( __IBMCPP__ ) && ( __IBMCPP__ < 400 ) && !defined(__OS400__) )
// AIX xlC 3.1 , 3.0.1 ==0x301
// Visual Age C++ 3.x
// OS-390 C++
# include <config/stl_ibm.h>
# elif defined(__STL_MSVC)
// Microsoft Visual C++ 4.0, 4.1, 4.2, 5.0
# include <config/stl_msvc.h>
# elif defined ( __BORLANDC__ )
// Borland C++ ( 4.x - 5.x )
# include <config/stl_bc.h>
# elif defined(__SUNPRO_CC)
// SUN CC 4.0.1-5.0
# include <config/stl_sunpro.h>
# elif defined (__GNUC__ )
// g++ 2.7.x and above
# include <config/stl_gcc.h>
# elif defined (__WATCOM_CPLUSPLUS__)
// Watcom C++
# include <config/stl_watcom.h>
# elif defined(__COMO__) || defined (__COMO_VERSION_)
# include <config/stl_como.h>
# elif defined (__SC__) && (__SC__ < 0x800)
// Symantec 7.5
# include <config/stl_symantec.h>
# elif defined (__MRC__) || (defined (__SC__) && (__SC__ >= 0x882))
// Apple MPW SCpp 8.8.2
// Apple MPW MrCpp 4.1.0
# include <config/stl_apple.h>
# elif defined (__MWERKS__)
// Metrowerks CodeWarrior
# include <config/stl_mwerks.h>
# elif defined(__hpux) && !defined(__GNUC__)
// HP compilers
# include <config/stl_hpacc.h>
# elif defined(__ICL)
// Intel compiler
# include <config/stl_intel.h>
// SCO UDK 7 compiler (UnixWare 7x, OSR 5, UnixWare 2x)
#elif defined(__USLC__)
# include <config/stl_sco.h>
// Apogee 4.x, use "configure" for older versions
#elif defined (__APOGEE__)
# include <config/stl_apcc.h>
#elif defined (__KCC)
# include <config/stl_kai.h>
#elif defined (__DECCXX)
# include <config/stl_dec.h>
#else
// Unable to identify the compiler, issue error diagnostic.
// Edit <config/stl_mycomp.h> to set STLport up for your compiler.
# include <config/stl_mycomp.h>
# endif /* end of compiler choice */
# undef __GIVE_UP_WITH_STL
#endif
@@ -0,0 +1,132 @@
/*
* 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 __SGI_STL_STLCONF_H
# define __SGI_STL_STLCONF_H
# undef __AUTO_CONFIGURED
//==========================================================
// Getting proper values of autoconf flags
// if you ran 'configure', __AUTO_CONFIGURED is set to 1 and
// specific compiler features will be used.
// Otherwise, the <stlcomp.h> header will be included for per-version
// features recognition.
//==========================================================
# if defined (__AUTO_CONFIGURED)
// auto-configured section
# undef __STL_NO_EXCEPTIONS
# undef __STL_NO_NAMESPACES
# undef __STL_NO_RELOPS_NAMESPACE
# undef __STL_NO_NEW_NEW_HEADER
# undef __STL_NO_NEW_IOSTREAMS
// select threads strategy
# undef _PTHREADS
# undef _NOTHREADS
// select SGI-style alloc instead of allocator<T>
# undef __STL_USE_SGI_ALLOCATORS
// select allocation method you like
# undef __STL_USE_MALLOC
# undef __STL_USE_NEWALLOC
// this one is not mandatory, just enabled
# undef __STL_USE_DEFALLOC
// define __STL_USE_ABBREVS if your linker has trouble with long
// external symbols
# undef __STL_USE_ABBREVS
// unsigned 32-bit integer type
# define __STL_UINT32_T unsigned
# undef __STL_NO_BOOL
# undef __STL_DONT_USE_BOOL_TYPEDEF
# undef __STL_YVALS_H
# undef __STL_LIMITED_DEFAULT_TEMPLATES
# undef __STL_DEFAULT_TYPE_PARAM
# undef __STL_NO_STATIC_TEMPLATE_DATA
# undef __STL_RAND48
# undef __STL_LOOP_INLINE_PROBLEMS
# undef __STL_HAS_NO_NAMESPACES
# undef __STL_NEED_TYPENAME
# undef __STL_NEED_EXPLICIT
# undef __STL_HAS_NO_EXCEPTIONS
# undef __STL_NO_EXCEPTION_SPEC
# undef __STL_WEAK_ATTRIBUTE
# undef __STL_BASE_MATCH_BUG
# undef __STL_NONTEMPL_BASE_MATCH_BUG
# undef __STL_NESTED_TYPE_PARAM_BUG
# undef __SGI_STL_NO_ARROW_OPERATOR
# undef __STL_UNINITIALIZABLE_PRIVATE
# undef __STL_BASE_TYPEDEF_BUG
# undef __STL_BASE_TYPEDEF_OUTSIDE_BUG
# undef __STL_CONST_CONSTRUCTOR_BUG
# undef __STL_NO_NEW_STYLE_CASTS
# undef __STL_NO_WCHAR_T
# undef __STL_WCHAR_T_IS_USHORT
# undef __STL_LONG_LONG
# undef __STL_NO_LONG_DOUBLE
# undef __STL_NEED_MUTABLE
# undef __STL_NO_PARTIAL_SPECIALIZATION_SYNTAX
# undef __STL_NO_BAD_ALLOC
# undef __STL_DEBUG_ALLOC
# undef __STL_NO_MEMBER_TEMPLATES
# undef __STL_NO_MEMBER_TEMPLATE_CLASSES
# undef __STL_NO_MEMBER_TEMPLATE_KEYWORD
# undef __STL_NO_FRIEND_TEMPLATES
# undef __STL_NO_QUALIFIED_FRIENDS
# undef __STL_NO_CLASS_PARTIAL_SPECIALIZATION
# undef __STL_NO_FUNCTION_TMPL_PARTIAL_ORDER
# undef __STL_AUTOMATIC_TYPE_TRAITS
# undef __STL_MEMBER_POINTER_PARAM_BUG
# undef __STL_NON_TYPE_TMPL_PARAM_BUG
# undef __STL_NO_DEFAULT_NON_TYPE_PARAM
# undef __STL_NO_METHOD_SPECIALIZATION
# undef __STL_STATIC_ARRAY_BUG
# undef __STL_STATIC_CONST_INIT_BUG
# undef __STL_TRIVIAL_CONSTRUCTOR_BUG
# undef __STL_TRIVIAL_DESTRUCTOR_BUG
# undef __STL_BROKEN_USING_DIRECTIVE
# undef __STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS
# undef __STL_NO_EXCEPTION_HEADER
# undef __STL_DEFAULT_CONSTRUCTOR_BUG
# undef __STL_HAS_NO_NEW_IOSTREAMS
# undef __STL_HAS_NO_NEW_C_HEADERS
# undef __STL_STATIC_CONST_INIT_BUG
// new ones
# undef __STL_THROW_RETURN_BUG
// unimp
# undef __STL_LINK_TIME_INSTANTIATION
# undef __STL_PARTIAL_SPEC_NEEDS_TEMPLATE_ARGS
// unimp
# undef __STL_NO_TEMPLATE_CONVERSIONS
# endif /* AUTO_CONFIGURED */
//==========================================================
#endif /* __STLCONF_H */
@@ -0,0 +1,132 @@
/*
* 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 __SGI_STL_STLCONF_H
# define __SGI_STL_STLCONF_H
# undef __AUTO_CONFIGURED
//==========================================================
// Getting proper values of autoconf flags
// if you ran 'configure', __AUTO_CONFIGURED is set to 1 and
// specific compiler features will be used.
// Otherwise, the <stlcomp.h> header will be included for per-version
// features recognition.
//==========================================================
# if defined (__AUTO_CONFIGURED)
// auto-configured section
# undef __STL_NO_EXCEPTIONS
# undef __STL_NO_NAMESPACES
# undef __STL_NO_RELOPS_NAMESPACE
# undef __STL_NO_NEW_NEW_HEADER
# undef __STL_NO_NEW_IOSTREAMS
// select threads strategy
# undef _PTHREADS
# undef _NOTHREADS
// select SGI-style alloc instead of allocator<T>
# undef __STL_USE_SGI_ALLOCATORS
// select allocation method you like
# undef __STL_USE_MALLOC
# undef __STL_USE_NEWALLOC
// this one is not mandatory, just enabled
# undef __STL_USE_DEFALLOC
// define __STL_USE_ABBREVS if your linker has trouble with long
// external symbols
# undef __STL_USE_ABBREVS
// unsigned 32-bit integer type
# define __STL_UINT32_T unsigned
# undef __STL_NO_BOOL
# undef __STL_DONT_USE_BOOL_TYPEDEF
# undef __STL_YVALS_H
# undef __STL_LIMITED_DEFAULT_TEMPLATES
# undef __STL_DEFAULT_TYPE_PARAM
# undef __STL_NO_STATIC_TEMPLATE_DATA
# undef __STL_RAND48
# undef __STL_LOOP_INLINE_PROBLEMS
# undef __STL_HAS_NO_NAMESPACES
# undef __STL_NEED_TYPENAME
# undef __STL_NEED_EXPLICIT
# undef __STL_HAS_NO_EXCEPTIONS
# undef __STL_NO_EXCEPTION_SPEC
# undef __STL_WEAK_ATTRIBUTE
# undef __STL_BASE_MATCH_BUG
# undef __STL_NONTEMPL_BASE_MATCH_BUG
# undef __STL_NESTED_TYPE_PARAM_BUG
# undef __SGI_STL_NO_ARROW_OPERATOR
# undef __STL_UNINITIALIZABLE_PRIVATE
# undef __STL_BASE_TYPEDEF_BUG
# undef __STL_BASE_TYPEDEF_OUTSIDE_BUG
# undef __STL_CONST_CONSTRUCTOR_BUG
# undef __STL_NO_NEW_STYLE_CASTS
# undef __STL_NO_WCHAR_T
# undef __STL_WCHAR_T_IS_USHORT
# undef __STL_LONG_LONG
# undef __STL_NO_LONG_DOUBLE
# undef __STL_NEED_MUTABLE
# undef __STL_NO_PARTIAL_SPECIALIZATION_SYNTAX
# undef __STL_NO_BAD_ALLOC
# undef __STL_DEBUG_ALLOC
# undef __STL_NO_MEMBER_TEMPLATES
# undef __STL_NO_MEMBER_TEMPLATE_CLASSES
# undef __STL_NO_MEMBER_TEMPLATE_KEYWORD
# undef __STL_NO_FRIEND_TEMPLATES
# undef __STL_NO_QUALIFIED_FRIENDS
# undef __STL_NO_CLASS_PARTIAL_SPECIALIZATION
# undef __STL_NO_FUNCTION_TMPL_PARTIAL_ORDER
# undef __STL_AUTOMATIC_TYPE_TRAITS
# undef __STL_MEMBER_POINTER_PARAM_BUG
# undef __STL_NON_TYPE_TMPL_PARAM_BUG
# undef __STL_NO_DEFAULT_NON_TYPE_PARAM
# undef __STL_NO_METHOD_SPECIALIZATION
# undef __STL_STATIC_ARRAY_BUG
# undef __STL_STATIC_CONST_INIT_BUG
# undef __STL_TRIVIAL_CONSTRUCTOR_BUG
# undef __STL_TRIVIAL_DESTRUCTOR_BUG
# undef __STL_BROKEN_USING_DIRECTIVE
# undef __STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS
# undef __STL_NO_EXCEPTION_HEADER
# undef __STL_DEFAULT_CONSTRUCTOR_BUG
# undef __STL_HAS_NO_NEW_IOSTREAMS
# undef __STL_HAS_NO_NEW_C_HEADERS
# undef __STL_STATIC_CONST_INIT_BUG
// new ones
# undef __STL_THROW_RETURN_BUG
// unimp
# undef __STL_LINK_TIME_INSTANTIATION
# undef __STL_PARTIAL_SPEC_NEEDS_TEMPLATE_ARGS
// unimp
# undef __STL_NO_TEMPLATE_CONVERSIONS
# endif /* AUTO_CONFIGURED */
//==========================================================
#endif /* __STLCONF_H */
@@ -0,0 +1,3 @@
#!/bin/sh
cp stlconf.h.in stlconf.h
echo "STLport unconfigured."
@@ -0,0 +1,60 @@
/*
* 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 __STLPORT_CSETJMP
# define __STLPORT_CSETJMP
# ifndef __STL_CONFIG_H
# include <stl_config.h>
# endif
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_CSETJMP
# define __STLPORT_NATIVE_PASS
# endif
# if defined (__STL_USE_NEW_C_HEADERS)
# include __STL_NATIVE_CPP_C_HEADER(csetjmp)
# else
# include <setjmp.h>
# endif
# if defined ( __STL_RESUME_STD_FOR_CSETJMP )
# undef __STL_RESUME_STD_FOR_CSETJMP
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
# ifdef __STL_IMPORT_VENDOR_CSTD
__STL_BEGIN_NAMESPACE
# ifndef setjmp
using __STL_VENDOR_CSTD::setjmp;
# endif
using __STL_VENDOR_CSTD::jmp_buf;
using __STL_VENDOR_CSTD::longjmp;
__STL_END_NAMESPACE
#endif /* __STL_IMPORT_VENDOR_CSTD */
#endif /* __STLPORT_CSETJMP */
// Local Variables:
// mode:C++
// End:
@@ -0,0 +1,58 @@
/*
* 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 __STLPORT_CSIGNAL
# define __STLPORT_CSIGNAL
# ifndef __STL_CONFIG_H
# include <stl_config.h>
# endif
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_CSIGNAL
# define __STLPORT_NATIVE_PASS
# endif
# if defined (__STL_USE_NEW_C_HEADERS)
# include __STL_NATIVE_CPP_C_HEADER(csignal)
# else
# include <signal.h>
# endif
# if defined ( __STL_RESUME_STD_FOR_CSIGNAL )
# undef __STL_RESUME_STD_FOR_CSIGNAL
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
# ifdef __STL_IMPORT_VENDOR_CSTD
__STL_BEGIN_NAMESPACE
using __STL_VENDOR_CSTD::sig_atomic_t;
using __STL_VENDOR_CSTD::signal;
using __STL_VENDOR_CSTD::raise;
__STL_END_NAMESPACE
#endif /* __STL_IMPORT_VENDOR_CSTD */
#endif /* __STLPORT_CSIGNAL */
// Local Variables:
// mode:C++
// End:
@@ -0,0 +1,54 @@
/*
* 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 __STLPORT_CSTDARG
# define __STLPORT_CSTDARG
# ifndef __STL_CONFIG_H
# include <stl_config.h>
# endif
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_CSTDARG
# define __STLPORT_NATIVE_PASS
# endif
# if defined (__STL_USE_NEW_C_HEADERS)
# include __STL_NATIVE_CPP_C_HEADER(cstdarg)
# else
# include <stdarg.h>
# endif
# if defined ( __STL_RESUME_STD_FOR_CSTDARG )
# undef __STL_RESUME_STD_FOR_CSTDARG
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
# ifdef __STL_IMPORT_VENDOR_CSTD
__STL_BEGIN_NAMESPACE
using __STL_VENDOR_CSTD::va_list;
__STL_END_NAMESPACE
#endif /* __STL_IMPORT_VENDOR_CSTD */
#endif /* __STLPORT_CSTDARG */
// Local Variables:
// mode:C++
// End:
@@ -0,0 +1,59 @@
/*
* 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 __STLPORT_CSTDDEF
# define __STLPORT_CSTDDEF
# ifndef __STL_CONFIG_H
# include <stl_config.h>
# endif
# if ! defined (__STL_WINCE)
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_CSTDDEF
# define __STLPORT_NATIVE_PASS
# endif
# if defined (__STL_USE_NEW_C_HEADERS)
# include __STL_NATIVE_CPP_C_HEADER(cstddef)
# else
# include __STL_NATIVE_C_HEADER(stddef.h)
# endif
# if defined ( __STL_RESUME_STD_FOR_CSTDDEF )
# undef __STL_RESUME_STD_FOR_CSTDDEF
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
# ifdef __STL_IMPORT_VENDOR_CSTD
__STL_BEGIN_NAMESPACE
using __STL_VENDOR_CSTD::ptrdiff_t;
using __STL_VENDOR_CSTD::size_t;
__STL_END_NAMESPACE
#endif /* __STL_IMPORT_VENDOR_CSTD */
#endif /* __STL_WINCE */
#endif /* __STLPORT_CSTDDEF */
// Local Variables:
// mode:C++
// End:
+104
View File
@@ -0,0 +1,104 @@
/*
* 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 __STLPORT_CSTDIO
# define __STLPORT_CSTDIO
# ifndef __STL_CONFIG_H
# include <stl_config.h>
# endif
# if ! defined (__STL_WINCE)
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_CSTDIO
# define __STLPORT_NATIVE_PASS
# endif
# if defined (__STL_USE_NEW_C_HEADERS)
# include __STL_NATIVE_CPP_C_HEADER(cstdio)
# else
# include <stdio.h>
# endif
# if defined ( __STL_RESUME_STD_FOR_CSTDIO )
# undef __STL_RESUME_STD_FOR_CSTDIO
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
# ifdef __STL_IMPORT_VENDOR_CSTD
__STL_BEGIN_NAMESPACE
using __STL_VENDOR_CSTD::FILE;
using __STL_VENDOR_CSTD::fpos_t;
using __STL_VENDOR_CSTD::size_t;
using __STL_VENDOR_CSTD::clearerr;
using __STL_VENDOR_CSTD::fclose;
using __STL_VENDOR_CSTD::feof;
using __STL_VENDOR_CSTD::ferror;
using __STL_VENDOR_CSTD::fflush;
using __STL_VENDOR_CSTD::fgetc;
using __STL_VENDOR_CSTD::fgetpos;
using __STL_VENDOR_CSTD::fgets;
using __STL_VENDOR_CSTD::fopen;
using __STL_VENDOR_CSTD::fprintf;
using __STL_VENDOR_CSTD::fputc;
using __STL_VENDOR_CSTD::fputs;
using __STL_VENDOR_CSTD::fread;
using __STL_VENDOR_CSTD::freopen;
using __STL_VENDOR_CSTD::fscanf;
using __STL_VENDOR_CSTD::fseek;
using __STL_VENDOR_CSTD::fsetpos;
using __STL_VENDOR_CSTD::ftell;
using __STL_VENDOR_CSTD::fwrite;
using __STL_VENDOR_CSTD::getc;
using __STL_VENDOR_CSTD::getchar;
using __STL_VENDOR_CSTD::gets;
using __STL_VENDOR_CSTD::perror;
using __STL_VENDOR_CSTD::printf;
using __STL_VENDOR_CSTD::putc;
using __STL_VENDOR_CSTD::putchar;
using __STL_VENDOR_CSTD::puts;
using __STL_VENDOR_CSTD::remove;
using __STL_VENDOR_CSTD::rename;
using __STL_VENDOR_CSTD::rewind;
using __STL_VENDOR_CSTD::scanf;
using __STL_VENDOR_CSTD::setbuf;
using __STL_VENDOR_CSTD::setvbuf;
using __STL_VENDOR_CSTD::sprintf;
using __STL_VENDOR_CSTD::sscanf;
using __STL_VENDOR_CSTD::tmpfile;
using __STL_VENDOR_CSTD::tmpnam;
using __STL_VENDOR_CSTD::ungetc;
using __STL_VENDOR_CSTD::vfprintf;
using __STL_VENDOR_CSTD::vprintf;
using __STL_VENDOR_CSTD::vsprintf;
__STL_END_NAMESPACE
# endif /* __STL_IMPORT_VENDOR_CSTD */
# endif /* ! defined (__STL_WINCE) */
#endif
// Local Variables:
// mode:C++
// End:
+121
View File
@@ -0,0 +1,121 @@
/*
* 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 __STLPORT_CSTDLIB
# define __STLPORT_CSTDLIB
# ifndef __STL_CONFIG_H
# include <stl_config.h>
# endif
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_CSTDLIB
# define __STLPORT_NATIVE_PASS
# endif
# if defined (__STL_USE_NEW_C_HEADERS)
# include __STL_NATIVE_CPP_C_HEADER(cstdlib)
# else
# include __STL_NATIVE_C_HEADER(stdlib.h)
# endif
# ifdef __STL_IMPORT_VENDOR_CSTD
__STL_BEGIN_NAMESPACE
// Table 18
using __STL_VENDOR_CSTD::abort;
using __STL_VENDOR_CSTD::atexit;
using __STL_VENDOR_CSTD::exit;
// Table 23
using __STL_VENDOR_CSTD::getenv;
// Table 33
using __STL_VENDOR_CSTD::calloc;
using __STL_VENDOR_CSTD::free;
using __STL_VENDOR_CSTD::malloc;
using __STL_VENDOR_CSTD::realloc;
// Table 49
using __STL_VENDOR_CSTD::atof;
using __STL_VENDOR_CSTD::atoi;
using __STL_VENDOR_CSTD::atol;
using __STL_VENDOR_CSTD::mblen;
using __STL_VENDOR_CSTD::mbstowcs;
using __STL_VENDOR_CSTD::mbtowc;
using __STL_VENDOR_CSTD::strtod;
using __STL_VENDOR_CSTD::strtol;
using __STL_VENDOR_CSTD::strtoul;
#if ! (defined (__STL_NO_NATIVE_WIDE_STREAMS) || defined (__STL_NO_MBSTATE_T))
using __STL_VENDOR_CSTD::wcstombs;
using __STL_VENDOR_CSTD::wctomb;
#endif
// Table 78
using __STL_VENDOR_CSTD::bsearch;
using __STL_VENDOR_CSTD::qsort;
__STL_END_NAMESPACE
# endif /* __STL_IMPORT_VENDOR_CSTD */
// Table 81
// dwa 2/28/99 - work around MSL bugs. Not strictly correct (actual
// namespace where div_t is defined is detectable), but probably the
// best we can do. We expect this to be fixed by the time Pro5 is
// released.
# if defined( __MSL__ ) && __MSL__ <= 0x5003
namespace std {
typedef ::div_t div_t;
typedef ::ldiv_t ldiv_t;
# ifdef __MSL_LONGLONG_SUPPORT__
typedef ::lldiv_t lldiv_t;
# endif
}
# endif
# ifdef __STL_IMPORT_VENDOR_CSTD
__STL_BEGIN_NAMESPACE
using __STL_VENDOR_CSTD::div_t;
using __STL_VENDOR_CSTD::ldiv_t;
# ifdef __STL_LONG_LONG
// using __STL_VENDOR_CSTD::lldiv_t;
# endif
using __STL_VENDOR_CSTD::size_t;
using __STL_VENDOR_CSTD::abs;
using __STL_VENDOR_CSTD::div;
using __STL_VENDOR_CSTD::labs;
using __STL_VENDOR_CSTD::ldiv;
using __STL_VENDOR_CSTD::rand;
using __STL_VENDOR_CSTD::srand;
__STL_END_NAMESPACE
#endif /* __STL_IMPORT_VENDOR_CSTD */
# if defined ( __STL_RESUME_STD_FOR_CSTDLIB )
# undef __STL_RESUME_STD_FOR_CSTDLIB
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
#endif /* __STLPORT_CSTDLIB */
// Local Variables:
// mode:C++
// End:
@@ -0,0 +1,85 @@
/*
* 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 __STLPORT_CSTRING
# define __STLPORT_CSTRING
# define __IN_STLPORT_CSTRING 1
# ifndef __STL_CONFIG_H
# include <stl_config.h>
# endif
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_CSTRING
# define __STLPORT_NATIVE_PASS
# endif
# if defined (__STL_USE_NEW_C_HEADERS)
# include __STL_NATIVE_CPP_C_HEADER(cstring)
# else
# include __STL_NATIVE_C_HEADER(string.h)
# endif
# if defined ( __STL_RESUME_STD_FOR_CSTRING )
# undef __STL_RESUME_STD_FOR_CSTRING
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
# ifdef __STL_IMPORT_VENDOR_CSTD
__STL_BEGIN_NAMESPACE
using __STL_VENDOR_CSTD::size_t;
using __STL_VENDOR_CSTD::memcpy;
using __STL_VENDOR_CSTD::memchr;
using __STL_VENDOR_CSTD::memmove;
using __STL_VENDOR_CSTD::memcmp;
using __STL_VENDOR_CSTD::memset;
using __STL_VENDOR_CSTD::strcat;
using __STL_VENDOR_CSTD::strchr;
using __STL_VENDOR_CSTD::strcmp;
using __STL_VENDOR_CSTD::strcoll;
using __STL_VENDOR_CSTD::strcpy;
using __STL_VENDOR_CSTD::strcspn;
using __STL_VENDOR_CSTD::strerror;
using __STL_VENDOR_CSTD::strlen;
using __STL_VENDOR_CSTD::strncat;
using __STL_VENDOR_CSTD::strncmp;
using __STL_VENDOR_CSTD::strncpy;
using __STL_VENDOR_CSTD::strpbrk;
using __STL_VENDOR_CSTD::strrchr;
using __STL_VENDOR_CSTD::strspn;
using __STL_VENDOR_CSTD::strstr;
using __STL_VENDOR_CSTD::strtok;
using __STL_VENDOR_CSTD::strxfrm;
__STL_END_NAMESPACE
#endif /* __STL_IMPORT_VENDOR_CSTD */
# undef __IN_STLPORT_CSTRING
#endif /* __STLPORT_CSTRING */
// Local Variables:
// mode:C++
// End:
+67
View File
@@ -0,0 +1,67 @@
/*
* 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 __STLPORT_CTIME
# define __STLPORT_CTIME
# ifndef __STL_CONFIG_H
# include <stl_config.h>
# endif
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_CTIME
# define __STLPORT_NATIVE_PASS
# endif
# if defined (__STL_USE_NEW_C_HEADERS)
# include __STL_NATIVE_CPP_C_HEADER(ctime)
# else
# include <time.h>
# endif
# if defined ( __STL_RESUME_STD_FOR_CTIME )
# undef __STL_RESUME_STD_FOR_CTIME
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
# ifdef __STL_IMPORT_VENDOR_CSTD
__STL_BEGIN_NAMESPACE
using __STL_VENDOR_CSTD::size_t;
using __STL_VENDOR_CSTD::clock_t;
using __STL_VENDOR_CSTD::time_t;
using __STL_VENDOR_CSTD::tm;
using __STL_VENDOR_CSTD::clock;
using __STL_VENDOR_CSTD::asctime;
using __STL_VENDOR_CSTD::ctime;
using __STL_VENDOR_CSTD::gmtime;
using __STL_VENDOR_CSTD::difftime;
using __STL_VENDOR_CSTD::mktime;
using __STL_VENDOR_CSTD::localtime;
using __STL_VENDOR_CSTD::strftime;
using __STL_VENDOR_CSTD::time;
__STL_END_NAMESPACE
#endif /* __STL_IMPORT_VENDOR_CSTD */
#endif /* __STLPORT_CTIME */
// Local Variables:
// mode:C++
// End:
+236
View File
@@ -0,0 +1,236 @@
/*
* 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 __STLPORT_CWCHAR
# define __STLPORT_CWCHAR
# ifndef __STL_CONFIG_H
# include <stl_config.h>
# endif
# if ! defined (__STL_WINCE)
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_CWCHAR
# define __STLPORT_NATIVE_PASS
# endif
# if defined (__STL_USE_NEW_C_HEADERS)
# include __STL_NATIVE_CPP_C_HEADER(cwchar)
# elif defined (__MRC__) || defined (__SC__) || defined (__BORLANDC__)
# include <stddef.h>
# else
# include <wchar.h>
# endif
// this stuff is varying a lot between platforms
#if defined(__MSL__) && __MSL__ <= 0x5012 // dwa 2/28/99 - not yet implemented by MSL
# define __STL_WCHAR_MSL_EXCLUDE 1
# define __STL_NO_MBSTATE_T 1
#elif defined(__sun) && defined (__SVR4) && !defined (_MBSTATE_T) && !defined (_STD_MBSTATE_T)
# ifndef __STL_NO_NATIVE_MBSTATE_T
# define __STL_NO_NATIVE_MBSTATE_T 1
# endif
# define __STL_WCHAR_SUNPRO_EXCLUDE 1
# if defined ( __STLPORT_NEW_IOSTREAMS )
# define _MBSTATE_T
# define _STD_MBSTATE_T
# else
# define __STL_NO_MBSTATE_T 1
# endif
#elif defined (__BORLANDC__)
# define __STL_NO_MBSTATE_T 1
# define __STL_WCHAR_BORLAND_EXCLUDE 1
# if (__BORLANDC__ < 0x540 )
# define __STL_WCHAR_SUNPRO_EXCLUDE
# endif
#endif
# if defined ( __STLPORT_NEW_IOSTREAMS ) && defined (__STL_NO_NATIVE_MBSTATE_T)&& ! defined (__STL_NO_MBSTATE_T)
# define __STL_USE_OWN_MBSTATE_T
# endif
# ifdef __STL_USE_OWN_MBSTATE_T
struct __stl_mbstate_t {
__stl_mbstate_t( long __st = 0 ) : _M_state(__st) {}
__stl_mbstate_t& operator=(const long __st) {
_M_state= __st;
return *this;
}
// default ones
__stl_mbstate_t(const __stl_mbstate_t& __x) : _M_state(__x._M_state) {}
__stl_mbstate_t& operator=(const __stl_mbstate_t& __x) {
_M_state= __x._M_state;
return *this;
}
long _M_state;
// friend inline bool operator==(const __stl_mbstate_t& __x, const __stl_mbstate_t& __y);
// friend inline bool operator!=(const __stl_mbstate_t& __x, const __stl_mbstate_t& __y);
};
inline bool operator==(const __stl_mbstate_t& __x, const __stl_mbstate_t& __y) {
return ( __x._M_state == __y._M_state );
}
inline bool operator!=(const __stl_mbstate_t& __x, const __stl_mbstate_t& __y) {
return ( __x._M_state == __y._M_state );
}
typedef __stl_mbstate_t mbstate_t;
# endif
// dwa 2/28/99 - Fix an MSL bug. We expect this to be fixed in the next release.
# if defined(__STL_WCHAR_MSL_EXCLUDE)
namespace std
{
extern "C" size_t wcsftime(wchar_t * str, size_t max_size, const wchar_t * format_str, const struct tm * timeptr);
}
# endif
# if defined (__STL_NO_MBSTATE_T) && !defined (__STL_NO_NATIVE_MBSTATE_T)
# define __STL_NO_NATIVE_MBSTATE_T 1
# endif
# if defined ( __STL_RESUME_STD_FOR_CWCHAR )
# undef __STL_RESUME_STD_FOR_CWCHAR
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
# ifdef __STL_IMPORT_VENDOR_CSTD
__STL_BEGIN_NAMESPACE
using __STL_VENDOR_CSTD::wint_t;
using __STL_VENDOR_CSTD::size_t;
# if !defined (__STL_NO_NATIVE_MBSTATE_T)
using __STL_VENDOR_MB_NAMESPACE::mbstate_t;
using __STL_VENDOR_MB_NAMESPACE::btowc;
using __STL_VENDOR_MB_NAMESPACE::mbrlen;
using __STL_VENDOR_MB_NAMESPACE::mbrtowc;
using __STL_VENDOR_MB_NAMESPACE::mbsinit;
using __STL_VENDOR_MB_NAMESPACE::mbsrtowcs;
using __STL_VENDOR_MB_NAMESPACE::wcrtomb;
using __STL_VENDOR_MB_NAMESPACE::wcsrtombs;
# endif
# ifndef __STL_NO_NATIVE_WIDE_FUNCTIONS
# ifndef __STL_WCHAR_BORLAND_EXCLUDE
using __STL_VENDOR_CSTD::fgetwc;
using __STL_VENDOR_CSTD::fgetws;
using __STL_VENDOR_CSTD::fputwc;
using __STL_VENDOR_CSTD::fputws;
# endif
# if !( defined (__STL_WCHAR_SUNPRO_EXCLUDE) || defined (__STL_WCHAR_BORLAND_EXCLUDE))
# ifndef __DECCXX
using __STL_VENDOR_CSTD::fwide;
# endif
using __STL_VENDOR_CSTD::fwprintf;
using __STL_VENDOR_CSTD::fwscanf;
using __STL_VENDOR_CSTD::getwchar;
# endif
# ifndef __STL_WCHAR_BORLAND_EXCLUDE
using __STL_VENDOR_CSTD::getwc;
using __STL_VENDOR_CSTD::ungetwc;
using __STL_VENDOR_CSTD::putwc;
using __STL_VENDOR_CSTD::putwchar;
# endif
# if !( defined (__STL_WCHAR_SUNPRO_EXCLUDE) || defined (__STL_WCHAR_BORLAND_EXCLUDE))
using __STL_VENDOR_CSTD::swprintf;
using __STL_VENDOR_CSTD::swscanf;
using __STL_VENDOR_CSTD::vfwprintf;
using __STL_VENDOR_CSTD::vwprintf;
using __STL_VENDOR_CSTD::vswprintf;
using __STL_VENDOR_CSTD::wcsftime;
using __STL_VENDOR_CSTD::wcstok;
# endif
using __STL_VENDOR_CSTD::wcscat;
using __STL_VENDOR_CSTD::wcsrchr;
using __STL_VENDOR_CSTD::wcscmp;
using __STL_VENDOR_CSTD::wcscoll;
using __STL_VENDOR_CSTD::wcscpy;
using __STL_VENDOR_CSTD::wcscspn;
using __STL_VENDOR_CSTD::wcslen;
using __STL_VENDOR_CSTD::wcsncat;
using __STL_VENDOR_CSTD::wcsncmp;
using __STL_VENDOR_CSTD::wcsncpy;
using __STL_VENDOR_CSTD::wcspbrk;
using __STL_VENDOR_CSTD::wcschr;
using __STL_VENDOR_CSTD::wcsspn;
using __STL_VENDOR_CSTD::wcsxfrm;
# if !defined (__STL_WCHAR_BORLAND_EXCLUDE)
using __STL_VENDOR_CSTD::wcstod;
using __STL_VENDOR_CSTD::wcstol;
# endif
# ifndef __STL_WCHAR_SUNPRO_EXCLUDE
using __STL_VENDOR_CSTD::wcsstr;
using __STL_VENDOR_CSTD::wmemchr;
# if !defined (__STL_WCHAR_BORLAND_EXCLUDE)
using __STL_VENDOR_CSTD::wctob;
using __STL_VENDOR_CSTD::wmemcmp;
using __STL_VENDOR_CSTD::wmemmove;
using __STL_VENDOR_CSTD::wprintf;
using __STL_VENDOR_CSTD::wscanf;
# endif
using __STL_VENDOR_CSTD::wmemcpy;
using __STL_VENDOR_CSTD::wmemset;
# endif
# endif /* __STL_NO_NATIVE_WIDE_FUNCTIONS */
__STL_END_NAMESPACE
# endif /* __STL_IMPORT_VENDOR_CSTD */
# undef __STL_WCHAR_SUNPRO_EXCLUDE
# undef __STL_WCHAR_MSL_EXCLUDE
# endif /* CWCHAR */
#endif /* __STLPORT_CWCHAR */
// Local Variables:
// mode:C++
// End:
@@ -0,0 +1,90 @@
/*
* 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 __STLPORT_CWCTYPE
# define __STLPORT_CWCTYPE
# ifndef __STL_CONFIG_H
# include <stl_config.h>
# endif
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_CWCTYPE
# define __STLPORT_NATIVE_PASS
# endif
# if defined (__STL_USE_NEW_C_HEADERS)
# include __STL_NATIVE_CPP_C_HEADER(cwctype)
# ifdef __MSL__
namespace std {
typedef wchar_t wctrans_t;
wint_t towctrans(wint_t c, wctrans_t value);
wctrans_t wctrans(const char *name);
}
# endif
# else
# include <wctype.h>
# endif
# if defined ( __STL_RESUME_STD_FOR_CWCTYPE )
# undef __STL_RESUME_STD_FOR_CWCTYPE
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
# ifdef __STL_IMPORT_VENDOR_CSTD
__STL_BEGIN_NAMESPACE
# if ! defined (__BORLANDC__)
using __STL_VENDOR_CSTD::wctrans_t;
using __STL_VENDOR_CSTD::towctrans;
using __STL_VENDOR_CSTD::wctrans;
using __STL_VENDOR_CSTD::wctype;
using __STL_VENDOR_CSTD::iswctype;
# endif
using __STL_VENDOR_CSTD::wctype_t;
using __STL_VENDOR_CSTD::wint_t;
using __STL_VENDOR_CSTD::iswalnum;
using __STL_VENDOR_CSTD::iswalpha;
using __STL_VENDOR_CSTD::iswcntrl;
using __STL_VENDOR_CSTD::iswdigit;
using __STL_VENDOR_CSTD::iswgraph;
using __STL_VENDOR_CSTD::iswlower;
using __STL_VENDOR_CSTD::iswprint;
using __STL_VENDOR_CSTD::iswpunct;
using __STL_VENDOR_CSTD::iswspace;
using __STL_VENDOR_CSTD::iswupper;
using __STL_VENDOR_CSTD::iswxdigit;
using __STL_VENDOR_CSTD::towlower;
using __STL_VENDOR_CSTD::towupper;
__STL_END_NAMESPACE
#endif /* __STL_IMPORT_VENDOR_CSTD */
#endif /* __STLPORT_CWCTYPE */
// Local Variables:
// mode:C++
// End:
+53
View File
@@ -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 __SGI_STL_DEQUE
#define __SGI_STL_DEQUE
#ifndef __SGI_STL_INTERNAL_DEQUE_H
# include <stl_deque.h>
#endif
#if defined (__STL_WHOLE_NATIVE_STD)
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_DEQUE
# define __STLPORT_NATIVE_PASS
# endif
# include __STL_NATIVE_HEADER(deque)
# if defined ( __STL_RESUME_STD_FOR_DEQUE )
# undef __STL_RESUME_STD_FOR_DEQUE
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
#endif
#endif /* __SGI_STL_DEQUE */
// Local Variables:
// mode:C++
// End:
@@ -0,0 +1,118 @@
/*
* 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 __SGI_STL_EXCEPTION_H
# ifndef __BORLANDC__
# define __SGI_STL_EXCEPTION_H
# endif
// This header exists solely for portability. Normally it just includes
// the native header <exception>.
// The header <exception> contains low-level functions that interact
// with a compiler's exception-handling mechanism. It is assumed to
// be supplied with the compiler, rather than with the library, because
// it is inherently tied very closely to the compiler itself.
// On platforms where <exception> does not exist, this header defines
// an exception base class. This is *not* a substitute for everything
// in <exception>, but it suffices to support a bare minimum of STL
// functionality.
#ifndef __STL_CONFIG_H
#include <stl_config.h>
#endif
#ifndef __STL_NO_EXCEPTION_HEADER
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_EXCEPTION
# define __STLPORT_NATIVE_PASS
# endif
# if defined (__GNUC__) && (__GNUC_MINOR__ >= 8 )
# include <../include/exception>
# else
# include __STL_NATIVE_HEADER(exception)
# endif
# ifdef __BORLANDC__
// define guard after inclusion only, as recursive inclusion
// is possible.
# define __SGI_STL_EXCEPTION_H
# endif
# if defined ( __STL_RESUME_STD_FOR_EXCEPTION )
# undef __STL_RESUME_STD_FOR_EXCEPTION
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
# ifndef __STL_EXCEPTION_BASE
# define __STL_EXCEPTION_BASE __STL_VENDOR_EXCEPT_STD::exception
# endif
# ifdef __STL_USE_OWN_NAMESPACE
__STL_BEGIN_NAMESPACE
using __STL_VENDOR_EXCEPT_STD::exception;
__STL_END_NAMESPACE
# endif /* __STL_OWN_NAMESPACE */
#else /* __STL_NO_EXCEPTION_HEADER */
// define it right away
# define __SGI_STL_EXCEPTION_H
__STL_BEGIN_NAMESPACE
// this has to be a class, to avoid portability problems
// with derived classes
class exception {
public:
virtual ~exception() __STL_NOTHROW {}
virtual const char* what() const __STL_NOTHROW { return ""; }
};
# define __STL_EXCEPTION_BASE exception
// fbp : absence of <exception> usually means that those
// functions are not going to be called by compiler.
// Still, define them for the user.
void unexpected();
typedef void (*unexpected_handler)();
unexpected_handler set_unexpected (unexpected_handler) __STL_NOTHROW;
void terminate();
typedef void (*terminate_handler)();
terminate_handler set_terminate(terminate_handler) __STL_NOTHROW;
bool uncaught_exception() __STL_NOTHROW;
__STL_END_NAMESPACE
#endif /* __STL_NO_EXCEPTION_HEADER */
#endif /* __SGI_STL_EXCEPTION_H */
// Local Variables:
// mode:C++
// End:
+151
View File
@@ -0,0 +1,151 @@
algorithm
bitset
cassert
cctype
cerrno
cfloat
char_traits.h
climits
clocale
cmath
complex
csetjmp
csignal
cstdarg
cstddef
cstdio
cstdlib
cstring
ctime
ctype.h
cwchar
cwctype
deque
exception
exception.h
export
export_names
fstream
fstream.h
functional
hash_map
hash_set
iomanip
iomanip.h
ios
iosfwd
iostream
iostream.h
istream
iterator
limits
list
locale
locale.h
map
math.h
memory
mmemory.h
msl_string.h
new
new.h
numeric
ostream
pthread_alloc
queue
rope
set
setjmp.h
signal.h
slist
sstream
stack
stdarg.h
stddef.h
stdexcept
stdio.h
stdlib.h
stl_algo.c
stl_algo.h
stl_algobase.c
stl_algobase.h
stl_alloc.c
stl_alloc.h
stl_bitset.bak
stl_bitset.c
stl_bitset.h
stl_bvector.h
stl_config.h
stl_construct.h
stl_ctraits_fns.h
stl_deque.c
stl_deque.h
stl_function.h
stl_hash_fun.h
stl_hash_map.h
stl_hash_set.h
stl_hashtable.c
stl_hashtable.h
stl_heap.c
stl_heap.h
stl_stream_iterator.h
stl_iterator.h
stl_iterator_base.h
stl_limits.c
stl_limits.h
stl_list.c
stl_list.h
stl_map.h
stl_multimap.h
stl_multiset.h
stl_numeric.c
stl_numeric.h
stl_pair.h
stl_queue.h
stl_range_errors.h
stl_raw_storage_iter.h
stl_relops.h
stl_rope.c
stl_rope.h
stl_self_config.h
stl_set.h
stl_slist.c
stl_slist.h
stl_slist_base.c
stl_slist_base.h
stl_stack.h
stl_string.c
stl_string.h
stl_string_fwd.c
stl_string_fwd.h
stl_tempbuf.c
stl_tempbuf.h
stl_threads.c
stl_threads.h
stl_tree.c
stl_tree.h
stl_uninitialized.h
stl_user_config.h
stl_valarray.c
stl_valarray.h
stl_vec_iterator.h
stl_vector.c
stl_vector.h
stldebug.c
stldebug.h
streambuf
string
string.h
strstream
strstream.h
time.h
type_traits.h
typeinfo
typeinfo.h
utility
valarray
vector
wchar.h
wctype.h
xmemory
xutility
Binary file not shown.
@@ -0,0 +1,84 @@
/*
* 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 __STLPORT_FSTREAM
# define __STLPORT_FSTREAM
# ifndef __STL_CONFIG_H
# include <stl_config.h>
# endif
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_FSTREAM
# define __STLPORT_NATIVE_PASS
# endif
# if defined (__STL_USE_NEW_IOSTREAMS)
# include __STL_NATIVE_HEADER(fstream)
# if defined (__STL_USE_OWN_NAMESPACE)
__STL_BEGIN_NAMESPACE
using __STL_VENDOR_STD::basic_filebuf;
using __STL_VENDOR_STD::filebuf;
using __STL_VENDOR_STD::basic_ifstream;
using __STL_VENDOR_STD::basic_ofstream;
using __STL_VENDOR_STD::ifstream;
using __STL_VENDOR_STD::ofstream;
using __STL_VENDOR_STD::basic_fstream;
using __STL_VENDOR_STD::fstream;
# ifndef __STL_NO_NATIVE_WIDE_STREAMS
using __STL_VENDOR_STD::wofstream;
using __STL_VENDOR_STD::wfilebuf;
using __STL_VENDOR_STD::wifstream;
using __STL_VENDOR_STD::wfstream;
# endif
__STL_END_NAMESPACE
# endif /* __STL_OWN_NAMESPACE */
# elif ! defined (__STL_USE_NO_IOSTREAMS)
# include __STL_NATIVE_HEADER(fstream.h)
# if defined (__STL_USE_NAMESPACES) && ! defined (__STL_BROKEN_USING_DIRECTIVE)
__STL_BEGIN_NAMESPACE
using ::streambuf;
using ::ifstream;
using ::ofstream;
using ::fstream;
__STL_END_NAMESPACE
# endif /* __STL_OWN_NAMESPACE */
# endif /* __STL_USE_NEW_IOSTREAMS */
# if defined ( __STL_RESUME_STD_FOR_FSTREAM )
# undef __STL_RESUME_STD_FOR_FSTREAM
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
#endif /* __STLPORT_FSTREAM */
// Local Variables:
// mode:C++
// End:
@@ -0,0 +1,50 @@
/*
* 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 __SGI_STL_FUNCTIONAL
#define __SGI_STL_FUNCTIONAL
# ifndef __STL_CONFIG_H
# include <stl_config.h>
# endif
# if defined (__STL_IMPORT_VENDOR_STD)
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_FUNCTIONAL
# define __STLPORT_NATIVE_PASS
# endif
# include __STL_NATIVE_HEADER(functional)
# if defined ( __STL_RESUME_STD_FOR_FUNCTIONAL )
# undef __STL_RESUME_STD_FOR_FUNCTIONAL
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
# endif
# ifndef __STL_INTERNAL_FUNCTION_H
# include <stl_function.h>
# endif
#endif /* __SGI_STL_FUNCTIONAL */
// Local Variables:
// mode:C++
// End:
@@ -0,0 +1,32 @@
/*
* 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 __SGI_STL_HASH_MAP
#define __SGI_STL_HASH_MAP
#ifndef __SGI_STL_INTERNAL_HASHTABLE_H
#include <stl_hashtable.h>
#endif
#include <stl_hash_map.h>
#endif /* __SGI_STL_HASH_MAP */
// Local Variables:
// mode:C++
// End:
@@ -0,0 +1,32 @@
/*
* 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 __SGI_STL_HASH_SET
#define __SGI_STL_HASH_SET
#ifndef __SGI_STL_INTERNAL_HASHTABLE_H
#include <stl_hashtable.h>
#endif
#include <stl_hash_set.h>
#endif /* __SGI_STL_HASH_SET */
// Local Variables:
// mode:C++
// End:
@@ -0,0 +1,92 @@
/*
* 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 __STLPORT_IOMANIP
# define __STLPORT_IOMANIP
# ifndef __STL_CONFIG_H
# include <stl_config.h>
# endif
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_IOMANIP
# define __STLPORT_NATIVE_PASS
# endif
# if defined (__STL_USE_NEW_IOSTREAMS)
# include __STL_NATIVE_HEADER(iomanip)
# ifdef __STL_USE_OWN_NAMESPACE
__STL_BEGIN_NAMESPACE
using __STL_VENDOR_STD::setiosflags;
using __STL_VENDOR_STD::resetiosflags;
using __STL_VENDOR_STD::setbase;
using __STL_VENDOR_STD::setfill;
using __STL_VENDOR_STD::setprecision;
using __STL_VENDOR_STD::setw;
# ifdef __SUNPRO_CC
// those are non-standard
using __STL_VENDOR_STD::smanip;
using __STL_VENDOR_STD::smanip_fill;
using __STL_VENDOR_STD::sbase;
using __STL_VENDOR_STD::sfill;
using __STL_VENDOR_STD::sios;
using __STL_VENDOR_STD::sprec;
using __STL_VENDOR_STD::swidth;
using __STL_VENDOR_STD::rsios;
# endif
__STL_END_NAMESPACE
#endif /* __STL_OWN_NAMESPACE */
# elif ! defined ( __STL_USE_NO_IOSTREAMS )
# include __STL_NATIVE_HEADER(iomanip.h)
# if defined (__STL_USE_NAMESPACES) && ! defined (__STL_BROKEN_USING_DIRECTIVE)
__STL_BEGIN_NAMESPACE
using ::setiosflags;
using ::resetiosflags;
using ::setbase;
using ::setfill;
using ::setprecision;
using ::setw;
__STL_END_NAMESPACE
# endif /* __STL_USE_OWN_NAMESPACE */
# endif /* __STL_USE_NEW_IOSTREAMS */
# if defined ( __STL_RESUME_STD_FOR_IOMANIP )
# undef __STL_RESUME_STD_FOR_IOMANIP
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
#endif /* __STLPORT_IOMANIP */
// Local Variables:
// mode:C++
// End:
+82
View File
@@ -0,0 +1,82 @@
/*
* 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 __STLPORT_IOS
# define __STLPORT_IOS
# ifndef __STL_CONFIG_H
# include <stl_config.h>
# endif
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_IOS
# define __STLPORT_NATIVE_PASS
# endif
# include __STL_NATIVE_HEADER(ios)
# if defined ( __STL_RESUME_STD_FOR_IOS )
# undef __STL_RESUME_STD_FOR_IOS
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
# ifdef __STL_USE_OWN_NAMESPACE
__STL_BEGIN_NAMESPACE
using __STL_VENDOR_STD::streamoff;
using __STL_VENDOR_STD::streamsize;
using __STL_VENDOR_STD::ios_base;
using __STL_VENDOR_STD::basic_ios;
// _lib.std.ios.manip_, manipulators:
using __STL_VENDOR_STD::boolalpha;
using __STL_VENDOR_STD::noboolalpha;
using __STL_VENDOR_STD::showbase;
using __STL_VENDOR_STD::noshowbase;
using __STL_VENDOR_STD::showpoint;
using __STL_VENDOR_STD::noshowpoint;
using __STL_VENDOR_STD::showpos;
using __STL_VENDOR_STD::noshowpos;
using __STL_VENDOR_STD::skipws;
using __STL_VENDOR_STD::noskipws;
using __STL_VENDOR_STD::uppercase;
using __STL_VENDOR_STD::nouppercase;
// _lib.adjustfield.manip_ adjustfield:
using __STL_VENDOR_STD::internal;
using __STL_VENDOR_STD::left;
using __STL_VENDOR_STD::right;
// _lib.basefield.manip_ basefield:
using __STL_VENDOR_STD::dec;
using __STL_VENDOR_STD::hex;
using __STL_VENDOR_STD::oct;
// _lib.floatfield.manip_ floatfield:
using __STL_VENDOR_STD::fixed;
using __STL_VENDOR_STD::scientific;
__STL_END_NAMESPACE
#endif /* __STL_OWN_NAMESPACE */
#endif /* __STLPORT_IOS */
// Local Variables:
// mode:C++
// End:
+187
View File
@@ -0,0 +1,187 @@
/*
* 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 __STLPORT_IOSFWD
# define __STLPORT_IOSFWD
#ifndef __STL_CONFIG_H
#include <stl_config.h>
#endif
# ifndef __STLPORT_CSTDDEF
# include <cstddef> /* wchar_t */
# endif
# ifndef __STLPORT_CSTRING
# include <cstring>
# endif
# if defined (__STL_USE_NEW_IOSTREAMS)
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_IOSFWD
# define __STLPORT_NATIVE_PASS
# endif
# include __STL_NATIVE_HEADER(iosfwd)
# if defined ( __MWERKS__ ) || defined (__KCC)
// MSL leaves a few important things out of <iosfwd>.
// We expect this to be fixed in later MSL implementations
# if !defined( __MSL_CPP__ ) || __MSL_CPP__ <= 0x4105
# ifdef MSIPL_USING_NAMESPACE
namespace std {
# endif
// A few things that seem to be missing from CodeWarrior's <iosfwd>
# ifdef __MWERKS__
template <class charT, class traits = char_traits<charT> >
class istreambuf_iterator;
template <class charT, class traits = char_traits<charT> >
class ostreambuf_iterator;
# endif /* __MWERKS__ */
# if defined (__STL_NO_NATIVE_WIDE_STREAMS)
class streampos;
# endif
# ifdef MSIPL_USING_NAMESPACE
} // namespace std
# endif
# endif /* __MSL__ version */
# endif /* MWERKS */
# if defined ( __STL_RESUME_STD_FOR_IOSFWD )
# undef __STL_RESUME_STD_FOR_IOSFWD
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
# if defined (__STL_USE_OWN_NAMESPACE)
__STL_BEGIN_NAMESPACE
// import everything here
# ifndef __STL_BROKEN_USING_DIRECTIVE
using __STL_VENDOR_STD::char_traits;
using __STL_VENDOR_STD::basic_ios;
using __STL_VENDOR_STD::basic_streambuf;
using __STL_VENDOR_STD::basic_istream;
using __STL_VENDOR_STD::basic_ostream;
using __STL_VENDOR_STD::basic_iostream;
using __STL_VENDOR_STD::basic_stringbuf;
using __STL_VENDOR_STD::basic_istringstream;
using __STL_VENDOR_STD::basic_ostringstream;
using __STL_VENDOR_STD::basic_stringstream;
using __STL_VENDOR_STD::basic_filebuf;
using __STL_VENDOR_STD::basic_ifstream;
using __STL_VENDOR_STD::basic_ofstream;
using __STL_VENDOR_STD::basic_fstream;
using __STL_VENDOR_STD::fpos;
using __STL_VENDOR_STD::istreambuf_iterator;
using __STL_VENDOR_STD::ostreambuf_iterator;
# endif
using __STL_VENDOR_STD::ios;
using __STL_VENDOR_STD::streambuf;
using __STL_VENDOR_STD::istream;
using __STL_VENDOR_STD::ostream;
using __STL_VENDOR_STD::iostream;
using __STL_VENDOR_STD::stringbuf;
using __STL_VENDOR_STD::istringstream;
using __STL_VENDOR_STD::ostringstream;
using __STL_VENDOR_STD::stringstream;
using __STL_VENDOR_STD::filebuf;
using __STL_VENDOR_STD::ifstream;
using __STL_VENDOR_STD::ofstream;
using __STL_VENDOR_STD::fstream;
using __STL_VENDOR_STD::streampos;
using __STL_VENDOR_STD::streamoff;
# if !defined (__STL_NO_NATIVE_WIDE_STREAMS)
using __STL_VENDOR_STD::wios;
using __STL_VENDOR_STD::wstreambuf;
using __STL_VENDOR_STD::wistream;
using __STL_VENDOR_STD::wostream;
using __STL_VENDOR_STD::wiostream;
using __STL_VENDOR_STD::wstringbuf;
using __STL_VENDOR_STD::wistringstream;
using __STL_VENDOR_STD::wostringstream;
using __STL_VENDOR_STD::wstringstream;
using __STL_VENDOR_STD::wfilebuf;
using __STL_VENDOR_STD::wifstream;
using __STL_VENDOR_STD::wofstream;
using __STL_VENDOR_STD::wfstream;
using __STL_VENDOR_STD::wstreampos;
# endif
__STL_END_NAMESPACE
# endif
# elif ! defined ( __STL_USE_NO_IOSTREAMS )
// use old-style iostreams
# include <iostream.h>
# endif /* __STL_USE_NEW_IOSTREAMS */
#ifndef __SGI_STL_INTERNAL_FUNCTION_H
# include <stl_function.h>
#endif
// now define things one expects to see here
#ifndef __SGI_STL_CHAR_TRAITS_H
// that defines char_traits or imports std::char_traits
# include <char_traits.h>
#endif
#if !defined (__IN_STLPORT_IOSFWD_OLD )
// predefinition of stream iterators.
__STL_BEGIN_NAMESPACE
# ifdef __STL_USE_ABBREVS
# define istream_iterator _iS__It
# define ostream_iterator _oS__It
# endif
__STL_END_NAMESPACE
# endif /* defined (NEW_IOSTREAMS ) */
// # ifndef __STLPORT_IOSFWD
// # define __STLPORT_IOSFWD
// # endif
#endif /* __STLPORT_IOSFWD */
// Local Variables:
// mode:C++
// End:
@@ -0,0 +1,99 @@
/*
* 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 __STLPORT_IOSTREAM
# define __STLPORT_IOSTREAM
# ifndef __STL_CONFIG_H
# include <stl_config.h>
# endif
# if ! defined (__STL_NO_IOSTREAMS)
# if defined (__STL_MSVC) && (__STL_MSVC < 1100)
# include <cwchar>
// lower ifdef level
# include <ios>
# endif
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_IOSTREAM
# define __STLPORT_NATIVE_PASS
# endif
# if defined (__STL_USE_NEW_IOSTREAMS)
# include __STL_NATIVE_HEADER(iostream)
# if defined (__STL_USE_OWN_NAMESPACE)
__STL_BEGIN_NAMESPACE
using __STL_VENDOR_STD::cin;
using __STL_VENDOR_STD::cout;
using __STL_VENDOR_STD::cerr;
using __STL_VENDOR_STD::clog;
# if ! defined (__STL_NO_NATIVE_WIDE_STREAMS)
using __STL_VENDOR_STD::wcin;
using __STL_VENDOR_STD::wcout;
using __STL_VENDOR_STD::wcerr;
using __STL_VENDOR_STD::wclog;
# endif
__STL_END_NAMESPACE
# endif /* __STL_USE_OWN_NAMESPACE */
# elif ! defined (__STL_USE_NO_IOSTREAMS )
# include __STL_NATIVE_HEADER(iostream.h)
# if defined (__STL_USE_NAMESPACES) && !defined (__STL_BROKEN_USING_DIRECTIVE)
__STL_BEGIN_NAMESPACE
using ::istream;
using ::ostream;
using ::cin;
using ::cout;
using ::cerr;
using ::clog;
using ::endl;
using ::ends;
using ::ios;
using ::flush;
__STL_END_NAMESPACE
# endif /* __STL_USE_OWN_NAMESPACE */
# endif /* __STL_USE_NEW_STYLE_IOSTREAMS */
# if defined ( __STL_RESUME_STD_FOR_IOSTREAM )
# undef __STL_RESUME_STD_FOR_IOSTREAM
# undef __STLPORT_NATIVE_PASS
# define std __STLPORT_NAMESPACE
# endif
# endif /* STL_NO_IOSTREAMS */
#endif
// Local Variables:
// mode:C++
// End:
@@ -0,0 +1,87 @@
/*
* 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 __STLPORT_ISTREAM
# define __STLPORT_ISTREAM
# ifndef __STL_CONFIG_H
# include <stl_config.h>
# endif
// # if defined (__STL_USE_OWN_NAMESPACE) && ! defined (__STL_MSVC)
// # include <string>
// # endif
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_ISTREAM
# define __STLPORT_NATIVE_PASS
# endif
# if defined (__STL_USE_NEW_IOSTREAMS)
# include __STL_NATIVE_HEADER(istream)
# if defined (__STL_USE_OWN_NAMESPACE)
__STL_BEGIN_NAMESPACE
using __STL_VENDOR_STD::basic_istream;
using __STL_VENDOR_STD::istream;
using __STL_VENDOR_STD::basic_iostream;
using __STL_VENDOR_STD::iostream;
# if !defined (__STL_NO_NATIVE_WIDE_STREAMS)
using __STL_VENDOR_STD::wistream;
using __STL_VENDOR_STD::wiostream;
# endif
#if !(defined (__STL_MSVC) && (__STL_MSVC < 1200))
using __STL_VENDOR_STD::ws;
#endif
__STL_END_NAMESPACE
# endif /* __STL_OWN_NAMESPACE */
# elif ! defined (__STL_USE_NO_IOSTREAMS)
# include __STL_NATIVE_HEADER(iostream.h)
# if defined (__STL_USE_NAMESPACES) && ! defined (__STL_BROKEN_USING_DIRECTIVE)
__STL_BEGIN_NAMESPACE
using ::istream;
using ::ws;
__STL_END_NAMESPACE
# endif /* NAMESPACES */
# endif /* if defined (__STL_USE_NEW_IOSTREAMS) */
# if defined ( __STL_RESUME_STD_FOR_ISTREAM )
# undef __STL_RESUME_STD_FOR_ISTREAM
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
#endif /* __STLPORT_ISTREAM */
// Local Variables:
// mode:C++
// End:
@@ -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 __SGI_STL_ITERATOR
#define __SGI_STL_ITERATOR
# ifndef __SGI_STL_INTERNAL_ITERATOR_H
# include <stl_iterator.h>
# endif
# ifndef __SGI_STL_INTERNAL_STREAM_ITERATOR_H
# include <stl_stream_iterator.h>
# endif
#if defined (__STL_IMPORT_VENDOR_STD)
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_ITERATOR
# define __STLPORT_NATIVE_PASS
# endif
# include __STL_NATIVE_HEADER(iterator)
# if defined ( __STL_RESUME_STD_FOR_ITERATOR )
# undef __STL_RESUME_STD_FOR_ITERATOR
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
#endif
#endif /* __SGI_STL_ITERATOR */
// Local Variables:
// mode:C++
// End:
@@ -0,0 +1,49 @@
/*
* 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 __STLPORT_LIMITS
#define __STLPORT_LIMITS
# ifndef __STL_CONFIG_H
# include <stl_config.h>
# endif
# include <stl_limits.h>
# ifdef __STL_WHOLE_NATIVE_STD
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_LIMITS
# define __STLPORT_NATIVE_PASS
# endif
# include __STL_NATIVE_HEADER(limits)
# if defined ( __STL_RESUME_STD_FOR_LIMITS )
# undef __STL_RESUME_STD_FOR_LIMITS
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
# endif
#endif /* __SGI_CPP_LIMITS */
// Local Variables:
// mode:C++
// End:
+54
View File
@@ -0,0 +1,54 @@
/*
*
* 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 __SGI_STL_LIST
#define __SGI_STL_LIST
#ifndef __SGI_STL_INTERNAL_LIST_H
# include <stl_list.h>
#endif
#if defined (__STL_WHOLE_NATIVE_STD)
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_LIST
# define __STLPORT_NATIVE_PASS
# endif
# include __STL_NATIVE_HEADER(list)
# if defined ( __STL_RESUME_STD_FOR_LIST )
# undef __STL_RESUME_STD_FOR_LIST
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
#endif
#endif /* __SGI_STL_LIST */
// Local Variables:
// mode:C++
// End:
+115
View File
@@ -0,0 +1,115 @@
/*
* 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 __STLPORT_LOCALE
# define __STLPORT_LOCALE
# ifndef __STL_CONFIG_H
# include <stl_config.h>
# endif
# ifndef __STLPORT_CSTDLIB
# include <cstdlib>
# endif
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_LOCALE
# define __STLPORT_NATIVE_PASS
# endif
# include __STL_NATIVE_HEADER(locale)
# if defined ( __STL_RESUME_STD_FOR_LOCALE )
# undef __STL_RESUME_STD_FOR_LOCALE
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
# ifdef __STL_USE_OWN_NAMESPACE
__STL_BEGIN_NAMESPACE
// from <cwchar>
#if !defined (__STL_NO_MBSTATE_T)
using __STL_VENDOR_MB_NAMESPACE::mbstate_t;
#endif
// _lib.locale_, locale:
using __STL_VENDOR_STD::locale;
using __STL_VENDOR_STD::use_facet;
using __STL_VENDOR_STD::has_facet;
// _lib.locale.convenience_, convenience interfaces:
using __STL_VENDOR_STD::isspace;
using __STL_VENDOR_STD::isprint;
using __STL_VENDOR_STD::iscntrl;
using __STL_VENDOR_STD::isupper;
using __STL_VENDOR_STD::islower;
using __STL_VENDOR_STD::isalpha;
using __STL_VENDOR_STD::isdigit;
using __STL_VENDOR_STD::ispunct;
using __STL_VENDOR_STD::isxdigit;
using __STL_VENDOR_STD::isalnum;
using __STL_VENDOR_STD::isgraph;
using __STL_VENDOR_STD::toupper;
using __STL_VENDOR_STD::tolower;
// _lib.category.ctype_ and _lib.facet.ctype.special_, ctype:
using __STL_VENDOR_STD::ctype_base;
using __STL_VENDOR_STD::ctype;
using __STL_VENDOR_STD::ctype_byname;
using __STL_VENDOR_STD::codecvt_base;
using __STL_VENDOR_STD::codecvt;
using __STL_VENDOR_STD::codecvt_byname;
// _lib.category.numeric_ and _lib.facet.numpunct_, numeric:
using __STL_VENDOR_STD::num_get;
using __STL_VENDOR_STD::num_put;
using __STL_VENDOR_STD::numpunct;
using __STL_VENDOR_STD::numpunct_byname;
// _lib.category.collate_, collation:
using __STL_VENDOR_STD::collate;
using __STL_VENDOR_STD::collate_byname;
// _lib.category.time_, date and time:
using __STL_VENDOR_STD::time_base;
using __STL_VENDOR_STD::time_get;
using __STL_VENDOR_STD::time_get_byname;
using __STL_VENDOR_STD::time_put;
using __STL_VENDOR_STD::time_put_byname;
// _lib.category.monetary_, money:
using __STL_VENDOR_STD::money_base;
using __STL_VENDOR_STD::money_get;
using __STL_VENDOR_STD::money_put;
using __STL_VENDOR_STD::moneypunct;
using __STL_VENDOR_STD::moneypunct_byname;
#if !defined (__STL_NO_NATIVE_MESSAGE_FACET)
using __STL_VENDOR_STD::messages_base;
using __STL_VENDOR_STD::messages;
using __STL_VENDOR_STD::messages_byname;
#endif // _MSL_NO_MESSAGE_FACET
__STL_END_NAMESPACE
#endif /* __STL_OWN_NAMESPACE */
#endif /* __STLPORT_LOCALE */
// Local Variables:
// mode:C++
// End:
+63
View File
@@ -0,0 +1,63 @@
/*
*
* 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 __SGI_STL_MAP
#define __SGI_STL_MAP
#ifndef __SGI_STL_INTERNAL_TREE_H
#include <stl_tree.h>
#endif
#include <stl_map.h>
#include <stl_multimap.h>
#if defined (__STL_WHOLE_NATIVE_STD)
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_MAP
# define __STLPORT_NATIVE_PASS
# endif
# ifdef __MSL__ // dwa 2/28/99 - help MSL get its own headers and prevent it from including ours
# include __STL_NATIVE_HEADER(tree.h)
# ifndef __SGI_STL_TREE_H
# define __SGI_STL_TREE_H
# endif
# endif
# include __STL_NATIVE_HEADER(map)
# if defined ( __STL_RESUME_STD_FOR_MAP )
# undef __STL_RESUME_STD_FOR_MAP
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
#endif
#endif /* __SGI_STL_MAP */
// Local Variables:
// mode:C++
// End:
+146
View File
@@ -0,0 +1,146 @@
/*
* 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 __SGI_STL_MEMORY
# define __SGI_STL_MEMORY
# ifndef __SGI_STL_INTERNAL_ALLOC_H
# include <stl_alloc.h>
# endif
# ifndef __SGI_STL_INTERNAL_TEMPBUF_H
# include <stl_tempbuf.h>
# endif
# ifndef __SGI_STL_INTERNAL_RAW_STORAGE_ITER_H
# include <stl_raw_storage_iter.h>
# endif
# if defined (__STL_IMPORT_VENDOR_STD)
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_MEMORY
# define __STLPORT_NATIVE_PASS
# endif
# include __STL_NATIVE_HEADER(memory)
# if __MSL__ >= 0x2405 /* 980401 vss MSL 2.4 Pro 3 Release */
# include <new_mem.h>
# endif
# if defined ( __STL_RESUME_STD_FOR_MEMORY )
# undef __STL_RESUME_STD_FOR_MEMORY
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
# endif
__STL_BEGIN_NAMESPACE
struct __auto_ptr_base {
void* _M_p;
};
template <class _Tp> class auto_ptr_ref {
public:
__auto_ptr_base& _M_r;
_Tp* const _M_p;
auto_ptr_ref(_Tp* __p, __auto_ptr_base& __r) : _M_r(__r), _M_p(__p) {}
_Tp* release() const { _M_r._M_p = 0; return _M_p; }
};
template<class _Tp> struct auto_ptr : public __auto_ptr_base {
typedef _Tp element_type;
typedef auto_ptr<_Tp> _Self;
_Tp* get() const __STL_NOTHROW { return __STATIC_CAST(_Tp*,_M_p); }
_Tp* release() __STL_NOTHROW { _Tp* __px = get(); _M_p = 0; return __px; }
void reset(_Tp* __px=0) __STL_NOTHROW { if (__px != get()) delete get(), _M_p = __px; }
explicit auto_ptr() __STL_NOTHROW { _M_p = 0; }
explicit auto_ptr(_Tp* __px) __STL_NOTHROW { _M_p = __px; }
auto_ptr(_Self& __r) __STL_NOTHROW { _M_p = __r.release(); }
_Self& operator=(_Self& __r) __STL_NOTHROW {
reset(__r.release());
return *this;
}
#if defined (__STL_MEMBER_TEMPLATES) && defined (__STL_FUNCTION_TMPL_PARTIAL_ORDER)
template<class _Tp1> auto_ptr(auto_ptr<_Tp1>& __r) __STL_NOTHROW {
_Tp* __px = __r.release();
_M_p = __px;
}
template<class _Tp1> auto_ptr& operator=(auto_ptr<_Tp1>& __r) __STL_NOTHROW {
reset(__r.release());
return *this;
}
#endif /* __STL_MEMBER_TEMPLATES */
~auto_ptr() { delete get(); }
_Tp& operator*() const __STL_NOTHROW { return *get(); }
# if defined (__SGI_STL_NO_ARROW_OPERATOR)
// fbp : you would not instantiate auto_ptrs for builtins, would you ?
# if !defined (__STL_NO_AUTO_PTR_PROXY_ARROW_OPERATOR)
__arrow_op_dispatch<_Tp&, _Tp*> operator->() const __STL_NOTHROW {
return __arrow_op_dispatch<_Tp&, _Tp*>(*get());
}
# endif
# else
_Tp* operator->() const __STL_NOTHROW { return get(); }
# endif
auto_ptr(auto_ptr_ref<_Tp> __r) __STL_NOTHROW {
_M_p = __r.release();
}
_Self& operator=(auto_ptr_ref<_Tp> __r) __STL_NOTHROW {
reset(__r.release());
return *this;
}
# if defined(__STL_MEMBER_TEMPLATES) && !defined(__STL_NO_TEMPLATE_CONVERSIONS)
template<class _Tp1> operator auto_ptr_ref<_Tp1>() __STL_NOTHROW {
return auto_ptr_ref<_Tp1>(get(),*this);
}
template<class _Tp1> operator auto_ptr<_Tp1>() __STL_NOTHROW {
return auto_ptr<_Tp1>(release());
}
# else
operator auto_ptr_ref<_Tp>() __STL_NOTHROW
{ return auto_ptr_ref<_Tp>(get(),*this); }
# endif
};
__STL_END_NAMESPACE
#endif /* __SGI_STL_MEMORY */
// Local Variables:
// mode:C++
// End:
+99
View File
@@ -0,0 +1,99 @@
/*
* 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 __STLPORT_NEW
# define __STLPORT_NEW
# ifndef __STL_CONFIG_H
# include <stl_config.h>
# endif
#ifndef __STL_WINCE
#if defined (__BORLANDC__) && (__BORLANDC__ > 0x520)
// new.h uses ::malloc ;(
# include <cstdlib>
using __stl_native_std::malloc;
#endif
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_NEW
# define __STLPORT_NATIVE_PASS
# endif
# if !defined (__STL_NO_NEW_NEW_HEADER)
# if defined (__GNUC__) && (__GNUC_MINOR__ >= 8 )
# include <../include/new>
# else
# include __STL_NATIVE_HEADER(new)
# endif
# else
# include __STL_NATIVE_HEADER(new.h)
# endif
# if defined ( __STL_RESUME_STD_FOR_NEW )
# undef __STL_RESUME_STD_FOR_NEW
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
# ifndef __STL_NO_BAD_ALLOC
# ifdef __STL_USE_OWN_NAMESPACE
__STL_BEGIN_NAMESPACE
using __STL_VENDOR_EXCEPT_STD::bad_alloc;
__STL_END_NAMESPACE
# endif /* __STL_OWN_NAMESPACE */
# else /* __STL_NO_BAD_ALLOC */
# include <exception>
__STL_BEGIN_NAMESPACE
class bad_alloc : public __STL_EXCEPTION_BASE {
public:
bad_alloc () __STL_NOTHROW { }
bad_alloc(const bad_alloc&) __STL_NOTHROW { }
bad_alloc& operator=(const bad_alloc&) __STL_NOTHROW {return *this;}
~bad_alloc () __STL_NOTHROW { }
const char* what() const __STL_NOTHROW { return "bad alloc"; }
};
__STL_END_NAMESPACE
#endif /* __STL_NO_BAD_ALLOC */
__STL_BEGIN_NAMESPACE
inline void* __stl_new(size_t __n) {
#if (( defined(__IBMCPP__)|| defined(__OS400__) || defined (__xlC__) || defined (qTidyHeap)) && defined(__DEBUG_ALLOC__) )
return ::operator __STL_NEW(__n, __FILE__, __LINE__);
#else
return ::operator __STL_NEW(__n);
#endif
}
inline void __stl_delete(void* __p) {
#if (( defined(__IBMCPP__) || defined(__OS400__)|| defined (__xlC__) || defined (qTidyHeap)) && defined(__DEBUG_ALLOC__) )
::operator delete(__p, __FILE__, __LINE__);
#else
::operator delete(__p);
#endif
}
__STL_END_NAMESPACE
#endif /* WINCE */
#endif /* __STLPORT_NEW */
// Local Variables:
// mode:C++
// End:
@@ -0,0 +1,40 @@
/*
*
* 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 __SGI_STL_NUMERIC
#define __SGI_STL_NUMERIC
# ifndef __STL_CONFIG_H
# include <stl_config.h>
# endif
#ifndef __SGI_STL_INTERNAL_FUNCTION_H
# include <stl_function.h>
#endif
#include <stl_numeric.h>
#endif /* __SGI_STL_NUMERIC */
// Local Variables:
// mode:C++
// End:
@@ -0,0 +1,78 @@
/*
* 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 __STLPORT_OSTREAM
# define __STLPORT_OSTREAM
# ifndef __STL_CONFIG_H
# include <stl_config.h>
# endif
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_OSTREAM
# define __STLPORT_NATIVE_PASS
# endif
# if defined (__STL_USE_NEW_IOSTREAMS) || defined (__IN_STLPORT_OSTREAM)
# include __STL_NATIVE_HEADER(ostream)
# if defined (__STL_USE_OWN_NAMESPACE)
__STL_BEGIN_NAMESPACE
using __STL_VENDOR_STD::basic_ostream;
using __STL_VENDOR_STD::ostream;
# ifndef __STL_NO_NATIVE_WIDE_STREAMS
using __STL_VENDOR_STD::wostream;
# endif
using __STL_VENDOR_STD::endl;
using __STL_VENDOR_STD::ends;
using __STL_VENDOR_STD::flush;
__STL_END_NAMESPACE
# endif /* __STL_OWN_NAMESPACE */
# elif ! defined (__STL_USE_NO_IOSTREAMS)
# include __STL_NATIVE_HEADER(iostream.h)
# if defined (__STL_USE_NAMESPACES) && ! defined (__STL_BROKEN_USING_DIRECTIVE)
__STL_BEGIN_NAMESPACE
using ::ostream;
using ::endl;
using ::ends;
using ::flush;
__STL_END_NAMESPACE
# endif /* __STL_NAMESPACE */
# endif /* if defined (__STL_USE_NEW_IOSTREAMS) */
# if defined ( __STL_RESUME_STD_FOR_OSTREAM )
# undef __STL_RESUME_STD_FOR_OSTREAM
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
#endif /* __STLPORT_OSTREAM */
// Local Variables:
// mode:C++
// End:
@@ -0,0 +1,519 @@
/*
*
* 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 __SGI_STL_PTHREAD_ALLOC
#define __SGI_STL_PTHREAD_ALLOC
// Pthread-specific node allocator.
// This is similar to the default allocator, except that free-list
// information is kept separately for each thread, avoiding locking.
// This should be reasonably fast even in the presence of threads.
// The down side is that storage may not be well-utilized.
// It is not an error to allocate memory in thread A and deallocate
// it in thread B. But this effectively transfers ownership of the memory,
// so that it can only be reallocated by thread B. Thus this can effectively
// result in a storage leak if it's done on a regular basis.
// It can also result in frequent sharing of
// cache lines among processors, with potentially serious performance
// consequences.
#ifndef __SGI_STL_INTERNAL_ALLOC_H
#include <stl_alloc.h>
#endif
#ifndef __RESTRICT
# define __RESTRICT
#endif
__STL_BEGIN_NAMESPACE
#define __STL_DATA_ALIGNMENT 8
union _Pthread_alloc_obj {
union _Pthread_alloc_obj * __free_list_link;
char __client_data[__STL_DATA_ALIGNMENT]; /* The client sees this. */
};
// Pthread allocators don't appear to the client to have meaningful
// instances. We do in fact need to associate some state with each
// thread. That state is represented by
// _Pthread_alloc_per_thread_state<_Max_size>.
template<size_t _Max_size>
struct _Pthread_alloc_per_thread_state {
typedef _Pthread_alloc_obj __obj;
enum { _S_NFREELISTS = _Max_size/__STL_DATA_ALIGNMENT };
_Pthread_alloc_obj* volatile __free_list[_S_NFREELISTS];
_Pthread_alloc_per_thread_state<_Max_size> * __next;
// Free list link for list of available per thread structures.
// When one of these becomes available for reuse due to thread
// termination, any objects in its free list remain associated
// with it. The whole structure may then be used by a newly
// created thread.
_Pthread_alloc_per_thread_state() : __next(0)
{
memset((void *)__free_list, 0, (size_t)_S_NFREELISTS * sizeof(__obj *));
}
// Returns an object of size __n, and possibly adds to size n free list.
void *_M_refill(size_t __n);
};
// Pthread-specific allocator.
// The argument specifies the largest object size allocated from per-thread
// free lists. Larger objects are allocated using malloc_alloc.
// Max_size must be a power of 2.
template <size_t _Max_size = 128>
class _Pthread_alloc_template {
public: // but only for internal use:
typedef _Pthread_alloc_obj __obj;
// Allocates a chunk for nobjs of size size. nobjs may be reduced
// if it is inconvenient to allocate the requested number.
static char *_S_chunk_alloc(size_t __size, int &__nobjs);
enum {_S_ALIGN = __STL_DATA_ALIGNMENT};
static size_t _S_round_up(size_t __bytes) {
return (((__bytes) + (int)_S_ALIGN-1) & ~((int)_S_ALIGN - 1));
}
static size_t _S_freelist_index(size_t __bytes) {
return (((__bytes) + (int)_S_ALIGN-1)/(int)_S_ALIGN - 1);
}
private:
// Chunk allocation state. And other shared state.
// Protected by _S_chunk_allocator_lock.
static pthread_mutex_t _S_chunk_allocator_lock;
static char *_S_start_free;
static char *_S_end_free;
static size_t _S_heap_size;
static _Pthread_alloc_per_thread_state<_Max_size>* _S_free_per_thread_states;
static pthread_key_t _S_key;
static bool _S_key_initialized;
// Pthread key under which per thread state is stored.
// Allocator instances that are currently unclaimed by any thread.
static void _S_destructor(void *instance);
// Function to be called on thread exit to reclaim per thread
// state.
static _Pthread_alloc_per_thread_state<_Max_size> *_S_new_per_thread_state();
// Return a recycled or new per thread state.
static _Pthread_alloc_per_thread_state<_Max_size> *_S_get_per_thread_state();
// ensure that the current thread has an associated
// per thread state.
class _M_lock;
friend class _M_lock;
class _M_lock {
public:
_M_lock () { pthread_mutex_lock(&_S_chunk_allocator_lock); }
~_M_lock () { pthread_mutex_unlock(&_S_chunk_allocator_lock); }
};
public:
/* n must be > 0 */
static void * allocate(size_t __n)
{
__obj * volatile * __my_free_list;
__obj * __RESTRICT __result;
_Pthread_alloc_per_thread_state<_Max_size>* __a;
if (__n > _Max_size) {
return(__malloc_alloc<0>::allocate(__n));
}
if (!_S_key_initialized ||
!(__a = (_Pthread_alloc_per_thread_state<_Max_size>*)
pthread_getspecific(_S_key))) {
__a = _S_get_per_thread_state();
}
__my_free_list = __a -> __free_list + _S_freelist_index(__n);
__result = *__my_free_list;
if (__result == 0) {
void *__r = __a -> _M_refill(_S_round_up(__n));
return __r;
}
*__my_free_list = __result -> __free_list_link;
return (__result);
};
/* p may not be 0 */
static void deallocate(void *__p, size_t __n)
{
__obj *__q = (__obj *)__p;
__obj * volatile * __my_free_list;
_Pthread_alloc_per_thread_state<_Max_size>* __a;
if (__n > _Max_size) {
__malloc_alloc<0>::deallocate(__p, __n);
return;
}
if (!_S_key_initialized ||
!(__a = (_Pthread_alloc_per_thread_state<_Max_size> *)
pthread_getspecific(_S_key))) {
__a = _S_get_per_thread_state();
}
__my_free_list = __a->__free_list + _S_freelist_index(__n);
__q -> __free_list_link = *__my_free_list;
*__my_free_list = __q;
}
static void * reallocate(void *__p, size_t __old_sz, size_t __new_sz);
} ;
typedef _Pthread_alloc_template<> pthread_alloc;
template <size_t _Max_size>
void _Pthread_alloc_template<_Max_size>::_S_destructor(void * __instance)
{
_M_lock __lock_instance; // Need to acquire lock here.
_Pthread_alloc_per_thread_state<_Max_size>* __s =
(_Pthread_alloc_per_thread_state<_Max_size> *)__instance;
__s -> __next = _S_free_per_thread_states;
_S_free_per_thread_states = __s;
}
template <size_t _Max_size>
_Pthread_alloc_per_thread_state<_Max_size> *
_Pthread_alloc_template<_Max_size>::_S_new_per_thread_state()
{
/* lock already held here. */
if (0 != _S_free_per_thread_states) {
_Pthread_alloc_per_thread_state<_Max_size> *__result =
_S_free_per_thread_states;
_S_free_per_thread_states = _S_free_per_thread_states -> __next;
return __result;
} else {
return __STL_NEW _Pthread_alloc_per_thread_state<_Max_size>;
}
}
template <size_t _Max_size>
_Pthread_alloc_per_thread_state<_Max_size> *
_Pthread_alloc_template<_Max_size>::_S_get_per_thread_state()
{
/*REFERENCED*/
_M_lock __lock_instance; // Need to acquire lock here.
int __ret_code;
_Pthread_alloc_per_thread_state<_Max_size> * __result;
if (!_S_key_initialized) {
if (pthread_key_create(&_S_key, _S_destructor)) {
__THROW_BAD_ALLOC; // failed
}
_S_key_initialized = true;
}
__result = _S_new_per_thread_state();
__ret_code = pthread_setspecific(_S_key, __result);
if (__ret_code) {
if (__ret_code == ENOMEM) {
__THROW_BAD_ALLOC;
} else {
// EINVAL
abort();
}
}
return __result;
}
/* We allocate memory in large chunks in order to avoid fragmenting */
/* the malloc heap too much. */
/* We assume that size is properly aligned. */
template <size_t _Max_size>
char *_Pthread_alloc_template<_Max_size>
::_S_chunk_alloc(size_t __p_size, int &__nobjs)
{
{
char * __result;
size_t __total_bytes;
size_t __bytes_left;
/*REFERENCED*/
_M_lock __lock_instance; // Acquire lock for this routine
__total_bytes = __p_size * __nobjs;
__bytes_left = _S_end_free - _S_start_free;
if (__bytes_left >= __total_bytes) {
__result = _S_start_free;
_S_start_free += __total_bytes;
return(__result);
} else if (__bytes_left >= __p_size) {
__nobjs = __bytes_left/__p_size;
__total_bytes = __p_size * __nobjs;
__result = _S_start_free;
_S_start_free += __total_bytes;
return(__result);
} else {
size_t __bytes_to_get =
2 * __total_bytes + _S_round_up(_S_heap_size >> 4);
// Try to make use of the left-over piece.
if (__bytes_left > 0) {
_Pthread_alloc_per_thread_state<_Max_size>* __a =
(_Pthread_alloc_per_thread_state<_Max_size>*)
pthread_getspecific(_S_key);
__obj * volatile * __my_free_list =
__a->__free_list + _S_freelist_index(__bytes_left);
((__obj *)_S_start_free) -> __free_list_link = *__my_free_list;
*__my_free_list = (__obj *)_S_start_free;
}
# ifdef _SGI_SOURCE
// Try to get memory that's aligned on something like a
// cache line boundary, so as to avoid parceling out
// parts of the same line to different threads and thus
// possibly different processors.
{
const int __cache_line_size = 128; // probable upper bound
__bytes_to_get &= ~(__cache_line_size-1);
_S_start_free = (char *)memalign(__cache_line_size, __bytes_to_get);
if (0 == _S_start_free) {
_S_start_free = (char *)__malloc_alloc<0>::allocate(__bytes_to_get);
}
}
# else /* !SGI_SOURCE */
_S_start_free = (char *)__malloc_alloc<0>::allocate(__bytes_to_get);
# endif
_S_heap_size += __bytes_to_get;
_S_end_free = _S_start_free + __bytes_to_get;
}
}
// lock is released here
return(_S_chunk_alloc(__p_size, __nobjs));
}
/* Returns an object of size n, and optionally adds to size n free list.*/
/* We assume that n is properly aligned. */
/* We hold the allocation lock. */
template <size_t _Max_size>
void *_Pthread_alloc_per_thread_state<_Max_size>
::_M_refill(size_t __n)
{
int __nobjs = 128;
char * __chunk =
_Pthread_alloc_template<_Max_size>::_S_chunk_alloc(__n, __nobjs);
__obj * volatile * __my_free_list;
__obj * __result;
__obj * __current_obj, * __next_obj;
int __i;
if (1 == __nobjs) {
return(__chunk);
}
__my_free_list = __free_list
+ _Pthread_alloc_template<_Max_size>::_S_freelist_index(__n);
/* Build free list in chunk */
__result = (__obj *)__chunk;
*__my_free_list = __next_obj = (__obj *)(__chunk + __n);
for (__i = 1; ; __i++) {
__current_obj = __next_obj;
__next_obj = (__obj *)((char *)__next_obj + __n);
if (__nobjs - 1 == __i) {
__current_obj -> __free_list_link = 0;
break;
} else {
__current_obj -> __free_list_link = __next_obj;
}
}
return(__result);
}
template <size_t _Max_size>
void *_Pthread_alloc_template<_Max_size>
::reallocate(void *__p, size_t __old_sz, size_t __new_sz)
{
void * __result;
size_t __copy_sz;
if (__old_sz > _Max_size
&& __new_sz > _Max_size) {
return(realloc(__p, __new_sz));
}
if (_S_round_up(__old_sz) == _S_round_up(__new_sz)) return(__p);
__result = allocate(__new_sz);
__copy_sz = __new_sz > __old_sz? __old_sz : __new_sz;
memcpy(__result, __p, __copy_sz);
deallocate(__p, __old_sz);
return(__result);
}
#if __STL_STATIC_TEMPLATE_DATA > 0
template <size_t _Max_size>
_Pthread_alloc_per_thread_state<_Max_size> *
_Pthread_alloc_template<_Max_size>::_S_free_per_thread_states = 0;
template <size_t _Max_size>
pthread_key_t _Pthread_alloc_template<_Max_size>::_S_key;
template <size_t _Max_size>
bool _Pthread_alloc_template<_Max_size>::_S_key_initialized = false;
template <size_t _Max_size>
pthread_mutex_t _Pthread_alloc_template<_Max_size>::_S_chunk_allocator_lock
= PTHREAD_MUTEX_INITIALIZER;
template <size_t _Max_size>
char *_Pthread_alloc_template<_Max_size>
::_S_start_free = 0;
template <size_t _Max_size>
char *_Pthread_alloc_template<_Max_size>
::_S_end_free = 0;
template <size_t _Max_size>
size_t _Pthread_alloc_template<_Max_size>
::_S_heap_size = 0;
# endif
template <class _Tp>
class pthread_allocator {
typedef pthread_alloc _S_Alloc; // The underlying allocator.
public:
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef _Tp* pointer;
typedef const _Tp* const_pointer;
typedef _Tp& reference;
typedef const _Tp& const_reference;
typedef _Tp value_type;
#ifdef __STL_MEMBER_TEMPLATE_CLASSES
template <class _NewType> struct rebind {
typedef pthread_allocator<_NewType> other;
};
#endif
pthread_allocator() __STL_NOTHROW {}
pthread_allocator(const pthread_allocator<_Tp>& a) __STL_NOTHROW {}
#if defined (__STL_MEMBER_TEMPLATES) && defined (__STL_FUNCTION_PARTIAL_ORDER)
template <class _OtherType> pthread_allocator(const pthread_allocator<_OtherType>&)
__STL_NOTHROW {}
#endif
~pthread_allocator() __STL_NOTHROW {}
pointer address(reference __x) const { return &__x; }
const_pointer address(const_reference __x) const { return &__x; }
// __n is permitted to be 0. The C++ standard says nothing about what
// the return value is when __n == 0.
_Tp* allocate(size_type __n, const void* = 0) {
return __n != 0 ? __STATIC_CAST(_Tp*,_S_Alloc::allocate(__n * sizeof(_Tp)))
: 0;
}
// p is not permitted to be a null pointer.
void deallocate(pointer __p, size_type __n)
{ _S_Alloc::deallocate(__p, __n * sizeof(_Tp)); }
size_type max_size() const __STL_NOTHROW
{ return size_t(-1) / sizeof(_Tp); }
void construct(pointer __p, const _Tp& __val) { __STL_PLACEMENT_NEW (__p) _Tp(__val); }
void destroy(pointer _p) { _p->~_Tp(); }
};
__STL_TEMPLATE_NULL
class pthread_allocator<void> {
public:
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef void* pointer;
typedef const void* const_pointer;
typedef void value_type;
#ifdef __STL_MEMBER_TEMPLATE_CLASSES
template <class _NewType> struct rebind {
typedef pthread_allocator<_NewType> other;
};
#endif
};
/*
template <size_t _Max_size>
inline bool operator==(const _Pthread_alloc_template<_Max_size>&,
const _Pthread_alloc_template<_Max_size>&)
{
return true;
}
*/
template <class _T1, class _T2>
inline bool operator==(const pthread_allocator<_T1>&,
const pthread_allocator<_T2>& a2)
{
return true;
}
#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
template <class _T1, class _T2>
inline bool operator!=(const pthread_allocator<_T1>&,
const pthread_allocator<_T2>&)
{
return false;
}
#endif
#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
template <class _Tp, size_t _Max_size>
struct _Alloc_traits<_Tp, _Pthread_alloc_template<_Max_size> >
{
typedef __allocator<_Tp, _Pthread_alloc_template<_Max_size> >
allocator_type;
};
/*
template <class _Tp, class _Atype, size_t _Max>
struct _Alloc_traits<_Tp, __allocator<_Atype, _Pthread_alloc_template<_Max> > >
{
typedef __allocator<_Tp, _Pthread_alloc_template<_Max> > allocator_type;
};
*/
template <class _Tp, class _Atype>
struct _Alloc_traits<_Tp, pthread_allocator<_Atype> >
{
typedef pthread_allocator<_Tp> allocator_type;
};
#endif
#if !defined (__STL_MEMBER_TEMPLATE_CLASSES)
template <class _Tp1, class _Tp2>
inline allocator<_Tp2>
__stl_alloc_rebind(pthread_allocator<_Tp1>&, const _Tp2*, __false_type) {
return allocator<_Tp2>();
}
#endif /* __STL_MEMBER_TEMPLATE_CLASSES */
__STL_END_NAMESPACE
#endif /* __SGI_STL_PTHREAD_ALLOC */
// Local Variables:
// mode:C++
// End:
+58
View File
@@ -0,0 +1,58 @@
/*
*
* 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 __SGI_STL_QUEUE
#define __SGI_STL_QUEUE
#ifndef __SGI_STL_INTERNAL_QUEUE_H
# include <stl_queue.h>
#endif
#ifndef __SGI_STL_INTERNAL_FUNCTION_H
# include <stl_function.h>
#endif
#if defined (__STL_WHOLE_NATIVE_STD)
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_QUEUE
# define __STLPORT_NATIVE_PASS
# endif
# include __STL_NATIVE_HEADER(queue)
# if defined ( __STL_RESUME_STD_FOR_QUEUE )
# undef __STL_RESUME_STD_FOR_QUEUE
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
#endif
#endif /* __SGI_STL_QUEUE */
// Local Variables:
// mode:C++
// End:
+25
View File
@@ -0,0 +1,25 @@
/*
* 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 __SGI_STL_ROPE
#define __SGI_STL_ROPE
// #ifndef __SGI_STL_INTERNAL_ROPE_H
# include <stl_rope.h>
// #endif
#endif /* __SGI_STL_ROPE */
// Local Variables:
// mode:C++
// End:
+64
View File
@@ -0,0 +1,64 @@
/*
*
* 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 __SGI_STL_SET
#define __SGI_STL_SET
#ifndef __SGI_STL_INTERNAL_TREE_H
#include <stl_tree.h>
#endif
#include <stl_set.h>
#include <stl_multiset.h>
#if defined (__STL_WHOLE_NATIVE_STD)
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_SET
# define __STLPORT_NATIVE_PASS
# endif
# ifdef __MSL__ // dwa 2/28/99 - help MSL get its own headers and prevent it from including ours
# include __STL_NATIVE_HEADER(tree.h)
# ifndef __SGI_STL_TREE_H
# define __SGI_STL_TREE_H
# endif
# endif
# include __STL_NATIVE_HEADER(set)
# if defined ( __STL_RESUME_STD_FOR_SET )
# undef __STL_RESUME_STD_FOR_SET
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
#endif
#endif /* __SGI_STL_SET */
// Local Variables:
// mode:C++
// End:
+26
View File
@@ -0,0 +1,26 @@
/*
* 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 __SGI_STL_SLIST
#define __SGI_STL_SLIST
#ifndef __SGI_STL_INTERNAL_SLIST_H
# include <stl_slist.h>
#endif
#endif /* __SGI_STL_SLIST */
// Local Variables:
// mode:C++
// End:
@@ -0,0 +1,65 @@
/*
* 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 __STLPORT_SSTREAM
# define __STLPORT_SSTREAM
# ifndef __STL_CONFIG_H
# include <stl_config.h>
# endif
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_SSTREAM
# define __STLPORT_NATIVE_PASS
# endif
# include __STL_NATIVE_HEADER(sstream)
# if defined ( __STL_RESUME_STD_FOR_SSTREAM )
# undef __STL_RESUME_STD_FOR_SSTREAM
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
# ifdef __STL_USE_OWN_NAMESPACE
__STL_BEGIN_NAMESPACE
using __STL_VENDOR_STD::basic_stringbuf;
using __STL_VENDOR_STD::stringbuf;
using __STL_VENDOR_STD::basic_istringstream;
using __STL_VENDOR_STD::basic_ostringstream;
using __STL_VENDOR_STD::basic_stringstream;
using __STL_VENDOR_STD::istringstream;
using __STL_VENDOR_STD::ostringstream;
using __STL_VENDOR_STD::stringstream;
#ifndef __STL_NO_NATIVE_WIDE_STREAMS
using __STL_VENDOR_STD::wstringbuf;
using __STL_VENDOR_STD::wistringstream;
using __STL_VENDOR_STD::wostringstream;
using __STL_VENDOR_STD::wstringstream;
#endif
__STL_END_NAMESPACE
#endif /* __STL_OWN_NAMESPACE */
#endif /* __STLPORT_SSTREAM */
// Local Variables:
// mode:C++
// End:
+58
View File
@@ -0,0 +1,58 @@
/*
*
* 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 __SGI_STL_STACK
#define __SGI_STL_STACK
#ifndef __SGI_STL_INTERNAL_DEQUE_H
#include <stl_deque.h>
#endif
#ifndef __SGI_STL_INTERNAL_STACK_H
#include <stl_stack.h>
#endif
#if defined (__STL_WHOLE_NATIVE_STD)
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_STACK
# define __STLPORT_NATIVE_PASS
# endif
# include __STL_NATIVE_HEADER(stack)
# if defined ( __STL_RESUME_STD_FOR_STACK )
# undef __STL_RESUME_STD_FOR_STACK
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
#endif
#endif /* __SGI_STL_STACK */
// Local Variables:
// mode:C++
// End:
@@ -0,0 +1,57 @@
algorithm
bitset
cassert
cctype
cerrno
cfloat
climits
clocale
cmath
complex
config
csetjmp
csignal
cstd
cstdarg
cstddef
cstdio
cstdlib
cstring
ctime
cwchar
cwctype
deque
exception
fstream
functional
hash_map
hash_set
iomanip
ios
iosfwd
iostream
istream
iterator
limits
list
locale
map
memory
new
numeric
ostream
pthread_alloc
queue
rope
set
slist
sstream
stack
stdexcept
streambuf
string
strstream
typeinfo
utility
valarray
vector
@@ -0,0 +1,158 @@
/*
* 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 __SGI_STDEXCEPT
# ifndef __BORLANDC__
# define __SGI_STDEXCEPT 1
# endif
#ifndef __STL_CONFIG_H
#include <stl_config.h>
#endif
/* recursive */
# ifdef __SGI_STDEXCEPT_SEEN
# define __DONT_RESUME_STD_FOR_STDEXCEPT
# endif
# if !defined(__SGI_STDEXCEPT_SEEN) && \
(!defined (__STL_USE_NATIVE_STDEXCEPT) || defined (__STL_USE_OWN_NAMESPACE))
# ifdef __BORLANDC__
# define __SGI_STDEXCEPT_SEEN 1
# endif
#if !defined (__STLPORT_DEBUG_H) && (defined (__STL_DEBUG) || defined (__STL_ASSERTIONS))
# include <stldebug.h>
#endif
# include <exception>
#if defined(__STL_USE_EXCEPTIONS) || \
!(defined(_MIPS_SIM) && defined(_ABIO32) && _MIPS_SIM == _ABIO32)
#ifndef __STLPORT_CSTRING
# include <cstring>
#endif
#ifndef __SGI_STL_STRING_FWD_H
# include <stl_string_fwd.h>
#endif
__STL_BEGIN_NAMESPACE
class __Named_exception : public __STL_EXCEPTION_BASE {
public:
__Named_exception(const string& __str) {
strncpy(_M_name, __get_c_string(__str), _S_bufsize);
_M_name[_S_bufsize - 1] = '\0';
}
virtual const char* what() const __STL_NOTHROW { return _M_name; }
private:
enum { _S_bufsize = 256 };
char _M_name[_S_bufsize];
};
class logic_error : public __Named_exception {
public:
logic_error(const string& __s) : __Named_exception(__s) {}
};
class runtime_error : public __Named_exception {
public:
runtime_error(const string& __s) : __Named_exception(__s) {}
};
class domain_error : public logic_error {
public:
domain_error(const string& __arg) : logic_error(__arg) {}
};
class invalid_argument : public logic_error {
public:
invalid_argument(const string& __arg) : logic_error(__arg) {}
};
class length_error : public logic_error {
public:
length_error(const string& __arg) : logic_error(__arg) {}
};
class out_of_range : public logic_error {
public:
out_of_range(const string& __arg) : logic_error(__arg) {}
};
class range_error : public runtime_error {
public:
range_error(const string& __arg) : runtime_error(__arg) {}
};
class overflow_error : public runtime_error {
public:
overflow_error(const string& __arg) : runtime_error(__arg) {}
};
class underflow_error : public runtime_error {
public:
underflow_error(const string& __arg) : runtime_error(__arg) {}
};
__STL_END_NAMESPACE
#endif /* Not o32, and no exceptions */
#endif /* __STL_USE_NATIVE_STDEXCEPT */
#if defined (__STL_USE_NATIVE_STDEXCEPT)
# if defined ( __STL_REDEFINE_STD ) && defined (std)
# undef std
# define __STL_RESUME_STD_FOR_STDEXCEPT
# define __STLPORT_NATIVE_PASS
# endif
# include __STL_NATIVE_HEADER(stdexcept)
# if defined ( __STL_RESUME_STD_FOR_STDEXCEPT ) && ! defined (__DONT_RESUME_STD_FOR_STDEXCEPT)
# undef __STL_RESUME_STD_FOR_STDEXCEPT
# define std __STLPORT_NAMESPACE
# undef __STLPORT_NATIVE_PASS
# endif
# endif /* __STL_USE_NATIVE_STDEXCEPT */
# ifdef __BORLANDC__
# undef __SGI_STDEXCEPT_SEEN
# define __SGI_STDEXCEPT 1
# undef __DONT_RESUME_STD_FOR_STDEXCEPT
# else
// this inclusion is apparently needed for MSVC
# ifndef __SGI_STL_STRING
# include <string>
# endif
# endif
#endif /* __SGI_STDEXCEPT */
// Local Variables:
// mode:C++
// End:
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,91 @@
/*
*
* 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 __SGI_STL_ALGOBASE_C
#define __SGI_STL_ALGOBASE_C
__STL_BEGIN_NAMESPACE
template <class _InputIter1, class _InputIter2>
bool lexicographical_compare(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __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) {
for ( ; __first1 != __last1 && __first2 != __last2
; ++__first1, ++__first2) {
if (__comp(*__first1, *__first2))
return true;
if (__comp(*__first2, *__first1))
return false;
}
return __first1 == __last1 && __first2 != __last2;
}
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)
return -1;
if (*__first2 < *__first1)
return 1;
++__first1;
++__first2;
}
if (__first2 == __last2) {
return !(__first1 == __last1);
}
else {
return -1;
}
}
template <class _InputIter1, class _InputIter2>
int lexicographical_compare_3way(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2)
{
return __lexicographical_compare_3way(__first1, __last1, __first2, __last2);
}
__STL_END_NAMESPACE
#endif /* __SGI_STL_ALGOBASE_C */
// Local Variables:
// mode:C++
// End:
@@ -0,0 +1,645 @@
/*
*
* 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 __SGI_STL_INTERNAL_ALGOBASE_H
#define __SGI_STL_INTERNAL_ALGOBASE_H
#ifndef __STL_CONFIG_H
#include <stl_config.h>
#endif
# if ! defined (__STLPORT_CSTDDEF)
# include <cstddef>
# endif
#if !defined (__STLPORT_DEBUG_H) && (defined (__STL_DEBUG) || defined (__STL_ASSERTIONS))
# include <stldebug.h>
#endif
#ifndef __STLPORT_CSTRING
# include <cstring>
#endif
#ifndef __STLPORT_CLIMITS
# include <climits>
#endif
# if ! defined (__STLPORT_CSTDLIB)
# include <cstdlib>
# endif
# ifndef __SGI_STL_INTERNAL_RELOPS
# include <stl_relops.h>
# endif
# ifndef __TYPE_TRAITS_H
# include <type_traits.h>
# endif
# ifndef __SGI_STL_INTERNAL_PAIR_H
# include <stl_pair.h>
# endif
#ifndef __SGI_STL_INTERNAL_ITERATOR_BASE_H
# include <stl_iterator_base.h>
#endif
__STL_BEGIN_NAMESPACE
// swap and iter_swap
template <class _Tp>
inline void swap(_Tp& __a, _Tp& __b) {
_Tp __tmp = __a;
__a = __b;
__b = __tmp;
}
# if defined (__STL_CLASS_PARTIAL_SPECIALIZATION)
template <class _ForwardIter1, class _ForwardIter2>
inline void iter_swap(_ForwardIter1 __a, _ForwardIter2 __b) {
typedef typename iterator_traits<_ForwardIter1>::value_type value_type;
swap((value_type&)*__a, (value_type&)*__b);
}
# else
template <class _ForwardIter1, class _ForwardIter2, class _Tp>
inline void __iter_swap(_ForwardIter1 __a, _ForwardIter2 __b, _Tp*) {
swap((_Tp&)*__a, (_Tp&)*__b);
}
template <class _ForwardIter1, class _ForwardIter2>
inline void iter_swap(_ForwardIter1 __a, _ForwardIter2 __b) {
__iter_swap(__a, __b, __VALUE_TYPE(__a));
}
# endif
//--------------------------------------------------
// min and max
#undef min
#undef max
# if defined (__BORLANDC__) && (__BORLANDC__ < 0x530)
# ifdef __STL_USE_NAMESPACES
using ::min;
using ::max;
# endif
# endif
# if !defined (__BORLANDC__) || defined (__STL_USE_OWN_NAMESPACE)
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 /* __BORLANDC__ */
# if defined (__BORLANDC__) && ( __BORLANDC__ < 0x530 || defined (__STL_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.
template <class _InputIter, class _OutputIter, class _Distance>
inline _OutputIter __copy(_InputIter __first, _InputIter __last,
_OutputIter __result,
input_iterator_tag, _Distance*)
{
for ( ; __first != __last; ++__result, ++__first)
*__result = *__first;
return __result;
}
# if defined (__STL_NONTEMPL_BASE_MATCH_BUG)
template <class _InputIter, class _OutputIter, class _Distance>
inline _OutputIter __copy(_InputIter __first, _InputIter __last,
_OutputIter __result, forward_iterator_tag, _Distance* __dis)
{
return __copy(__first, __last, __result, input_iterator_tag(),
__dis);
}
template <class _InputIter, class _OutputIter, class _Distance>
inline _OutputIter __copy(_InputIter __first, _InputIter __last,
_OutputIter __result, bidirectional_iterator_tag, _Distance* __dis)
{
return __copy(__first, __last, __result, input_iterator_tag(),
__dis);
}
# endif
template <class _RandomAccessIter, class _OutputIter, class _Distance>
inline _OutputIter
__copy(_RandomAccessIter __first, _RandomAccessIter __last,
_OutputIter __result, random_access_iterator_tag, _Distance*)
{
for (_Distance __n = __last - __first; __n > 0; --__n) {
*__result = *__first;
++__first;
++__result;
}
return __result;
}
template <class _Tp>
inline _Tp*
__copy_trivial(const _Tp* __first, const _Tp* __last, _Tp* __result) {
memmove((void*)__result, (const void*)__first, sizeof(_Tp) * (__last - __first));
return __result + (__last - __first);
}
#if defined(__STL_FUNCTION_TMPL_PARTIAL_ORDER)
template <class _InputIter, class _OutputIter>
inline _OutputIter __copy_aux2(_InputIter __first, _InputIter __last,
_OutputIter __result, __false_type) {
return __copy(__first, __last, __result,
__ITERATOR_CATEGORY(__first),
__DISTANCE_TYPE(__first));
}
template <class _InputIter, class _OutputIter>
inline _OutputIter __copy_aux2(_InputIter __first, _InputIter __last,
_OutputIter __result, __true_type) {
return __copy(__first, __last, __result,
__ITERATOR_CATEGORY(__first),
__DISTANCE_TYPE(__first));
}
# ifndef __APOGEE__
template <class _Tp>
inline _Tp* __copy_aux2(_Tp* __first, _Tp* __last, _Tp* __result,
__true_type) {
return __copy_trivial(__first, __last, __result);
}
# endif
template <class _Tp>
inline _Tp* __copy_aux2(const _Tp* __first, const _Tp* __last, _Tp* __result,
__true_type) {
return __copy_trivial(__first, __last, __result);
}
template <class _InputIter, class _OutputIter, class _Tp>
inline _OutputIter __copy_aux(_InputIter __first, _InputIter __last,
_OutputIter __result, _Tp*) {
typedef typename __type_traits<_Tp>::has_trivial_assignment_operator
_Trivial;
return __copy_aux2(__first, __last, __result, _Trivial());
}
template <class _InputIter, class _OutputIter>
inline _OutputIter copy(_InputIter __first, _InputIter __last,
_OutputIter __result) {
return __copy_aux(__first, __last, __result, __VALUE_TYPE(__first));
}
// Hack for compilers that don't have partial ordering of function templates
// but do have partial specialization of class templates.
#elif defined __STL_CLASS_PARTIAL_SPECIALIZATION
template <class _InputIter, class _OutputIter, class _BoolType>
struct __copy_dispatch {
static _OutputIter copy(_InputIter __first, _InputIter __last,
_OutputIter __result) {
typedef typename iterator_traits<_InputIter>::iterator_category _Category;
typedef typename iterator_traits<_InputIter>::difference_type _Distance;
return __copy(__first, __last, __result, _Category(), (_Distance*) 0);
}
};
template <class _Tp>
struct __copy_dispatch<_Tp*, _Tp*, __true_type>
{
static _Tp* copy(const _Tp* __first, const _Tp* __last, _Tp* __result) {
# ifdef __STL_EXPLICIT_FUNCTION_TMPL_ARGS
// dwa 11/19/98 -- CW bug workaround
return __copy_trivial<_Tp>(__first, __last, __result);
# else
return __copy_trivial(__first, __last, __result);
# endif
}
};
template <class _Tp>
struct __copy_dispatch<const _Tp*, _Tp*, __true_type>
{
static _Tp* copy(const _Tp* __first, const _Tp* __last, _Tp* __result) {
return __copy_trivial(__first, __last, __result);
}
};
template <class _InputIter, class _OutputIter>
inline _OutputIter copy(_InputIter __first, _InputIter __last,
_OutputIter __result) {
typedef typename iterator_traits<_InputIter>::value_type _Tp;
typedef typename __type_traits<_Tp>::has_trivial_assignment_operator
_Trivial;
return __copy_dispatch<_InputIter, _OutputIter, _Trivial>
::copy(__first, __last, __result);
}
#else /* __STL_CLASS_PARTIAL_SPECIALIZATION */
template <class _InputIter, class _OutputIter>
inline _OutputIter copy(_InputIter __first, _InputIter __last,
_OutputIter __result)
{
return __copy(__first, __last, __result,
__ITERATOR_CATEGORY(__first),
__DISTANCE_TYPE(__first));
}
#define __SGI_STL_DECLARE_COPY_TRIVIAL(_Tp) \
inline _Tp* copy(const _Tp* __first, const _Tp* __last, _Tp* __result) { \
return (_Tp*)__copy_trivial(__first, __last, __result); \
}
__SGI_STL_DECLARE_COPY_TRIVIAL(char)
# ifndef __STL_NO_SIGNED_BUILTINS
__SGI_STL_DECLARE_COPY_TRIVIAL(signed char)
# endif
__SGI_STL_DECLARE_COPY_TRIVIAL(unsigned char)
__SGI_STL_DECLARE_COPY_TRIVIAL(short)
__SGI_STL_DECLARE_COPY_TRIVIAL(unsigned short)
__SGI_STL_DECLARE_COPY_TRIVIAL(int)
__SGI_STL_DECLARE_COPY_TRIVIAL(unsigned int)
__SGI_STL_DECLARE_COPY_TRIVIAL(long)
__SGI_STL_DECLARE_COPY_TRIVIAL(unsigned long)
#if !defined(__STL_NO_WCHAR_T) && !defined (__STL_WCHAR_T_IS_USHORT)
__SGI_STL_DECLARE_COPY_TRIVIAL(wchar_t)
#endif
#ifdef _STL_LONG_LONG
__SGI_STL_DECLARE_COPY_TRIVIAL(long long)
__SGI_STL_DECLARE_COPY_TRIVIAL(unsigned long long)
#endif
__SGI_STL_DECLARE_COPY_TRIVIAL(float)
__SGI_STL_DECLARE_COPY_TRIVIAL(double)
# ifndef __STL_NO_LONG_DOUBLE
__SGI_STL_DECLARE_COPY_TRIVIAL(long double)
# endif
#undef __SGI_STL_DECLARE_COPY_TRIVIAL
#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
//--------------------------------------------------
// copy_backward
template <class _BidirectionalIter1, class _BidirectionalIter2,
class _Distance>
inline _BidirectionalIter2 __copy_backward(_BidirectionalIter1 __first,
_BidirectionalIter1 __last,
_BidirectionalIter2 __result,
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,
random_access_iterator_tag,
_Distance*)
{
for (_Distance __n = __last - __first; __n > 0; --__n)
*--__result = *--__last;
return __result;
}
#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
// This dispatch class is a workaround for compilers that do not
// have partial ordering of function templates. All we're doing is
// creating a specialization so that we can turn a call to copy_backward
// into a memmove whenever possible.
template <class _BidirectionalIter1, class _BidirectionalIter2,
class _BoolType>
struct __copy_backward_dispatch
{
typedef typename iterator_traits<_BidirectionalIter1>::iterator_category
_Cat;
typedef typename iterator_traits<_BidirectionalIter1>::difference_type
_Distance;
static _BidirectionalIter2 copy(_BidirectionalIter1 __first,
_BidirectionalIter1 __last,
_BidirectionalIter2 __result) {
return __copy_backward(__first, __last, __result, _Cat(), (_Distance*) 0);
}
};
template <class _Tp>
struct __copy_backward_dispatch<_Tp*, _Tp*, __true_type>
{
static _Tp* copy(const _Tp* __first, const _Tp* __last, _Tp* __result) {
const ptrdiff_t _Num = __last - __first;
memmove(__result - _Num, __first, sizeof(_Tp) * _Num);
return __result - _Num;
}
};
template <class _Tp>
struct __copy_backward_dispatch<const _Tp*, _Tp*, __true_type>
{
static _Tp* copy(const _Tp* __first, const _Tp* __last, _Tp* __result) {
return __copy_backward_dispatch<_Tp*, _Tp*, __true_type>
::copy(__first, __last, __result);
}
};
template <class _BI1, class _BI2>
inline _BI2 copy_backward(_BI1 __first, _BI1 __last, _BI2 __result) {
typedef typename __type_traits<typename iterator_traits<_BI2>::value_type>
::has_trivial_assignment_operator
_Trivial;
return __copy_backward_dispatch<_BI1, _BI2, _Trivial>
::copy(__first, __last, __result);
}
#else /* __STL_CLASS_PARTIAL_SPECIALIZATION */
template <class _BI1, class _BI2>
inline _BI2 copy_backward(_BI1 __first, _BI1 __last, _BI2 __result) {
return __copy_backward(__first, __last, __result,
__ITERATOR_CATEGORY(__first),
__DISTANCE_TYPE(__first));
}
#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
//--------------------------------------------------
// copy_n (not part of the C++ standard)
template <class _InputIter, class _Size, class _OutputIter>
__STL_INLINE_LOOP
pair<_InputIter, _OutputIter> __copy_n(_InputIter __first, _Size __count,
_OutputIter __result,
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,
random_access_iterator_tag) {
_RAIter __last = __first + __count;
return pair<_RAIter, _OutputIter>(__last, copy(__first, __last, __result));
}
template <class _InputIter, class _Size, class _OutputIter>
inline pair<_InputIter, _OutputIter>
__copy_n(_InputIter __first, _Size __count, _OutputIter __result) {
return __copy_n(__first, __count, __result,
__ITERATOR_CATEGORY(__first));
}
template <class _InputIter, class _Size, class _OutputIter>
inline pair<_InputIter, _OutputIter>
copy_n(_InputIter __first, _Size __count, _OutputIter __result) {
__STL_FIX_LITERAL_BUG(__first)
return __copy_n(__first, __count, __result);
}
//--------------------------------------------------
// fill and fill_n
template <class _ForwardIter, class _Tp>
__STL_INLINE_LOOP
void fill(_ForwardIter __first, _ForwardIter __last, const _Tp& __value) {
for ( ; __first != __last; ++__first)
*__first = __value;
}
template <class _OutputIter, class _Size, class _Tp>
__STL_INLINE_LOOP
_OutputIter fill_n(_OutputIter __first, _Size __n, const _Tp& __value) {
__STL_FIX_LITERAL_BUG(__first)
for ( ; __n > 0; --__n, ++__first)
*__first = __value;
return __first;
}
//--------------------------------------------------
// equal and mismatch
template <class _InputIter1, class _InputIter2>
__STL_INLINE_LOOP
pair<_InputIter1, _InputIter2> mismatch(_InputIter1 __first1,
_InputIter1 __last1,
_InputIter2 __first2) {
__STL_FIX_LITERAL_BUG(__first2)
while (__first1 != __last1 && *__first1 == *__first2) {
++__first1;
++__first2;
}
return pair<_InputIter1, _InputIter2>(__first1, __first2);
}
template <class _InputIter1, class _InputIter2, class _BinaryPredicate>
__STL_INLINE_LOOP
pair<_InputIter1, _InputIter2> mismatch(_InputIter1 __first1,
_InputIter1 __last1,
_InputIter2 __first2,
_BinaryPredicate __binary_pred) {
__STL_FIX_LITERAL_BUG(__first2)
while (__first1 != __last1 && __binary_pred(*__first1, *__first2)) {
++__first1;
++__first2;
}
return pair<_InputIter1, _InputIter2>(__first1, __first2);
}
template <class _InputIter1, class _InputIter2>
__STL_INLINE_LOOP
bool equal(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2) {
__STL_FIX_LITERAL_BUG(__first1) __STL_FIX_LITERAL_BUG(__last1) __STL_FIX_LITERAL_BUG(__first2)
for ( ; __first1 != __last1; ++__first1, ++__first2)
if (!(*__first1 == *__first2))
return false;
return true;
}
template <class _InputIter1, class _InputIter2, class _BinaryPredicate>
__STL_INLINE_LOOP
bool equal(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _BinaryPredicate __binary_pred) {
__STL_FIX_LITERAL_BUG(__first2)
for ( ; __first1 != __last1; ++__first1, ++__first2)
if (!__binary_pred(*__first1, *__first2))
return false;
return true;
}
//--------------------------------------------------
// lexicographical_compare and lexicographical_compare_3way.
// (the latter is not part of the C++ standard.)
template <class _InputIter1, class _InputIter2>
bool lexicographical_compare(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2);
template <class _InputIter1, class _InputIter2, class _Compare>
bool lexicographical_compare(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2,
_Compare __comp);
inline bool
lexicographical_compare(const unsigned char* __first1,
const unsigned char* __last1,
const unsigned char* __first2,
const unsigned char* __last2)
{
const size_t __len1 = __last1 - __first1;
const size_t __len2 = __last2 - __first2;
const int __result = memcmp(__first1, __first2, min(__len1, __len2));
return __result != 0 ? (__result < 0) : (__len1 < __len2);
}
inline bool lexicographical_compare(const char* __first1, const char* __last1,
const char* __first2, const char* __last2)
{
#if CHAR_MAX == SCHAR_MAX
return lexicographical_compare((const signed char*) __first1,
(const signed char*) __last1,
(const signed char*) __first2,
(const signed char*) __last2);
#else /* CHAR_MAX == SCHAR_MAX */
return lexicographical_compare((const unsigned char*) __first1,
(const unsigned char*) __last1,
(const unsigned char*) __first2,
(const unsigned char*) __last2);
#endif /* CHAR_MAX == SCHAR_MAX */
}
template <class _InputIter1, class _InputIter2>
int __lexicographical_compare_3way(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2);
inline int
__lexicographical_compare_3way(const unsigned char* __first1,
const unsigned char* __last1,
const unsigned char* __first2,
const unsigned char* __last2)
{
const ptrdiff_t __len1 = __last1 - __first1;
const ptrdiff_t __len2 = __last2 - __first2;
const int __result = memcmp(__first1, __first2, min(__len1, __len2));
return __result != 0 ? __result
: (__len1 == __len2 ? 0 : (__len1 < __len2 ? -1 : 1));
}
inline int
__lexicographical_compare_3way(const char* __first1, const char* __last1,
const char* __first2, const char* __last2)
{
#if CHAR_MAX == SCHAR_MAX
return __lexicographical_compare_3way(
(const signed char*) __first1,
(const signed char*) __last1,
(const signed char*) __first2,
(const signed char*) __last2);
#else
return __lexicographical_compare_3way((const unsigned char*) __first1,
(const unsigned char*) __last1,
(const unsigned char*) __first2,
(const unsigned char*) __last2);
#endif
}
template <class _InputIter1, class _InputIter2>
int lexicographical_compare_3way(_InputIter1 __first1, _InputIter1 __last1,
_InputIter2 __first2, _InputIter2 __last2);
__STL_END_NAMESPACE
# if !defined (__STL_LINK_TIME_INSTANTIATION)
# include <stl_algobase.c>
# endif
#endif /* __SGI_STL_INTERNAL_ALGOBASE_H */
// Local Variables:
// mode:C++
// End:
@@ -0,0 +1,326 @@
/*
*
* 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 __STL_ALLOC_C
#define __STL_ALLOC_C
// Specialised debug form of malloc which does not provide "false"
// memory leaks when run with debug CRT libraries.
#if defined(__STL_MSVC) && __STL_MSVC>=1020 && defined(_DEBUG)
# include <crtdbg.h>
# define __STL_CHUNK_MALLOC(s) _malloc_dbg(s, _CRT_BLOCK, __FILE__, __LINE__)
#else // !_DEBUG
# ifdef __STL_NODE_ALLOC_USE_MALLOC
# define __STL_CHUNK_MALLOC(s) ::malloc(s)
# else
# define __STL_CHUNK_MALLOC(s) __stl_new(s)
# endif
#endif // !_DEBUG
__STL_BEGIN_NAMESPACE
template <int __inst>
void * __malloc_alloc<__inst>::_S_oom_malloc(size_t __n)
{
__oom_handler_type __my_malloc_handler;
void * __result;
for (;;) {
__my_malloc_handler = __oom_handler;
if (0 == __my_malloc_handler) { __THROW_BAD_ALLOC; }
(*__my_malloc_handler)();
__result = malloc(__n);
if (__result) return(__result);
}
#if defined(__STL_NEED_UNREACHABLE_RETURN)
return 0;
#endif
}
template <int __inst>
void* __malloc_alloc<__inst>::_S_oom_realloc(void* __p, size_t __n)
{
__oom_handler_type __my_malloc_handler;
void* __result;
for (;;) {
__my_malloc_handler = __oom_handler;
if (0 == __my_malloc_handler) { __THROW_BAD_ALLOC; }
(*__my_malloc_handler)();
__result = realloc(__p, __n);
if (__result) return(__result);
}
#if defined(__STL_NEED_UNREACHABLE_RETURN)
return 0;
#endif
}
# ifdef __STL_DEBUG_ALLOC
template <class _Alloc>
void * __debug_alloc<_Alloc>::allocate(size_t __n) {
size_t __real_n = __n + __extra_before_chunk() + __extra_after_chunk();
__alloc_header *__result = (__alloc_header *)__allocator_type::allocate(__real_n);
memset((char*)__result, __shred_byte, __real_n*sizeof(value_type));
__result->__magic = __magic;
__result->__type_size = sizeof(value_type);
__result->_M_size = __n;
return ((char*)__result) + (long)__extra_before;
}
template <class _Alloc>
void __debug_alloc<_Alloc>::deallocate(void *__p, size_t __n) {
__alloc_header * __real_p = (__alloc_header*)((char *)__p -(long)__extra_before);
// check integrity
__stl_verbose_assert(__real_p->__magic != __deleted_magic, _StlMsg_DBA_DELETED_TWICE);
__stl_verbose_assert(__real_p->__magic == __magic, _StlMsg_DBA_NEVER_ALLOCATED);
__stl_verbose_assert(__real_p->__type_size == 1,
_StlMsg_DBA_TYPE_MISMATCH);
__stl_verbose_assert(__real_p->_M_size == __n, _StlMsg_DBA_SIZE_MISMATCH);
// check pads on both sides
unsigned char* __tmp;
for (__tmp= (unsigned char*)(__real_p+1); __tmp < (unsigned char*)__p; __tmp++)
__stl_verbose_assert(*__tmp==__shred_byte, _StlMsg_DBA_UNDERRUN);
size_t __real_n= __n + __extra_before_chunk() + __extra_after_chunk();
for (__tmp= ((unsigned char*)__p)+__n*sizeof(value_type);
__tmp < ((unsigned char*)__real_p)+__real_n ; __tmp++)
__stl_verbose_assert(*__tmp==__shred_byte, _StlMsg_DBA_OVERRUN);
// that may be unfortunate, just in case
__real_p->__magic=__deleted_magic;
memset((char*)__p, __shred_byte, __n*sizeof(value_type));
__allocator_type::deallocate(__real_p, __real_n);
}
# if 0
template <class _Alloc>
void *
__debug_alloc<_Alloc>::reallocate(void *__p, size_t __old_sz, size_t __new_sz) {
__alloc_header * __real_p = (__alloc_header*)((char *)__p - (long)__extra_before);
size_t __extra = __extra_before_chunk() + __extra_after_chunk();
__stl_verbose_assert(__real_p->__magic != __deleted_magic, _StlMsg_DBA_DELETED_TWICE);
__stl_verbose_assert(__real_p->__magic == __magic, _StlMsg_DBA_NEVER_ALLOCATED);
__stl_verbose_assert(__real_p->__type_size == sizeof(value_type),
_StlMsg_DBA_TYPE_MISMATCH);
__stl_verbose_assert(__real_p->_M_size == __old_sz, _StlMsg_DBA_SIZE_MISMATCH);
__real_p = (__alloc_header*)__allocator_type::reallocate(__real_p, __old_sz + __extra,
__new_sz + __extra);
__real_p->_M_size = __new_sz;
return ((char*)__real_p) + (long)__extra_before;
}
# endif
#endif
/* We allocate memory in large chunks in order to avoid fragmenting */
/* the malloc heap too much. */
/* We assume that size is properly aligned. */
/* We hold the allocation lock. */
template <bool __threads, int __inst>
char*
__node_alloc<__threads, __inst>::_S_chunk_alloc(size_t _p_size,
int& __nobjs)
{
char* __result;
size_t __total_bytes = _p_size * __nobjs;
size_t __bytes_left = _S_end_free - _S_start_free;
if (__bytes_left >= __total_bytes) {
__result = _S_start_free;
_S_start_free += __total_bytes;
return(__result);
} else if (__bytes_left >= _p_size) {
__nobjs = (int)(__bytes_left/_p_size);
__total_bytes = _p_size * __nobjs;
__result = _S_start_free;
_S_start_free += __total_bytes;
return(__result);
} else {
size_t __bytes_to_get =
2 * __total_bytes + _S_round_up(_S_heap_size >> 4);
// Try to make use of the left-over piece.
if (__bytes_left > 0) {
_Obj* __STL_VOLATILE* __my_free_list =
_S_free_list + _S_freelist_index(__bytes_left);
((_Obj*)_S_start_free) -> _M_free_list_link = *__my_free_list;
*__my_free_list = (_Obj*)_S_start_free;
}
_S_start_free = (char*)__STL_CHUNK_MALLOC(__bytes_to_get);
if (0 == _S_start_free) {
size_t __i;
_Obj* __STL_VOLATILE* __my_free_list;
_Obj* __p;
// Try to make do with what we have. That can't
// hurt. We do not try smaller requests, since that tends
// to result in disaster on multi-process machines.
for (__i = _p_size; __i <= (size_t)_MAX_BYTES; __i += (size_t)_ALIGN) {
__my_free_list = _S_free_list + _S_freelist_index(__i);
__p = *__my_free_list;
if (0 != __p) {
*__my_free_list = __p -> _M_free_list_link;
_S_start_free = (char*)__p;
_S_end_free = _S_start_free + __i;
return(_S_chunk_alloc(_p_size, __nobjs));
// Any leftover piece will eventually make it to the
// right free list.
}
}
_S_end_free = 0; // In case of exception.
_S_start_free = (char*)__STL_CHUNK_MALLOC(__bytes_to_get);
/*
(char*)malloc_alloc::allocate(__bytes_to_get);
*/
// This should either throw an
// exception or remedy the situation. Thus we assume it
// succeeded.
}
_S_heap_size += __bytes_to_get;
_S_end_free = _S_start_free + __bytes_to_get;
return(_S_chunk_alloc(_p_size, __nobjs));
}
}
/* Returns an object of size __n, and optionally adds to size __n free list.*/
/* We assume that __n is properly aligned. */
/* We hold the allocation lock. */
template <bool __threads, int __inst>
void*
__node_alloc<__threads, __inst>::_S_refill(size_t __n)
{
int __nobjs = 20;
__n = _S_round_up(__n);
char* __chunk = _S_chunk_alloc(__n, __nobjs);
_Obj* __STL_VOLATILE* __my_free_list;
_Obj* __result;
_Obj* __current_obj;
_Obj* __next_obj;
int __i;
if (1 == __nobjs) return(__chunk);
__my_free_list = _S_free_list + _S_freelist_index(__n);
/* Build free list in chunk */
__result = (_Obj*)__chunk;
*__my_free_list = __next_obj = (_Obj*)(__chunk + __n);
for (__i = 1; ; __i++) {
__current_obj = __next_obj;
__next_obj = (_Obj*)((char*)__next_obj + __n);
if (__nobjs - 1 == __i) {
__current_obj -> _M_free_list_link = 0;
break;
} else {
__current_obj -> _M_free_list_link = __next_obj;
}
}
return(__result);
}
# if 0
template <bool threads, int inst>
void*
__node_alloc<threads, inst>::reallocate(void* __p,
size_t __old_sz,
size_t __new_sz)
{
void* __result;
size_t __copy_sz;
if (__old_sz > (size_t) _MAX_BYTES && __new_sz > (size_t) _MAX_BYTES) {
return(realloc(__p, __new_sz));
}
if (_S_round_up(__old_sz) == _S_round_up(__new_sz)) return(__p);
__result = allocate(__new_sz);
__copy_sz = __new_sz > __old_sz? __old_sz : __new_sz;
memcpy(__result, __p, __copy_sz);
deallocate(__p, __old_sz);
return(__result);
}
# endif
# if ( __STL_STATIC_TEMPLATE_DATA > 0 )
// malloc_alloc out-of-memory handling
template <int __inst>
__oom_handler_type __malloc_alloc<__inst>::__oom_handler=(__oom_handler_type)0 ;
#ifdef __STL_THREADS
template <bool __threads, int __inst>
_STL_mutex_base
_Node_Alloc_Lock<__threads, __inst>::_S_lock __STL_MUTEX_INITIALIZER;
#endif
template <bool __threads, int __inst>
_Node_alloc_obj * __STL_VOLATILE
__node_alloc<__threads, __inst>::_S_free_list[_NFREELISTS]
= {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
// The 16 zeros are necessary to make version 4.1 of the SunPro
// compiler happy. Otherwise it appears to allocate too little
// space for the array.
template <bool __threads, int __inst>
char *__node_alloc<__threads, __inst>::_S_start_free = 0;
template <bool __threads, int __inst>
char *__node_alloc<__threads, __inst>::_S_end_free = 0;
template <bool __threads, int __inst>
size_t __node_alloc<__threads, __inst>::_S_heap_size = 0;
# else /* ( __STL_STATIC_TEMPLATE_DATA > 0 ) */
__DECLARE_INSTANCE(__oom_handler_type, __malloc_alloc<0>::__oom_handler, =0);
__DECLARE_INSTANCE(char *, __single_client_alloc::_S_start_free,=0);
__DECLARE_INSTANCE(char *, __single_client_alloc::_S_end_free,=0);
__DECLARE_INSTANCE(size_t, __single_client_alloc::_S_heap_size,=0);
__DECLARE_INSTANCE(_Node_alloc_obj * __STL_VOLATILE,
__single_client_alloc::_S_free_list[_NFREELISTS],
={0});
__DECLARE_INSTANCE(char *, __multithreaded_alloc::_S_start_free,=0);
__DECLARE_INSTANCE(char *, __multithreaded_alloc::_S_end_free,=0);
__DECLARE_INSTANCE(size_t, __multithreaded_alloc::_S_heap_size,=0);
__DECLARE_INSTANCE(_Node_alloc_obj * __STL_VOLATILE,
__multithreaded_alloc::_S_free_list[_NFREELISTS],
={0});
# ifdef __STL_THREADS
__DECLARE_INSTANCE(_STL_mutex_base,
__single_client_alloc::_S_node_allocator_lock,
__STL_MUTEX_INITIALIZER);
__DECLARE_INSTANCE(_STL_mutex_base,
__multithreaded_alloc::_S_node_allocator_lock,
__STL_MUTEX_INITIALIZER);
# endif
# endif /* __STL_STATIC_TEMPLATE_DATA */
__STL_END_NAMESPACE
#endif /* __STL_ALLOC_C */
// Local Variables:
// mode:C++
// End:
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,513 @@
/*
* 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 __STL_BITSET_C
# define __STL_BITSET_C
#define __BITS_PER_WORDT(__wt) (CHAR_BIT*sizeof(__wt))
#define __BITSET_WORDS(__n,__wt) \
((__n) < 1 ? 1 : ((__n) + __BITS_PER_WORDT(__wt) - 1)/__BITS_PER_WORDT(__wt))
# if ! defined (__STL_DEFAULT_TYPE_PARAM)
# define bitset __bitset
# endif
#if defined(__IBMCPP__)
// supress EDC3130: A constant is being used as a conditional expression
#pragma info(nocnd)
#endif
__STL_BEGIN_NAMESPACE
//
// Definitions of non-inline functions from _Base_bitset.
//
template<size_t _Nw, class _WordT>
_Base_bitset<_Nw, _WordT>::_Base_bitset(unsigned long __val)
{
_M_do_reset();
const size_t __n = min(sizeof(unsigned long)*CHAR_BIT,
__BITS_PER_WORDT(_WordT)*_Nw);
for(size_t __i = 0; __i < __n; ++__i, __val >>= 1)
if ( __val & 0x1 )
_M_getword(__i) |= _S_maskbit(__i);
}
template<size_t _Nw, class _WordT>
void _Base_bitset<_Nw, _WordT>::_M_do_left_shift(size_t __shift)
{
if (__shift != 0) {
const size_t __wshift = __shift / __BITS_PER_WORDT(_WordT);
const size_t __offset = __shift % __BITS_PER_WORDT(_WordT);
const size_t __sub_offset = __BITS_PER_WORDT(_WordT) - __offset;
size_t __n = _Nw - 1;
for ( ; __n > __wshift; --__n)
_M_w[__n] = (_M_w[__n - __wshift] << __offset) |
(_M_w[__n - __wshift - 1] >> __sub_offset);
if (__n == __wshift)
_M_w[__n] = _M_w[0] << __offset;
for (size_t __n1 = 0; __n1 < __n; ++__n1)
_M_w[__n1] = __STATIC_CAST(_WordT,0);
}
}
template<size_t _Nw, class _WordT>
void _Base_bitset<_Nw, _WordT>::_M_do_right_shift(size_t __shift)
{
if (__shift != 0) {
const size_t __wshift = __shift / __BITS_PER_WORDT(_WordT);
const size_t __offset = __shift % __BITS_PER_WORDT(_WordT);
const size_t __sub_offset = __BITS_PER_WORDT(_WordT) - __offset;
const size_t __limit = _Nw - __wshift - 1;
size_t __n = 0;
for ( ; __n < __limit; ++__n)
_M_w[__n] = (_M_w[__n + __wshift] >> __offset) |
(_M_w[__n + __wshift + 1] << __sub_offset);
_M_w[__limit] = _M_w[_Nw-1] >> __offset;
for (size_t __n1 = __limit + 1; __n1 < _Nw; ++__n1)
_M_w[__n1] = __STATIC_CAST(_WordT,0);
}
}
template<size_t _Nw, class _WordT>
unsigned long _Base_bitset<_Nw, _WordT>::_M_do_to_ulong() const
{
if (sizeof(_WordT) >= sizeof(unsigned long)) {
for (size_t __i = 1; __i < _Nw; ++__i)
if (_M_w[__i])
__STL_THROW(overflow_error("bitset"));
const _WordT __mask = __STATIC_CAST(_WordT,__STATIC_CAST(unsigned long,-1));
if (_M_w[0] & ~__mask)
__STL_THROW(overflow_error("bitset"));
return __STATIC_CAST(unsigned long,_M_w[0] & __mask);
}
else { // sizeof(_WordT) < sizeof(unsigned long).
const size_t __nwords =
(sizeof(unsigned long) + sizeof(_WordT) - 1) / sizeof(_WordT);
size_t __min_nwords = __nwords;
if (_Nw > __nwords) {
for (size_t __i = __nwords; __i < _Nw; ++__i)
if (_M_w[__i])
__STL_THROW(overflow_error("bitset"));
}
else
__min_nwords = _Nw;
// If unsigned long is 8 bytes and _WordT is 6 bytes, then an unsigned
// long consists of all of one word plus 2 bytes from another word.
const size_t __part = sizeof(unsigned long) % sizeof(_WordT);
if (__part != 0 && __nwords <= _Nw &&
(_M_w[__min_nwords - 1] >> ((sizeof(_WordT) - __part) * CHAR_BIT)) != 0)
__STL_THROW(overflow_error("bitset"));
unsigned long __result = 0;
for (size_t __i = 0; __i < __min_nwords; ++__i) {
__result |= __STATIC_CAST(const unsigned long,
_M_w[__i]) << (__i * sizeof(_WordT) * CHAR_BIT);
}
return __result;
}
} // End _M_do_to_ulong
template<size_t _Nw, class _WordT>
size_t _Base_bitset<_Nw, _WordT>::_M_do_find_first(size_t __not_found) const
{
for ( size_t __i = 0; __i < _Nw; __i++ ) {
_WordT __thisword = _M_w[__i];
if ( __thisword != __STATIC_CAST(_WordT,0) ) {
// find byte within word
for ( size_t __j = 0; __j < sizeof(_WordT); __j++ ) {
unsigned char __this_byte
= __STATIC_CAST(unsigned char,(__thisword & (~(unsigned char)0)));
if ( __this_byte )
return __i*__BITS_PER_WORDT(_WordT) + __j*CHAR_BIT +
_First_one<true>::_S_first_one[__this_byte];
__thisword >>= CHAR_BIT;
}
}
}
// not found, so return an indication of failure.
return __not_found;
}
template<size_t _Nw, class _WordT>
size_t
_Base_bitset<_Nw, _WordT>::_M_do_find_next(size_t __prev,
size_t __not_found) const
{
// make bound inclusive
++__prev;
// check out of bounds
if ( __prev >= _Nw * __BITS_PER_WORDT(_WordT) )
return __not_found;
// search first word
size_t __i = _S_whichword(__prev);
_WordT __thisword = _M_w[__i];
// mask off bits below bound
__thisword &= (~__STATIC_CAST(_WordT,0)) << _S_whichbit(__prev);
if ( __thisword != __STATIC_CAST(_WordT,0) ) {
// find byte within word
// get first byte into place
__thisword >>= _S_whichbyte(__prev) * CHAR_BIT;
for ( size_t __j = _S_whichbyte(__prev); __j < sizeof(_WordT); __j++ ) {
unsigned char __this_byte
= __STATIC_CAST(unsigned char,(__thisword & (~(unsigned char)0)));
if ( __this_byte )
return __i*__BITS_PER_WORDT(_WordT) + __j*CHAR_BIT +
_First_one<true>::_S_first_one[__this_byte];
__thisword >>= CHAR_BIT;
}
}
// check subsequent words
__i++;
for ( ; __i < _Nw; __i++ ) {
_WordT __thisword = _M_w[__i];
if ( __thisword != __STATIC_CAST(_WordT,0) ) {
// find byte within word
for ( size_t __j = 0; __j < sizeof(_WordT); __j++ ) {
unsigned char __this_byte
= __STATIC_CAST(unsigned char,(__thisword & (~(unsigned char)0)));
if ( __this_byte )
return __i*__BITS_PER_WORDT(_WordT) + __j*CHAR_BIT +
_First_one<true>::_S_first_one[__this_byte];
__thisword >>= CHAR_BIT;
}
}
}
// not found, so return an indication of failure.
return __not_found;
} // end _M_do_find_next
// ------------------------------------------------------------
//
// Definitions of non-inline functions from the single-word version of
// _Base_bitset.
//
# if defined (__STL_CLASS_PARTIAL_SPECIALIZATION)
template <class _WordT>
size_t _Base_bitset<1, _WordT>::_M_do_find_first(size_t __not_found) const
{
_WordT __thisword = _M_w;
if ( __thisword != __STATIC_CAST(_WordT,0) ) {
// find byte within word
for ( size_t __j = 0; __j < sizeof(_WordT); __j++ ) {
unsigned char __this_byte
= __STATIC_CAST(unsigned char,(__thisword & (~(unsigned char)0)));
if ( __this_byte )
return __j*CHAR_BIT + _First_one<true>::_S_first_one[__this_byte];
__thisword >>= CHAR_BIT;
}
}
// not found, so return a value that indicates failure.
return __not_found;
}
template <class _WordT>
size_t
_Base_bitset<1, _WordT>::_M_do_find_next(size_t __prev,
size_t __not_found ) const
{
// make bound inclusive
++__prev;
// check out of bounds
if ( __prev >= __BITS_PER_WORDT(_WordT) )
return __not_found;
// search first (and only) word
_WordT __thisword = _M_w;
// mask off bits below bound
__thisword &= (~__STATIC_CAST(_WordT,0)) << _S_whichbit(__prev);
if ( __thisword != __STATIC_CAST(_WordT,0) ) {
// find byte within word
// get first byte into place
__thisword >>= _S_whichbyte(__prev) * CHAR_BIT;
for ( size_t __j = _S_whichbyte(__prev); __j < sizeof(_WordT); __j++ ) {
unsigned char __this_byte
= __STATIC_CAST(unsigned char,(__thisword & (~(unsigned char)0)));
if ( __this_byte )
return __j*CHAR_BIT + _First_one<true>::_S_first_one[__this_byte];
__thisword >>= CHAR_BIT;
}
}
// not found, so return a value that indicates failure.
return __not_found;
} // end _M_do_find_next
# endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
# if ! defined (__STL_NON_TYPE_TMPL_PARAM_BUG)
#if defined ( __STL_USE_NEW_IOSTREAMS)
template <class _CharT, class _Traits, size_t _Nb, class _WordT>
basic_istream<_CharT, _Traits>&
operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Nb,_WordT>& __x)
{
basic_string<_CharT, _Traits> __tmp;
__tmp.reserve(_Nb);
// Skip whitespace
typename __STL_VENDOR_STD::basic_istream<_CharT, _Traits>::sentry __sentry(__is);
if (__sentry) {
basic_streambuf<_CharT, _Traits>* __buf = __is.rdbuf();
for (size_t __i = 0; __i < _Nb; ++__i) {
static _Traits::int_type __eof = _Traits::eof();
typename _Traits::int_type __c1 = __buf->sbumpc();
if (_Traits::eq_int_type(__c1, __eof)) {
__is.setstate(ios_base::eofbit);
break;
}
else {
char __c2 = _Traits::to_char_type(__c1);
char __c = __is.narrow(__c2, '*');
if (__c == '0' || __c == '1')
__tmp.push_back(__c);
else if (_Traits::eq_int_type(__buf->sputbackc(__c2), __eof)) {
__is.setstate(ios_base::failbit);
break;
}
}
}
if (__tmp.empty())
__is.setstate(ios_base::failbit);
else
__x._M_copy_from_string(__tmp, __STATIC_CAST(size_t,0), _Nb);
}
return __is;
}
template <class _CharT, class _Traits, size_t _Nb, class _WordT>
basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os,
const bitset<_Nb,_WordT>& __x)
{
basic_string<_CharT, _Traits> __tmp;
__x._M_copy_to_string(__tmp);
return __os << __tmp;
}
#elif ! defined ( __STL_USE_NO_IOSTREAMS )
template <size_t _Nb, class _WordT>
istream&
operator>>(istream& __is, bitset<_Nb,_WordT>& __x) {
string __tmp;
__tmp.reserve(_Nb);
// In new templatized iostreams, use istream::sentry
if (__is.flags() & ios::skipws) {
char __c;
do
__is.get(__c);
while (__is && isspace(__c));
if (__is)
__is.putback(__c);
}
for (size_t __i = 0; __i < _Nb; ++__i) {
char __c;
__is.get(__c);
if (!__is)
break;
else if (__c != '0' && __c != '1') {
__is.putback(__c);
break;
}
else
__tmp.push_back(__c);
}
if (__tmp.empty())
__is.clear(__is.rdstate() | ios::failbit);
else
__x._M_copy_from_string(__tmp, __STATIC_CAST(size_t,0), _Nb);
return __is;
}
# endif /* __STL_USE_NEW_IOSTREAMS */
# endif /* __STL_NON_TYPE_TMPL_PARAM_BUG */
// ------------------------------------------------------------
// Lookup tables for find and count operations.
# if ( __STL_STATIC_TEMPLATE_DATA > 0 )
template<bool __dummy>
unsigned char _Bit_count<__dummy>::_S_bit_count[256] = {
# else
unsigned char _Bit_count<true>::_S_bit_count[256] __STL_WEAK = {
# endif
0, /* 0 */ 1, /* 1 */ 1, /* 2 */ 2, /* 3 */ 1, /* 4 */
2, /* 5 */ 2, /* 6 */ 3, /* 7 */ 1, /* 8 */ 2, /* 9 */
2, /* 10 */ 3, /* 11 */ 2, /* 12 */ 3, /* 13 */ 3, /* 14 */
4, /* 15 */ 1, /* 16 */ 2, /* 17 */ 2, /* 18 */ 3, /* 19 */
2, /* 20 */ 3, /* 21 */ 3, /* 22 */ 4, /* 23 */ 2, /* 24 */
3, /* 25 */ 3, /* 26 */ 4, /* 27 */ 3, /* 28 */ 4, /* 29 */
4, /* 30 */ 5, /* 31 */ 1, /* 32 */ 2, /* 33 */ 2, /* 34 */
3, /* 35 */ 2, /* 36 */ 3, /* 37 */ 3, /* 38 */ 4, /* 39 */
2, /* 40 */ 3, /* 41 */ 3, /* 42 */ 4, /* 43 */ 3, /* 44 */
4, /* 45 */ 4, /* 46 */ 5, /* 47 */ 2, /* 48 */ 3, /* 49 */
3, /* 50 */ 4, /* 51 */ 3, /* 52 */ 4, /* 53 */ 4, /* 54 */
5, /* 55 */ 3, /* 56 */ 4, /* 57 */ 4, /* 58 */ 5, /* 59 */
4, /* 60 */ 5, /* 61 */ 5, /* 62 */ 6, /* 63 */ 1, /* 64 */
2, /* 65 */ 2, /* 66 */ 3, /* 67 */ 2, /* 68 */ 3, /* 69 */
3, /* 70 */ 4, /* 71 */ 2, /* 72 */ 3, /* 73 */ 3, /* 74 */
4, /* 75 */ 3, /* 76 */ 4, /* 77 */ 4, /* 78 */ 5, /* 79 */
2, /* 80 */ 3, /* 81 */ 3, /* 82 */ 4, /* 83 */ 3, /* 84 */
4, /* 85 */ 4, /* 86 */ 5, /* 87 */ 3, /* 88 */ 4, /* 89 */
4, /* 90 */ 5, /* 91 */ 4, /* 92 */ 5, /* 93 */ 5, /* 94 */
6, /* 95 */ 2, /* 96 */ 3, /* 97 */ 3, /* 98 */ 4, /* 99 */
3, /* 100 */ 4, /* 101 */ 4, /* 102 */ 5, /* 103 */ 3, /* 104 */
4, /* 105 */ 4, /* 106 */ 5, /* 107 */ 4, /* 108 */ 5, /* 109 */
5, /* 110 */ 6, /* 111 */ 3, /* 112 */ 4, /* 113 */ 4, /* 114 */
5, /* 115 */ 4, /* 116 */ 5, /* 117 */ 5, /* 118 */ 6, /* 119 */
4, /* 120 */ 5, /* 121 */ 5, /* 122 */ 6, /* 123 */ 5, /* 124 */
6, /* 125 */ 6, /* 126 */ 7, /* 127 */ 1, /* 128 */ 2, /* 129 */
2, /* 130 */ 3, /* 131 */ 2, /* 132 */ 3, /* 133 */ 3, /* 134 */
4, /* 135 */ 2, /* 136 */ 3, /* 137 */ 3, /* 138 */ 4, /* 139 */
3, /* 140 */ 4, /* 141 */ 4, /* 142 */ 5, /* 143 */ 2, /* 144 */
3, /* 145 */ 3, /* 146 */ 4, /* 147 */ 3, /* 148 */ 4, /* 149 */
4, /* 150 */ 5, /* 151 */ 3, /* 152 */ 4, /* 153 */ 4, /* 154 */
5, /* 155 */ 4, /* 156 */ 5, /* 157 */ 5, /* 158 */ 6, /* 159 */
2, /* 160 */ 3, /* 161 */ 3, /* 162 */ 4, /* 163 */ 3, /* 164 */
4, /* 165 */ 4, /* 166 */ 5, /* 167 */ 3, /* 168 */ 4, /* 169 */
4, /* 170 */ 5, /* 171 */ 4, /* 172 */ 5, /* 173 */ 5, /* 174 */
6, /* 175 */ 3, /* 176 */ 4, /* 177 */ 4, /* 178 */ 5, /* 179 */
4, /* 180 */ 5, /* 181 */ 5, /* 182 */ 6, /* 183 */ 4, /* 184 */
5, /* 185 */ 5, /* 186 */ 6, /* 187 */ 5, /* 188 */ 6, /* 189 */
6, /* 190 */ 7, /* 191 */ 2, /* 192 */ 3, /* 193 */ 3, /* 194 */
4, /* 195 */ 3, /* 196 */ 4, /* 197 */ 4, /* 198 */ 5, /* 199 */
3, /* 200 */ 4, /* 201 */ 4, /* 202 */ 5, /* 203 */ 4, /* 204 */
5, /* 205 */ 5, /* 206 */ 6, /* 207 */ 3, /* 208 */ 4, /* 209 */
4, /* 210 */ 5, /* 211 */ 4, /* 212 */ 5, /* 213 */ 5, /* 214 */
6, /* 215 */ 4, /* 216 */ 5, /* 217 */ 5, /* 218 */ 6, /* 219 */
5, /* 220 */ 6, /* 221 */ 6, /* 222 */ 7, /* 223 */ 3, /* 224 */
4, /* 225 */ 4, /* 226 */ 5, /* 227 */ 4, /* 228 */ 5, /* 229 */
5, /* 230 */ 6, /* 231 */ 4, /* 232 */ 5, /* 233 */ 5, /* 234 */
6, /* 235 */ 5, /* 236 */ 6, /* 237 */ 6, /* 238 */ 7, /* 239 */
4, /* 240 */ 5, /* 241 */ 5, /* 242 */ 6, /* 243 */ 5, /* 244 */
6, /* 245 */ 6, /* 246 */ 7, /* 247 */ 5, /* 248 */ 6, /* 249 */
6, /* 250 */ 7, /* 251 */ 6, /* 252 */ 7, /* 253 */ 7, /* 254 */
8 /* 255 */
}; // end _Bit_count
# if ( __STL_STATIC_TEMPLATE_DATA > 0 )
template<bool __dummy>
unsigned char _First_one<__dummy>::_S_first_one[256] = {
# else
unsigned char _First_one<true>::_S_first_one[256] __STL_WEAK = {
# endif
0, /* 0 */ 0, /* 1 */ 1, /* 2 */ 0, /* 3 */ 2, /* 4 */
0, /* 5 */ 1, /* 6 */ 0, /* 7 */ 3, /* 8 */ 0, /* 9 */
1, /* 10 */ 0, /* 11 */ 2, /* 12 */ 0, /* 13 */ 1, /* 14 */
0, /* 15 */ 4, /* 16 */ 0, /* 17 */ 1, /* 18 */ 0, /* 19 */
2, /* 20 */ 0, /* 21 */ 1, /* 22 */ 0, /* 23 */ 3, /* 24 */
0, /* 25 */ 1, /* 26 */ 0, /* 27 */ 2, /* 28 */ 0, /* 29 */
1, /* 30 */ 0, /* 31 */ 5, /* 32 */ 0, /* 33 */ 1, /* 34 */
0, /* 35 */ 2, /* 36 */ 0, /* 37 */ 1, /* 38 */ 0, /* 39 */
3, /* 40 */ 0, /* 41 */ 1, /* 42 */ 0, /* 43 */ 2, /* 44 */
0, /* 45 */ 1, /* 46 */ 0, /* 47 */ 4, /* 48 */ 0, /* 49 */
1, /* 50 */ 0, /* 51 */ 2, /* 52 */ 0, /* 53 */ 1, /* 54 */
0, /* 55 */ 3, /* 56 */ 0, /* 57 */ 1, /* 58 */ 0, /* 59 */
2, /* 60 */ 0, /* 61 */ 1, /* 62 */ 0, /* 63 */ 6, /* 64 */
0, /* 65 */ 1, /* 66 */ 0, /* 67 */ 2, /* 68 */ 0, /* 69 */
1, /* 70 */ 0, /* 71 */ 3, /* 72 */ 0, /* 73 */ 1, /* 74 */
0, /* 75 */ 2, /* 76 */ 0, /* 77 */ 1, /* 78 */ 0, /* 79 */
4, /* 80 */ 0, /* 81 */ 1, /* 82 */ 0, /* 83 */ 2, /* 84 */
0, /* 85 */ 1, /* 86 */ 0, /* 87 */ 3, /* 88 */ 0, /* 89 */
1, /* 90 */ 0, /* 91 */ 2, /* 92 */ 0, /* 93 */ 1, /* 94 */
0, /* 95 */ 5, /* 96 */ 0, /* 97 */ 1, /* 98 */ 0, /* 99 */
2, /* 100 */ 0, /* 101 */ 1, /* 102 */ 0, /* 103 */ 3, /* 104 */
0, /* 105 */ 1, /* 106 */ 0, /* 107 */ 2, /* 108 */ 0, /* 109 */
1, /* 110 */ 0, /* 111 */ 4, /* 112 */ 0, /* 113 */ 1, /* 114 */
0, /* 115 */ 2, /* 116 */ 0, /* 117 */ 1, /* 118 */ 0, /* 119 */
3, /* 120 */ 0, /* 121 */ 1, /* 122 */ 0, /* 123 */ 2, /* 124 */
0, /* 125 */ 1, /* 126 */ 0, /* 127 */ 7, /* 128 */ 0, /* 129 */
1, /* 130 */ 0, /* 131 */ 2, /* 132 */ 0, /* 133 */ 1, /* 134 */
0, /* 135 */ 3, /* 136 */ 0, /* 137 */ 1, /* 138 */ 0, /* 139 */
2, /* 140 */ 0, /* 141 */ 1, /* 142 */ 0, /* 143 */ 4, /* 144 */
0, /* 145 */ 1, /* 146 */ 0, /* 147 */ 2, /* 148 */ 0, /* 149 */
1, /* 150 */ 0, /* 151 */ 3, /* 152 */ 0, /* 153 */ 1, /* 154 */
0, /* 155 */ 2, /* 156 */ 0, /* 157 */ 1, /* 158 */ 0, /* 159 */
5, /* 160 */ 0, /* 161 */ 1, /* 162 */ 0, /* 163 */ 2, /* 164 */
0, /* 165 */ 1, /* 166 */ 0, /* 167 */ 3, /* 168 */ 0, /* 169 */
1, /* 170 */ 0, /* 171 */ 2, /* 172 */ 0, /* 173 */ 1, /* 174 */
0, /* 175 */ 4, /* 176 */ 0, /* 177 */ 1, /* 178 */ 0, /* 179 */
2, /* 180 */ 0, /* 181 */ 1, /* 182 */ 0, /* 183 */ 3, /* 184 */
0, /* 185 */ 1, /* 186 */ 0, /* 187 */ 2, /* 188 */ 0, /* 189 */
1, /* 190 */ 0, /* 191 */ 6, /* 192 */ 0, /* 193 */ 1, /* 194 */
0, /* 195 */ 2, /* 196 */ 0, /* 197 */ 1, /* 198 */ 0, /* 199 */
3, /* 200 */ 0, /* 201 */ 1, /* 202 */ 0, /* 203 */ 2, /* 204 */
0, /* 205 */ 1, /* 206 */ 0, /* 207 */ 4, /* 208 */ 0, /* 209 */
1, /* 210 */ 0, /* 211 */ 2, /* 212 */ 0, /* 213 */ 1, /* 214 */
0, /* 215 */ 3, /* 216 */ 0, /* 217 */ 1, /* 218 */ 0, /* 219 */
2, /* 220 */ 0, /* 221 */ 1, /* 222 */ 0, /* 223 */ 5, /* 224 */
0, /* 225 */ 1, /* 226 */ 0, /* 227 */ 2, /* 228 */ 0, /* 229 */
1, /* 230 */ 0, /* 231 */ 3, /* 232 */ 0, /* 233 */ 1, /* 234 */
0, /* 235 */ 2, /* 236 */ 0, /* 237 */ 1, /* 238 */ 0, /* 239 */
4, /* 240 */ 0, /* 241 */ 1, /* 242 */ 0, /* 243 */ 2, /* 244 */
0, /* 245 */ 1, /* 246 */ 0, /* 247 */ 3, /* 248 */ 0, /* 249 */
1, /* 250 */ 0, /* 251 */ 2, /* 252 */ 0, /* 253 */ 1, /* 254 */
0, /* 255 */
}; // end _First_one
__STL_END_NAMESPACE
# undef __BITS_PER_WORDT
# undef __BITSET_WORDS
# undef bitset
#if defined(__IBMCPP__)
#pragma info(restore)
#endif
#endif /* __STL_BITSET_C */
@@ -0,0 +1,802 @@
/*
* 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 __SGI_STL_BITSET_H
#define __SGI_STL_BITSET_H
// 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 __SGI_STL_INTERNAL_ALGOBASE_H
# include <stl_algobase.h>
# endif
# ifndef __SGI_STL_INTERNAL_ALLOC_H
# include <stl_alloc.h>
# endif
# ifndef __SGI_STL_INTERNAL_ITERATOR_H
# include <stl_iterator.h>
# endif
# ifndef __SGI_STL_INTERNAL_UNINITIALIZED_H
# include <stl_uninitialized.h>
# endif
# ifndef __STLPORT_STRING
# include <string>
# endif
# ifndef __STLPORT_IOSTREAM
# include <iostream>
# endif
#define __BITS_PER_WORDT(__wt) (CHAR_BIT*sizeof(__wt))
#define __BITSET_WORDS(__n,__wt) \
((__n) < 1 ? 1 : ((__n) + __BITS_PER_WORDT(__wt) - 1)/__BITS_PER_WORDT(__wt))
__STL_BEGIN_NAMESPACE
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#pragma set woff 1209
#endif
// structure to aid in counting bits
template<bool __dummy>
struct _Bit_count {
static unsigned char _S_bit_count[256];
};
// Mapping from 8 bit unsigned integers to the index of the first one
// bit:
template<bool __dummy>
struct _First_one {
static unsigned char _S_first_one[256];
};
//
// Base class: general case.
//
template<size_t _Nw, class _WordT>
struct _Base_bitset {
_WordT _M_w[_Nw]; // 0 is the least significant word.
_Base_bitset( void ) { _M_do_reset(); }
_Base_bitset(unsigned long __val);
static size_t _S_whichword( size_t __pos ) {
return __pos / __BITS_PER_WORDT(_WordT);
}
static size_t _S_whichbyte( size_t __pos ) {
return (__pos % __BITS_PER_WORDT(_WordT)) / CHAR_BIT;
}
static size_t _S_whichbit( size_t __pos ) {
return __pos % __BITS_PER_WORDT(_WordT);
}
static _WordT _S_maskbit( size_t __pos ) {
return __STATIC_CAST(_WordT,1) << _S_whichbit(__pos);
}
_WordT& _M_getword(size_t __pos) { return _M_w[_S_whichword(__pos)]; }
_WordT _M_getword(size_t __pos) const { return _M_w[_S_whichword(__pos)]; }
_WordT& _M_hiword() { return _M_w[_Nw - 1]; }
_WordT _M_hiword() const { return _M_w[_Nw - 1]; }
void _M_do_and(const _Base_bitset<_Nw,_WordT>& __x) {
for ( size_t __i = 0; __i < _Nw; __i++ ) {
_M_w[__i] &= __x._M_w[__i];
}
}
void _M_do_or(const _Base_bitset<_Nw,_WordT>& __x) {
for ( size_t __i = 0; __i < _Nw; __i++ ) {
_M_w[__i] |= __x._M_w[__i];
}
}
void _M_do_xor(const _Base_bitset<_Nw,_WordT>& __x) {
for ( size_t __i = 0; __i < _Nw; __i++ ) {
_M_w[__i] ^= __x._M_w[__i];
}
}
void _M_do_left_shift(size_t __shift);
void _M_do_right_shift(size_t __shift);
void _M_do_flip() {
for ( size_t __i = 0; __i < _Nw; __i++ ) {
_M_w[__i] = ~_M_w[__i];
}
}
void _M_do_set() {
for ( size_t __i = 0; __i < _Nw; __i++ ) {
_M_w[__i] = ~__STATIC_CAST(_WordT,0);
}
}
void _M_do_reset() {
for ( size_t __i = 0; __i < _Nw; __i++ ) {
_M_w[__i] = 0;
}
}
bool _M_is_equal(const _Base_bitset<_Nw,_WordT>& __x) const {
for (size_t __i = 0; __i < _Nw; ++__i) {
if (_M_w[__i] != __x._M_w[__i])
return false;
}
return true;
}
bool _M_is_any() const {
for ( size_t __i = 0; __i < __BITSET_WORDS(_Nw,_WordT); __i++ ) {
if ( _M_w[__i] != __STATIC_CAST(_WordT,0) )
return true;
}
return false;
}
size_t _M_do_count() const {
size_t __result = 0;
const unsigned char* __byte_ptr = (const unsigned char*)_M_w;
const unsigned char* __end_ptr = (const unsigned char*)(_M_w+_Nw);
while ( __byte_ptr < __end_ptr ) {
__result += _Bit_count<true>::_S_bit_count[*__byte_ptr];
__byte_ptr++;
}
return __result;
}
unsigned long _M_do_to_ulong() const;
// find first "on" bit
size_t _M_do_find_first(size_t __not_found) const;
// find the next "on" bit that follows "prev"
size_t _M_do_find_next(size_t __prev, size_t __not_found) const;
};
//
// Base class: specialization for a single word.
//
# if defined (__STL_CLASS_PARTIAL_SPECIALIZATION)
template<class _WordT>
struct _Base_bitset<1, _WordT> {
_WordT _M_w;
_Base_bitset( void ) { _M_do_reset(); }
_Base_bitset(unsigned long __val) {
_M_do_reset();
const size_t __n = min(sizeof(unsigned long)*CHAR_BIT,
__BITS_PER_WORDT(_WordT));
for(size_t __i = 0; __i < __n; ++__i, __val >>= 1)
if ( __val & 0x1 )
_M_w |= _S_maskbit(__i);
}
static size_t _S_whichword( size_t __pos ) {
return __pos / __BITS_PER_WORDT(_WordT);
}
static size_t _S_whichbyte( size_t __pos ) {
return (__pos % __BITS_PER_WORDT(_WordT)) / CHAR_BIT;
}
static size_t _S_whichbit( size_t __pos ) {
return __pos % __BITS_PER_WORDT(_WordT);
}
static _WordT _S_maskbit( size_t __pos ) {
return (__STATIC_CAST(_WordT,1)) << _S_whichbit(__pos);
}
_WordT& _M_getword(size_t) { return _M_w; }
_WordT _M_getword(size_t) const { return _M_w; }
_WordT& _M_hiword() { return _M_w; }
_WordT _M_hiword() const { return _M_w; }
void _M_do_and(const _Base_bitset<1,_WordT>& __x) { _M_w &= __x._M_w; }
void _M_do_or(const _Base_bitset<1,_WordT>& __x) { _M_w |= __x._M_w; }
void _M_do_xor(const _Base_bitset<1,_WordT>& __x) { _M_w ^= __x._M_w; }
void _M_do_left_shift(size_t __shift) { _M_w <<= __shift; }
void _M_do_right_shift(size_t __shift) { _M_w >>= __shift; }
void _M_do_flip() { _M_w = ~_M_w; }
void _M_do_set() { _M_w = ~__STATIC_CAST(_WordT,0); }
void _M_do_reset() { _M_w = 0; }
bool _M_is_equal(const _Base_bitset<1,_WordT>& __x) const {
return _M_w == __x._M_w;
}
bool _M_is_any() const {
return _M_w != 0;
}
size_t _M_do_count() const {
size_t __result = 0;
const unsigned char* __byte_ptr = (const unsigned char*)&_M_w;
const unsigned char* __end_ptr = ((const unsigned char*)&_M_w)+sizeof(_M_w);
while ( __byte_ptr < __end_ptr ) {
__result += _Bit_count<true>::_S_bit_count[*__byte_ptr];
__byte_ptr++;
}
return __result;
}
unsigned long _M_do_to_ulong() const {
if (sizeof(_WordT) <= sizeof(unsigned long))
return __STATIC_CAST(unsigned long,_M_w);
else {
const _WordT __mask = __STATIC_CAST(_WordT,__STATIC_CAST(unsigned long,-1));
if (_M_w & ~__mask)
__STL_THROW(overflow_error("bitset"));
return __STATIC_CAST(unsigned long,_M_w);
}
}
size_t _M_do_find_first(size_t __not_found) const;
// find the next "on" bit that follows "prev"
size_t _M_do_find_next(size_t __prev, size_t __not_found) const;
};
# if !defined( __STL_MEMBER_SPECIALIZATION_BUG )
//
// One last specialization: _M_do_to_ulong() and the constructor from
// unsigned long are very simple if the bitset consists of a single
// word of type unsigned long.
//
__STL_TEMPLATE_NULL
inline unsigned long
_Base_bitset<1, unsigned long>::_M_do_to_ulong() const { return _M_w; }
__STL_TEMPLATE_NULL
inline _Base_bitset<(size_t)1, unsigned long>::_Base_bitset(unsigned long __val) {
_M_w = __val;
}
# endif // __STL_MEMBER_SPECIALIZATION_BUG
# endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
// ------------------------------------------------------------
// Helper class to zero out the unused high-order bits in the highest word.
# ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
template <class _WordT, size_t _Extrabits> struct _Sanitize {
static void _M_do_sanitize(_WordT& __val)
{ __val &= ~((~__STATIC_CAST(_WordT,0)) << _Extrabits); }
};
template <class _WordT> struct _Sanitize<_WordT, 0> {
static void _M_do_sanitize(_WordT) {}
};
#else /* __STL_CLASS_PARTIAL_SPECIALIZATION */
template <class _WordT, size_t _Extrabits> struct _Sanitize {
static void _M_do_sanitize(_WordT& __val) {
if (_Extrabits != 0)
__val &= ~((~__STATIC_CAST(_WordT,0)) << _Extrabits);
}
};
#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
// ------------------------------------------------------------
// Class bitset.
// _Nb may be any nonzero number of type size_t.
// Type _WordT may be any unsigned integral type.
typedef unsigned long __stl_ulong;
# if defined (__STL_DEFAULT_TYPE_PARAM)
template<size_t _Nb, class _WordT = __stl_ulong>
# else
# define bitset __bitset
template<size_t _Nb, class _WordT>
# endif
class bitset : public _Base_bitset<__BITSET_WORDS(_Nb,_WordT), _WordT>
{
private:
typedef _Base_bitset<__BITSET_WORDS(_Nb,_WordT), _WordT> _Base;
void _M_do_sanitize() {
_Sanitize<_WordT,_Nb%__BITS_PER_WORDT(_WordT) >
::_M_do_sanitize(this->_M_hiword());
}
public:
// bit reference:
struct reference {
typedef _Base_bitset<_Nb,_WordT> _Bitset_base;
typedef bitset<_Nb,_WordT> _Bitset;
// friend _Bitset;
_WordT *_M_wp;
size_t _M_bpos;
// should be left undefined
reference() {}
reference( _Bitset& __b, size_t __pos ) {
_M_wp = &__b._M_getword(__pos);
_M_bpos = _Bitset_base::_S_whichbit(__pos);
}
public:
~reference() {}
// for b[i] = __x;
reference& operator=(bool __x) {
if ( __x )
*_M_wp |= _Bitset_base::_S_maskbit(_M_bpos);
else
*_M_wp &= ~_Bitset_base::_S_maskbit(_M_bpos);
return *this;
}
// for b[i] = b[__j];
reference& operator=(const reference& __j) {
if ( (*(__j._M_wp) & _Bitset_base::_S_maskbit(__j._M_bpos)) )
*_M_wp |= _Bitset_base::_S_maskbit(_M_bpos);
else
*_M_wp &= ~_Bitset_base::_S_maskbit(_M_bpos);
return *this;
}
// flips the bit
bool operator~() const { return (*(_M_wp) & _Bitset_base::_S_maskbit(_M_bpos)) == 0; }
// for __x = b[i];
operator bool() const { return (*(_M_wp) & _Bitset_base::_S_maskbit(_M_bpos)) != 0; }
// for b[i].flip();
reference& flip() {
*_M_wp ^= _Bitset_base::_S_maskbit(_M_bpos);
return *this;
}
};
friend struct reference;
// 23.3.5.1 constructors:
bitset() {}
bitset(unsigned long __val) :
_Base_bitset<__BITSET_WORDS(_Nb,_WordT), _WordT>(__val) {}
# ifdef __STL_MEMBER_TEMPLATES
template<class _CharT, class _Traits, class _Alloc>
explicit bitset(const basic_string<_CharT,_Traits,_Alloc>& __s,
size_t __pos = 0)
: _Base_bitset<__BITSET_WORDS(_Nb,_WordT), _WordT>()
{
if (__pos > __s.size())
__STL_THROW(out_of_range("bitset"));
_M_copy_from_string(__s, __pos,
basic_string<_CharT, _Traits, _Alloc>::npos);
}
template<class _CharT, class _Traits, class _Alloc>
bitset(const basic_string<_CharT, _Traits, _Alloc>& __s,
size_t __pos,
size_t __n)
: _Base_bitset<__BITSET_WORDS(_Nb,_WordT), _WordT>()
{
if (__pos > __s.size())
__STL_THROW(out_of_range("bitset"));
_M_copy_from_string(__s, __pos, __n);
}
#else /* __STL_MEMBER_TEMPLATES */
explicit bitset(const string& __s,
size_t __pos = 0,
size_t __n = (size_t)-1)
: _Base_bitset<__BITSET_WORDS(_Nb,_WordT), _WordT>()
{
if (__pos > __s.size())
__STL_THROW(out_of_range("bitset"));
_M_copy_from_string(__s, __pos, __n);
}
#endif /* __STL_MEMBER_TEMPLATES */
// 23.3.5.2 bitset operations:
bitset<_Nb,_WordT>& operator&=(const bitset<_Nb,_WordT>& __rhs) {
this->_M_do_and(__rhs);
return *this;
}
bitset<_Nb,_WordT>& operator|=(const bitset<_Nb,_WordT>& __rhs) {
this->_M_do_or(__rhs);
return *this;
}
bitset<_Nb,_WordT>& operator^=(const bitset<_Nb,_WordT>& __rhs) {
this->_M_do_xor(__rhs);
return *this;
}
bitset<_Nb,_WordT>& operator<<=(size_t __pos) {
this->_M_do_left_shift(__pos);
this->_M_do_sanitize();
return *this;
}
bitset<_Nb,_WordT>& operator>>=(size_t __pos) {
this->_M_do_right_shift(__pos);
this->_M_do_sanitize();
return *this;
}
//
// Extension:
// Versions of single-bit set, reset, flip, test with no range checking.
//
bitset<_Nb,_WordT>& _Unchecked_set(size_t __pos) {
this->_M_getword(__pos) |= _Base::_S_maskbit(__pos);
return *this;
}
bitset<_Nb,_WordT>& _Unchecked_set(size_t __pos, int __val) {
if (__val)
this->_M_getword(__pos) |= _Base::_S_maskbit(__pos);
else
this->_M_getword(__pos) &= ~ _Base::_S_maskbit(__pos);
return *this;
}
bitset<_Nb,_WordT>& _Unchecked_reset(size_t __pos) {
this->_M_getword(__pos) &= ~ _Base::_S_maskbit(__pos);
return *this;
}
bitset<_Nb,_WordT>& _Unchecked_flip(size_t __pos) {
this->_M_getword(__pos) ^= _Base::_S_maskbit(__pos);
return *this;
}
bool _Unchecked_test(size_t __pos) const {
return (this->_M_getword(__pos) & _Base::_S_maskbit(__pos)) != __STATIC_CAST(_WordT,0);
}
// Set, reset, and flip.
bitset<_Nb,_WordT>& set() {
this->_M_do_set();
this->_M_do_sanitize();
return *this;
}
bitset<_Nb,_WordT>& set(size_t __pos) {
if (__pos >= _Nb)
__STL_THROW(out_of_range("bitset"));
return _Unchecked_set(__pos);
}
bitset<_Nb,_WordT>& set(size_t __pos, int __val) {
if (__pos >= _Nb)
__STL_THROW(out_of_range("bitset"));
return _Unchecked_set(__pos, __val);
}
bitset<_Nb,_WordT>& reset() {
this->_M_do_reset();
return *this;
}
bitset<_Nb,_WordT>& reset(size_t __pos) {
if (__pos >= _Nb)
__STL_THROW(out_of_range("bitset"));
return _Unchecked_reset(__pos);
}
bitset<_Nb,_WordT>& flip() {
this->_M_do_flip();
this->_M_do_sanitize();
return *this;
}
bitset<_Nb,_WordT>& flip(size_t __pos) {
if (__pos >= _Nb)
__STL_THROW(out_of_range("bitset"));
return _Unchecked_flip(__pos);
}
bitset<_Nb,_WordT> operator~() const {
return bitset<_Nb,_WordT>(*this).flip();
}
// element access:
//for b[i];
reference operator[](size_t __pos) { return reference(*this,__pos); }
bool operator[](size_t __pos) const { return _Unchecked_test(__pos); }
unsigned long to_ulong() const { return this->_M_do_to_ulong(); }
#if defined (__STL_MEMBER_TEMPLATES) && \
defined (__STL_EXPLICIT_FUNCTION_TMPL_ARGS)
template <class _CharT, class _Traits, class _Alloc>
basic_string<_CharT, _Traits, _Alloc> to_string() const {
basic_string<_CharT, _Traits, _Alloc> __result;
_M_copy_to_string(__result);
return __result;
}
#else
string to_string() const {
string __result;
_M_copy_to_string(__result);
return __result;
}
#endif /* __STL_EXPLICIT_FUNCTION_TMPL_ARGS */
size_t count() const { return this->_M_do_count(); }
size_t size() const { return _Nb; }
bool operator==(const bitset<_Nb,_WordT>& __rhs) const {
return this->_M_is_equal(__rhs);
}
bool operator!=(const bitset<_Nb,_WordT>& __rhs) const {
return !this->_M_is_equal(__rhs);
}
bool test(size_t __pos) const {
if (__pos > _Nb)
__STL_THROW(out_of_range("bitset"));
return _Unchecked_test(__pos);
}
bool any() const { return this->_M_is_any(); }
bool none() const { return !this->_M_is_any(); }
bitset<_Nb,_WordT> operator<<(size_t __pos) const {
bitset<_Nb,_WordT> __result(*this);
__result <<= __pos ; return __result;
}
bitset<_Nb,_WordT> operator>>(size_t __pos) const {
bitset<_Nb,_WordT> __result(*this);
__result >>= __pos ; return __result;
}
//
// EXTENSIONS: bit-find operations. These operations are
// experimental, and are subject to change or removal in future
// versions.
//
// find the index of the first "on" bit
size_t _Find_first() const
{ return this->_M_do_find_first(_Nb); }
// find the index of the next "on" bit after prev
size_t _Find_next( size_t __prev ) const
{ return this->_M_do_find_next(__prev, _Nb); }
//
// Definitions of should-be non-inline member functions.
//
# if defined (__STL_MEMBER_TEMPLATES)
template<class _CharT, class _Traits, class _Alloc>
void _M_copy_from_string(const basic_string<_CharT,_Traits,_Alloc>& __s,
size_t __pos,
size_t __n)
#else
void _M_copy_from_string(const string& __s,
size_t __pos,
size_t __n)
#endif
{
reset();
size_t __tmp = _Nb;
const size_t __Nbits = min(__tmp, min(__n, __s.size() - __pos));
for ( size_t __i= 0; __i < __Nbits; ++__i) {
switch(__s[__pos + __Nbits - __i - 1]) {
case '0':
break;
case '1':
set(__i);
break;
default:
__STL_THROW(invalid_argument("bitset"));
}
}
}
# if defined (__STL_MEMBER_TEMPLATES)
template <class _CharT, class _Traits, class _Alloc>
void _M_copy_to_string(basic_string<_CharT, _Traits, _Alloc>& __s) const
# else
void _M_copy_to_string(string& __s) const
# endif
{
__s.assign(_Nb, '0');
for (size_t __i = 0; __i < _Nb; ++__i)
if (_Unchecked_test(__i))
__s[_Nb - 1 - __i] = '1';
}
# if defined (__STL_NON_TYPE_TMPL_PARAM_BUG)
bitset<_Nb,_WordT> operator&(const bitset<_Nb,_WordT>& __y) {
bitset<_Nb,_WordT> __result(*this);
__result &= __y;
return __result;
}
bitset<_Nb,_WordT> operator|(const bitset<_Nb,_WordT>& __y) {
bitset<_Nb,_WordT> __result(*this);
__result |= __y;
return __result;
}
bitset<_Nb,_WordT> operator^(const bitset<_Nb,_WordT>& __y) {
bitset<_Nb,_WordT> __result(*this);
__result ^= __y;
return __result;
}
# endif
};
// ------------------------------------------------------------
//
// 23.3.5.3 bitset operations:
//
# if ! defined (__STL_NON_TYPE_TMPL_PARAM_BUG)
template <size_t _Nb, class _WordT>
inline bitset<_Nb,_WordT> operator&(const bitset<_Nb,_WordT>& __x,
const bitset<_Nb,_WordT>& __y) {
bitset<_Nb,_WordT> __result(__x);
__result &= __y;
return __result;
}
template <size_t _Nb, class _WordT>
inline bitset<_Nb,_WordT> operator|(const bitset<_Nb,_WordT>& __x,
const bitset<_Nb,_WordT>& __y) {
bitset<_Nb,_WordT> __result(__x);
__result |= __y;
return __result;
}
template <size_t _Nb, class _WordT>
inline bitset<_Nb,_WordT> operator^(const bitset<_Nb,_WordT>& __x,
const bitset<_Nb,_WordT>& __y) {
bitset<_Nb,_WordT> __result(__x);
__result ^= __y;
return __result;
}
#if defined ( __STL_USE_NEW_IOSTREAMS )
template <class _CharT, class _Traits, size_t _Nb, class _WordT>
basic_istream<_CharT, _Traits>&
operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Nb,_WordT>& __x);
template <class _CharT, class _Traits, size_t _Nb, class _WordT>
basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os,
const bitset<_Nb,_WordT>& __x);
#elif ! defined ( __STL_USE_NO_IOSTREAMS )
template <size_t _Nb, class _WordT>
istream&
operator>>(istream& __is, bitset<_Nb,_WordT>& __x);
template <size_t _Nb, class _WordT>
inline ostream& operator<<(ostream& __os, const bitset<_Nb,_WordT>& __x) {
string __tmp;
__x._M_copy_to_string(__tmp);
return __os << __tmp;
}
#endif
# endif /* __STL_NON_TYPE_TMPL_PARAM_BUG */
# undef bitset
# if defined (__STL_DEFAULT_TYPE_PARAM)
# define __bitset__ bitset
# else
# define __bitset__ __bitset
// provide a "default" bitset adaptor
template <size_t _Nb>
class bitset : public __bitset__<_Nb, __stl_ulong>
{
public:
# define _BS_SUPER __bitset__<_Nb, __stl_ulong >
typedef _BS_SUPER _Super;
typedef typename _BS_SUPER::reference reference; \
__IMPORT_SUPER_COPY_ASSIGNMENT(bitset, bitset<_Nb>, _BS_SUPER)
bitset() {}
explicit bitset(const unsigned long __val) : _BS_SUPER(__val) { }
explicit bitset(const string& __s,
size_t __pos = 0,
size_t __n = (size_t)-1) : _BS_SUPER(__s, __pos, __n) {}
~bitset() {}
# if defined (__STL_BASE_MATCH_BUG)
bool operator==(const bitset<_Nb>& __y) {
return operator == ((const _Super&)*this,(const _Super&)__y);
}
bool operator<(const bitset<_Nb>& __y) {
return operator < ((const _Super&)*this,(const _Super&)__y);
}
# endif /* __STL_BASE_MATCH_BUG */
};
# undef _BS_SUPER
# endif /* __STL_DEFAULT_TYPE_PARAM */
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#pragma reset woff 1209
#endif
__STL_END_NAMESPACE
# undef __BITS_PER_WORDT
# undef __BITSET_WORDS
#if defined(__IBMCPP__)
#pragma info(restore)
#endif
# if !defined (__STL_LINK_TIME_INSTANTIATION)
# include <stl_bitset.c>
# endif
#endif /* __SGI_STL_BITSET_H */
// Local Variables:
// mode:C++
// End:
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,989 @@
/*
*
* 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 __STL_CONFIG_H
# define __STL_CONFIG_H
/*
* Purpose of this file :
*
* Defines all STLport settings.
* This file is actually a wrapper : it includes compiler-specific
* settings from <config/stlcomp.h> (<config/stlconf.h>, if you ran "configure),
* and user-defined settings from <stl_user_config.h>.
* See <config/stl_mycomp.h> and <stl_user_config.h> for the description
* of those macros
*
*/
// Other macros defined by this file:
// * bool, true, and false, if __STL_NO_BOOL is defined.
// * typename, as a null macro if it's not already a keyword.
// * explicit, as a null macro if it's not already a keyword.
// * namespace-related macros (__STLPORT_STD, __STL_BEGIN_NAMESPACE, etc.)
// * exception-related macros (__STL_TRY, __STL_UNWIND, etc.)
// * __stl_assert, either as a test or as a null macro, depending on
// whether or not __STL_ASSERTIONS is defined.
// SGI basic release
# define __SGI_STL 0x320
// Adaptation version
# define __SGI_STL_PORT 0x321
// include STLport config definitions
# include <stl_self_config.h>
// First, attempt to include config file produced by "configure"
# include <config/stlconf.h>
# if ! defined (__AUTO_CONFIGURED)
// Not configured, use per-version compiler recognition
# include <config/stlcomp.h>
# endif
//=========================================================
// some fixes to configuration, either "configure"d or
// hardcoded. This also includes modifications
// of STLport switches depending on compiler flags
# include <config/stl_confix.h>
//=========================================================
// Placeholder for user to override settings.
// It could be also used to mask settings from
// different directories
# include <stl_user_config.h>
//=========================================================
// SGI terms
#if !defined(__STL_HAS_NAMESPACES) && !defined(__STL_HAS_NO_NAMESPACES)
# define __STL_HAS_NAMESPACES 1
#endif
# if !defined (__STL_NO_PARTIAL_SPECIALIZATION_SYNTAX) && !defined (__STL_PARTIAL_SPECIALIZATION_SYNTAX)
# define __STL_PARTIAL_SPECIALIZATION_SYNTAX 1
# endif
# if !defined (__STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS) && !defined(__STL_EXPLICIT_FUNCTION_TMPL_ARGS)
# define __STL_EXPLICIT_FUNCTION_TMPL_ARGS 1
# endif
# if !defined (__STL_NO_MEMBER_TEMPLATES) && !defined (__STL_MEMBER_TEMPLATES)
# define __STL_MEMBER_TEMPLATES 1
# endif
# if !defined (__STL_NO_FRIEND_TEMPLATES) && !defined (__STL_FRIEND_TEMPLATES)
# define __STL_FRIEND_TEMPLATES 1
# endif
# if !defined (__STL_NO_MEMBER_TEMPLATE_CLASSES) && !defined (__STL_MEMBER_TEMPLATE_CLASSES)
# define __STL_MEMBER_TEMPLATE_CLASSES 1
# endif
#if !defined (__STL_NO_CLASS_PARTIAL_SPECIALIZATION) && !defined (__STL_CLASS_PARTIAL_SPECIALIZATION)
# define __STL_CLASS_PARTIAL_SPECIALIZATION 1
#endif
#if !defined (__STL_FUNCTION_TMPL_PARTIAL_ORDER) && !defined (__STL_NO_FUNCTION_TMPL_PARTIAL_ORDER)
# define __STL_FUNCTION_TMPL_PARTIAL_ORDER 1
#endif
#if !defined(__STL_NO_TEMPLATE_CONVERSIONS) && !defined (__SGI_STL_USE_AUTO_PTR_CONVERSIONS)
# define __SGI_STL_USE_AUTO_PTR_CONVERSIONS
#endif
//==========================================================
// final workaround tuning based on given flags
//==========================================================
#ifndef __STL_UINT32_T
# define __STL_UINT32_T unsigned long
#endif
# if !defined (__STL_HAS_NO_NAMESPACES)
// undef only "USE"
# if defined __STL_NO_NAMESPACES
# undef __STL_USE_NAMESPACES
# else
// assume it as the default, turn it off later if NO_NAMESPACES selected
# undef __STL_USE_NAMESPACES
# define __STL_USE_NAMESPACES 1
# endif
# endif
# ifndef __STLPORT_NAMESPACE
# define __STLPORT_NAMESPACE stlport
# endif
# if defined (__STL_NO_IOSTREAMS)
# undef __STL_USE_NO_IOSTREAMS
# endif
# if defined (__STLPORT_NEW_IOSTREAMS) || \
(!defined (__STL_HAS_NO_NEW_IOSTREAMS) && !defined (__STL_USE_NEW_IOSTREAMS)) \
&& ! defined (__STL_USE_NO_IOSTREAMS)
# define __STL_USE_NEW_IOSTREAMS
# endif
# if defined (__STL_NO_NEW_IOSTREAMS)
# undef __STL_USE_NEW_IOSTREAMS
# endif
// Operating system recognition (basic)
# if defined (__unix)
# define __STL_UNIX 1
# elif defined(macintosh) || defined (_MAC)
# define __STL_MAC 1
# elif defined (_WIN32) || defined (__WIN32) || defined (WIN32) || defined (__WIN32__)
# define __STL_WIN32 1
# elif defined (__WIN16) || defined (WIN16) || defined (_WIN16)
# define __STL_WIN16
# endif /* __unix */
// shared library tune-up
# if defined (__BUILDING_STLPORT_DLL)
// if we are rebuilding right now as a DLL, place everything here
# if defined (__DLL) || defined (_DLL) || defined (_WINDLL)
# undef __STL_USE_DECLSPEC
# define __STL_USE_DECLSPEC
# undef __STL_DESIGNATED_DLL
# define __STL_DESIGNATED_DLL 1
# endif
# endif
// Use own namespace always if possible and not explicitly instructed otherwise
# if defined (__STL_USE_NEW_IOSTREAMS) && \
defined (__STL_USE_NAMESPACES) && !defined (__STL_BROKEN_USING_DIRECTIVE) && \
!defined(__STL_STD_REBUILD) && !defined(__STL_NO_OWN_NAMESPACE)
# undef __STL_USE_OWN_NAMESPACE
# define __STL_USE_OWN_NAMESPACE 1
# else
// if this is somehow set, undefine it, as it is not meaningful
# undef __STL_WHOLE_NATIVE_STD
# endif
# if defined(_PTHREADS) && !defined(_NOTHREADS)
# define __STL_PTHREADS
# endif
# if defined(_UITHREADS) && !defined(_NOTHREADS)
# define __STL_UITHREADS
# endif
# ifdef _REENTRANT
# if !defined(_NOTHREADS) && !defined(_PTHREADS)
# if defined (__sgi)
# define __STL_SGI_THREADS
# elif (defined (__sun) && defined (__SVR4)) || \
(defined(_UITHREADS) || defined (__STL_SOLARIS_THREADS) && !defined(_NOTHREADS))
# define __STL_UITHREADS
# elif defined (_WIN32) || defined (WIN32) || defined (__WIN32__)
# define __STL_WIN32THREADS
# else
# define __STL_PTHREADS
# endif /* __sgi */
# endif /* _NOTHREADS */
# endif /* _REENTRANT */
# if defined (_MFC_VER) && !defined (__STL_USE_MFC)
# define __STL_USE_MFC 1
# endif
#if defined(__STL_WIN32THREADS) || defined(STL_SGI_THREADS) \
|| defined(__STL_PTHREADS) || defined(__STL_UITHREADS)
# define __STL_THREADS
# define __STL_VOLATILE volatile
// windows.h _MUST be included before bool definition ;(
# if defined (__STL_WIN32THREADS) && defined (__STL_NO_BOOL)
# undef NOMINMAX
# define NOMINMAX
# ifdef __STL_USE_MFC
# include <afx.h>
# else
# include <windows.h>
# endif
# undef min
# undef max
# define __STLPORT_WINDOWS_H_INCLUDED
# endif
#else
# define __STL_VOLATILE
#endif
# if !defined ( __STL_USE_NEW_C_HEADERS ) && !defined ( __STL_HAS_NO_NEW_C_HEADERS )
# define __STL_USE_NEW_C_HEADERS
# endif
// disable new-style headers if requested
# if defined ( __STL_NO_NEW_C_HEADERS )
# undef __STL_USE_NEW_C_HEADERS
# endif
# if defined ( __STL_NO_STATIC_TEMPLATE_DATA )
# define __STL_STATIC_TEMPLATE_DATA 0
# if !defined ( __STL_WEAK_ATTRIBUTE )
# define __STL_WEAK_ATTRIBUTE 0
# endif
# else
# define __STL_STATIC_TEMPLATE_DATA 1
# endif
#ifdef __STL_STATIC_CONST_INIT_BUG
# define __STL_INLINE_STATIC_INIT(x)
# define __STL_OUTLINE_STATIC_INIT(x) = x
#else
# define __STL_INLINE_STATIC_INIT(x) = x
# define __STL_OUTLINE_STATIC_INIT(x)
#endif
# if defined (__STL_BASE_TYPEDEF_BUG)
# undef __STL_BASE_TYPEDEF_OUTSIDE_BUG
# define __STL_BASE_TYPEDEF_OUTSIDE_BUG 1
# endif
# if defined ( __STL_NESTED_TYPE_PARAM_BUG ) || (defined (__STL_MSVC) && (__STL_MSVC < 1100))
# define __STL_GLOBAL_NESTED_RETURN_TYPE_PARAM_BUG
# endif
// SUNpro 4.2 inline string literal bug
#ifdef __STL_INLINE_STRING_LITERAL_BUG
# define __STL_FIX_LITERAL_BUG(__x) __x=__x;
#else
# define __STL_FIX_LITERAL_BUG(__x)
#endif
// comment this section if you want to use BufSize parameter
// of deque (note that no template function taking deque<T,Alloc,BufSize>
// as parameter will compile then)
# if defined (__STL_NON_TYPE_TMPL_PARAM_BUG)
# undef __STL_NO_DEFAULT_NON_TYPE_PARAM
# define __STL_NO_DEFAULT_NON_TYPE_PARAM 1
# endif
# define __STL_NEW new
# define __STL_PLACEMENT_NEW new
// features tuning
# ifdef __STL_DEBUG
# define __STL_ASSERTIONS 1
# endif
// if __STL_DEBUG or __STL_ASSERTIONS are set, stldebug.h defines those
# ifndef __STL_ASSERTIONS
# define __stl_assert(expr) do {} while(0) // dwa 3/19/99 - prevents 'unwanted ;' warning
# endif
# ifndef __STL_DEBUG
# define __stl_verbose_assert(expr,diagnostic)
# define __stl_debug_check(expr)
# define __stl_debug_do(expr)
# endif
// tuning of static template data members workaround
# if ( __STL_STATIC_TEMPLATE_DATA < 1 )
// ignore __PUT directive in this case
# if ( __STL_WEAK_ATTRIBUTE > 0 )
# define __STL_WEAK __attribute__ (( weak ))
# define __DECLARE_INSTANCE(type,item,init) type item __attribute__ (( weak )) init
# else
# define __STL_WEAK
# ifdef __PUT_STATIC_DATA_MEMBERS_HERE
# define __DECLARE_INSTANCE(type,item,init) type item init
# else
# define __DECLARE_INSTANCE(type,item,init)
# endif /* __PUT_STATIC_DATA_MEMBERS_HERE */
# endif /* __STL_WEAK_ATTRIBUTE */
# endif /* __STL_STATIC_TEMPLATE_DATA */
// default parameters as template types derived from arguments ( not always supported )
# if defined (__STL_LIMITED_DEFAULT_TEMPLATES)
# define __DFL_TMPL_PARAM( classname, defval ) class classname
# define __DFL_TMPL_ARG(classname) , classname
# else
# define __STL_DEFAULT_TYPE_PARAM 1
# define __DFL_TMPL_PARAM( classname, defval ) class classname = defval
# define __DFL_TMPL_ARG(classname)
# endif
// default parameters as complete types
# if defined ( __STL_DEFAULT_TYPE_PARAM )
# define __DFL_TYPE_PARAM( classname, defval ) class classname = defval
# define __DFL_NON_TYPE_PARAM(type,name,val) type name = val
# define __DFL_TYPE_ARG(classname)
# else
# define __DFL_TYPE_PARAM( classname, defval ) class classname
# define __DFL_NON_TYPE_PARAM(type,name,val) type name
# define __DFL_TYPE_ARG(classname) , classname
# endif
// SGI compatibility
#ifdef __STL_NO_WCHAR_T
# ifndef __STL_NO_NATIVE_WIDE_STREAMS
# define __STL_NO_NATIVE_WIDE_STREAMS 1
# endif
#else
# define __STL_HAS_WCHAR_T 1
#endif
#if !defined (__STL_NO_AT_MEMBER_FUNCTION)
# define __STL_CAN_THROW_RANGE_ERRORS 1
#endif
// __STL_USE_SGI_ALLOCATORS is a hook so that users can
// disable allocator<_Tp> as default, and continue to use the same kind of
// allocators as before, without having to edit library headers.
# if !defined (__STL_USE_SGI_ALLOCATORS)
# define __STL_DEFAULT_ALLOCATOR(_Tp) allocator< _Tp >
# define __STL_DEFAULT_ALLOCATOR_SELECT( _Tp ) __DFL_TMPL_PARAM(_Alloc,allocator< _Tp >)
# define __STL_DEFAULT_PAIR_ALLOCATOR(_Key, _Tp) allocator< pair < _Key, _Tp > >
# if defined (__STL_LIMITED_DEFAULT_TEMPLATES)
# define __STL_DEFAULT_PAIR_ALLOCATOR_SELECT(_Key, _Tp ) class _Alloc
# define __STL_USE_WRAPPER_FOR_ALLOC_PARAM 1
# else
# define __STL_DEFAULT_PAIR_ALLOCATOR_SELECT(_Key, _Tp ) class _Alloc = allocator< pair < _Key, _Tp > >
# endif
# else
# define __STL_DEFAULT_ALLOCATOR( _Tp ) __sgi_alloc
# define __STL_DEFAULT_ALLOCATOR_SELECT( _Tp ) __DFL_TYPE_PARAM(_Alloc,__sgi_alloc)
# define __STL_DEFAULT_PAIR_ALLOCATOR( _Key, _Tp ) __sgi_alloc
# define __STL_DEFAULT_PAIR_ALLOCATOR_SELECT(_Key, _Tp ) __DFL_TYPE_PARAM(_Alloc,__sgi_alloc)
# if defined (__STL_LIMITED_DEFAULT_TEMPLATES) && !defined (__STL_DEFAULT_TYPE_PARAM)
# define __STL_USE_WRAPPER_FOR_ALLOC_PARAM 1
# endif
# endif
// default parameters workaround tuning
# if defined ( __STL_USE_WRAPPER_FOR_ALLOC_PARAM )
# define __WORKAROUND_RENAME(X) __##X
# else
# define __WORKAROUND_RENAME(X) X
# endif
# define __FULL_NAME(X) __WORKAROUND_RENAME(X)
// macro to convert the allocator for initialization
// not using MEMBER_TEMPLATE_CLASSES as it should work given template constructor
#if defined (__STL_MEMBER_TEMPLATES) || ! defined (__STL_CLASS_PARTIAL_SPECIALIZATION)
// if __STL_NO_TEMPLATE_CONVERSIONS is set, the member template constructor is
// not used implicitly to convert allocator parameter, so let us do it explicitly
# if defined (__STL_MEMBER_TEMPLATE_CLASSES) && defined (__STL_NO_TEMPLATE_CONVERSIONS)
# define __STL_CONVERT_ALLOCATOR(__a, _Tp) __a.rebind<_Tp>::other(__a)
# else
# define __STL_CONVERT_ALLOCATOR(__a, _Tp) __a
# endif
// else convert, but only if partial specialization works, since else
// Container::allocator_type won't be different
#else
# define __STL_CONVERT_ALLOCATOR(__a, _Tp) __stl_alloc_create(__a,(_Tp*)0)
#endif
#ifdef __STL_MEMBER_TEMPLATE_CLASSES
# define __STL_REBIND_ALLOCATOR(__a, _Tp) __a
#else
# define __STL_REBIND_ALLOCATOR(__a, _Tp) __stl_alloc_rebind(__a,(_Tp*)0)
#endif
// parameters passed to container's constructors.
// some compilers choke on default parameters
// given as a constructor name
# if defined (__STL_DEFAULT_PARAM_CONSTRUCTOR_BUG)
# define __STL_ALLOC_INSTANCE(_X) _STL_factory<_X>::_Instance()
# else
# define __STL_ALLOC_INSTANCE(_X) _X()
# endif
// namespace stuff adjustment
// provide a mechanism to redefine std:: namespace in a way that is transparent to the
// user. __STL_REDEFINE_STD is being used for wrapper files that include native headers
// to temporary undef the std macro.
# if defined ( __STL_USE_NAMESPACES ) && defined ( __STL_USE_OWN_NAMESPACE ) && \
! defined ( __STL_DONT_REDEFINE_STD )
# define __STL_REDEFINE_STD 1
# else
// for safety
# undef __STL_REDEFINE_STD
# endif
# if defined ( __STL_REDEFINE_STD )
# undef std
// make std namespace nonempty
namespace std { }
namespace __stl_native_std = std;
# define std __STLPORT_NAMESPACE
# endif
// this always mean the C library is in global namespace
# if defined (__STL_HAS_NO_NEW_C_HEADERS) && ! defined (__STL_VENDOR_GLOBAL_CSTD)
# define __STL_VENDOR_GLOBAL_CSTD 1
# endif
// Depending of whether compiler supports namespaces,
// tune the parameters for vendor-supplied libraries.
// This section is guarded by __STL_HAS_NO_NAMESPACES, not by __STL_USE_NAMESPACES,
// since it depends only on the native features, not on user's preference whether
// to use namespace for STLport or not.
# if !defined (__STL_HAS_NO_NAMESPACES)
// Import some vendor's headers into corresponding STLport ones if they might be needed
//
# if defined (__STL_WHOLE_NATIVE_STD) || \
(defined(__STL_USE_OWN_NAMESPACE) && defined (__STL_USE_NEW_IOSTREAMS) && \
! defined (__STLPORT_NEW_IOSTREAMS) )
# define __STL_IMPORT_VENDOR_STD 1
# endif
// if using stlport:: namespace or if C library stuff is not in vendor's std::,
// try importing 'em.
// MSVC has ambiguity problem when we try to import C-style std:: stuff into global namespace
# if ( defined(__STL_USE_OWN_NAMESPACE) || defined (__STL_VENDOR_GLOBAL_CSTD)) && \
! ( defined (__STL_MSVC) && __STL_MSVC <= 1200 && ! defined (__ICL) )
# define __STL_IMPORT_VENDOR_CSTD 1
# endif
# define __STL_USING_NAMESPACE(x) using namespace x ;
// assume std:: namespace for C++ std library if not being told otherwise
# ifdef __STL_VENDOR_GLOBAL_STD
# define __STL_VENDOR_STD
# define __STL_USING_VENDOR_STD
# else
# ifdef __STL_REDEFINE_STD
# define __STL_VENDOR_STD __stl_native_std
# else
# define __STL_VENDOR_STD std
# endif
# define __STL_USING_VENDOR_STD __STL_USING_NAMESPACE(__STL_VENDOR_STD)
# endif
// tune things that come from C library
# if defined (__STL_VENDOR_GLOBAL_CSTD) || !defined(__STL_USE_NEW_C_HEADERS)
// in old-style headers, C functions go to global scope.
# define __STL_VENDOR_CSTD
# define __STL_USING_VENDOR_CSTD
# else
# define __STL_VENDOR_CSTD __STL_VENDOR_STD
# define __STL_USING_VENDOR_CSTD __STL_USING_NAMESPACE(__STL_VENDOR_CSTD)
# endif /* __STL_VENDOR_CSTD */
// exception, typeinfo, new - always come from the vendor
# ifdef __STL_VENDOR_GLOBAL_EXCEPT_STD
# define __STL_VENDOR_EXCEPT_STD
# else
# define __STL_VENDOR_EXCEPT_STD __STL_VENDOR_STD
# endif
# ifndef __STL_USING_BASE_MEMBER
# define __STL_USING_BASE_MEMBER using
# endif
# else
// compiler has no namespace support
# define __STL_VENDOR_STD
# define __STL_VENDOR_CSTD
# define __STL_USING_BASE_MEMBER
# define __STL_USING_NAMESPACE(x)
# define __STL_USING_VENDOR_CSTD
# define __STL_USING_VENDOR_STD
# define __STL_VENDOR_EXCEPT_STD
# define std
# endif
# if defined (__STL_USE_NAMESPACES)
# if defined (__STL_USE_OWN_NAMESPACE)
# define __STLPORT_STD __STLPORT_NAMESPACE
// make it non-empty right away
namespace __STLPORT_STD { }
# else
# define __STLPORT_STD std
// provide stlport:: as equivalent namespace for portability anyways
namespace std { }
// this is safe as without USE_OWN_NAMESPACE we do not redefine std
namespace __STLPORT_NAMESPACE = __STLPORT_STD;
# endif /* __STL_USE_OWN_NAMESPACE */
// SGI terms
# define __STD_QUALIFIER __STLPORT_STD::
# define __STL_BEGIN_NAMESPACE namespace __STLPORT_STD {
# define __STL_END_NAMESPACE }
# define __STL_USE_NAMESPACE_FOR_RELOPS
// decide whether or not we use separate namespace for rel ops
# if /* defined(__STL_FUNCTION_TMPL_PARTIAL_ORDER) && */ \
!defined(__STL_NO_RELOPS_NAMESPACE)
# define __STLPORT_STD_RELOPS __STLPORT_STD::rel_ops
# define __STL_BEGIN_RELOPS_NAMESPACE namespace __STLPORT_STD { namespace rel_ops {
# define __STL_END_RELOPS_NAMESPACE } }
# define __STL_USE_SEPARATE_RELOPS_NAMESPACE
# else /* Use std::rel_ops namespace */
# define __STL_BEGIN_RELOPS_NAMESPACE namespace __STLPORT_STD { namespace rel_ops {}
# define __STL_END_RELOPS_NAMESPACE }
# define __STLPORT_STD_RELOPS __STLPORT_STD
# endif /* Use std::rel_ops namespace */
# else /* __STL_USE_NAMESPACES */
// STLport is being put into global namespace
# define __STLPORT_STD
# define __STL_BEGIN_NAMESPACE
# define __STL_END_NAMESPACE
# undef __STL_USE_NAMESPACE_FOR_RELOPS
# define __STL_BEGIN_RELOPS_NAMESPACE
# define __STL_END_RELOPS_NAMESPACE
# define __STLPORT_STD_RELOPS
// this one is contradiction, so turn it off
# undef __STL_USE_OWN_NAMESPACE
# endif /* __STL_USE_NAMESPACES */
// fbp : never define __STD ! (Borland & MSVC may have contradictory ones )
//#ifndef __BORLANDC__
//# define __STD __STLPORT_STD
//#endif
# ifdef __KCC
# define __STL_VENDOR_MB_NAMESPACE __STL_VENDOR_STD
# else
# define __STL_VENDOR_MB_NAMESPACE __STL_VENDOR_CSTD
# endif
// user level defines for STLport stuff and C-related stuff.
# define STLPORT __STLPORT_STD
# define STLPORT_CSTD __STL_VENDOR_CSTD
#if defined(__STL_BOGUS_TEMPLATE_TYPE_MATCHING_BUG)
// MrCpp erratically matches rope<...> to _CharT if the parameter type of __right is _CharT in operator xx (rope<_CharT,_Alloc>& __left, _CharT __right)
template<class T>
class _stl_trivial_proxy
{
public:
_stl_trivial_proxy(T _rhs):_M_data(_rhs) {}
operator T() const { return _M_data; }
_stl_trivial_proxy& operator= (T _rhs) { _M_data = _rhs; return this*;}
T* operator&() { return &_M_data; }
const T* operator& () const { return &_M_data; }
private:
T _M_data;
};
# define __STL_SIMPLE_TYPE(T) _stl_trivial_proxy<T>
#else
# define __STL_SIMPLE_TYPE(T) T
#endif
// if we are going to use native new iostreams, use native <string> and <stdexcept>
# if defined (__STL_USE_NEW_IOSTREAMS) && \
!defined (__STL_USE_SGI_STRING) && !defined (__STLPORT_NEW_IOSTREAMS)
# define __STL_USE_NATIVE_STRING 1
# define __STL_USE_NATIVE_STDEXCEPT 1
# endif /* __STL_USE_NEW_IOSTREAMS */
# if defined(__STL_MSVC) && defined (__STL_USE_NEW_IOSTREAMS) && \
!defined (__STL_USE_OWN_NAMESPACE) && ! defined (__STL_STD_REBUILD) && defined (__STL_USE_SGI_STRING)
# if !defined (CRTDLL2)
# error "You have to #define CRTDLL2, and to link dynamically to work with <iostream> and SGI <string>, or to #define __STL_OWN_NAMESPACE. Read README.VC++"
# endif /* CRTDLL2 */
# endif /* __STL_MSVC */
# ifndef __STL_RAND48
# define __STL_NO_DRAND48
# endif
// some backwards compatibility
#define __BEGIN_STL_NAMESPACE __STL_BEGIN_NAMESPACE
#define __END_STL_NAMESPACE __STL_END_NAMESPACE
#define __STL_NAMESPACE __STLPORT_STD
# define __STL_NAME(name) __STLPORT_STD::name // Lo Russo Graziano <Graziano.LoRusso@CSELT.IT>
// advanced keywords usage
# ifndef __STL_NO_NEW_STYLE_CASTS
# define __CONST_CAST(__x,__y) const_cast<__x>(__y)
# define __STATIC_CAST(__x,__y) static_cast<__x>(__y)
# define __REINTERPRET_CAST(__x,__y) reinterpret_cast<__x>(__y)
# define __DYNAMIC_CAST(__x,__y) dynamic_cast<__x>(__y)
# else
# define __STATIC_CAST(__x,__y) ((__x)__y)
# define __CONST_CAST(__x,__y) ((__x)__y)
# define __REINTERPRET_CAST(__x,__y) ((__x)__y)
# define __DYNAMIC_CAST(__x,__y) ((__x)__y)
# endif
# ifdef __STL_NEED_TYPENAME
# define typename
# endif
#ifndef __STL_TYPENAME_ON_RETURN_TYPE
# define __STL_TYPENAME_ON_RETURN_TYPE
#endif
# ifdef __STL_NO_TYPENAME_IN_TEMPLATE_HEADER
# define __STL_HEADER_TYPENAME
# else
# define __STL_HEADER_TYPENAME typename
# endif
# ifndef __STL_NO_MEMBER_TEMPLATE_KEYWORD
# define __STL_TEMPLATE template
# else
# define __STL_TEMPLATE
# endif
# ifdef __STL_NEED_EXPLICIT
# define explicit
# endif
# ifndef __STL_NEED_MUTABLE
# define __ASSIGN_MUTABLE(type,x,y) x=y
# else
# define __ASSIGN_MUTABLE(type,x,y) __CONST_CAST(type,x)=y
# define mutable
# endif
# if defined (__STL_NO_SIGNED_BUILTINS)
// old HP-UX don't understand "signed" keyword
# define signed
# endif
# if defined (__STL_LOOP_INLINE_PROBLEMS)
# define __STL_INLINE_LOOP
# else
# define __STL_INLINE_LOOP inline
# endif
//#if defined ( __STL_UNINITIALIZABLE_PRIVATE )
#if 1
# define __PRIVATE public
# define __PROTECTED public
#else
# define __PRIVATE private
# define __PROTECTED protected
#endif
# ifndef __STL_NO_PARTIAL_SPECIALIZATION_SYNTAX
# define __STL_TEMPLATE_NULL template<>
# else
# define __STL_TEMPLATE_NULL
# endif
# ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
# define __STL_DIFFERENCE_TYPE(_Iterator) typename iterator_traits<_Iterator>::difference_type
# else
# define __STL_DIFFERENCE_TYPE(_Iterator) ptrdiff_t
# endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
# ifndef __STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS
# define __STL_NULL_TMPL_ARGS <>
# else
# define __STL_NULL_TMPL_ARGS
# endif
# define __IMPORT_CONTAINER_TYPEDEFS(_Super) \
typedef typename _Super::value_type value_type; \
typedef typename _Super::size_type size_type; \
typedef typename _Super::difference_type difference_type; \
typedef typename _Super::reference reference; \
typedef typename _Super::const_reference const_reference; \
typedef typename _Super::pointer pointer; \
typedef typename _Super::const_pointer const_pointer;
# define __IMPORT_ITERATORS(_Super) \
typedef typename _Super::iterator iterator; \
typedef typename _Super::const_iterator const_iterator;
# define __IMPORT_REVERSE_ITERATORS(_Super) \
typedef typename _Super::const_reverse_iterator const_reverse_iterator; \
typedef typename _Super::reverse_iterator reverse_iterator;
#define __IMPORT_SUPER_COPY_ASSIGNMENT(__derived_name, _Self, _SUPER) \
__derived_name(const _Super& __x) : _SUPER(__x) {} \
_Self& operator=(const _Super& __x) { \
*(_Super*)this = __x; \
return *this; \
} \
__derived_name(const _Self& __x) : _SUPER(__x) {} \
_Self& operator=(const _Self& __x) { \
*(_Super*)this = __x; \
return *this; \
}
# define __IMPORT_WITH_ITERATORS(_Super) \
__IMPORT_CONTAINER_TYPEDEFS(_Super) __IMPORT_ITERATORS(_Super)
# define __IMPORT_WITH_REVERSE_ITERATORS(_Super) \
__IMPORT_WITH_ITERATORS(_Super) __IMPORT_REVERSE_ITERATORS(_Super)
# if defined (__STL_TRIVIAL_CONSTRUCTOR_BUG)
# define __TRIVIAL_CONSTRUCTOR(__type) __type() {}
# else
# define __TRIVIAL_CONSTRUCTOR(__type)
# endif
# if defined (__STL_TRIVIAL_DESTRUCTOR_BUG)
# define __TRIVIAL_DESTRUCTOR(__type) ~__type() {}
# else
# define __TRIVIAL_DESTRUCTOR(__type)
# endif
# define __TRIVIAL_STUFF(__type) \
__TRIVIAL_CONSTRUCTOR(__type) __TRIVIAL_DESTRUCTOR(__type)
# if ! (defined ( __STL_NO_EXCEPTIONS ) || defined (__STL_HAS_NO_EXCEPTIONS) \
|| defined ( __STL_USE_EXCEPTIONS ))
# define __STL_USE_EXCEPTIONS
# endif
# ifdef __STL_USE_EXCEPTIONS
# define __STL_TRY try
# define __STL_CATCH_ALL catch(...)
# define __STL_THROW(x) throw x
# define __STL_RETHROW throw
# define __STL_UNWIND(action) catch(...) { action; throw; }
# if !defined ( __STL_NO_EXCEPTION_SPEC )
# define __STL_THROWS(x) throw x
# define __STL_NOTHROW throw()
# else
# define __STL_THROWS(x)
# define __STL_NOTHROW
# endif
# else
# define __STL_TRY
# define __STL_CATCH_ALL if (false)
# define __STL_THROW(x)
# define __STL_RETHROW
# define __STL_UNWIND(action)
# define __STL_THROWS(x)
# define __STL_NOTHROW
# endif
// inclusion of vendor's library headers tuning,
# if !defined(__STL_MAKE_HEADER)
# define __STL_MAKE_HEADER(path, header) <path/header>
# endif
#if !defined (__STL_NATIVE_HEADER)
# if !defined (__STL_NATIVE_INCLUDE_PATH)
# define __STL_NATIVE_INCLUDE_PATH ../include
# endif
# define __STL_NATIVE_HEADER(header) __STL_MAKE_HEADER(__STL_NATIVE_INCLUDE_PATH,header)
#endif
// For some compilers, C headers like <stdio.h> are located in separate directory
#if !defined (__STL_NATIVE_C_HEADER)
# if !defined (__STL_NATIVE_C_INCLUDE_PATH)
# define __STL_NATIVE_C_INCLUDE_PATH __STL_NATIVE_INCLUDE_PATH
# endif
# define __STL_NATIVE_C_HEADER(header) __STL_MAKE_HEADER(__STL_NATIVE_C_INCLUDE_PATH,header)
#endif
// For some compilers, C-library headers like <cstdio> are located in separate directory
#if !defined (__STL_NATIVE_CPP_C_HEADER)
# if !defined (__STL_NATIVE_CPP_C_INCLUDE_PATH)
# define __STL_NATIVE_CPP_C_INCLUDE_PATH __STL_NATIVE_INCLUDE_PATH
# endif
# define __STL_NATIVE_CPP_C_HEADER(header) __STL_MAKE_HEADER(__STL_NATIVE_CPP_C_INCLUDE_PATH,header)
#endif
# if defined (__IBMCPP__) && (__IBMCPP__ < 400)
# include <isynonym.hpp>
# if defined (__OS400__) // rolandh
typedef int bool;
# elif !( defined (__xlC__) || defined (_AIX))
typedef Boolean bool;
# endif
# else
# if defined(__STL_YVALS_H)
# if defined ( __STL_REDEFINE_STD )
# undef std
# endif
# include <yvals.h>
# if defined ( __STL_REDEFINE_STD )
# define std __STLPORT_NAMESPACE
# endif
# else
# if defined(__STL_NO_BOOL)
# if defined (__STL_DONT_USE_BOOL_TYPEDEF)
# define bool int
# else
typedef int bool;
# endif
# define true 1
# define false 0
# else
# define __STL_BOOL_KEYWORD 1
# endif /* __STL_NO_BOOL */
# endif
# endif /* __IBMCPP__ */
# ifndef __STL_MPW_EXTRA_CONST
# define __STL_MPW_EXTRA_CONST
# endif
# ifndef __STL_DEFAULTCHAR
# define __STL_DEFAULTCHAR char
# endif
# if defined (__STL_DEBUG_ALLOC) && ! defined (__STL_ASSERTIONS)
# define __STL_ASSERTIONS 1
# endif
# if defined (__STL_DEBUG_UNINITIALIZED) || defined (__STL_DEBUG_ALLOC)
// uninitialized value filler
# ifndef __STL_SHRED_BYTE
# ifdef __STL_MAC
// This value is designed to cause problems on the Mac if an error occurs
# define __STL_SHRED_BYTE 0xA3
# else
# define __STL_SHRED_BYTE 0xFF
# endif
# endif /* __STL_SHRED_BYTE */
# else
// turn off filling
# undef __STL_SHRED_BYTE
# endif /* (__STL_DEBUG_UNINITIALIZED) || (__STL_DEBUG_ALLOC) */
// shared library tune-up
// get the right keywords fron the config
// import functions is all we need unless we use exports ourselves
# ifndef __STL_IMPORT_DECLSPEC
# define __STL_IMPORT_DECLSPEC
# endif
# if defined (__STL_USE_DECLSPEC) /* using export/import technique */
# ifndef __STL_EXPORT_DECLSPEC
# define __STL_EXPORT_DECLSPEC
# endif
# ifndef __STL_CLASS_EXPORT_DECLSPEC
# define __STL_CLASS_EXPORT_DECLSPEC
# endif
# ifndef __STL_CLASS_IMPORT_DECLSPEC
# define __STL_CLASS_IMPORT_DECLSPEC
# endif
// a keyword used to instantiate export template
# ifndef __STL_EXPORT_TEMPLATE_KEYWORD
# define __STL_EXPORT_TEMPLATE_KEYWORD
# endif
# ifndef __STL_IMPORT_TEMPLATE_KEYWORD
# define __STL_IMPORT_TEMPLATE_KEYWORD
# endif
# if defined (__STL_DESIGNATED_DLL) /* This is a DLL which will contain STLport exports */
# define __STL_DECLSPEC __STL_EXPORT_DECLSPEC
# define __STL_CLASS_DECLSPEC __STL_CLASS_EXPORT_DECLSPEC
# define __STL_EXPORT __STL_EXPORT_TEMPLATE_KEYWORD
# else
# define __STL_DECLSPEC __STL_IMPORT_DECLSPEC /* Other modules, importing STLport exports */
# define __STL_CLASS_DECLSPEC __STL_CLASS_IMPORT_DECLSPEC
# define __STL_EXPORT __STL_IMPORT_TEMPLATE_KEYWORD
# endif
# else /* Not using DLL export/import mechanism */
# define __STL_DECLSPEC
# define __STL_CLASS_DECLSPEC
# define __STL_EXPORT
# endif
# ifdef __STL_PARTIAL_SPEC_NEEDS_TEMPLATE_ARGS
# define __STL_PSPEC2(t1,t2) < t1,t2 >
# define __STL_PSPEC3(t1,t2,t3) < t1,t2,t3 >
# else
# define __STL_PSPEC2(t1,t2) /* nothing */
# define __STL_PSPEC3(t1,t2,t3) /* nothing */
# endif
# if !defined (__STL_CLASS_PARTIAL_SPECIALIZATION)
# if !( defined (__SGI_STL_NO_ARROW_OPERATOR) && defined (__SGI_STL_NO_PROXY_ARROW_OPERATOR)) \
&& !defined (__STL_NO_MSVC50_COMPATIBILITY) && !defined (__STL_MSVC50_COMPATIBILITY)
// this one is needed for proper reverse_iterator<> operator ->() handling
# define __STL_MSVC50_COMPATIBILITY 1
# endif
# endif
// some cleanup
# undef __STL_PARTIAL_SPECIALIZATION_SYNTAX
# undef __STL_DONT_USE_BOOL_TYPEDEF
# undef __STL_YVALS_H
# undef __STL_LOOP_INLINE_PROBLEMS
# undef __STL_NEED_EXPLICIT
# undef __STL_NEED_TYPENAME
# undef __STL_NO_NEW_STYLE_CASTS
# undef __AUTO_CONFIGURED
# define __STL_CONFIG_H_DONE 1
#endif /* __STL_CONFIG_H */
// Local Variables:
// mode:C++
// End:
@@ -0,0 +1,144 @@
/*
*
* 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 __SGI_STL_INTERNAL_CONSTRUCT_H
#define __SGI_STL_INTERNAL_CONSTRUCT_H
# if defined (__STL_DEBUG_UNINITIALIZED) && ! defined (__STLPORT_CSTRING)
# include <cstring>
# endif
# ifndef __STLPORT_NEW
# include <new>
# endif
# ifndef __TYPE_TRAITS_H
# include <type_traits.h>
# endif
#ifndef __SGI_STL_INTERNAL_ITERATOR_BASE_H
# include <stl_iterator_base.h>
#endif
__STL_BEGIN_NAMESPACE
# ifdef __STL_TRIVIAL_DESTRUCTOR_BUG
template <class _Tp>
inline void __destroy_aux(_Tp* __pointer, __false_type) { __pointer->~_Tp(); }
template <class _Tp>
inline void __destroy_aux(_Tp* __pointer, __true_type) {}
# endif
template <class _Tp>
inline void destroy(_Tp* __pointer) {
# if _MSC_VER >= 1010
__pointer;
# endif // _MSC_VER >= 1000
# ifdef __STL_TRIVIAL_DESTRUCTOR_BUG
typedef typename __type_traits<_Tp>::has_trivial_destructor
_Trivial_destructor;
__destroy_aux(__pointer, _Trivial_destructor());
# else
# if ( defined (__BORLANDC__) && ( __BORLANDC__ < 0x500 ) )
__pointer->_Tp::~_Tp();
# else
__pointer->~_Tp();
# endif
# endif
# ifdef __STL_DEBUG_UNINITIALIZED
memset((char*)__pointer, (char)__STL_SHRED_BYTE, sizeof(_Tp));
# endif
}
# if defined (new)
# define __STL_NEW_REDEFINE new
# undef new
# endif
template <class _T1, class _T2>
inline void construct(_T1* __p, const _T2& __value) {
# ifdef __STL_DEBUG_UNINITIALIZED
memset((char*)__p, (char)__STL_SHRED_BYTE, sizeof(_T1));
# endif
__STL_PLACEMENT_NEW (__p) _T1(__value);
}
template <class _T1>
inline void construct(_T1* __p) {
# ifdef __STL_DEBUG_UNINITIALIZED
memset((char*)__p, (char)__STL_SHRED_BYTE, sizeof(_T1));
# endif
__STL_PLACEMENT_NEW (__p) _T1();
}
# if defined(__STL_NEW_REDEFINE)
# ifdef DEBUG_NEW
# define new DEBUG_NEW
# endif
# undef __STL_NEW_REDEFINE
# endif
template <class _ForwardIterator>
__STL_INLINE_LOOP void
__destroy_aux(_ForwardIterator __first, _ForwardIterator __last, __false_type)
{
for ( ; __first != __last; ++__first)
destroy(&*__first);
}
template <class _ForwardIterator>
inline void __destroy_aux(_ForwardIterator, _ForwardIterator, __true_type) {}
template <class _ForwardIterator, class _Tp>
inline void
__destroy(_ForwardIterator __first, _ForwardIterator __last, _Tp*)
{
typedef typename __type_traits<_Tp>::has_trivial_destructor
_Trivial_destructor;
__destroy_aux(__first, __last, _Trivial_destructor());
}
template <class _ForwardIterator>
inline void destroy(_ForwardIterator __first, _ForwardIterator __last) {
__destroy(__first, __last, __VALUE_TYPE(__first));
}
inline void destroy(char*, char*) {}
# ifdef __STL_HAS_WCHAR_T // dwa 8/15/97
inline void destroy(wchar_t*, wchar_t*) {}
inline void destroy(const wchar_t*, const wchar_t*) {}
# endif
__STL_END_NAMESPACE
#endif /* __SGI_STL_INTERNAL_CONSTRUCT_H */
// Local Variables:
// mode:C++
// End:
@@ -0,0 +1,69 @@
/*
* Copyright (c) 1999
* 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.
*/
// WARNING: This is an internal header file, included by other C++
// standard library headers. You should not attempt to use this header
// file directly.
#ifndef __SGI_STL_INTERNAL_CTRAITS_FUNCTIONS_H
#define __SGI_STL_INTERNAL_CTRAITS_FUNCTIONS_H
// This file contains a few small adapters that allow a character
// traits class to be used as a function object.
__STL_BEGIN_NAMESPACE
template <class _Traits>
struct _Eq_traits
: public binary_function<typename _Traits::char_type,
typename _Traits::char_type,
bool>
{
bool operator()(const typename _Traits::char_type& __x,
const typename _Traits::char_type& __y) const
{ return _Traits::eq(__x, __y); }
};
template <class _Traits>
struct _Eq_int_traits
: public binary_function<typename _Traits::char_type,
typename _Traits::int_type,
bool>
{
bool operator()(const typename _Traits::char_type& __x,
const typename _Traits::int_type& __y) const
{ return _Traits::eq_int_type(_Traits::to_int_type(__x), __y); }
};
template <class _Traits>
struct _Lt_traits
: public binary_function<typename _Traits::char_type,
typename _Traits::char_type,
bool>
{
bool operator()(const typename _Traits::char_type& __x,
const typename _Traits::char_type& __y) const
{ return _Traits::lt(__x, __y); }
};
__STL_END_NAMESPACE
#endif /* __SGI_STL_INTERNAL_CTRAITS_FUNCTIONS_H */
// Local Variables:
// mode:C++
// End:
@@ -0,0 +1,925 @@
/*
*
*
* 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 __STL_DEQUE_C
#define __STL_DEQUE_C
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#pragma set woff 1174
#pragma set woff 1375
#endif
# undef deque
# if defined ( __STL_NO_DEFAULT_NON_TYPE_PARAM )
# define deque __deque
# else
# define deque __WORKAROUND_RENAME(deque)
# endif
__STL_BEGIN_NAMESPACE
# ifdef __STL_DEBUG
// this hack is horrible, but, given no Alloc parameter
// for _Deque_iterator, we are not able to restore full deque structure anyways
template <class _Tp>
struct _Deq_iter_guts : public __owned_link {
_Tp* _M_cur;
_Tp* _M_first;
_Tp* _M_last;
_Tp** _M_node;
bool _M_unsafe;
};
// We do not send __ptr as _Tp*, as only void* is guaranteed to hold any pointer
template <class _Tp>
bool __Deq_dereferenceable(const void* __ptr, _Tp*) {
typedef _Deq_iter_guts<_Tp> _Guts;
const _Guts * __guts = (const _Guts*)(void*)__ptr;
__stl_verbose_return(__guts->_Valid(), _StlMsg_INVALID_ITERATOR);
if (__guts->_M_unsafe) return true;
const _Guts* __start = (const _Guts*)(__guts->_Owner()->_Owner());
const _Guts* __finish = __start+1;
__stl_verbose_return(
((__guts->_M_node == __finish->_M_node) ? /* *__guts < *__finish */
(__guts->_M_cur < __finish->_M_cur) : (__guts->_M_node < __finish->_M_node)) &&
!((__guts->_M_node == __start->_M_node) ? /* ! (*__guts < *__start) */
(__guts->_M_cur < __start->_M_cur) : (__guts->_M_node < __start->_M_node)),
_StlMsg_NOT_DEREFERENCEABLE);
return true;
}
template <class _Tp>
bool __Deq_nonsingular(const void* __ptr, _Tp*) {
typedef _Deq_iter_guts<_Tp> _Guts;
const _Guts * __guts = (const _Guts*)(void*)__ptr;
__stl_verbose_return(__guts->_Valid(), _StlMsg_INVALID_ITERATOR);
if (__guts->_M_unsafe) return true;
const _Guts* __start = (const _Guts*)(__guts->_Owner()->_Owner());
const _Guts* __finish = __start+1;
__stl_verbose_return(
!(((__guts->_M_node == __finish->_M_node) ? /* *__guts > *__finish */
(__guts->_M_cur > __finish->_M_cur) : (__guts->_M_node > __finish->_M_node)) ||
((__guts->_M_node == __start->_M_node) ? /* (*__guts < *__start) */
(__guts->_M_cur < __start->_M_cur) : (__guts->_M_node < __start->_M_node))),
_StlMsg_SINGULAR_ITERATOR);
return true;
}
# endif
// Non-inline member functions from _Deque_base.
template <class _Tp, class _Alloc, size_t __bufsiz>
_Deque_base<_Tp,_Alloc,__bufsiz>::~_Deque_base() {
if (_M_map._M_data) {
_M_destroy_nodes(_M_start._M_node, _M_finish._M_node + 1);
_M_map.deallocate(_M_map._M_data, _M_map_size._M_data);
}
// should be done here instead of ~deque to ensure
// no detach is ever possible
__stl_debug_do(_M_start._Invalidate());
__stl_debug_do(_M_finish._Invalidate());
}
template <class _Tp, class _Alloc, size_t __bufsiz>
void
_Deque_base<_Tp,_Alloc,__bufsiz>::_M_initialize_map(size_t __num_elements)
{
size_t __num_nodes =
__num_elements / __deque_buf_size(__bufsiz, sizeof(_Tp)) + 1;
_M_map_size._M_data = max((size_t) _S_initial_map_size, __num_nodes + 2);
_M_map._M_data = _M_map.allocate(_M_map_size._M_data);
_Tp** __nstart = _M_map._M_data + (_M_map_size._M_data - __num_nodes) / 2;
_Tp** __nfinish = __nstart + __num_nodes;
__STL_TRY {
_M_create_nodes(__nstart, __nfinish);
}
__STL_UNWIND((_M_map.deallocate(_M_map._M_data, _M_map_size._M_data),
_M_map._M_data = 0, _M_map_size._M_data = 0));
_M_start._M_set_node(__nstart);
_M_finish._M_set_node(__nfinish - 1);
_M_start._M_cur = _M_start._M_first;
_M_finish._M_cur = _M_finish._M_first +
__num_elements % __deque_buf_size(__bufsiz, sizeof(_Tp));
}
template <class _Tp, class _Alloc, size_t __bufsiz>
void
_Deque_base<_Tp,_Alloc,__bufsiz>::_M_create_nodes(_Tp** __nstart,
_Tp** __nfinish)
{
_Tp** __cur;
__STL_TRY {
for (__cur = __nstart; __cur < __nfinish; ++__cur)
*__cur = _M_map_size.allocate(__buf_traits::_buf_size);
}
__STL_UNWIND(_M_destroy_nodes(__nstart, __cur));
}
template <class _Tp, class _Alloc, size_t __bufsiz>
void
_Deque_base<_Tp,_Alloc,__bufsiz>::_M_destroy_nodes(_Tp** __nstart,
_Tp** __nfinish)
{
for (_Tp** __n = __nstart; __n < __nfinish; ++__n)
_M_map_size.deallocate(*__n, __buf_traits::_buf_size);
}
// Non-inline member functions
# if defined ( __STL_NESTED_TYPE_PARAM_BUG )
// qualified references
# define __iterator__ _Deque_iterator<_Tp, _Nonconst_traits<_Tp>, _Buf_size_traits<_Tp, __bufsiz> >
# define const_iterator _Deque_iterator<_Tp, _Const_traits<_Tp>, _Buf_size_traits<_Tp, __bufsiz> >
# define iterator __iterator__
# define size_type size_t
# define value_type _Tp
# else
# define __iterator__ __STL_TYPENAME_ON_RETURN_TYPE deque<_Tp, _Alloc, __bufsiz>::iterator
# endif
template <class _Tp, class _Alloc, size_t __bufsiz>
deque<_Tp, _Alloc, __bufsiz>&
deque<_Tp, _Alloc, __bufsiz>::operator= (const deque<_Tp, _Alloc, __bufsiz>& __x) {
const size_type __len = size();
if (&__x != this) {
if (__len >= __x.size())
erase(copy(__x.begin(), __x.end(), _M_start), _M_finish);
else {
const_iterator __mid = __x.begin() + difference_type(__len);
copy(__x.begin(), __mid, _M_start);
insert(_M_finish, __mid, __x.end());
}
}
__stl_debug_do(_Invalidate_all());
return *this;
}
template <class _Tp, class _Alloc, size_t __bufsiz>
void
deque<_Tp, _Alloc, __bufsiz>::_M_fill_insert(iterator __pos,
size_type __n, const value_type& __x)
{
__stl_debug_check(__check_if_owner(&_M_iter_list, __pos));
if (__pos._M_cur == _M_start._M_cur) {
iterator __new_start = _M_reserve_elements_at_front(__n);
__STL_TRY {
uninitialized_fill(__new_start, _M_start, __x);
}
__STL_UNWIND(_M_destroy_nodes(__new_start._M_node, _M_start._M_node));
_M_start = __new_start;
__stl_debug_do(_M_orphan_start());
}
else if (__pos._M_cur == _M_finish._M_cur) {
iterator __new_finish = _M_reserve_elements_at_back(__n);
__STL_TRY {
uninitialized_fill(_M_finish, __new_finish, __x);
}
__STL_UNWIND(_M_destroy_nodes(_M_finish._M_node+1, __new_finish._M_node+1));
_M_finish = __new_finish;
__stl_debug_do(_M_orphan_finish());
}
else
_M_insert_aux(__pos, __n, __x);
}
#ifndef __STL_MEMBER_TEMPLATES
template <class _Tp, class _Alloc, size_t __bufsiz>
void deque<_Tp, _Alloc, __bufsiz>::insert(iterator __pos,
const value_type* __first,
const value_type* __last) {
__stl_debug_check(__check_if_owner(&_M_iter_list, __pos));
size_type __n = __last - __first;
if (__pos._M_cur == _M_start._M_cur) {
iterator __new_start = _M_reserve_elements_at_front(__n);
__STL_TRY {
uninitialized_copy(__first, __last, __new_start);
}
__STL_UNWIND(_M_destroy_nodes(__new_start._M_node, _M_start._M_node));
_M_start = __new_start;
__stl_debug_do(_M_orphan_start());
}
else if (__pos._M_cur == _M_finish._M_cur) {
iterator __new_finish = _M_reserve_elements_at_back(__n);
__STL_TRY {
uninitialized_copy(__first, __last, _M_finish);
}
__STL_UNWIND(_M_destroy_nodes(_M_finish._M_node + 1,
__new_finish._M_node + 1));
_M_finish = __new_finish;
__stl_debug_do(_M_orphan_finish());
}
else
_M_insert_aux(__pos, __first, __last, __n);
}
template <class _Tp, class _Alloc, size_t __bufsiz>
void deque<_Tp,_Alloc,__bufsiz>::insert(iterator __pos,
const_iterator __first,
const_iterator __last)
{
__stl_debug_check(__check_if_owner(&_M_iter_list, __pos));
size_type __n = __last - __first;
if (__pos._M_cur == _M_start._M_cur) {
iterator __new_start = _M_reserve_elements_at_front(__n);
__STL_TRY {
uninitialized_copy(__first, __last, __new_start);
}
__STL_UNWIND(_M_destroy_nodes(__new_start._M_node, _M_start._M_node));
_M_start = __new_start;
__stl_debug_do(_M_orphan_start());
}
else if (__pos._M_cur == _M_finish._M_cur) {
iterator __new_finish = _M_reserve_elements_at_back(__n);
__STL_TRY {
uninitialized_copy(__first, __last, _M_finish);
}
__STL_UNWIND(_M_destroy_nodes(_M_finish._M_node + 1,__new_finish._M_node + 1));
_M_finish = __new_finish;
__stl_debug_do(_M_orphan_finish());
}
else
_M_insert_aux(__pos, __first, __last, __n);
}
#endif /* __STL_MEMBER_TEMPLATES */
template <class _Tp, class _Alloc, size_t __bufsiz>
__iterator__
deque<_Tp,_Alloc,__bufsiz>::erase(iterator __first, iterator __last)
{
__stl_debug_check(__check_if_owner(&_M_iter_list, __first) && __check_range(__first,__last));
if (__first == _M_start && __last == _M_finish) {
clear();
return _M_finish;
}
else {
difference_type __n = __last - __first;
difference_type __elems_before = __first - _M_start;
if (__elems_before < difference_type(size() - __n) / 2) {
copy_backward(_M_start, __first, __last);
iterator __new_start = _M_start + __n;
destroy(_M_start, __new_start);
_M_destroy_nodes(__new_start._M_node, _M_start._M_node);
_M_start = __new_start;
__stl_debug_do(_M_orphan_start());
}
else {
copy(__last, _M_finish, __first);
iterator __new_finish = _M_finish - __n;
destroy(__new_finish, _M_finish);
_M_destroy_nodes(__new_finish._M_node + 1, _M_finish._M_node + 1);
_M_finish = __new_finish;
__stl_debug_do(_M_orphan_finish());
}
return _M_start + __elems_before;
}
}
template <class _Tp, class _Alloc, size_t __bufsiz>
void deque<_Tp,_Alloc,__bufsiz>::clear()
{
__stl_debug_do(_Invalidate_all());
for (_Map_pointer __node = _M_start._M_node + 1;
__node < _M_finish._M_node;
++__node) {
destroy(*__node, *__node + __buf_traits::_buf_size);
_M_map_size.deallocate(*__node, __buf_traits::_buf_size);
}
if (_M_start._M_node != _M_finish._M_node) {
destroy(_M_start._M_cur, _M_start._M_last);
destroy(_M_finish._M_first, _M_finish._M_cur);
_M_map_size.deallocate(_M_finish._M_first, __buf_traits::_buf_size);
}
else
destroy(_M_start._M_cur, _M_finish._M_cur);
_M_finish = _M_start;
__stl_debug_do(_M_orphan_finish());
}
// Precondition: _M_start and _M_finish have already been initialized,
// but none of the deque's elements have yet been constructed.
template <class _Tp, class _Alloc, size_t __bufsiz>
void
deque<_Tp,_Alloc,__bufsiz>::_M_fill_initialize(const value_type& __value) {
_Map_pointer __cur;
__stl_debug_do(_M_iter_list._Safe_init(&_M_start));
__stl_debug_do(_Init_bounds());
__STL_TRY {
for (__cur = _M_start._M_node; __cur < _M_finish._M_node; ++__cur)
uninitialized_fill(*__cur, *__cur + __buf_traits::_buf_size, __value);
uninitialized_fill(_M_finish._M_first, _M_finish._M_cur, __value);
}
# ifdef __STL_DEBUG
__STL_UNWIND(destroy(_M_start, iterator(&_M_iter_list,*__cur, __cur)));
# else
__STL_UNWIND(destroy(_M_start, iterator(*__cur, __cur)));
# endif
}
// Called only if _M_finish._M_cur == _M_finish._M_last - 1.
template <class _Tp, class _Alloc, size_t __bufsiz>
void
deque<_Tp,_Alloc,__bufsiz>::_M_push_back_aux(const value_type& __t)
{
value_type __t_copy = __t;
_M_reserve_map_at_back();
*(_M_finish._M_node + 1) = _M_map_size.allocate(__buf_traits::_buf_size);
__STL_TRY {
construct(_M_finish._M_cur, __t_copy);
_M_finish._M_set_node(_M_finish._M_node + 1);
_M_finish._M_cur = _M_finish._M_first;
}
__STL_UNWIND(_M_map_size.deallocate(*(_M_finish._M_node + 1),
__buf_traits::_buf_size));
}
// Called only if _M_finish._M_cur == _M_finish._M_last - 1.
template <class _Tp, class _Alloc, size_t __bufsiz>
void
deque<_Tp,_Alloc,__bufsiz>::_M_push_back_aux()
{
_M_reserve_map_at_back();
*(_M_finish._M_node + 1) = _M_map_size.allocate(__buf_traits::_buf_size);
__STL_TRY {
construct(_M_finish._M_cur);
_M_finish._M_set_node(_M_finish._M_node + 1);
_M_finish._M_cur = _M_finish._M_first;
}
__STL_UNWIND(_M_map_size.deallocate(*(_M_finish._M_node + 1),
__buf_traits::_buf_size));
}
// Called only if _M_start._M_cur == _M_start._M_first.
template <class _Tp, class _Alloc, size_t __bufsiz>
void
deque<_Tp,_Alloc,__bufsiz>::_M_push_front_aux(const value_type& __t)
{
value_type __t_copy = __t;
_M_reserve_map_at_front();
*(_M_start._M_node - 1) = _M_map_size.allocate(__buf_traits::_buf_size);
__STL_TRY {
_M_start._M_set_node(_M_start._M_node - 1);
_M_start._M_cur = _M_start._M_last - 1;
construct(_M_start._M_cur, __t_copy);
}
__STL_UNWIND((++_M_start,
_M_map_size.deallocate(*(_M_start._M_node - 1), __buf_traits::_buf_size)));
}
// Called only if _M_start._M_cur == _M_start._M_first.
template <class _Tp, class _Alloc, size_t __bufsiz>
void
deque<_Tp,_Alloc,__bufsiz>::_M_push_front_aux()
{
_M_reserve_map_at_front();
*(_M_start._M_node - 1) = _M_map_size.allocate(__buf_traits::_buf_size);
__STL_TRY {
_M_start._M_set_node(_M_start._M_node - 1);
_M_start._M_cur = _M_start._M_last - 1;
construct(_M_start._M_cur);
}
__STL_UNWIND((++_M_start, _M_map_size.deallocate(*(_M_start._M_node - 1),
__buf_traits::_buf_size )));
}
// Called only if _M_finish._M_cur == _M_finish._M_first.
template <class _Tp, class _Alloc, size_t __bufsiz>
void
deque<_Tp,_Alloc,__bufsiz>::_M_pop_back_aux()
{
_M_map_size.deallocate(_M_finish._M_first, __buf_traits::_buf_size);
_M_finish._M_set_node(_M_finish._M_node - 1);
_M_finish._M_cur = _M_finish._M_last - 1;
destroy(_M_finish._M_cur);
}
// Called only if _M_start._M_cur == _M_start._M_last - 1. Note that
// if the deque has at least one element (a precondition for this member
// function), and if _M_start._M_cur == _M_start._M_last, then the deque
// must have at least two nodes.
template <class _Tp, class _Alloc, size_t __bufsiz>
void
deque<_Tp,_Alloc,__bufsiz>::_M_pop_front_aux()
{
destroy(_M_start._M_cur);
_M_map_size.deallocate(_M_start._M_first, __buf_traits::_buf_size);
_M_start._M_set_node(_M_start._M_node + 1);
_M_start._M_cur = _M_start._M_first;
}
template <class _Tp, class _Alloc, size_t __bufsiz>
__iterator__
deque<_Tp,_Alloc,__bufsiz>::_M_insert_aux_prepare(__iterator__ __pos) {
difference_type __index = __pos - _M_start;
if (__index < difference_type(size() / 2)) {
push_front(front());
iterator __front1 = _M_start;
++__front1;
iterator __front2 = __front1;
++__front2;
__pos = _M_start + __index;
iterator __pos1 = __pos;
++__pos1;
copy(__front2, __pos1, __front1);
}
else {
push_back(back());
iterator __back1 = _M_finish;
--__back1;
iterator __back2 = __back1;
--__back2;
__pos = _M_start + __index;
copy_backward(__pos, __back2, __back1);
}
return __pos;
}
template <class _Tp, class _Alloc, size_t __bufsiz>
__iterator__
deque<_Tp,_Alloc,__bufsiz>::_M_insert_aux(__iterator__ __pos,
const value_type& __x) {
value_type __x_copy = __x;
__pos = _M_insert_aux_prepare(__pos);
*__pos = __x_copy;
return __pos;
}
template <class _Tp, class _Alloc, size_t __bufsiz>
__iterator__
deque<_Tp,_Alloc,__bufsiz>::_M_insert_aux(__iterator__ __pos)
{
__pos = _M_insert_aux_prepare(__pos);
*__pos = value_type();
return __pos;
}
template <class _Tp, class _Alloc, size_t __bufsiz>
void
deque<_Tp,_Alloc,__bufsiz>::_M_insert_aux(iterator __pos,
size_type __n,
const value_type& __x)
{
const difference_type __elems_before = __pos - _M_start;
size_type __length = size();
value_type __x_copy = __x;
if (__elems_before < difference_type(__length / 2)) {
iterator __new_start = _M_reserve_elements_at_front(__n);
iterator __old_start = _M_start;
__pos = _M_start + __elems_before;
__STL_TRY {
if (__elems_before >= difference_type(__n)) {
iterator __start_n = _M_start + difference_type(__n);
uninitialized_copy(_M_start, __start_n, __new_start);
_M_start = __new_start;
__stl_debug_do(_M_orphan_start());
copy(__start_n, __pos, __old_start);
fill(__pos - difference_type(__n), __pos, __x_copy);
}
else {
__uninitialized_copy_fill(_M_start, __pos, __new_start,
_M_start, __x_copy);
_M_start = __new_start;
__stl_debug_do(_M_orphan_start());
fill(__old_start, __pos, __x_copy);
}
}
__STL_UNWIND(_M_destroy_nodes(__new_start._M_node, _M_start._M_node));
}
else {
iterator __new_finish = _M_reserve_elements_at_back(__n);
iterator __old_finish = _M_finish;
const difference_type __elems_after =
difference_type(__length) - __elems_before;
__pos = _M_finish - __elems_after;
__STL_TRY {
if (__elems_after > difference_type(__n)) {
iterator __finish_n = _M_finish - difference_type(__n);
uninitialized_copy(__finish_n, _M_finish, _M_finish);
_M_finish = __new_finish;
__stl_debug_do(_M_orphan_finish());
copy_backward(__pos, __finish_n, __old_finish);
fill(__pos, __pos + difference_type(__n), __x_copy);
}
else {
__uninitialized_fill_copy(_M_finish, __pos + difference_type(__n),
__x_copy, __pos, _M_finish);
_M_finish = __new_finish;
__stl_debug_do(_M_orphan_finish());
fill(__pos, __old_finish, __x_copy);
}
}
__STL_UNWIND(_M_destroy_nodes(_M_finish._M_node + 1, __new_finish._M_node + 1));
}
__stl_debug_do(_Invalidate_all());
}
#ifndef __STL_MEMBER_TEMPLATES
template <class _Tp, class _Alloc, size_t __bufsiz>
void
deque<_Tp,_Alloc,__bufsiz>::_M_insert_aux(iterator __pos,
const value_type* __first,
const value_type* __last,
size_type __n)
{
const difference_type __elemsbefore = __pos - _M_start;
size_type __length = size();
if (__elemsbefore < difference_type(__length / 2)) {
iterator __new_start = _M_reserve_elements_at_front(__n);
iterator __old_start = _M_start;
__pos = _M_start + __elemsbefore;
__STL_TRY {
if (__elemsbefore >= difference_type(__n)) {
iterator __start_n = _M_start + difference_type(__n);
uninitialized_copy(_M_start, __start_n, __new_start);
_M_start = __new_start;
__stl_debug_do(_M_orphan_start());
copy(__start_n, __pos, __old_start);
copy(__first, __last, __pos - difference_type(__n));
}
else {
const value_type* __mid =
__first + (difference_type(__n) - __elemsbefore);
__uninitialized_copy_copy(_M_start, __pos, __first, __mid,
__new_start);
_M_start = __new_start;
__stl_debug_do(_M_orphan_start());
copy(__mid, __last, __old_start);
}
}
__STL_UNWIND(_M_destroy_nodes(__new_start._M_node, _M_start._M_node));
}
else {
iterator __new_finish = _M_reserve_elements_at_back(__n);
iterator __old_finish = _M_finish;
const difference_type __elemsafter =
difference_type(__length) - __elemsbefore;
__pos = _M_finish - __elemsafter;
__STL_TRY {
if (__elemsafter > difference_type(__n)) {
iterator __finish_n = _M_finish - difference_type(__n);
uninitialized_copy(__finish_n, _M_finish, _M_finish);
_M_finish = __new_finish;
__stl_debug_do(_M_orphan_finish());
copy_backward(__pos, __finish_n, __old_finish);
copy(__first, __last, __pos);
}
else {
const value_type* __mid = __first + __elemsafter;
__uninitialized_copy_copy(__mid, __last, __pos, _M_finish, _M_finish);
_M_finish = __new_finish;
__stl_debug_do(_M_orphan_finish());
copy(__first, __mid, __pos);
}
}
__STL_UNWIND(_M_destroy_nodes(_M_finish._M_node + 1, __new_finish._M_node + 1));
}
__stl_debug_do(_Invalidate_all());
}
template <class _Tp, class _Alloc, size_t __bufsiz>
void
deque<_Tp,_Alloc,__bufsiz>::_M_insert_aux(iterator __pos,
const_iterator __first,
const_iterator __last,
size_type __n)
{
const difference_type __elemsbefore = __pos - _M_start;
size_type __length = size();
if (__elemsbefore < difference_type(__length / 2)) {
iterator __new_start = _M_reserve_elements_at_front(__n);
iterator __old_start = _M_start;
__pos = _M_start + __elemsbefore;
__STL_TRY {
if (__elemsbefore >= difference_type(__n)) {
iterator __start_n = _M_start + __n;
uninitialized_copy(_M_start, __start_n, __new_start);
_M_start = __new_start;
__stl_debug_do(_M_orphan_start());
copy(__start_n, __pos, __old_start);
copy(__first, __last, __pos - difference_type(__n));
}
else {
const_iterator __mid = __first + (__n - __elemsbefore);
__uninitialized_copy_copy(_M_start, __pos, __first, __mid,
__new_start);
_M_start = __new_start;
__stl_debug_do(_M_orphan_start());
copy(__mid, __last, __old_start);
}
}
__STL_UNWIND(_M_destroy_nodes(__new_start._M_node, _M_start._M_node));
}
else {
iterator __new_finish = _M_reserve_elements_at_back(__n);
iterator __old_finish = _M_finish;
const difference_type __elemsafter = __length - __elemsbefore;
__pos = _M_finish - __elemsafter;
__STL_TRY {
if (__elemsafter > difference_type(__n)) {
iterator __finish_n = _M_finish - difference_type(__n);
uninitialized_copy(__finish_n, _M_finish, _M_finish);
_M_finish = __new_finish;
__stl_debug_do(_M_orphan_finish());
copy_backward(__pos, __finish_n, __old_finish);
copy(__first, __last, __pos);
}
else {
const_iterator __mid = __first + __elemsafter;
__uninitialized_copy_copy(__mid, __last, __pos, _M_finish, _M_finish);
_M_finish = __new_finish;
__stl_debug_do(_M_orphan_finish());
copy(__first, __mid, __pos);
}
}
__STL_UNWIND(_M_destroy_nodes(_M_finish._M_node + 1, __new_finish._M_node + 1));
}
__stl_debug_do(_Invalidate_all());
}
#endif /* __STL_MEMBER_TEMPLATES */
template <class _Tp, class _Alloc, size_t __bufsiz>
void
deque<_Tp,_Alloc,__bufsiz>::_M_new_elements_at_front(size_type __new_elems)
{
size_type __new_nodes
= (__new_elems + __buf_traits::_buf_size - 1) / __buf_traits::_buf_size;
_M_reserve_map_at_front(__new_nodes);
size_type __i;
__STL_TRY {
for (__i = 1; __i <= __new_nodes; ++__i)
*(_M_start._M_node - __i) = _M_map_size.allocate(__buf_traits::_buf_size);
}
# ifdef __STL_USE_EXCEPTIONS
catch(...) {
for (size_type __j = 1; __j < __i; ++__j)
_M_map_size.deallocate(*(_M_start._M_node - __j), __buf_traits::_buf_size);
throw;
}
# endif /* __STL_USE_EXCEPTIONS */
}
template <class _Tp, class _Alloc, size_t __bufsiz>
void
deque<_Tp,_Alloc,__bufsiz>::_M_new_elements_at_back(size_type __new_elems)
{
size_type __new_nodes
= (__new_elems + __buf_traits::_buf_size - 1) / __buf_traits::_buf_size;
_M_reserve_map_at_back(__new_nodes);
size_type __i;
__STL_TRY {
for (__i = 1; __i <= __new_nodes; ++__i)
*(_M_finish._M_node + __i) = _M_map_size.allocate(__buf_traits::_buf_size);
}
# ifdef __STL_USE_EXCEPTIONS
catch(...) {
for (size_type __j = 1; __j < __i; ++__j)
_M_map_size.deallocate(*(_M_finish._M_node + __j), __buf_traits::_buf_size);
throw;
}
# endif /* __STL_USE_EXCEPTIONS */
}
template <class _Tp, class _Alloc, size_t __bufsiz>
void
deque<_Tp,_Alloc,__bufsiz>::_M_reallocate_map(size_type __nodes_to_add,
bool __add_at_front)
{
size_type __old_num_nodes = _M_finish._M_node - _M_start._M_node + 1;
size_type __new_num_nodes = __old_num_nodes + __nodes_to_add;
_Map_pointer __new_nstart;
if (_M_map_size._M_data > 2 * __new_num_nodes) {
__new_nstart = _M_map._M_data + (_M_map_size._M_data - __new_num_nodes) / 2
+ (__add_at_front ? __nodes_to_add : 0);
if (__new_nstart < _M_start._M_node)
copy(_M_start._M_node, _M_finish._M_node + 1, __new_nstart);
else
copy_backward(_M_start._M_node, _M_finish._M_node + 1,
__new_nstart + __old_num_nodes);
}
else {
size_type __new_map_size =
_M_map_size._M_data + max((size_t)_M_map_size._M_data, __nodes_to_add) + 2;
_Map_pointer __new_map = _M_map.allocate(__new_map_size);
__new_nstart = __new_map + (__new_map_size - __new_num_nodes) / 2
+ (__add_at_front ? __nodes_to_add : 0);
copy(_M_start._M_node, _M_finish._M_node + 1, __new_nstart);
_M_map.deallocate(_M_map._M_data, _M_map_size._M_data);
_M_map._M_data = __new_map;
_M_map_size._M_data = __new_map_size;
}
_M_start._M_set_node(__new_nstart);
_M_finish._M_set_node(__new_nstart + __old_num_nodes - 1);
__stl_debug_do(_Invalidate_all());
}
#if defined (__STL_MEMBER_TEMPLATES) && ! defined (__STL_INLINE_MEMBER_TEMPLATES )
template <class _Tp, class _Alloc, size_t __bufsize>
template <class _InputIterator>
void deque<_Tp,_Alloc,__bufsize>::_M_range_initialize(_InputIterator __first,
_InputIterator __last,
input_iterator_tag) {
_M_initialize_map(0);
__stl_debug_do(_M_iter_list._Safe_init(&_M_start));
__stl_debug_do(_Init_bounds());
__STL_TRY {
for ( ; __first != __last; ++__first)
push_back(*__first);
}
__STL_UNWIND(clear());
}
template <class _Tp, class _Alloc, size_t __bufsize>
template <class _ForwardIterator>
void deque<_Tp,_Alloc,__bufsize>::_M_range_initialize(_ForwardIterator __first,
_ForwardIterator __last,
forward_iterator_tag) {
size_type __n = 0;
distance(__first, __last, __n);
__stl_debug_do(_M_iter_list._Safe_init(&_M_start));
__stl_debug_do(_Init_bounds());
_M_initialize_map(__n);
_Map_pointer __cur_node;
__STL_TRY {
for (__cur_node = _M_start._M_node;
__cur_node < _M_finish._M_node;
++__cur_node) {
_ForwardIterator __mid = __first;
advance(__mid, __buf_traits::_buf_size);
uninitialized_copy(__first, __mid, *__cur_node);
__first = __mid;
}
uninitialized_copy(__first, __last, _M_finish._M_first);
}
# ifdef __STL_DEBUG
__STL_UNWIND(destroy(_M_start, iterator(&_M_iter_list, *__cur_node, __cur_node)));
# else
__STL_UNWIND(destroy(_M_start, iterator(*__cur_node, __cur_node)));
# endif
}
template <class _Tp, class _Alloc, size_t __bufsize>
template <class _ForwardIterator>
void deque<_Tp,_Alloc,__bufsize>::insert(iterator __pos,
_ForwardIterator __first,
_ForwardIterator __last,
forward_iterator_tag)
{
__stl_debug_check(__check_if_owner(&_M_iter_list, __pos));
size_type __n = 0;
distance(__first, __last, __n);
if (__pos._M_cur == _M_start._M_cur) {
iterator __new_start = _M_reserve_elements_at_front(__n);
__STL_TRY {
uninitialized_copy(__first, __last, __new_start);
_M_start = __new_start;
__stl_debug_do(_M_orphan_start());
}
__STL_UNWIND(_M_destroy_nodes(__new_start._M_node, _M_start._M_node));
}
else if (__pos._M_cur == _M_finish._M_cur) {
iterator __new_finish = _M_reserve_elements_at_back(__n);
__STL_TRY {
uninitialized_copy(__first, __last, _M_finish);
_M_finish = __new_finish;
__stl_debug_do(_M_orphan_finish());
}
__STL_UNWIND(_M_destroy_nodes(_M_finish._M_node + 1, __new_finish._M_node + 1));
}
else
_M_insert_aux(__pos, __first, __last, __n);
}
template <class _Tp, class _Alloc, size_t __bufsize>
template <class _ForwardIterator>
void deque<_Tp,_Alloc,__bufsize>::_M_insert_aux(iterator __pos,
_ForwardIterator __first,
_ForwardIterator __last,
size_type __n)
{
const difference_type __elemsbefore = __pos - _M_start;
size_type __length = size();
if (__elemsbefore < difference_type(__length / 2)) {
iterator __new_start = _M_reserve_elements_at_front(__n);
iterator __old_start = _M_start;
__pos = _M_start + __elemsbefore;
__STL_TRY {
if (__elemsbefore >= difference_type(__n)) {
iterator __start_n = _M_start + difference_type(__n);
uninitialized_copy(_M_start, __start_n, __new_start);
_M_start = __new_start;
__stl_debug_do(_M_orphan_start());
copy(__start_n, __pos, __old_start);
copy(__first, __last, __pos - difference_type(__n));
}
else {
_ForwardIterator __mid = __first;
advance(__mid, difference_type(__n) - __elemsbefore);
__uninitialized_copy_copy(_M_start, __pos, __first, __mid,
__new_start);
_M_start = __new_start;
__stl_debug_do(_M_orphan_start());
copy(__mid, __last, __old_start);
}
}
__STL_UNWIND(_M_destroy_nodes(__new_start._M_node, _M_start._M_node));
}
else {
iterator __new_finish = _M_reserve_elements_at_back(__n);
iterator __old_finish = _M_finish;
const difference_type __elemsafter =
difference_type(__length) - __elemsbefore;
__pos = _M_finish - __elemsafter;
__STL_TRY {
if (__elemsafter > difference_type(__n)) {
iterator __finish_n = _M_finish - difference_type(__n);
uninitialized_copy(__finish_n, _M_finish, _M_finish);
_M_finish = __new_finish;
__stl_debug_do(_M_orphan_finish());
copy_backward(__pos, __finish_n, __old_finish);
copy(__first, __last, __pos);
}
else {
_ForwardIterator __mid = __first;
advance(__mid, __elemsafter);
__uninitialized_copy_copy(__mid, __last, __pos, _M_finish, _M_finish);
_M_finish = __new_finish;
__stl_debug_do(_M_orphan_finish());
copy(__first, __mid, __pos);
}
}
__STL_UNWIND(_M_destroy_nodes(_M_finish._M_node + 1, __new_finish._M_node + 1));
}
__stl_debug_do(_Invalidate_all());
}
# endif /* __STL_MEMBER_TEMPLATES */
__STL_END_NAMESPACE
# undef deque
# undef __iterator__
# undef iterator
# undef const_iterator
# undef size_type
# undef value_type
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#pragma reset woff 1174
#pragma reset woff 1375
#endif
#endif /* __STL_DEQUE_C */
// Local Variables:
// mode:C++
// End:
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,791 @@
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Copyright (c) 1996-1998
* 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 __SGI_STL_INTERNAL_FUNCTION_H
#define __SGI_STL_INTERNAL_FUNCTION_H
__STL_BEGIN_NAMESPACE
template <class _Arg, class _Result>
struct unary_function {
typedef _Arg argument_type;
typedef _Result result_type;
};
template <class _Arg1, class _Arg2, class _Result>
struct binary_function {
typedef _Arg1 first_argument_type;
typedef _Arg2 second_argument_type;
typedef _Result result_type;
};
template <class _Tp>
struct plus : public binary_function<_Tp,_Tp,_Tp> {
_Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x + __y; }
};
template <class _Tp>
struct minus : public binary_function<_Tp,_Tp,_Tp> {
_Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x - __y; }
};
template <class _Tp>
struct multiplies : public binary_function<_Tp,_Tp,_Tp> {
_Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x * __y; }
};
template <class _Tp>
struct divides : public binary_function<_Tp,_Tp,_Tp> {
_Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x / __y; }
};
// identity_element (not part of the C++ standard).
template <class _Tp> inline _Tp identity_element(plus<_Tp>) {
return _Tp(0);
}
template <class _Tp> inline _Tp identity_element(multiplies<_Tp>) {
return _Tp(1);
}
template <class _Tp>
struct modulus : public binary_function<_Tp,_Tp,_Tp>
{
_Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x % __y; }
};
template <class _Tp>
struct negate : public unary_function<_Tp,_Tp>
{
_Tp operator()(const _Tp& __x) const { return -__x; }
};
template <class _Tp>
struct equal_to : public binary_function<_Tp,_Tp,bool>
{
bool operator()(const _Tp& __x, const _Tp& __y) const { return __x == __y; }
};
template <class _Tp>
struct not_equal_to : public binary_function<_Tp,_Tp,bool>
{
bool operator()(const _Tp& __x, const _Tp& __y) const { return __x != __y; }
};
template <class _Tp>
struct greater : public binary_function<_Tp,_Tp,bool>
{
bool operator()(const _Tp& __x, const _Tp& __y) const { return __x > __y; }
};
template <class _Tp>
struct less : public binary_function<_Tp,_Tp,bool>
{
bool operator()(const _Tp& __x, const _Tp& __y) const { return __x < __y; }
};
template <class _Tp>
struct greater_equal : public binary_function<_Tp,_Tp,bool>
{
bool operator()(const _Tp& __x, const _Tp& __y) const { return __x >= __y; }
};
template <class _Tp>
struct less_equal : public binary_function<_Tp,_Tp,bool>
{
bool operator()(const _Tp& __x, const _Tp& __y) const { return __x <= __y; }
};
template <class _Tp>
struct logical_and : public binary_function<_Tp,_Tp,bool>
{
bool operator()(const _Tp& __x, const _Tp& __y) const { return __x && __y; }
};
template <class _Tp>
struct logical_or : public binary_function<_Tp,_Tp,bool>
{
bool operator()(const _Tp& __x, const _Tp& __y) const { return __x || __y; }
};
template <class _Tp>
struct logical_not : public unary_function<_Tp,bool>
{
bool operator()(const _Tp& __x) const { return !__x; }
};
# if defined (__STL_BASE_TYPEDEF_BUG)
// this workaround is needed for SunPro 4.0.1
// suggested by "Martin Abernethy" <gma@paston.co.uk>:
// We have to introduce the XXary_predicate_aux structures in order to
// access the argument and return types of predicate functions supplied
// as type parameters. SUN C++ 4.0.1 compiler gives errors for template type parameters
// of the form 'name1::name2', where name1 is itself a type parameter.
template <class _Pair>
struct __pair_aux : private _Pair
{
typedef typename _Pair::first_type first_type;
typedef typename _Pair::second_type second_type;
};
template <class _Operation>
struct __unary_fun_aux : private _Operation
{
typedef typename _Operation::argument_type argument_type;
typedef typename _Operation::result_type result_type;
};
template <class _Operation>
struct __binary_fun_aux : private _Operation
{
typedef typename _Operation::first_argument_type first_argument_type;
typedef typename _Operation::second_argument_type second_argument_type;
typedef typename _Operation::result_type result_type;
};
# define __UNARY_ARG(__Operation,__type) __unary_fun_aux<__Operation>::__type
# define __BINARY_ARG(__Operation,__type) __binary_fun_aux<__Operation>::__type
# define __PAIR_ARG(__Pair,__type) __pair_aux<__Pair>::__type
# else
# define __UNARY_ARG(__Operation,__type) __Operation::__type
# define __BINARY_ARG(__Operation,__type) __Operation::__type
# define __PAIR_ARG(__Pair,__type) __Pair::__type
# endif
template <class _Predicate>
class unary_negate :
public unary_function<typename __UNARY_ARG(_Predicate,argument_type), bool> {
protected:
_Predicate _M_pred;
public:
explicit unary_negate(const _Predicate& __x) : _M_pred(__x) {}
bool operator()(const typename _Predicate::argument_type& __x) const {
return !_M_pred(__x);
}
};
template <class _Predicate>
inline unary_negate<_Predicate>
not1(const _Predicate& __pred)
{
return unary_negate<_Predicate>(__pred);
}
template <class _Predicate>
class binary_negate
: public binary_function<typename __BINARY_ARG(_Predicate,first_argument_type),
typename __BINARY_ARG(_Predicate,second_argument_type),
bool> {
protected:
_Predicate _M_pred;
public:
explicit binary_negate(const _Predicate& __x) : _M_pred(__x) {}
bool operator()(const typename _Predicate::first_argument_type& __x,
const typename _Predicate::second_argument_type& __y) const
{
return !_M_pred(__x, __y);
}
};
template <class _Predicate>
inline binary_negate<_Predicate>
not2(const _Predicate& __pred)
{
return binary_negate<_Predicate>(__pred);
}
template <class _Operation>
class binder1st :
public unary_function<typename __BINARY_ARG(_Operation,second_argument_type),
typename __BINARY_ARG(_Operation,result_type) > {
protected:
_Operation _M_op;
typename _Operation::first_argument_type _M_value;
public:
binder1st(const _Operation& __x,
const typename _Operation::first_argument_type& __y)
: _M_op(__x), _M_value(__y) {}
typename _Operation::result_type
operator()(const typename _Operation::second_argument_type& __x) const {
return _M_op(_M_value, __x);
}
};
template <class _Operation, class _Tp>
inline binder1st<_Operation>
bind1st(const _Operation& __fn, const _Tp& __x)
{
typedef typename _Operation::first_argument_type _Arg1_type;
return binder1st<_Operation>(__fn, _Arg1_type(__x));
}
template <class _Operation>
class binder2nd
: public unary_function<typename __BINARY_ARG(_Operation,first_argument_type),
typename __BINARY_ARG(_Operation,result_type)> {
protected:
_Operation _M_op;
typename _Operation::second_argument_type value;
public:
binder2nd(const _Operation& __x,
const typename _Operation::second_argument_type& __y)
: _M_op(__x), value(__y) {}
typename _Operation::result_type
operator()(const typename _Operation::first_argument_type& __x) const {
return _M_op(__x, value);
}
};
template <class _Operation, class _Tp>
inline binder2nd<_Operation>
bind2nd(const _Operation& __fn, const _Tp& __x)
{
typedef typename _Operation::second_argument_type _Arg2_type;
return binder2nd<_Operation>(__fn, _Arg2_type(__x));
}
// unary_compose and binary_compose (extensions, not part of the standard).
template <class _Operation1, class _Operation2>
class unary_compose :
public unary_function<typename __UNARY_ARG(_Operation2,argument_type),
typename __UNARY_ARG(_Operation1,result_type)> {
protected:
_Operation1 _M_fn1;
_Operation2 _M_fn2;
public:
unary_compose(const _Operation1& __x, const _Operation2& __y)
: _M_fn1(__x), _M_fn2(__y) {}
typename _Operation1::result_type
operator()(const typename _Operation2::argument_type& __x) const {
return _M_fn1(_M_fn2(__x));
}
};
template <class _Operation1, class _Operation2>
inline unary_compose<_Operation1,_Operation2>
compose1(const _Operation1& __fn1, const _Operation2& __fn2)
{
return unary_compose<_Operation1,_Operation2>(__fn1, __fn2);
}
template <class _Operation1, class _Operation2, class _Operation3>
class binary_compose :
public unary_function<typename __UNARY_ARG(_Operation2,argument_type),
typename __BINARY_ARG(_Operation1,result_type)> {
protected:
_Operation1 _M_fn1;
_Operation2 _M_fn2;
_Operation3 _M_fn3;
public:
binary_compose(const _Operation1& __x, const _Operation2& __y,
const _Operation3& __z)
: _M_fn1(__x), _M_fn2(__y), _M_fn3(__z) { }
typename _Operation1::result_type
operator()(const typename _Operation2::argument_type& __x) const {
return _M_fn1(_M_fn2(__x), _M_fn3(__x));
}
};
template <class _Operation1, class _Operation2, class _Operation3>
inline binary_compose<_Operation1, _Operation2, _Operation3>
compose2(const _Operation1& __fn1, const _Operation2& __fn2,
const _Operation3& __fn3)
{
return binary_compose<_Operation1,_Operation2,_Operation3>
(__fn1, __fn2, __fn3);
}
template <class _Arg, class _Result>
class pointer_to_unary_function : public unary_function<_Arg, _Result> {
protected:
_Result (*_M_ptr)(_Arg);
public:
pointer_to_unary_function() {}
explicit pointer_to_unary_function(_Result (*__x)(_Arg)) : _M_ptr(__x) {}
_Result operator()(_Arg __x) const { return _M_ptr(__x); }
};
template <class _Arg, class _Result>
inline pointer_to_unary_function<_Arg, _Result> ptr_fun(_Result (*__x)(_Arg))
{
return pointer_to_unary_function<_Arg, _Result>(__x);
}
template <class _Arg1, class _Arg2, class _Result>
class pointer_to_binary_function :
public binary_function<_Arg1,_Arg2,_Result> {
protected:
_Result (*_M_ptr)(_Arg1, _Arg2);
public:
pointer_to_binary_function() {}
explicit pointer_to_binary_function(_Result (*__x)(_Arg1, _Arg2))
: _M_ptr(__x) {}
_Result operator()(_Arg1 __x, _Arg2 __y) const {
return _M_ptr(__x, __y);
}
};
template <class _Arg1, class _Arg2, class _Result>
inline pointer_to_binary_function<_Arg1,_Arg2,_Result>
ptr_fun(_Result (*__x)(_Arg1, _Arg2)) {
return pointer_to_binary_function<_Arg1,_Arg2,_Result>(__x);
}
// identity is an extension: it is not part of the standard.
template <class _Tp>
struct _Identity : public unary_function<_Tp,_Tp> {
const _Tp& operator()(const _Tp& __x) const { return __x; }
};
template <class _Tp> struct identity : public _Identity<_Tp> {};
# ifdef __STL_USE_ABBREVS
# define _Select1st _S1st
# define _Select2nd _S2nd
# endif
// select1st and select2nd are extensions: they are not part of the standard.
template <class _Pair>
struct _Select1st : public unary_function<_Pair, typename _Pair::first_type> {
const typename _Pair::first_type& operator()(const _Pair& __x) const {
return __x.first;
}
};
template <class _Pair>
struct _Select2nd : public unary_function<_Pair, typename _Pair::second_type>
{
const typename _Pair::second_type& operator()(const _Pair& __x) const {
return __x.second;
}
};
#ifdef __STL_MULTI_CONST_TEMPLATE_ARG_BUG
// fbp : sort of select1st just for maps
template <class _Pair, class _U>
// JDJ (CW Pro1 doesn't like const when first_type is also const)
struct __Select1st_hint : public unary_function<_Pair, _U> {
const _U& operator () (const _Pair& __x) const { return __x.first; }
};
# endif
template <class _Pair> struct select1st : public _Select1st<_Pair> {};
template <class _Pair> struct select2nd : public _Select2nd<_Pair> {};
// project1st and project2nd are extensions: they are not part of the standard
template <class _Arg1, class _Arg2>
struct _Project1st : public binary_function<_Arg1, _Arg2, _Arg1> {
_Arg1 operator()(const _Arg1& __x, const _Arg2&) const { return __x; }
};
template <class _Arg1, class _Arg2>
struct _Project2nd : public binary_function<_Arg1, _Arg2, _Arg2> {
_Arg2 operator()(const _Arg1&, const _Arg2& __y) const { return __y; }
};
template <class _Arg1, class _Arg2>
struct project1st : public _Project1st<_Arg1, _Arg2> {};
template <class _Arg1, class _Arg2>
struct project2nd : public _Project2nd<_Arg1, _Arg2> {};
// constant_void_fun, constant_unary_fun, and constant_binary_fun are
// extensions: they are not part of the standard. (The same, of course,
// is true of the helper functions constant0, constant1, and constant2.)
template <class _Result>
struct _Constant_void_fun {
typedef _Result result_type;
result_type _M_val;
_Constant_void_fun(const result_type& __v) : _M_val(__v) {}
const result_type& operator()() const { return _M_val; }
};
template <class _Result, class _Argument>
struct _Constant_unary_fun {
typedef _Argument argument_type;
typedef _Result result_type;
result_type _M_val;
_Constant_unary_fun(const result_type& __v) : _M_val(__v) {}
const result_type& operator()(const _Argument&) const { return _M_val; }
};
template <class _Result, class _Arg1, class _Arg2>
struct _Constant_binary_fun {
typedef _Arg1 first_argument_type;
typedef _Arg2 second_argument_type;
typedef _Result result_type;
_Result _M_val;
_Constant_binary_fun(const _Result& __v) : _M_val(__v) {}
const result_type& operator()(const _Arg1&, const _Arg2&) const {
return _M_val;
}
};
template <class _Result>
struct constant_void_fun : public _Constant_void_fun<_Result> {
constant_void_fun(const _Result& __v) : _Constant_void_fun<_Result>(__v) {}
};
template <class _Result, __DFL_TMPL_PARAM( _Argument , _Result) >
struct constant_unary_fun : public _Constant_unary_fun<_Result, _Argument>
{
constant_unary_fun(const _Result& __v)
: _Constant_unary_fun<_Result, _Argument>(__v) {}
};
template <class _Result, __DFL_TMPL_PARAM( _Arg1 , _Result), __DFL_TMPL_PARAM( _Arg2 , _Arg1) >
struct constant_binary_fun
: public _Constant_binary_fun<_Result, _Arg1, _Arg2>
{
constant_binary_fun(const _Result& __v)
: _Constant_binary_fun<_Result, _Arg1, _Arg2>(__v) {}
};
template <class _Result>
inline constant_void_fun<_Result> constant0(const _Result& __val)
{
return constant_void_fun<_Result>(__val);
}
template <class _Result>
inline constant_unary_fun<_Result,_Result> constant1(const _Result& __val)
{
return constant_unary_fun<_Result,_Result>(__val);
}
template <class _Result>
inline constant_binary_fun<_Result,_Result,_Result>
constant2(const _Result& __val)
{
return constant_binary_fun<_Result,_Result,_Result>(__val);
}
// subtractive_rng is an extension: it is not part of the standard.
// Note: this code assumes that int is 32 bits.
class subtractive_rng : public unary_function<__STL_UINT32_T, __STL_UINT32_T> {
private:
__STL_UINT32_T _M_table[55];
__STL_UINT32_T _M_index1;
__STL_UINT32_T _M_index2;
public:
__STL_UINT32_T operator()(__STL_UINT32_T __limit) {
_M_index1 = (_M_index1 + 1) % 55;
_M_index2 = (_M_index2 + 1) % 55;
_M_table[_M_index1] = _M_table[_M_index1] - _M_table[_M_index2];
return _M_table[_M_index1] % __limit;
}
void _M_initialize(__STL_UINT32_T __seed)
{
__STL_UINT32_T __k = 1;
_M_table[54] = __seed;
__STL_UINT32_T __i;
for (__i = 0; __i < 54; __i++) {
__STL_UINT32_T __ii = (21 * (__i + 1) % 55) - 1;
_M_table[__ii] = __k;
__k = __seed - __k;
__seed = _M_table[__ii];
}
for (int __loop = 0; __loop < 4; __loop++) {
for (__i = 0; __i < 55; __i++)
_M_table[__i] = _M_table[__i] - _M_table[(1 + __i + 30) % 55];
}
_M_index1 = 0;
_M_index2 = 31;
}
subtractive_rng(unsigned int __seed) { _M_initialize(__seed); }
subtractive_rng() { _M_initialize(161803398ul); }
};
// Adaptor function objects: pointers to member functions.
// There are a total of 16 = 2^4 function objects in this family.
// (1) Member functions taking no arguments vs member functions taking
// one argument.
// (2) Call through pointer vs call through reference.
// (3) Member function with void return type vs member function with
// non-void return type.
// (4) Const vs non-const member function.
// Note that choice (3) is nothing more than a workaround: according
// to the draft, compilers should handle void and non-void the same way.
// This feature is not yet widely implemented, though. You can only use
// member functions returning void if your compiler supports partial
// specialization.
// All of this complexity is in the function objects themselves. You can
// ignore it by using the helper function mem_fun and mem_fun_ref,
// which create whichever type of adaptor is appropriate.
// (mem_fun1 and mem_fun1_ref are no longer part of the C++ standard,
// but they are provided for backward compatibility.)
template <class _Ret, class _Tp>
class mem_fun_t : public unary_function<_Tp*,_Ret> {
typedef _Ret (_Tp::*_fun_type)(void);
public:
explicit mem_fun_t(_fun_type __pf) : _M_f(__pf) {}
_Ret operator()(_Tp* __p) const { return (__p->*_M_f)(); }
private:
_fun_type _M_f;
};
template <class _Ret, class _Tp>
class const_mem_fun_t : public unary_function<const _Tp*,_Ret> {
typedef _Ret (_Tp::*_fun_type)(void) const;
public:
explicit const_mem_fun_t(_fun_type __pf) : _M_f(__pf) {}
_Ret operator()(const _Tp* __p) const { return (__p->*_M_f)(); }
private:
_fun_type _M_f;
};
template <class _Ret, class _Tp>
class mem_fun_ref_t : public unary_function<_Tp,_Ret> {
typedef _Ret (_Tp::*_fun_type)(void);
public:
explicit mem_fun_ref_t(_fun_type __pf) : _M_f(__pf) {}
_Ret operator()(_Tp& __r) const { return (__r.*_M_f)(); }
private:
_fun_type _M_f;
};
template <class _Ret, class _Tp>
class const_mem_fun_ref_t : public unary_function<_Tp,_Ret> {
typedef _Ret (_Tp::*_fun_type)(void) const;
public:
explicit const_mem_fun_ref_t(_fun_type __pf) : _M_f(__pf) {}
_Ret operator()(const _Tp& __r) const { return (__r.*_M_f)(); }
private:
_fun_type _M_f;
};
template <class _Ret, class _Tp, class _Arg>
class mem_fun1_t : public binary_function<_Tp*,_Arg,_Ret> {
typedef _Ret (_Tp::*_fun_type)(_Arg);
public:
explicit mem_fun1_t(_fun_type __pf) : _M_f(__pf) {}
_Ret operator()(_Tp* __p, _Arg __x) const { return (__p->*_M_f)(__x); }
private:
_fun_type _M_f;
};
template <class _Ret, class _Tp, class _Arg>
class const_mem_fun1_t : public binary_function<const _Tp*,_Arg,_Ret> {
typedef _Ret (_Tp::*_fun_type)(_Arg) const;
public:
explicit const_mem_fun1_t(_fun_type __pf) : _M_f(__pf) {}
_Ret operator()(const _Tp* __p, _Arg __x) const
{ return (__p->*_M_f)(__x); }
private:
_fun_type _M_f;
};
template <class _Ret, class _Tp, class _Arg>
class mem_fun1_ref_t : public binary_function<_Tp,_Arg,_Ret> {
typedef _Ret (_Tp::*_fun_type)(_Arg);
public:
explicit mem_fun1_ref_t(_fun_type __pf) : _M_f(__pf) {}
_Ret operator()(_Tp& __r, _Arg __x) const { return (__r.*_M_f)(__x); }
private:
_fun_type _M_f;
};
template <class _Ret, class _Tp, class _Arg>
class const_mem_fun1_ref_t : public binary_function<_Tp,_Arg,_Ret> {
typedef _Ret (_Tp::*_fun_type)(_Arg) const;
public:
explicit const_mem_fun1_ref_t(_fun_type __pf) : _M_f(__pf) {}
_Ret operator()(const _Tp& __r, _Arg __x) const { return (__r.*_M_f)(__x); }
private:
_fun_type _M_f;
};
# ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
template <class _Tp>
class mem_fun_t<void, _Tp> : public unary_function<_Tp*,void> {
typedef void (_Tp::*_fun_type)(void);
public:
explicit mem_fun_t __STL_PSPEC2(void,_Tp) (_fun_type __pf) : _M_f(__pf) {}
void operator()(_Tp* __p) const { (__p->*_M_f)(); }
private:
_fun_type _M_f;
};
template <class _Tp>
class const_mem_fun_t<void, _Tp> : public unary_function<const _Tp*,void> {
typedef void (_Tp::*_fun_type)(void) const;
public:
explicit const_mem_fun_t __STL_PSPEC2(void,_Tp) (_fun_type __pf) : _M_f(__pf) {}
void operator()(const _Tp* __p) const { (__p->*_M_f)(); }
private:
_fun_type _M_f;
};
template <class _Tp>
class mem_fun_ref_t<void, _Tp> : public unary_function<_Tp,void> {
typedef void (_Tp::*_fun_type)(void);
public:
explicit mem_fun_ref_t __STL_PSPEC2(void,_Tp) (_fun_type __pf) : _M_f(__pf) {}
void operator()(_Tp& __r) const { (__r.*_M_f)(); }
private:
_fun_type _M_f;
};
template <class _Tp>
class const_mem_fun_ref_t<void, _Tp> : public unary_function<_Tp,void> {
typedef void (_Tp::*_fun_type)(void) const;
public:
explicit const_mem_fun_ref_t __STL_PSPEC2(void,_Tp) (_fun_type __pf) : _M_f(__pf) {}
void operator()(const _Tp& __r) const { (__r.*_M_f)(); }
private:
_fun_type _M_f;
};
template <class _Tp, class _Arg>
class mem_fun1_t<void, _Tp, _Arg> : public binary_function<_Tp*,_Arg,void> {
typedef void (_Tp::*_fun_type)(_Arg);
public:
explicit mem_fun1_t __STL_PSPEC3(void,_Tp,_Arg) (_fun_type __pf) : _M_f(__pf) {}
void operator()(_Tp* __p, _Arg __x) const { (__p->*_M_f)(__x); }
private:
_fun_type _M_f;
};
template <class _Tp, class _Arg>
class const_mem_fun1_t<void, _Tp, _Arg>
: public binary_function<const _Tp*,_Arg,void> {
typedef void (_Tp::*_fun_type)(_Arg) const;
public:
explicit const_mem_fun1_t __STL_PSPEC3(void,_Tp,_Arg) (_fun_type __pf) : _M_f(__pf) {}
void operator()(const _Tp* __p, _Arg __x) const { (__p->*_M_f)(__x); }
private:
_fun_type _M_f;
};
template <class _Tp, class _Arg>
class mem_fun1_ref_t<void, _Tp, _Arg>
: public binary_function<_Tp,_Arg,void> {
typedef void (_Tp::*_fun_type)(_Arg);
public:
explicit mem_fun1_ref_t __STL_PSPEC3(void,_Tp,_Arg) (_fun_type __pf) : _M_f(__pf) {}
void operator()(_Tp& __r, _Arg __x) const { (__r.*_M_f)(__x); }
private:
_fun_type _M_f;
};
template <class _Tp, class _Arg>
class const_mem_fun1_ref_t<void, _Tp, _Arg>
: public binary_function<_Tp,_Arg,void> {
typedef void (_Tp::*_fun_type)(_Arg) const;
public:
explicit const_mem_fun1_ref_t __STL_PSPEC3(void,_Tp,_Arg) (_fun_type __pf) : _M_f(__pf) {}
void operator()(const _Tp& __r, _Arg __x) const { (__r.*_M_f)(__x); }
private:
_fun_type _M_f;
};
#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
# if !defined (__STL_MEMBER_POINTER_PARAM_BUG)
// Mem_fun adaptor helper functions. There are only two:
// mem_fun and mem_fun_ref. (mem_fun1 and mem_fun1_ref
// are provided for backward compatibility, but they are no longer
// part of the C++ standard.)
template <class _Ret, class _Tp>
inline mem_fun_t<_Ret,_Tp> mem_fun(_Ret (_Tp::*__f)())
{ return mem_fun_t<_Ret,_Tp>(__f); }
template <class _Ret, class _Tp>
inline const_mem_fun_t<_Ret,_Tp> mem_fun(_Ret (_Tp::*__f)() const)
{ return const_mem_fun_t<_Ret,_Tp>(__f); }
template <class _Ret, class _Tp>
inline mem_fun_ref_t<_Ret,_Tp> mem_fun_ref(_Ret (_Tp::*__f)())
{ return mem_fun_ref_t<_Ret,_Tp>(__f); }
template <class _Ret, class _Tp>
inline const_mem_fun_ref_t<_Ret,_Tp> mem_fun_ref(_Ret (_Tp::*__f)() const)
{ return const_mem_fun_ref_t<_Ret,_Tp>(__f); }
template <class _Ret, class _Tp, class _Arg>
inline mem_fun1_t<_Ret,_Tp,_Arg> mem_fun(_Ret (_Tp::*__f)(_Arg))
{ return mem_fun1_t<_Ret,_Tp,_Arg>(__f); }
template <class _Ret, class _Tp, class _Arg>
inline const_mem_fun1_t<_Ret,_Tp,_Arg> mem_fun(_Ret (_Tp::*__f)(_Arg) const)
{ return const_mem_fun1_t<_Ret,_Tp,_Arg>(__f); }
template <class _Ret, class _Tp, class _Arg>
inline mem_fun1_ref_t<_Ret,_Tp,_Arg> mem_fun_ref(_Ret (_Tp::*__f)(_Arg))
{ return mem_fun1_ref_t<_Ret,_Tp,_Arg>(__f); }
template <class _Ret, class _Tp, class _Arg>
inline const_mem_fun1_ref_t<_Ret,_Tp,_Arg>
mem_fun_ref(_Ret (_Tp::*__f)(_Arg) const)
{ return const_mem_fun1_ref_t<_Ret,_Tp,_Arg>(__f); }
template <class _Ret, class _Tp, class _Arg>
inline mem_fun1_t<_Ret,_Tp,_Arg> mem_fun1(_Ret (_Tp::*__f)(_Arg))
{ return mem_fun1_t<_Ret,_Tp,_Arg>(__f); }
template <class _Ret, class _Tp, class _Arg>
inline const_mem_fun1_t<_Ret,_Tp,_Arg> mem_fun1(_Ret (_Tp::*__f)(_Arg) const)
{ return const_mem_fun1_t<_Ret,_Tp,_Arg>(__f); }
template <class _Ret, class _Tp, class _Arg>
inline mem_fun1_ref_t<_Ret,_Tp,_Arg> mem_fun1_ref(_Ret (_Tp::*__f)(_Arg))
{ return mem_fun1_ref_t<_Ret,_Tp,_Arg>(__f); }
template <class _Ret, class _Tp, class _Arg>
inline const_mem_fun1_ref_t<_Ret,_Tp,_Arg>
mem_fun1_ref(_Ret (_Tp::*__f)(_Arg) const)
{ return const_mem_fun1_ref_t<_Ret,_Tp,_Arg>(__f); }
# endif /* __STL_MEMBER_POINTER_PARAM_BUG */
__STL_END_NAMESPACE
#endif /* __SGI_STL_INTERNAL_FUNCTION_H */
// Local Variables:
// mode:C++
// End:
@@ -0,0 +1,107 @@
/*
* Copyright (c) 1996-1998
* 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.
*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* 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. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*/
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
#ifndef __SGI_STL_HASH_FUN_H
#define __SGI_STL_HASH_FUN_H
# ifndef __STLPORT_CSTDDEF
# include <cstddef>
# endif
__STL_BEGIN_NAMESPACE
template <class _Key> struct hash { };
inline size_t __stl_hash_string(const char* __s)
{
__STL_FIX_LITERAL_BUG(__s)
unsigned long __h = 0;
for ( ; *__s; ++__s)
__h = 5*__h + *__s;
return size_t(__h);
}
__STL_TEMPLATE_NULL struct hash<char*>
{
size_t operator()(const char* __s) const { __STL_FIX_LITERAL_BUG(__s) return __stl_hash_string(__s); }
};
__STL_TEMPLATE_NULL struct hash<const char*>
{
size_t operator()(const char* __s) const { __STL_FIX_LITERAL_BUG(__s) return __stl_hash_string(__s); }
};
__STL_TEMPLATE_NULL struct hash<char> {
size_t operator()(char __x) const { return __x; }
};
__STL_TEMPLATE_NULL struct hash<unsigned char> {
size_t operator()(unsigned char __x) const { return __x; }
};
#ifndef __STL_NO_SIGNED_BUILTINS
__STL_TEMPLATE_NULL struct hash<signed char> {
size_t operator()(unsigned char __x) const { return __x; }
};
#endif
__STL_TEMPLATE_NULL struct hash<short> {
size_t operator()(short __x) const { return __x; }
};
__STL_TEMPLATE_NULL struct hash<unsigned short> {
size_t operator()(unsigned short __x) const { return __x; }
};
__STL_TEMPLATE_NULL struct hash<int> {
size_t operator()(int __x) const { return __x; }
};
__STL_TEMPLATE_NULL struct hash<unsigned int> {
size_t operator()(unsigned int __x) const { return __x; }
};
__STL_TEMPLATE_NULL struct hash<long> {
size_t operator()(long __x) const { return __x; }
};
__STL_TEMPLATE_NULL struct hash<unsigned long> {
size_t operator()(unsigned long __x) const { return __x; }
};
# if defined (__STL_LONG_LONG)
__STL_TEMPLATE_NULL struct hash<long long> {
size_t operator()(long x) const { return x; }
};
__STL_TEMPLATE_NULL struct hash<unsigned long long> {
size_t operator()(unsigned long x) const { return x; }
};
# endif
__STL_END_NAMESPACE
#endif /* __SGI_STL_HASH_FUN_H */
// Local Variables:
// mode:C++
// End:
@@ -0,0 +1,614 @@
/*
*
* 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 __SGI_STL_INTERNAL_HASH_MAP_H
#define __SGI_STL_INTERNAL_HASH_MAP_H
__STL_BEGIN_NAMESPACE
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#pragma set woff 1174
#pragma set woff 1375
#endif
# define hash_map __WORKAROUND_RENAME(hash_map)
# define hash_multimap __WORKAROUND_RENAME(hash_multimap)
template <class _Key, class _Tp, __DFL_TMPL_PARAM(_HashFcn,hash<_Key>),
__DFL_TMPL_PARAM(_EqualKey,equal_to<_Key>),
__STL_DEFAULT_PAIR_ALLOCATOR_SELECT(const _Key, _Tp) >
class hash_map
{
private:
# ifdef __STL_MULTI_CONST_TEMPLATE_ARG_BUG
typedef hashtable<pair<const _Key, _Tp>, _Key, _HashFcn,
__Select1st_hint<pair<const _Key, _Tp>, _Key >, _EqualKey, _Alloc> _Ht;
# else
typedef hashtable<pair<const _Key,_Tp>,_Key,_HashFcn,
_Select1st<pair<const _Key,_Tp> >,_EqualKey,_Alloc> _Ht;
# endif
typedef hash_map<_Key, _Tp, _HashFcn, _EqualKey, _Alloc> _Self;
public:
typedef typename _Ht::key_type key_type;
typedef _Tp data_type;
typedef _Tp mapped_type;
typedef typename _Ht::value_type _value_type;
typedef typename _Ht::value_type value_type;
typedef typename _Ht::hasher hasher;
typedef typename _Ht::key_equal key_equal;
typedef typename _Ht::size_type size_type;
typedef typename _Ht::difference_type difference_type;
typedef typename _Ht::pointer pointer;
typedef typename _Ht::const_pointer const_pointer;
typedef typename _Ht::reference reference;
typedef typename _Ht::const_reference const_reference;
typedef typename _Ht::iterator iterator;
typedef typename _Ht::const_iterator const_iterator;
typedef typename _Ht::allocator_type allocator_type;
hasher hash_funct() const { return _M_ht.hash_funct(); }
key_equal key_eq() const { return _M_ht.key_eq(); }
allocator_type get_allocator() const { return _M_ht.get_allocator(); }
private:
_Ht _M_ht;
public:
hash_map() : _M_ht(100, hasher(), key_equal(), allocator_type()) {}
explicit hash_map(size_type __n)
: _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
hash_map(size_type __n, const hasher& __hf)
: _M_ht(__n, __hf, key_equal(), allocator_type()) {}
hash_map(size_type __n, const hasher& __hf, const key_equal& __eql,
const allocator_type& __a = __STL_ALLOC_INSTANCE(allocator_type))
: _M_ht(__n, __hf, __eql, __a) {}
#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator>
hash_map(_InputIterator __f, _InputIterator __l)
: _M_ht(100, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_unique(__f, __l); }
template <class _InputIterator>
hash_map(_InputIterator __f, _InputIterator __l, size_type __n)
: _M_ht(__n, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_unique(__f, __l); }
template <class _InputIterator>
hash_map(_InputIterator __f, _InputIterator __l, size_type __n,
const hasher& __hf)
: _M_ht(__n, __hf, key_equal(), allocator_type())
{ _M_ht.insert_unique(__f, __l); }
template <class _InputIterator>
hash_map(_InputIterator __f, _InputIterator __l, size_type __n,
const hasher& __hf, const key_equal& __eql,
const allocator_type& __a = __STL_ALLOC_INSTANCE(allocator_type))
: _M_ht(__n, __hf, __eql, __a)
{ _M_ht.insert_unique(__f, __l); }
#else
hash_map(const value_type* __f, const value_type* __l)
: _M_ht(100, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_unique(__f, __l); }
hash_map(const value_type* __f, const value_type* __l, size_type __n)
: _M_ht(__n, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_unique(__f, __l); }
hash_map(const value_type* __f, const value_type* __l, size_type __n,
const hasher& __hf)
: _M_ht(__n, __hf, key_equal(), allocator_type())
{ _M_ht.insert_unique(__f, __l); }
hash_map(const value_type* __f, const value_type* __l, size_type __n,
const hasher& __hf, const key_equal& __eql,
const allocator_type& __a = __STL_ALLOC_INSTANCE(allocator_type))
: _M_ht(__n, __hf, __eql, __a)
{ _M_ht.insert_unique(__f, __l); }
hash_map(const_iterator __f, const_iterator __l)
: _M_ht(100, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_unique(__f, __l); }
hash_map(const_iterator __f, const_iterator __l, size_type __n)
: _M_ht(__n, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_unique(__f, __l); }
hash_map(const_iterator __f, const_iterator __l, size_type __n,
const hasher& __hf)
: _M_ht(__n, __hf, key_equal(), allocator_type())
{ _M_ht.insert_unique(__f, __l); }
hash_map(const_iterator __f, const_iterator __l, size_type __n,
const hasher& __hf, const key_equal& __eql,
const allocator_type& __a = __STL_ALLOC_INSTANCE(allocator_type))
: _M_ht(__n, __hf, __eql, __a)
{ _M_ht.insert_unique(__f, __l); }
#endif /*__STL_MEMBER_TEMPLATES */
public:
size_type size() const { return _M_ht.size(); }
size_type max_size() const { return _M_ht.max_size(); }
bool empty() const { return _M_ht.empty(); }
void swap(_Self& __hs) { _M_ht.swap(__hs._M_ht); }
iterator begin() { return _M_ht.begin(); }
iterator end() { return _M_ht.end(); }
const_iterator begin() const { return _M_ht.begin(); }
const_iterator end() const { return _M_ht.end(); }
public:
pair<iterator,bool> insert(const value_type& __obj)
{ return _M_ht.insert_unique(__obj); }
#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator>
void insert(_InputIterator __f, _InputIterator __l)
{ _M_ht.insert_unique(__f,__l); }
#else
void insert(const value_type* __f, const value_type* __l) {
_M_ht.insert_unique(__f,__l);
}
void insert(const_iterator __f, const_iterator __l)
{ _M_ht.insert_unique(__f, __l); }
#endif /*__STL_MEMBER_TEMPLATES */
pair<iterator,bool> insert_noresize(const value_type& __obj)
{ return _M_ht.insert_unique_noresize(__obj); }
iterator find(const key_type& __key) { return _M_ht.find(__key); }
const_iterator find(const key_type& __key) const
{ return _M_ht.find(__key); }
_Tp& operator[](const key_type& __key) {
return _M_ht.find_or_insert(_value_type(__key, _Tp())).second;
}
size_type count(const key_type& __key) const { return _M_ht.count(__key); }
pair<iterator, iterator> equal_range(const key_type& __key)
{ return _M_ht.equal_range(__key); }
pair<const_iterator, const_iterator>
equal_range(const key_type& __key) const
{ return _M_ht.equal_range(__key); }
size_type erase(const key_type& __key) {return _M_ht.erase(__key); }
void erase(iterator __it) { _M_ht.erase(__it); }
void erase(iterator __f, iterator __l) { _M_ht.erase(__f, __l); }
void clear() { _M_ht.clear(); }
void resize(size_type __hint) { _M_ht.resize(__hint); }
size_type bucket_count() const { return _M_ht.bucket_count(); }
size_type max_bucket_count() const { return _M_ht.max_bucket_count(); }
size_type elems_in_bucket(size_type __n) const
{ return _M_ht.elems_in_bucket(__n); }
static bool _M_equal (const _Self& __x, const _Self& __y) {
return _Ht::_M_equal(__x._M_ht,__y._M_ht);
}
};
template <class _Key, class _Tp, class _HashFcn, class _EqlKey, class _Alloc>
inline bool
operator==(const hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1,
const hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm2)
{
return hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>::_M_equal(__hm1, __hm2);
}
#ifdef __STL_USE_SEPARATE_RELOPS_NAMESPACE
template <class _Key, class _Tp, class _HashFcn, class _EqlKey, class _Alloc>
inline bool
operator!=(const hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1,
const hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm2) {
return !(__hm1 == __hm2);
}
template <class _Key, class _Tp, class _HashFcn, class _EqlKey, class _Alloc>
inline void
swap(hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1,
hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm2)
{
__hm1.swap(__hm2);
}
#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
template <class _Key, class _Tp, __DFL_TMPL_PARAM(_HashFcn,hash<_Key>),
__DFL_TMPL_PARAM(_EqualKey,equal_to<_Key>),
__STL_DEFAULT_PAIR_ALLOCATOR_SELECT(const _Key, _Tp) >
class hash_multimap
{
private:
# ifdef __STL_MULTI_CONST_TEMPLATE_ARG_BUG
typedef hashtable<pair<const _Key, _Tp>, _Key, _HashFcn,
__select1st_hint<pair<const _Key, _Tp>, _Key >, _EqualKey, _Alloc> _Ht;
# else
typedef hashtable<pair<const _Key, _Tp>, _Key, _HashFcn,
select1st<pair<const _Key, _Tp> >, _EqualKey, _Alloc> _Ht;
# endif
typedef hash_multimap<_Key, _Tp, _HashFcn, _EqualKey, _Alloc> _Self;
public:
typedef typename _Ht::key_type key_type;
typedef _Tp data_type;
typedef _Tp mapped_type;
typedef typename _Ht::value_type _value_type;
typedef _value_type value_type;
typedef typename _Ht::hasher hasher;
typedef typename _Ht::key_equal key_equal;
typedef typename _Ht::size_type size_type;
typedef typename _Ht::difference_type difference_type;
typedef typename _Ht::pointer pointer;
typedef typename _Ht::const_pointer const_pointer;
typedef typename _Ht::reference reference;
typedef typename _Ht::const_reference const_reference;
typedef typename _Ht::iterator iterator;
typedef typename _Ht::const_iterator const_iterator;
typedef typename _Ht::allocator_type allocator_type;
hasher hash_funct() const { return _M_ht.hash_funct(); }
key_equal key_eq() const { return _M_ht.key_eq(); }
allocator_type get_allocator() const { return _M_ht.get_allocator(); }
private:
_Ht _M_ht;
public:
hash_multimap() : _M_ht(100, hasher(), key_equal(), allocator_type()) {}
explicit hash_multimap(size_type __n)
: _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
hash_multimap(size_type __n, const hasher& __hf)
: _M_ht(__n, __hf, key_equal(), allocator_type()) {}
hash_multimap(size_type __n, const hasher& __hf, const key_equal& __eql,
const allocator_type& __a = __STL_ALLOC_INSTANCE(allocator_type))
: _M_ht(__n, __hf, __eql, __a) {}
#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator>
hash_multimap(_InputIterator __f, _InputIterator __l)
: _M_ht(100, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_equal(__f, __l); }
template <class _InputIterator>
hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n)
: _M_ht(__n, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_equal(__f, __l); }
template <class _InputIterator>
hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n,
const hasher& __hf)
: _M_ht(__n, __hf, key_equal(), allocator_type())
{ _M_ht.insert_equal(__f, __l); }
template <class _InputIterator>
hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n,
const hasher& __hf, const key_equal& __eql,
const allocator_type& __a = __STL_ALLOC_INSTANCE(allocator_type))
: _M_ht(__n, __hf, __eql, __a)
{ _M_ht.insert_equal(__f, __l); }
#else
hash_multimap(const value_type* __f, const value_type* __l)
: _M_ht(100, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_equal(__f, __l); }
hash_multimap(const value_type* __f, const value_type* __l, size_type __n)
: _M_ht(__n, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_equal(__f, __l); }
hash_multimap(const value_type* __f, const value_type* __l, size_type __n,
const hasher& __hf)
: _M_ht(__n, __hf, key_equal(), allocator_type())
{ _M_ht.insert_equal(__f, __l); }
hash_multimap(const value_type* __f, const value_type* __l, size_type __n,
const hasher& __hf, const key_equal& __eql,
const allocator_type& __a = __STL_ALLOC_INSTANCE(allocator_type))
: _M_ht(__n, __hf, __eql, __a)
{ _M_ht.insert_equal(__f, __l); }
hash_multimap(const_iterator __f, const_iterator __l)
: _M_ht(100, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_equal(__f, __l); }
hash_multimap(const_iterator __f, const_iterator __l, size_type __n)
: _M_ht(__n, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_equal(__f, __l); }
hash_multimap(const_iterator __f, const_iterator __l, size_type __n,
const hasher& __hf)
: _M_ht(__n, __hf, key_equal(), allocator_type())
{ _M_ht.insert_equal(__f, __l); }
hash_multimap(const_iterator __f, const_iterator __l, size_type __n,
const hasher& __hf, const key_equal& __eql,
const allocator_type& __a = __STL_ALLOC_INSTANCE(allocator_type))
: _M_ht(__n, __hf, __eql, __a)
{ _M_ht.insert_equal(__f, __l); }
#endif /*__STL_MEMBER_TEMPLATES */
public:
size_type size() const { return _M_ht.size(); }
size_type max_size() const { return _M_ht.max_size(); }
bool empty() const { return _M_ht.empty(); }
void swap(_Self& __hs) { _M_ht.swap(__hs._M_ht); }
iterator begin() { return _M_ht.begin(); }
iterator end() { return _M_ht.end(); }
const_iterator begin() const { return _M_ht.begin(); }
const_iterator end() const { return _M_ht.end(); }
public:
iterator insert(const value_type& __obj)
{ return _M_ht.insert_equal(__obj); }
#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator>
void insert(_InputIterator __f, _InputIterator __l)
{ _M_ht.insert_equal(__f,__l); }
#else
void insert(const value_type* __f, const value_type* __l) {
_M_ht.insert_equal(__f,__l);
}
void insert(const_iterator __f, const_iterator __l)
{ _M_ht.insert_equal(__f, __l); }
#endif /*__STL_MEMBER_TEMPLATES */
iterator insert_noresize(const value_type& __obj)
{ return _M_ht.insert_equal_noresize(__obj); }
iterator find(const key_type& __key) { return _M_ht.find(__key); }
const_iterator find(const key_type& __key) const
{ return _M_ht.find(__key); }
size_type count(const key_type& __key) const { return _M_ht.count(__key); }
pair<iterator, iterator> equal_range(const key_type& __key)
{ return _M_ht.equal_range(__key); }
pair<const_iterator, const_iterator>
equal_range(const key_type& __key) const
{ return _M_ht.equal_range(__key); }
size_type erase(const key_type& __key) {return _M_ht.erase(__key); }
void erase(iterator __it) { _M_ht.erase(__it); }
void erase(iterator __f, iterator __l) { _M_ht.erase(__f, __l); }
void clear() { _M_ht.clear(); }
public:
void resize(size_type __hint) { _M_ht.resize(__hint); }
size_type bucket_count() const { return _M_ht.bucket_count(); }
size_type max_bucket_count() const { return _M_ht.max_bucket_count(); }
size_type elems_in_bucket(size_type __n) const
{ return _M_ht.elems_in_bucket(__n); }
static bool _M_equal (const _Self& __x, const _Self& __y) {
return _Ht::_M_equal(__x._M_ht,__y._M_ht);
}
};
template <class _Key, class _Tp, class _HashFcn, class _EqlKey, class _Alloc>
inline bool
operator==(const hash_multimap<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1,
const hash_multimap<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm2)
{
return hash_multimap<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>::_M_equal(__hm1, __hm2);
}
#ifdef __STL_USE_SEPARATE_RELOPS_NAMESPACE
template <class _Key, class _Tp, class _HashFcn, class _EqlKey, class _Alloc>
inline bool
operator!=(const hash_multimap<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1,
const hash_multimap<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm2) {
return !(__hm1 == __hm2);
}
template <class _Key, class _Tp, class _HashFcn, class _EqlKey, class _Alloc>
inline void
swap(hash_multimap<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1,
hash_multimap<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm2)
{
__hm1.swap(__hm2);
}
#endif /* __STL_USE_SEPARATE_RELOPS_NAMESPACE */
// Specialization of insert_iterator so that it will work for hash_map
// and hash_multimap.
#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
template <class _Key, class _Tp, class _HashFn, class _EqKey, class _Alloc>
class insert_iterator<hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc> > {
protected:
typedef hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc> _Container;
_Container* container;
public:
typedef _Container container_type;
typedef output_iterator_tag iterator_category;
typedef void value_type;
typedef void difference_type;
typedef void pointer;
typedef void reference;
insert_iterator(_Container& __x) : container(&__x) {}
insert_iterator(_Container& __x, typename _Container::iterator)
: container(&__x) {}
insert_iterator<_Container>&
operator=(const typename _Container::value_type& __value) {
container->insert(__value);
return *this;
}
insert_iterator<_Container>& operator*() { return *this; }
insert_iterator<_Container>& operator++() { return *this; }
insert_iterator<_Container>& operator++(int) { return *this; }
};
template <class _Key, class _Tp, class _HashFn, class _EqKey, class _Alloc>
class insert_iterator<hash_multimap<_Key, _Tp, _HashFn, _EqKey, _Alloc> > {
protected:
typedef hash_multimap<_Key, _Tp, _HashFn, _EqKey, _Alloc> _Container;
_Container* container;
typename _Container::iterator iter;
public:
typedef _Container container_type;
typedef output_iterator_tag iterator_category;
typedef void value_type;
typedef void difference_type;
typedef void pointer;
typedef void reference;
insert_iterator(_Container& __x) : container(&__x) {}
insert_iterator(_Container& __x, typename _Container::iterator)
: container(&__x) {}
insert_iterator<_Container>&
operator=(const typename _Container::value_type& __value) {
container->insert(__value);
return *this;
}
insert_iterator<_Container>& operator*() { return *this; }
insert_iterator<_Container>& operator++() { return *this; }
insert_iterator<_Container>& operator++(int) { return *this; }
};
#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
// do a cleanup
# undef hash_map
# undef hash_multimap
# define __hash_map__ __FULL_NAME(hash_map)
# define __hash_multimap__ __FULL_NAME(hash_multimap)
# if defined (__STL_USE_WRAPPER_FOR_ALLOC_PARAM)
// provide a "default" hash_map adaptor
# if defined (__STL_MINIMUM_DEFAULT_TEMPLATE_PARAMS)
# define __HM_TEMPLATE_HEADER template <class _Key, class _Tp>
# define __HM_ARGUMENTS _Key, _Tp
# define __HM_BASE_ARGUMENTS _Key, _Tp, hash<_Key>, equal_to<_Key>, __STL_DEFAULT_PAIR_ALLOCATOR(const _Key, _Tp)
# else
# define __HM_TEMPLATE_HEADER template <class _Key, class _Tp, class _HashFcn, class _EqualKey >
# define __HM_ARGUMENTS _Key, _Tp, _HashFcn, _EqualKey
# define __HM_BASE_ARGUMENTS _Key, _Tp, _HashFcn, _EqualKey, __STL_DEFAULT_PAIR_ALLOCATOR(const _Key, _Tp)
# endif
# define __HM_SUPER __hash_map< __HM_BASE_ARGUMENTS >
# define __HMM_SUPER __hash_multimap< __HM_BASE_ARGUMENTS >
__HM_TEMPLATE_HEADER
class hash_map : public __HM_SUPER
{
typedef hash_map< __HM_ARGUMENTS > _Self;
public:
typedef __HM_SUPER _Super;
__IMPORT_WITH_ITERATORS(_Super)
typedef typename _Super::key_type key_type;
typedef typename _Super::hasher hasher;
typedef typename _Super::key_equal key_equal;
typedef _Tp data_type;
hash_map() {}
hash_map(size_type __n) : __HM_SUPER(__n) {}
hash_map(size_type __n, const hasher& __hf) : __HM_SUPER(__n, __hf) {}
hash_map(size_type __n, const hasher& __hf, const key_equal& __eql): __HM_SUPER(__n, __hf, __eql) {}
hash_map(const value_type* __f, const value_type* __l) : __HM_SUPER(__f,__l) {}
hash_map(const value_type* __f, const value_type* __l, size_type __n): __HM_SUPER(__f,__l,__n) {}
hash_map(const value_type* __f, const value_type* __l, size_type __n,
const hasher& __hf) : __HM_SUPER(__f,__l,__n,__hf) {}
hash_map(const value_type* __f, const value_type* __l, size_type __n,
const hasher& __hf, const key_equal& __eql) : __HM_SUPER(__f,__l,__n,__hf, __eql) {}
hash_map(const_iterator __f, const_iterator __l) : __HM_SUPER(__f,__l) { }
hash_map(const_iterator __f, const_iterator __l, size_type __n) : __HM_SUPER(__f,__l,__n) { }
hash_map(const_iterator __f, const_iterator __l, size_type __n,
const hasher& __hf) : __HM_SUPER(__f, __l, __n, __hf) { }
hash_map(const_iterator __f, const_iterator __l, size_type __n,
const hasher& __hf, const key_equal& __eql) : __HM_SUPER(__f, __l, __n, __hf, __eql) { }
# if defined (__STL_BASE_MATCH_BUG)
friend inline bool operator== __STL_NULL_TMPL_ARGS (const _Self& __hm1, const _Self& __hm2);
# endif
};
# if defined (__STL_BASE_MATCH_BUG)
__HM_TEMPLATE_HEADER
inline bool operator==(const hash_map< __HM_ARGUMENTS >& __hm1,
const hash_map< __HM_ARGUMENTS >& __hm2)
{
typedef __HM_SUPER _Super;
return (const _Super&)__hm1 == (const _Super&)__hm2;
}
# endif
// provide a "default" hash_multimap adaptor
__HM_TEMPLATE_HEADER
class hash_multimap : public __HMM_SUPER
{
typedef hash_multimap< __HM_ARGUMENTS > _Self;
public:
typedef __HMM_SUPER _Super;
__IMPORT_WITH_ITERATORS(_Super)
typedef typename _Super::key_type key_type;
typedef typename _Super::hasher hasher;
typedef typename _Super::key_equal key_equal;
typedef _Tp data_type;
hash_multimap() {}
hash_multimap(size_type __n) : __HMM_SUPER(__n) {}
hash_multimap(size_type __n, const hasher& __hf) : __HMM_SUPER(__n, __hf) {}
hash_multimap(size_type __n, const hasher& __hf, const key_equal& __eql): __HMM_SUPER(__n, __hf, __eql) {}
hash_multimap(const value_type* __f, const value_type* __l) : __HMM_SUPER(__f,__l) {}
hash_multimap(const value_type* __f, const value_type* __l, size_type __n): __HMM_SUPER(__f,__l,__n) {}
hash_multimap(const value_type* __f, const value_type* __l, size_type __n,
const hasher& __hf) : __HMM_SUPER(__f,__l,__n,__hf) {}
hash_multimap(const value_type* __f, const value_type* __l, size_type __n,
const hasher& __hf, const key_equal& __eql) : __HMM_SUPER(__f,__l,__n,__hf, __eql) {}
hash_multimap(const_iterator __f, const_iterator __l) : __HMM_SUPER(__f,__l) { }
hash_multimap(const_iterator __f, const_iterator __l, size_type __n) : __HMM_SUPER(__f,__l,__n) { }
hash_multimap(const_iterator __f, const_iterator __l, size_type __n,
const hasher& __hf) : __HMM_SUPER(__f, __l, __n, __hf) { }
hash_multimap(const_iterator __f, const_iterator __l, size_type __n,
const hasher& __hf, const key_equal& __eql) : __HMM_SUPER(__f, __l, __n, __hf, __eql) { }
# if defined (__STL_BASE_MATCH_BUG)
friend inline bool operator== __STL_NULL_TMPL_ARGS (const _Self& __hm1, const _Self& __hm2);
# endif
};
# if defined (__STL_BASE_MATCH_BUG)
__HM_TEMPLATE_HEADER
inline bool operator==(const hash_multimap< __HM_ARGUMENTS >& __hm1,
const hash_multimap< __HM_ARGUMENTS >& __hm2)
{
typedef __HMM_SUPER _Super;
return (const _Super&)__hm1 == (const _Super&)__hm2;
}
# endif
# undef __HM_SUPER
# undef __HMM_SUPER
# undef __HM_TEMPLATE_HEADER
# undef __HM_ARGUMENTS
# undef __HM_BASE_ARGUMENTS
# endif /* WRAPPER */
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#pragma reset woff 1174
#pragma reset woff 1375
#endif
__STL_END_NAMESPACE
#endif /* __SGI_STL_INTERNAL_HASH_MAP_H */
// Local Variables:
// mode:C++
// End:
@@ -0,0 +1,599 @@
/*
*
* 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 __SGI_STL_INTERNAL_HASH_SET_H
#define __SGI_STL_INTERNAL_HASH_SET_H
__STL_BEGIN_NAMESPACE
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#pragma set woff 1174
#pragma set woff 1375
#endif
# define hash_set __WORKAROUND_RENAME(hash_set)
# define hash_multiset __WORKAROUND_RENAME(hash_multiset)
template <class _Value, __DFL_TMPL_PARAM(_HashFcn,hash<_Value>),
__DFL_TMPL_PARAM(_EqualKey,equal_to<_Value>),
__STL_DEFAULT_ALLOCATOR_SELECT(_Value) >
class hash_set
{
private:
typedef hashtable<_Value, _Value, _HashFcn, _Identity<_Value>,
_EqualKey, _Alloc> _Ht;
typedef hash_set<_Value, _HashFcn, _EqualKey, _Alloc> _Self;
typedef typename _Ht::iterator _ht_iterator;
public:
typedef typename _Ht::key_type key_type;
typedef typename _Ht::value_type value_type;
typedef typename _Ht::hasher hasher;
typedef typename _Ht::key_equal key_equal;
typedef typename _Ht::size_type size_type;
typedef typename _Ht::difference_type difference_type;
typedef typename _Ht::const_pointer pointer;
typedef typename _Ht::const_pointer const_pointer;
typedef typename _Ht::const_reference reference;
typedef typename _Ht::const_reference const_reference;
// SunPro bug
typedef typename _Ht::const_iterator const_iterator;
typedef const_iterator iterator;
typedef typename _Ht::allocator_type allocator_type;
hasher hash_funct() const { return _M_ht.hash_funct(); }
key_equal key_eq() const { return _M_ht.key_eq(); }
allocator_type get_allocator() const { return _M_ht.get_allocator(); }
private:
_Ht _M_ht;
public:
hash_set()
: _M_ht(100, hasher(), key_equal(), allocator_type()) {}
explicit hash_set(size_type __n)
: _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
hash_set(size_type __n, const hasher& __hf)
: _M_ht(__n, __hf, key_equal(), allocator_type()) {}
hash_set(size_type __n, const hasher& __hf, const key_equal& __eql,
const allocator_type& __a = __STL_ALLOC_INSTANCE(allocator_type))
: _M_ht(__n, __hf, __eql, __a) {}
#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator>
hash_set(_InputIterator __f, _InputIterator __l)
: _M_ht(100, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_unique(__f, __l); }
template <class _InputIterator>
hash_set(_InputIterator __f, _InputIterator __l, size_type __n)
: _M_ht(__n, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_unique(__f, __l); }
template <class _InputIterator>
hash_set(_InputIterator __f, _InputIterator __l, size_type __n,
const hasher& __hf)
: _M_ht(__n, __hf, key_equal(), allocator_type())
{ _M_ht.insert_unique(__f, __l); }
template <class _InputIterator>
hash_set(_InputIterator __f, _InputIterator __l, size_type __n,
const hasher& __hf, const key_equal& __eql,
const allocator_type& __a = __STL_ALLOC_INSTANCE(allocator_type))
: _M_ht(__n, __hf, __eql, __a)
{ _M_ht.insert_unique(__f, __l); }
#else
hash_set(const value_type* __f, const value_type* __l)
: _M_ht(100, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_unique(__f, __l); }
hash_set(const value_type* __f, const value_type* __l, size_type __n)
: _M_ht(__n, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_unique(__f, __l); }
hash_set(const value_type* __f, const value_type* __l, size_type __n,
const hasher& __hf)
: _M_ht(__n, __hf, key_equal(), allocator_type())
{ _M_ht.insert_unique(__f, __l); }
hash_set(const value_type* __f, const value_type* __l, size_type __n,
const hasher& __hf, const key_equal& __eql,
const allocator_type& __a = __STL_ALLOC_INSTANCE(allocator_type))
: _M_ht(__n, __hf, __eql, __a)
{ _M_ht.insert_unique(__f, __l); }
hash_set(const_iterator __f, const_iterator __l)
: _M_ht(100, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_unique(__f, __l); }
hash_set(const_iterator __f, const_iterator __l, size_type __n)
: _M_ht(__n, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_unique(__f, __l); }
hash_set(const_iterator __f, const_iterator __l, size_type __n,
const hasher& __hf)
: _M_ht(__n, __hf, key_equal(), allocator_type())
{ _M_ht.insert_unique(__f, __l); }
hash_set(const_iterator __f, const_iterator __l, size_type __n,
const hasher& __hf, const key_equal& __eql,
const allocator_type& __a = __STL_ALLOC_INSTANCE(allocator_type))
: _M_ht(__n, __hf, __eql, __a)
{ _M_ht.insert_unique(__f, __l); }
#endif /*__STL_MEMBER_TEMPLATES */
public:
size_type size() const { return _M_ht.size(); }
size_type max_size() const { return _M_ht.max_size(); }
bool empty() const { return _M_ht.empty(); }
void swap(_Self& __hs) { _M_ht.swap(__hs._M_ht); }
iterator begin() const { return _M_ht.begin(); }
iterator end() const { return _M_ht.end(); }
public:
pair<iterator, bool> insert(const value_type& __obj)
{
pair<_ht_iterator, bool> __p = _M_ht.insert_unique(__obj);
return pair<iterator,bool>((const iterator&)__p.first, __p.second);
}
#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator>
void insert(_InputIterator __f, _InputIterator __l)
{ _M_ht.insert_unique(__f,__l); }
#else
void insert(const value_type* __f, const value_type* __l) {
_M_ht.insert_unique(__f,__l);
}
void insert(const_iterator __f, const_iterator __l)
{_M_ht.insert_unique(__f, __l); }
#endif /*__STL_MEMBER_TEMPLATES */
pair<iterator, bool> insert_noresize(const value_type& __obj)
{
pair<_ht_iterator, bool> __p =
_M_ht.insert_unique_noresize(__obj);
return pair<iterator, bool>(__p.first, __p.second);
}
iterator find(const key_type& __key) const { return _M_ht.find(__key); }
size_type count(const key_type& __key) const { return _M_ht.count(__key); }
pair<iterator, iterator> equal_range(const key_type& __key) const
{ return _M_ht.equal_range(__key); }
size_type erase(const key_type& __key) {return _M_ht.erase(__key); }
void erase(iterator __it) { _M_ht.erase(__it); }
void erase(iterator __f, iterator __l) { _M_ht.erase(__f, __l); }
void clear() { _M_ht.clear(); }
public:
void resize(size_type __hint) { _M_ht.resize(__hint); }
size_type bucket_count() const { return _M_ht.bucket_count(); }
size_type max_bucket_count() const { return _M_ht.max_bucket_count(); }
size_type elems_in_bucket(size_type __n) const
{ return _M_ht.elems_in_bucket(__n); }
static bool _M_equal (const _Self& __x, const _Self& __y) {
return _Ht::_M_equal(__x._M_ht,__y._M_ht);
}
};
template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
inline bool
operator==(const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs1,
const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs2)
{
return hash_set<_Value,_HashFcn,_EqualKey,_Alloc>::_M_equal(__hs1, __hs2);
}
#ifdef __STL_USE_SEPARATE_RELOPS_NAMESPACE
template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
inline bool
operator!=(const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs1,
const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs2) {
return !(__hs1 == __hs2);
}
template <class _Val, class _HashFcn, class _EqualKey, class _Alloc>
inline void
swap(hash_set<_Val,_HashFcn,_EqualKey,_Alloc>& __hs1,
hash_set<_Val,_HashFcn,_EqualKey,_Alloc>& __hs2)
{
__hs1.swap(__hs2);
}
#endif /* __STL_USE_SEPARATE_RELOPS_NAMESPACE */
template <class _Value, __DFL_TMPL_PARAM(_HashFcn,hash<_Value>),
__DFL_TMPL_PARAM(_EqualKey,equal_to<_Value>),
__STL_DEFAULT_ALLOCATOR_SELECT(_Value) >
class hash_multiset
{
private:
typedef hashtable<_Value, _Value, _HashFcn, _Identity<_Value>,
_EqualKey, _Alloc> _Ht;
typedef hash_multiset<_Value, _HashFcn, _EqualKey, _Alloc> _Self;
public:
typedef typename _Ht::key_type key_type;
typedef typename _Ht::value_type value_type;
typedef typename _Ht::hasher hasher;
typedef typename _Ht::key_equal key_equal;
typedef typename _Ht::size_type size_type;
typedef typename _Ht::difference_type difference_type;
typedef typename _Ht::const_pointer pointer;
typedef typename _Ht::const_pointer const_pointer;
typedef typename _Ht::const_reference reference;
typedef typename _Ht::const_reference const_reference;
typedef typename _Ht::const_iterator const_iterator;
// SunPro bug
typedef const_iterator iterator;
typedef typename _Ht::allocator_type allocator_type;
hasher hash_funct() const { return _M_ht.hash_funct(); }
key_equal key_eq() const { return _M_ht.key_eq(); }
allocator_type get_allocator() const { return _M_ht.get_allocator(); }
private:
_Ht _M_ht;
public:
hash_multiset()
: _M_ht(100, hasher(), key_equal(), allocator_type()) {}
explicit hash_multiset(size_type __n)
: _M_ht(__n, hasher(), key_equal(), allocator_type()) {}
hash_multiset(size_type __n, const hasher& __hf)
: _M_ht(__n, __hf, key_equal(), allocator_type()) {}
hash_multiset(size_type __n, const hasher& __hf, const key_equal& __eql,
const allocator_type& __a = __STL_ALLOC_INSTANCE(allocator_type))
: _M_ht(__n, __hf, __eql, __a) {}
#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator>
hash_multiset(_InputIterator __f, _InputIterator __l)
: _M_ht(100, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_equal(__f, __l); }
template <class _InputIterator>
hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n)
: _M_ht(__n, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_equal(__f, __l); }
template <class _InputIterator>
hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n,
const hasher& __hf)
: _M_ht(__n, __hf, key_equal(), allocator_type())
{ _M_ht.insert_equal(__f, __l); }
template <class _InputIterator>
hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n,
const hasher& __hf, const key_equal& __eql,
const allocator_type& __a = __STL_ALLOC_INSTANCE(allocator_type))
: _M_ht(__n, __hf, __eql, __a)
{ _M_ht.insert_equal(__f, __l); }
#else
hash_multiset(const value_type* __f, const value_type* __l)
: _M_ht(100, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_equal(__f, __l); }
hash_multiset(const value_type* __f, const value_type* __l, size_type __n)
: _M_ht(__n, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_equal(__f, __l); }
hash_multiset(const value_type* __f, const value_type* __l, size_type __n,
const hasher& __hf)
: _M_ht(__n, __hf, key_equal(), allocator_type())
{ _M_ht.insert_equal(__f, __l); }
hash_multiset(const value_type* __f, const value_type* __l, size_type __n,
const hasher& __hf, const key_equal& __eql,
const allocator_type& __a = __STL_ALLOC_INSTANCE(allocator_type))
: _M_ht(__n, __hf, __eql, __a)
{ _M_ht.insert_equal(__f, __l); }
hash_multiset(const_iterator __f, const_iterator __l)
: _M_ht(100, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_equal(__f, __l); }
hash_multiset(const_iterator __f, const_iterator __l, size_type __n)
: _M_ht(__n, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_equal(__f, __l); }
hash_multiset(const_iterator __f, const_iterator __l, size_type __n,
const hasher& __hf)
: _M_ht(__n, __hf, key_equal(), allocator_type())
{ _M_ht.insert_equal(__f, __l); }
hash_multiset(const_iterator __f, const_iterator __l, size_type __n,
const hasher& __hf, const key_equal& __eql,
const allocator_type& __a = __STL_ALLOC_INSTANCE(allocator_type))
: _M_ht(__n, __hf, __eql, __a)
{ _M_ht.insert_equal(__f, __l); }
#endif /*__STL_MEMBER_TEMPLATES */
public:
size_type size() const { return _M_ht.size(); }
size_type max_size() const { return _M_ht.max_size(); }
bool empty() const { return _M_ht.empty(); }
void swap(_Self& hs) { _M_ht.swap(hs._M_ht); }
iterator begin() const { return _M_ht.begin(); }
iterator end() const { return _M_ht.end(); }
public:
iterator insert(const value_type& __obj)
{ return _M_ht.insert_equal(__obj); }
#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator>
void insert(_InputIterator __f, _InputIterator __l)
{ _M_ht.insert_equal(__f,__l); }
#else
void insert(const value_type* __f, const value_type* __l) {
_M_ht.insert_equal(__f,__l);
}
void insert(const_iterator __f, const_iterator __l)
{ _M_ht.insert_equal(__f, __l); }
#endif /*__STL_MEMBER_TEMPLATES */
iterator insert_noresize(const value_type& __obj)
{ return _M_ht.insert_equal_noresize(__obj); }
iterator find(const key_type& __key) const { return _M_ht.find(__key); }
size_type count(const key_type& __key) const { return _M_ht.count(__key); }
pair<iterator, iterator> equal_range(const key_type& __key) const
{ return _M_ht.equal_range(__key); }
size_type erase(const key_type& __key) {return _M_ht.erase(__key); }
void erase(iterator __it) { _M_ht.erase(__it); }
void erase(iterator __f, iterator __l) { _M_ht.erase(__f, __l); }
void clear() { _M_ht.clear(); }
public:
void resize(size_type __hint) { _M_ht.resize(__hint); }
size_type bucket_count() const { return _M_ht.bucket_count(); }
size_type max_bucket_count() const { return _M_ht.max_bucket_count(); }
size_type elems_in_bucket(size_type __n) const
{ return _M_ht.elems_in_bucket(__n); }
static bool _M_equal (const _Self& __x, const _Self& __y) {
return _Ht::_M_equal(__x._M_ht,__y._M_ht);
}
};
template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
inline bool
operator==(const hash_multiset<_Value,_HashFcn,_EqualKey,_Alloc>& __hs1,
const hash_multiset<_Value,_HashFcn,_EqualKey,_Alloc>& __hs2)
{
return hash_multiset<_Value,_HashFcn,_EqualKey,_Alloc>::_M_equal(__hs1, __hs2);
}
#ifdef __STL_USE_SEPARATE_RELOPS_NAMESPACE
template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
inline bool
operator!=(const hash_multiset<_Value,_HashFcn,_EqualKey,_Alloc>& __hs1,
const hash_multiset<_Value,_HashFcn,_EqualKey,_Alloc>& __hs2) {
return !(__hs1 == __hs2);
}
template <class _Val, class _HashFcn, class _EqualKey, class _Alloc>
inline void
swap(hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs1,
hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs2) {
__hs1.swap(__hs2);
}
#endif /* __STL_USE_SEPARATE_RELOPS_NAMESPACE */
// Specialization of insert_iterator so that it will work for hash_set
// and hash_multiset.
#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
class insert_iterator<hash_set<_Value, _HashFcn, _EqualKey, _Alloc> > {
protected:
typedef hash_set<_Value, _HashFcn, _EqualKey, _Alloc> _Container;
_Container* container;
public:
typedef _Container container_type;
typedef output_iterator_tag iterator_category;
typedef void value_type;
typedef void difference_type;
typedef void pointer;
typedef void reference;
insert_iterator(_Container& __x) : container(&__x) {}
insert_iterator(_Container& __x, typename _Container::iterator)
: container(&__x) {}
insert_iterator<_Container>&
operator=(const typename _Container::value_type& __value) {
container->insert(__value);
return *this;
}
insert_iterator<_Container>& operator*() { return *this; }
insert_iterator<_Container>& operator++() { return *this; }
insert_iterator<_Container>& operator++(int) { return *this; }
};
template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
class insert_iterator<hash_multiset<_Value, _HashFcn, _EqualKey, _Alloc> > {
protected:
typedef hash_multiset<_Value, _HashFcn, _EqualKey, _Alloc> _Container;
_Container* container;
typename _Container::iterator iter;
public:
typedef _Container container_type;
typedef output_iterator_tag iterator_category;
typedef void value_type;
typedef void difference_type;
typedef void pointer;
typedef void reference;
insert_iterator(_Container& __x) : container(&__x) {}
insert_iterator(_Container& __x, typename _Container::iterator)
: container(&__x) {}
insert_iterator<_Container>&
operator=(const typename _Container::value_type& __value) {
container->insert(__value);
return *this;
}
insert_iterator<_Container>& operator*() { return *this; }
insert_iterator<_Container>& operator++() { return *this; }
insert_iterator<_Container>& operator++(int) { return *this; }
};
#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
// do a cleanup
# undef hash_set
# undef hash_multiset
// provide a uniform way to access full funclionality
# define __hash_set__ __FULL_NAME(hash_set)
# define __hash_multiset__ __FULL_NAME(hash_multiset)
# if defined ( __STL_USE_WRAPPER_FOR_ALLOC_PARAM )
# if defined (__STL_MINIMUM_DEFAULT_TEMPLATE_PARAMS)
# define __HS_TEMPLATE_HEADER template <class _Value>
# define __HS_ARGUMENTS _Value
# define __HS_BASE_ARGUMENTS _Value, hash<_Value>, equal_to<_Value>, __STL_DEFAULT_ALLOCATOR(_Value)
# else
# define __HS_TEMPLATE_HEADER template <class _Value, class _HashFcn, class _EqualKey >
# define __HS_ARGUMENTS _Value, _HashFcn, _EqualKey
# define __HS_BASE_ARGUMENTS _Value, _HashFcn, _EqualKey, __STL_DEFAULT_ALLOCATOR(_Value)
# endif
# define __HS_SUPER __hash_set< __HS_BASE_ARGUMENTS >
# define __HMS_SUPER __hash_multiset< __HS_BASE_ARGUMENTS >
// provide a "default" hash_set adaptor
__HS_TEMPLATE_HEADER
class hash_set : public __HS_SUPER
{
typedef hash_set< __HS_ARGUMENTS > _Self;
public:
typedef __HS_SUPER _Super;
__IMPORT_WITH_ITERATORS(_Super)
typedef typename _Super::key_type key_type;
typedef typename _Super::hasher hasher;
typedef typename _Super::key_equal key_equal;
hash_set() {}
hash_set(size_type n) : __HS_SUPER(n) {}
hash_set(size_type n, const hasher& hf) : __HS_SUPER(n, hf) {}
hash_set(size_type n, const hasher& hf, const key_equal& eql): __HS_SUPER(n, hf, eql) {}
hash_set(const value_type* f, const value_type* l) : __HS_SUPER(f,l) {}
hash_set(const value_type* f, const value_type* l, size_type n): __HS_SUPER(f,l,n) {}
hash_set(const value_type* f, const value_type* l, size_type n,
const hasher& hf) : __HS_SUPER(f,l,n,hf) {}
hash_set(const value_type* f, const value_type* l, size_type n,
const hasher& hf, const key_equal& eql) : __HS_SUPER(f,l,n,hf, eql) {}
hash_set(const_iterator f, const_iterator l) : __HS_SUPER(f,l) { }
hash_set(const_iterator f, const_iterator l, size_type n) : __HS_SUPER(f,l,n) { }
hash_set(const_iterator f, const_iterator l, size_type n,
const hasher& hf) : __HS_SUPER(f, l, n, hf) { }
hash_set(const_iterator f, const_iterator l, size_type n,
const hasher& hf, const key_equal& eql) : __HS_SUPER(f, l, n, hf, eql) { }
# if defined (__STL_BASE_MATCH_BUG)
friend inline bool operator== __STL_NULL_TMPL_ARGS (const _Self& hs1, const _Self& hs2);
# endif
};
# if defined (__STL_BASE_MATCH_BUG)
__HS_TEMPLATE_HEADER
inline bool operator==(const hash_set< __HS_ARGUMENTS >& hs1,
const hash_set< __HS_ARGUMENTS >& hs2)
{
typedef __HS_SUPER _Super;
return (const _Super&)hs1 == (const _Super&)hs2;
}
# endif
// provide a "default" hash_multiset adaptor
__HS_TEMPLATE_HEADER
class hash_multiset : public __HMS_SUPER
{
typedef hash_multiset< __HS_ARGUMENTS > _Self;
public:
typedef __HMS_SUPER _Super;
__IMPORT_WITH_ITERATORS(_Super)
typedef typename _Super::key_type key_type;
typedef typename _Super::hasher hasher;
typedef typename _Super::key_equal key_equal;
hash_multiset() {}
hash_multiset(size_type __n) : __HMS_SUPER(__n) {}
hash_multiset(size_type __n, const hasher& __hf) : __HMS_SUPER(__n, __hf) {}
hash_multiset(size_type __n, const hasher& __hf, const key_equal& __eql): __HMS_SUPER(__n, __hf, __eql) {}
hash_multiset(const value_type* __f, const value_type* __l) : __HMS_SUPER(__f,__l) {}
hash_multiset(const value_type* __f, const value_type* __l, size_type __n): __HMS_SUPER(__f,__l,__n) {}
hash_multiset(const value_type* __f, const value_type* __l, size_type __n,
const hasher& __hf) : __HMS_SUPER(__f,__l,__n,__hf) {}
hash_multiset(const value_type* __f, const value_type* __l, size_type __n,
const hasher& __hf, const key_equal& __eql) : __HMS_SUPER(__f,__l,__n,__hf, __eql) {}
hash_multiset(const_iterator __f, const_iterator __l) : __HMS_SUPER(__f,__l) { }
hash_multiset(const_iterator __f, const_iterator __l, size_type __n) : __HMS_SUPER(__f,__l,__n) { }
hash_multiset(const_iterator __f, const_iterator __l, size_type __n,
const hasher& __hf) : __HMS_SUPER(__f, __l, __n, __hf) { }
hash_multiset(const_iterator __f, const_iterator __l, size_type __n,
const hasher& __hf, const key_equal& __eql) : __HMS_SUPER(__f, __l, __n, __hf, __eql) { }
# if defined (__STL_BASE_MATCH_BUG)
friend inline bool operator== __STL_NULL_TMPL_ARGS (const _Self& __hs1, const _Self& __hs2);
# endif
};
# if defined (__STL_BASE_MATCH_BUG)
__HS_TEMPLATE_HEADER
inline bool operator==(const hash_multiset< __HS_ARGUMENTS >& __hs1,
const hash_multiset< __HS_ARGUMENTS >& __hs2)
{
typedef __HMS_SUPER __s;
return __STLPORT_STD::operator==((const __s&)__hs1,(const __s&)__hs2);
}
# endif
# undef __HS_SUPER
# undef __HMS_SUPER
# undef __HS_ARGUMENTS
# undef __HS_BASE_ARGUMENTS
# undef __HS_TEMPLATE_HEADER
# endif /* WRAPPER */
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#pragma reset woff 1174
#pragma reset woff 1375
#endif
__STL_END_NAMESPACE
#endif /* __SGI_STL_INTERNAL_HASH_SET_H */
// Local Variables:
// mode:C++
// End:
@@ -0,0 +1,462 @@
/*
*
*
* 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 __STL_HASHTABLE_C
#define __STL_HASHTABLE_C
__STL_BEGIN_NAMESPACE
#if ( __STL_STATIC_TEMPLATE_DATA > 0 )
template <class _Tp>
_Tp _Stl_prime<_Tp>::_M_list[__stl_num_primes]
# else
# if ( __STL_WEAK_ATTRIBUTE > 0 )
const unsigned long __stl_prime_list[__stl_num_primes] __attribute__((weak))
# else
// give up
static const unsigned long __stl_prime_list[__stl_num_primes]
# endif /* __STL_WEAK_ATTRIBUTE */
#endif /* __STL_STATIC_TEMPLATE_DATA */
= {
53ul, 97ul, 193ul, 389ul, 769ul,
1543ul, 3079ul, 6151ul, 12289ul, 24593ul,
49157ul, 98317ul, 196613ul, 393241ul, 786433ul,
1572869ul, 3145739ul, 6291469ul, 12582917ul, 25165843ul,
50331653ul, 100663319ul, 201326611ul, 402653189ul, 805306457ul,
1610612741ul, 3221225473ul, 4294967291ul
};
// fbp: these defines are for outline methods definitions.
// needed to definitions to be portable. Should not be used in method bodies.
# if defined ( __STL_NESTED_TYPE_PARAM_BUG )
# define __difference_type__ ptrdiff_t
# define __size_type__ size_t
# define __value_type__ _Val
# define __key_type__ _Key
# define __node__ _Hashtable_node<_Val>
# define __reference__ _Val&
# define __iterator__ _Ht_iterator<_Val, _Nonconst_traits<_Val>, _Key, _HF, _ExK, _EqK, _All>
# define __const_iterator__ _Ht_iterator<_Val, _Const_traits<_Val>, _Key, _HF, _ExK, _EqK, _All>
# else
# define __difference_type__ typename hashtable<_Val, _Key, _HF, _ExK, _EqK, _All>::difference_type
# define __size_type__ __STL_TYPENAME_ON_RETURN_TYPE hashtable<_Val, _Key, _HF, _ExK, _EqK, _All>::size_type
# define __value_type__ __STL_TYPENAME_ON_RETURN_TYPE hashtable<_Val, _Key, _HF, _ExK, _EqK, _All>::value_type
# define __key_type__ __STL_TYPENAME_ON_RETURN_TYPE hashtable<_Val, _Key, _HF, _ExK, _EqK, _All>::key_type
# define __node__ __STL_TYPENAME_ON_RETURN_TYPE hashtable<_Val, _Key, _HF, _ExK, _EqK, _All>::_Node
# define __reference__ __STL_TYPENAME_ON_RETURN_TYPE hashtable<_Val, _Key, _HF, _ExK, _EqK, _All>::reference
# define __iterator__ __STL_TYPENAME_ON_RETURN_TYPE hashtable<_Val, _Key, _HF, _ExK, _EqK, _All>::iterator
# define __const_iterator__ __STL_TYPENAME_ON_RETURN_TYPE hashtable<_Val, _Key, _HF, _ExK, _EqK, _All>::const_iterator
# endif
template <class _Val, class _Key, class _HF, class _ExK, class _EqK,
class _All>
_Hashtable_node<_Val>*
_Hashtable_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>::_M_skip_to_next() {
size_t __bucket = _M_ht->_M_bkt_num(_M_cur->_M_val);
size_t __h_sz;
__h_sz = this->_M_ht->bucket_count();
_Node* __i=0;
while (__i==0 && ++__bucket < __h_sz)
__i = (_Node*)_M_ht->_M_buckets[__bucket];
return __i;
}
template <class _Val, class _Key, class _HF, class _ExK, class _EqK, class _All>
bool
hashtable<_Val,_Key,_HF,_ExK,_EqK,_All>::_M_equal(
const hashtable<_Val,_Key,_HF,_ExK,_EqK,_All>& __ht1,
const hashtable<_Val,_Key,_HF,_ExK,_EqK,_All>& __ht2)
{
// typedef _Hashtable_node<_Val> _Node;
if (__ht1.bucket_count() != __ht2.bucket_count())
return false;
for (size_t __n = 0; __n < __ht1.bucket_count(); ++__n) {
const _Node* __cur1 = __ht1._M_get_bucket(__n);
const _Node* __cur2 = __ht2._M_get_bucket(__n);
for ( ; __cur1 && __cur2 && __cur1->_M_val == __cur2->_M_val;
__cur1 = __cur1->_M_next, __cur2 = __cur2->_M_next)
{}
if (__cur1 || __cur2)
return false;
}
return true;
}
template <class _Val, class _Key, class _HF, class _ExK, class _EqK, class _All>
pair<__iterator__, bool>
hashtable<_Val,_Key,_HF,_ExK,_EqK,_All>
::insert_unique_noresize(const __value_type__& __obj)
{
const size_type __n = _M_bkt_num(__obj);
_Node* __first = (_Node*)_M_buckets[__n];
for (_Node* __cur = __first; __cur; __cur = __cur->_M_next)
if (_M_equals(_M_get_key(__cur->_M_val), _M_get_key(__obj)))
return pair<iterator, bool>(iterator(__cur, this), false);
_Node* __tmp = _M_new_node(__obj);
__tmp->_M_next = __first;
_M_buckets[__n] = __tmp;
++_M_num_elements._M_data;
return pair<iterator, bool>(iterator(__tmp, this), true);
}
template <class _Val, class _Key, class _HF, class _ExK, class _EqK, class _All>
__iterator__
hashtable<_Val,_Key,_HF,_ExK,_EqK,_All>
::insert_equal_noresize(const __value_type__& __obj)
{
const size_type __n = _M_bkt_num(__obj);
_Node* __first = (_Node*)_M_buckets[__n];
for (_Node* __cur = __first; __cur; __cur = __cur->_M_next)
if (_M_equals(_M_get_key(__cur->_M_val), _M_get_key(__obj))) {
_Node* __tmp = _M_new_node(__obj);
__tmp->_M_next = __cur->_M_next;
__cur->_M_next = __tmp;
++_M_num_elements._M_data;
return iterator(__tmp, this);
}
_Node* __tmp = _M_new_node(__obj);
__tmp->_M_next = __first;
_M_buckets[__n] = __tmp;
++_M_num_elements._M_data;
return iterator(__tmp, this);
}
template <class _Val, class _Key, class _HF, class _ExK, class _EqK, class _All>
__reference__
hashtable<_Val,_Key,_HF,_ExK,_EqK,_All>::find_or_insert(const __value_type__& __obj)
{
resize(_M_num_elements._M_data + 1);
size_type __n = _M_bkt_num(__obj);
_Node* __first = (_Node*)_M_buckets[__n];
for (_Node* __cur = __first; __cur; __cur = __cur->_M_next)
if (_M_equals(_M_get_key(__cur->_M_val), _M_get_key(__obj)))
return __cur->_M_val;
_Node* __tmp = _M_new_node(__obj);
__tmp->_M_next = __first;
_M_buckets[__n] = __tmp;
++_M_num_elements._M_data;
return __tmp->_M_val;
}
template <class _Val, class _Key, class _HF, class _ExK, class _EqK, class _All>
pair<__iterator__,
__iterator__>
hashtable<_Val,_Key,_HF,_ExK,_EqK,_All>::equal_range(const __key_type__& __key)
{
typedef pair<iterator, iterator> _Pii;
const size_type __n = _M_bkt_num_key(__key);
for (_Node* __first = (_Node*)_M_buckets[__n]; __first; __first = __first->_M_next)
if (_M_equals(_M_get_key(__first->_M_val), __key)) {
for (_Node* __cur = __first->_M_next; __cur; __cur = __cur->_M_next)
if (!_M_equals(_M_get_key(__cur->_M_val), __key))
return _Pii(iterator(__first, this), iterator(__cur, this));
for (size_type __m = __n + 1; __m < _M_buckets.size(); ++__m)
if (_M_buckets[__m])
return _Pii(iterator(__first, this),
iterator((_Node*)_M_buckets[__m], this));
return _Pii(iterator(__first, this), end());
}
return _Pii(end(), end());
}
template <class _Val, class _Key, class _HF, class _ExK, class _EqK, class _All>
pair<__const_iterator__,
__const_iterator__>
hashtable<_Val,_Key,_HF,_ExK,_EqK,_All>
::equal_range(const __key_type__& __key) const
{
typedef pair<const_iterator, const_iterator> _Pii;
const size_type __n = _M_bkt_num_key(__key);
for (const _Node* __first = (_Node*)_M_buckets[__n] ;
__first;
__first = __first->_M_next) {
if (_M_equals(_M_get_key(__first->_M_val), __key)) {
for (const _Node* __cur = __first->_M_next;
__cur;
__cur = __cur->_M_next)
if (!_M_equals(_M_get_key(__cur->_M_val), __key))
return _Pii(const_iterator(__first, this),
const_iterator(__cur, this));
for (size_type __m = __n + 1; __m < _M_buckets.size(); ++__m)
if (_M_buckets[__m])
return _Pii(const_iterator(__first, this),
const_iterator((_Node*)_M_buckets[__m], this));
return _Pii(const_iterator(__first, this), end());
}
}
return _Pii(end(), end());
}
template <class _Val, class _Key, class _HF, class _ExK, class _EqK, class _All>
__size_type__
hashtable<_Val,_Key,_HF,_ExK,_EqK,_All>::erase(const __key_type__& __key)
{
const size_type __n = _M_bkt_num_key(__key);
_Node* __first = (_Node*)_M_buckets[__n];
size_type __erased = 0;
if (__first) {
_Node* __cur = __first;
_Node* __next = __cur->_M_next;
while (__next) {
if (_M_equals(_M_get_key(__next->_M_val), __key)) {
__cur->_M_next = __next->_M_next;
_M_delete_node(__next);
__next = __cur->_M_next;
++__erased;
--_M_num_elements._M_data;
}
else {
__cur = __next;
__next = __cur->_M_next;
}
}
if (_M_equals(_M_get_key(__first->_M_val), __key)) {
_M_buckets[__n] = __first->_M_next;
_M_delete_node(__first);
++__erased;
--_M_num_elements._M_data;
}
}
return __erased;
}
template <class _Val, class _Key, class _HF, class _ExK, class _EqK, class _All>
void hashtable<_Val,_Key,_HF,_ExK,_EqK,_All>::erase(const __const_iterator__& _c_it)
{
const iterator& __it = (iterator&)_c_it;
_Node* const __p = __it._M_cur;
__stl_verbose_assert(__it._Owner()==this, _StlMsg_NOT_OWNER);
if (__p) {
const size_type __n = _M_bkt_num(__p->_M_val);
_Node* __cur = (_Node*)_M_buckets[__n];
if (__cur == __p) {
_M_buckets[__n] = __cur->_M_next;
_M_delete_node(__cur);
--_M_num_elements._M_data;
}
else {
_Node* __next = __cur->_M_next;
while (__next) {
if (__next == __p) {
__cur->_M_next = __next->_M_next;
_M_delete_node(__next);
--_M_num_elements._M_data;
break;
}
else {
__cur = __next;
__next = __cur->_M_next;
}
}
}
}
}
#if 0
template <class _Val, class _Key, class _HF, class _ExK, class _EqK, class _All>
void hashtable<_Val,_Key,_HF,_ExK,_EqK,_All>::erase(const __const_iterator__& __it) {
erase((const iterator&)__it);
}
# endif
template <class _Val, class _Key, class _HF, class _ExK, class _EqK, class _All>
void hashtable<_Val,_Key,_HF,_ExK,_EqK,_All>
::erase(__const_iterator__ _c_first, __const_iterator__ _c_last)
{
iterator& __first = (iterator&)_c_first;
iterator& __last = (iterator&)_c_last;
size_type __f_bucket = __first._M_cur ?
_M_bkt_num(__first._M_cur->_M_val) : _M_buckets.size();
size_type __l_bucket = __last._M_cur ?
_M_bkt_num(__last._M_cur->_M_val) : _M_buckets.size();
__stl_debug_check(__check_if_owner((__owned_list*)this,
__first)&&__check_if_owner((__owned_list*)this,
__last));
__stl_verbose_assert(__f_bucket <= __l_bucket, _StlMsg_INVALID_RANGE);
if (__first._M_cur == __last._M_cur)
return;
else if (__f_bucket == __l_bucket)
_M_erase_bucket(__f_bucket, __first._M_cur, __last._M_cur);
else {
_M_erase_bucket(__f_bucket, __first._M_cur, 0);
for (size_type __n = __f_bucket + 1; __n < __l_bucket; ++__n)
_M_erase_bucket(__n, 0);
if (__l_bucket != _M_buckets.size())
_M_erase_bucket(__l_bucket, __last._M_cur);
}
}
template <class _Val, class _Key, class _HF, class _ExK, class _EqK, class _All>
void hashtable<_Val,_Key,_HF,_ExK,_EqK,_All>
::resize(__size_type__ __num_elements_hint)
{
const size_type __old_n = _M_buckets.size();
if (__num_elements_hint > __old_n) {
const size_type __n = _M_next_size(__num_elements_hint);
if (__n > __old_n) {
_BucketVector __tmp(__n, (void*)(0),
_M_buckets.get_allocator());
__STL_TRY {
for (size_type __bucket = 0; __bucket < __old_n; ++__bucket) {
_Node* __first = (_Node*)_M_buckets[__bucket];
while (__first) {
size_type __new_bucket = _M_bkt_num(__first->_M_val, __n);
_M_buckets[__bucket] = __first->_M_next;
__first->_M_next = (_Node*)__tmp[__new_bucket];
__tmp[__new_bucket] = __first;
__first = (_Node*)_M_buckets[__bucket];
}
}
_M_buckets.swap(__tmp);
}
# ifdef __STL_USE_EXCEPTIONS
catch(...) {
for (size_type __bucket = 0; __bucket < __tmp.size(); ++__bucket) {
while (__tmp[__bucket]) {
_Node* __next = ((_Node*)__tmp[__bucket])->_M_next;
_M_delete_node((_Node*)__tmp[__bucket]);
__tmp[__bucket] = __next;
}
}
throw;
}
# endif /* __STL_USE_EXCEPTIONS */
}
}
}
template <class _Val, class _Key, class _HF, class _ExK, class _EqK, class _All>
void hashtable<_Val,_Key,_HF,_ExK,_EqK,_All>
::_M_erase_bucket(const __size_type__ __n, __node__* __first, __node__* __last)
{
_Node* __cur = (_Node*)_M_buckets[__n];
if (__cur == __first)
_M_erase_bucket(__n, __last);
else {
_Node* __next;
for (__next = __cur->_M_next;
__next != __first;
__cur = __next, __next = __cur->_M_next)
;
while (__next != __last) {
__cur->_M_next = __next->_M_next;
_M_delete_node(__next);
__next = __cur->_M_next;
--_M_num_elements._M_data;
}
}
}
template <class _Val, class _Key, class _HF, class _ExK, class _EqK, class _All>
void hashtable<_Val,_Key,_HF,_ExK,_EqK,_All>
::_M_erase_bucket(const __size_type__ __n, __node__* __last)
{
_Node* __cur = (_Node*)_M_buckets[__n];
while (__cur && __cur != __last) {
_Node* __next = __cur->_M_next;
_M_delete_node(__cur);
__cur = __next;
_M_buckets[__n] = __cur;
--_M_num_elements._M_data;
}
}
template <class _Val, class _Key, class _HF, class _ExK, class _EqK, class _All>
void hashtable<_Val,_Key,_HF,_ExK,_EqK,_All>::clear()
{
for (size_type __i = 0; __i < _M_buckets.size(); ++__i) {
_Node* __cur = (_Node*)_M_buckets[__i];
while (__cur != 0) {
_Node* __next = __cur->_M_next;
_M_delete_node(__cur);
__cur = __next;
}
_M_buckets[__i] = 0;
}
# ifdef __STL_DEBUG
// if (_M_num_elements._M_data)
_Invalidate_all();
# endif
_M_num_elements._M_data = 0;
}
template <class _Val, class _Key, class _HF, class _ExK, class _EqK, class _All>
void hashtable<_Val,_Key,_HF,_ExK,_EqK,_All>
::_M_copy_from(const hashtable<_Val,_Key,_HF,_ExK,_EqK,_All>& __ht)
{
_M_buckets.clear();
_M_buckets.reserve(__ht._M_buckets.size());
_M_buckets.insert(_M_buckets.end(), __ht._M_buckets.size(), (void*) 0);
__STL_TRY {
for (size_type __i = 0; __i < __ht._M_buckets.size(); ++__i) {
const _Node* __cur = (_Node*)__ht._M_buckets[__i];
if (__cur) {
_Node* __copy = _M_new_node(__cur->_M_val);
_M_buckets[__i] = __copy;
for (_Node* __next = __cur->_M_next;
__next;
__cur = __next, __next = __cur->_M_next) {
__copy->_M_next = _M_new_node(__next->_M_val);
__copy = __copy->_M_next;
}
}
}
_M_num_elements._M_data = __ht._M_num_elements._M_data;
}
__STL_UNWIND(clear());
}
# undef __iterator__
# undef __const_iterator__
# undef __difference_type__
# undef __size_type__
# undef __value_type__
# undef __key_type__
# undef __node__
# undef __stl_num_primes
__STL_END_NAMESPACE
#endif /* __STL_HASHTABLE_C */
// Local Variables:
// mode:C++
// End:

Some files were not shown because too many files have changed in this diff Show More