11#pragma once
2- #ifndef _STL_EXT_internal
3- #define _STL_EXT_internal
42
5- #include < string>
6- #include < vector>
7- #include < list>
8- #include < set>
93#include " _types.h"
104#include " _rect.h"
115#include " _plane.h"
3024
3125using std::swap;
3226
33- #ifdef __BORLANDC__
34- #ifndef M_NOSTDCONTAINERS_EXT
35- #define M_NOSTDCONTAINERS_EXT
36- #endif
37- #endif
38-
39- #ifdef M_NOSTDCONTAINERS_EXT
40-
41- #define xr_list std::list
42- #define xr_deque std::deque
43- #define xr_stack std::stack
44- #define xr_set std::set
45- #define xr_multiset std::multiset
46- #define xr_map std::map
47- #define xr_hash_map std::hash_map
48- #define xr_multimap std::multimap
49- #define xr_string std::string
50-
51- template <class T >
52- class xr_vector : public std ::vector<T>
53- {
54- public:
55- typedef size_t size_type;
56- typedef T& reference;
57- typedef const T& const_reference;
58-
59- public:
60- xr_vector () : std::vector<T>() {}
61- xr_vector (size_t _count, const T& _value) : std::vector<T>(_count, _value) {}
62- explicit xr_vector (size_t _count) : std::vector<T>(_count) {}
63- ICF const_reference operator [](size_type _Pos) const
64- {
65- {
66- VERIFY (_Pos < size ());
67- }
68- return (*(begin () + _Pos));
69- }
70- ICF reference operator [](size_type _Pos)
71- {
72- {
73- VERIFY (_Pos < size ());
74- }
75- return (*(begin () + _Pos));
76- }
77- };
78-
79- template <>
80- class xr_vector <bool > : public std::vector<bool >
81- {
82- typedef bool T;
83-
84- public:
85- xr_vector<T>() : std::vector<T>() {}
86- xr_vector<T>(size_t _count, const T& _value) : std::vector<T>(_count, _value) {}
87- explicit xr_vector<T>(size_t _count) : std::vector<T>(_count) {}
88- u32 size () const { return (u32 )std::vector<T>::size (); }
89- };
90-
91- #else // M_NOSTDCONTAINERS_EXT
92-
93- #ifdef STLPORT
94- namespace std
95- {
96- template <class _Tp1 , class _Tp2 >
97- inline xalloc<_Tp2>& __stl_alloc_rebind (xalloc<_Tp1>& __a, const _Tp2*)
98- { return (xalloc<_Tp2>&)(__a); }
99- template <class _Tp1 , class _Tp2 >
100- inline xalloc<_Tp2> __stl_alloc_create (xalloc<_Tp1>&, const _Tp2*)
101- { return xalloc<_Tp2>(); }
102- }
103-
104- template <typename V, class _HashFcn = std::hash<V>, class _EqualKey = std::equal_to<V>, typename allocator = xalloc<V>>
105- class xr_hash_multiset : public std ::hash_multiset<V, _HashFcn, _EqualKey, allocator>
106- {
107- public:
108- u32 size () const { return (u32 ) __super ::size (); }
109- };
110-
111- template <typename K, class V , class _HashFcn = std::hash<K>, class _EqualKey = std::equal_to<K>,
112- typename allocator = xalloc<std::pair<K, V>>>
113- class xr_hash_map : public std ::hash_map<K, V, _HashFcn, _EqualKey, allocator>
114- {
115- public:
116- u32 size () const { return (u32 ) __super ::size (); }
117- };
118- template <typename K, class V , class _HashFcn = std::hash<K>, class _EqualKey = std::equal_to<K>,
119- typename allocator = xalloc<std::pair<K, V>>>
120- class xr_hash_multimap : public std ::hash_multimap<K, V, _HashFcn, _EqualKey, allocator>
121- {
122- public:
123- u32 size () const { return (u32 ) __super ::size (); }
124- };
125- #else
12627#ifndef _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS
12728#define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS
12829#endif
@@ -134,9 +35,6 @@ class xr_hash_map : public stdext::hash_map<K, V, _Traits, allocator>
13435public:
13536 u32 size () const { return (u32 ) __super ::size (); }
13637};
137- #endif // #ifdef STLPORT
138-
139- #endif // M_NOSTDCONTAINERS_EXT
14038
14139#include " xrCommon/predicates.h"
14240
@@ -150,5 +48,3 @@ class xr_hash_map : public stdext::hash_map<K, V, _Traits, allocator>
15048#include " FixedVector.h"
15149#include " buffer_vector.h"
15250#include " xr_vector_defs.h"
153-
154- #endif // include guard
0 commit comments