From c5e93c048410634380a6c27dfd24b13b37d06bbe Mon Sep 17 00:00:00 2001 From: Stepan Usatiuk Date: Sat, 23 Mar 2024 21:58:24 +0100 Subject: [PATCH] working vector --- .idea/codeStyles/Project.xml | 5 + src/kernel/templates/TestTemplates.cpp | 8 +- src/kernel/templates/stl/CMakeLists.txt | 2 +- src/kernel/templates/stl/algo.h | 8 +- src/kernel/templates/stl/algobase.h | 8 +- src/kernel/templates/stl/algorithm | 10 +- src/kernel/templates/stl/alloc.h | 4 +- src/kernel/templates/stl/bitset | 214 ++--- src/kernel/templates/stl/bvector.h | 10 +- src/kernel/templates/stl/char_traits.h | 6 +- src/kernel/templates/stl/container_concepts.h | 2 +- src/kernel/templates/stl/defalloc.h | 12 +- src/kernel/templates/stl/deque | 12 +- src/kernel/templates/stl/deque.h | 8 +- src/kernel/templates/stl/function.h | 8 +- src/kernel/templates/stl/functional | 6 +- src/kernel/templates/stl/hash_map | 4 +- src/kernel/templates/stl/hash_map.h | 6 +- src/kernel/templates/stl/hash_set | 4 +- src/kernel/templates/stl/hash_set.h | 6 +- src/kernel/templates/stl/hashtable.h | 8 +- src/kernel/templates/stl/heap.h | 4 +- src/kernel/templates/stl/iterator | 20 +- src/kernel/templates/stl/iterator.h | 28 +- src/kernel/templates/stl/limits | 6 +- src/kernel/templates/stl/list | 10 +- src/kernel/templates/stl/list.h | 6 +- src/kernel/templates/stl/map | 6 +- src/kernel/templates/stl/map.h | 8 +- src/kernel/templates/stl/memory | 12 +- src/kernel/templates/stl/multimap.h | 8 +- src/kernel/templates/stl/multiset.h | 8 +- src/kernel/templates/stl/numeric | 24 +- src/kernel/templates/stl/pair.h | 6 +- src/kernel/templates/stl/pthread_alloc | 6 +- src/kernel/templates/stl/pthread_alloc.h | 2 +- src/kernel/templates/stl/queue | 20 +- src/kernel/templates/stl/rope | 20 +- src/kernel/templates/stl/rope.h | 4 +- src/kernel/templates/stl/sequence_concepts.h | 2 +- src/kernel/templates/stl/set | 6 +- src/kernel/templates/stl/set.h | 8 +- src/kernel/templates/stl/slist | 10 +- src/kernel/templates/stl/slist.h | 6 +- src/kernel/templates/stl/stack | 12 +- src/kernel/templates/stl/stack.h | 10 +- src/kernel/templates/stl/stdexcept | 6 +- src/kernel/templates/stl/stl_algo.h | 2 +- src/kernel/templates/stl/stl_algobase.h | 32 +- src/kernel/templates/stl/stl_alloc.h | 15 +- src/kernel/templates/stl/stl_config.h | 517 ++++++------ src/kernel/templates/stl/stl_construct.h | 2 +- src/kernel/templates/stl/stl_deque.h | 2 +- src/kernel/templates/stl/stl_exception.h | 4 +- src/kernel/templates/stl/stl_hash_fun.h | 2 +- src/kernel/templates/stl/stl_hash_map.h | 2 +- src/kernel/templates/stl/stl_hash_set.h | 2 +- src/kernel/templates/stl/stl_hashtable.h | 18 +- src/kernel/templates/stl/stl_iterator.h | 742 +++++++++--------- src/kernel/templates/stl/stl_iterator_base.h | 2 +- src/kernel/templates/stl/stl_list.h | 2 +- src/kernel/templates/stl/stl_map.h | 2 +- src/kernel/templates/stl/stl_multimap.h | 2 +- src/kernel/templates/stl/stl_multiset.h | 2 +- src/kernel/templates/stl/stl_queue.h | 2 +- src/kernel/templates/stl/stl_range_errors.h | 4 +- src/kernel/templates/stl/stl_set.h | 2 +- src/kernel/templates/stl/stl_slist.h | 2 +- src/kernel/templates/stl/stl_stack.h | 2 +- src/kernel/templates/stl/stl_string_fwd.h | 8 +- src/kernel/templates/stl/stl_threads.h | 12 +- src/kernel/templates/stl/stl_tree.h | 8 +- src/kernel/templates/stl/stl_vector.h | 2 +- src/kernel/templates/stl/string | 668 ++++++++-------- src/kernel/templates/stl/tempbuf.h | 14 +- src/kernel/templates/stl/tree.h | 6 +- src/kernel/templates/stl/type_traits.h | 2 +- src/kernel/templates/stl/utility | 6 +- src/kernel/templates/stl/valarray | 12 +- src/kernel/templates/stl/vector | 14 +- src/kernel/templates/stl/vector.h | 8 +- 81 files changed, 1383 insertions(+), 1348 deletions(-) diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index cb12a0504..85f1efab1 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -1,5 +1,10 @@ + diff --git a/src/kernel/templates/TestTemplates.cpp b/src/kernel/templates/TestTemplates.cpp index 4001ee7e2..9ee1290f4 100644 --- a/src/kernel/templates/TestTemplates.cpp +++ b/src/kernel/templates/TestTemplates.cpp @@ -15,7 +15,8 @@ #include "TtyManager.hpp" -#include "map" +#include "stl/pair.h" +#include "stl/vector.h" class SharedPtrTester { private: @@ -282,5 +283,10 @@ int test_templates() { cowTester.test(); test_unique_ptr(); test_list(); + + cgistd::vector test; + test.push_back(1); + test.push_back(2); + return 0; } diff --git a/src/kernel/templates/stl/CMakeLists.txt b/src/kernel/templates/stl/CMakeLists.txt index 962a266d6..c0479a786 100644 --- a/src/kernel/templates/stl/CMakeLists.txt +++ b/src/kernel/templates/stl/CMakeLists.txt @@ -1 +1 @@ -target_include_directories(kernel.elf PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) \ No newline at end of file +#target_include_directories(kernel.elf PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) \ No newline at end of file diff --git a/src/kernel/templates/stl/algo.h b/src/kernel/templates/stl/algo.h index 1707868c7..22ab650a2 100644 --- a/src/kernel/templates/stl/algo.h +++ b/src/kernel/templates/stl/algo.h @@ -27,10 +27,10 @@ #ifndef __SGI_STL_ALGO_H #define __SGI_STL_ALGO_H -#include -#include -#include -#include +#include "algobase.h" +#include "tempbuf.h" +#include "stl_algo.h" +#include "stl_numeric.h" #ifdef __STL_USE_NAMESPACES diff --git a/src/kernel/templates/stl/algobase.h b/src/kernel/templates/stl/algobase.h index f35e7af4a..bfcf5f8de 100644 --- a/src/kernel/templates/stl/algobase.h +++ b/src/kernel/templates/stl/algobase.h @@ -27,16 +27,16 @@ #define __SGI_STL_ALGOBASE_H #ifndef __SGI_STL_PAIR_H -#include +#include "pair.h" #endif #ifndef __SGI_STL_ITERATOR_H -#include +#include "iterator.h" #endif #ifndef __SGI_STL_INTERNAL_ALGOBASE_H -#include +#include "stl_algobase.h" #endif #ifndef __SGI_STL_INTERNAL_UNINITIALIZED_H -#include +#include "stl_uninitialized.h" #endif #ifdef __STL_USE_NAMESPACES diff --git a/src/kernel/templates/stl/algorithm b/src/kernel/templates/stl/algorithm index 1ba584f06..c2132897d 100644 --- a/src/kernel/templates/stl/algorithm +++ b/src/kernel/templates/stl/algorithm @@ -27,11 +27,11 @@ #ifndef __SGI_STL_ALGORITHM #define __SGI_STL_ALGORITHM -#include -#include -#include -#include -#include +#include "stl_algobase.h" +#include "stl_construct.h" +#include "stl_uninitialized.h" +#include "stl_tempbuf.h" +#include "stl_algo.h" #endif /* __SGI_STL_ALGORITHM */ diff --git a/src/kernel/templates/stl/alloc.h b/src/kernel/templates/stl/alloc.h index f99a86231..ab21dcc61 100644 --- a/src/kernel/templates/stl/alloc.h +++ b/src/kernel/templates/stl/alloc.h @@ -15,10 +15,10 @@ #define __SGI_STL_ALLOC_H #ifndef __STL_CONFIG_H -#include +#include "stl_config.h" #endif #ifndef __SGI_STL_INTERNAL_ALLOC_H -#include +#include "stl_alloc.h" #endif #ifdef __STL_USE_NAMESPACES diff --git a/src/kernel/templates/stl/bitset b/src/kernel/templates/stl/bitset index 8328b208d..d8d9975e1 100644 --- a/src/kernel/templates/stl/bitset +++ b/src/kernel/templates/stl/bitset @@ -30,16 +30,16 @@ // returns a reference to a bit, again without doing any range checking. -#include // for size_t -#include // for memset -#include -#include // for invalid_argument, out_of_range, overflow_error +#include "stddef.h" // for size_t +#include "string.h" // for memset +#include "string" +#include "stdexcept" // for invalid_argument, out_of_range, overflow_error -#ifdef __STL_USE_NEW_IOSTREAMS -#include -#else -#include // for istream, ostream -#endif +//#ifdef __STL_USE_NEW_IOSTREAMS +//#include "iostream" +//#else +//#include "iostream.h" // for istream, ostream +//#endif #define __BITS_PER_WORD (CHAR_BIT*sizeof(unsigned long)) #define __BITSET_WORDS(__n) \ @@ -841,104 +841,104 @@ inline bitset<_Nb> operator^(const bitset<_Nb>& __x, const bitset<_Nb>& __y) { return __result; } -#ifdef __STL_USE_NEW_IOSTREAMS - -template -basic_istream<_CharT, _Traits>& -operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x) -{ - basic_string<_CharT, _Traits> __tmp; - __tmp.reserve(_Nb); - - // Skip whitespace - typename 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(0), _Nb); - } - - return __is; -} - -template -basic_ostream<_CharT, _Traits>& -operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Nb>& __x) -{ - basic_string<_CharT, _Traits> __tmp; - __x._M_copy_to_string(__tmp); - return __os << __tmp; -} - -#else /* __STL_USE_NEW_IOSTREAMS */ - -template -istream& operator>>(istream& __is, bitset<_Nb>& __x) { - string __tmp; - __tmp.reserve(_Nb); - - 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(0), _Nb); - - return __is; -} - -template -ostream& operator<<(ostream& __os, const bitset<_Nb>& __x) { - string __tmp; - __x._M_copy_to_string(__tmp); - return __os << __tmp; -} - -#endif /* __STL_USE_NEW_IOSTREAMS */ +//#ifdef __STL_USE_NEW_IOSTREAMS +// +//template +//basic_istream<_CharT, _Traits>& +//operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x) +//{ +// basic_string<_CharT, _Traits> __tmp; +// __tmp.reserve(_Nb); +// +// // Skip whitespace +// typename 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(0), _Nb); +// } +// +// return __is; +//} +// +//template +//basic_ostream<_CharT, _Traits>& +//operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Nb>& __x) +//{ +// basic_string<_CharT, _Traits> __tmp; +// __x._M_copy_to_string(__tmp); +// return __os << __tmp; +//} +// +//#else /* __STL_USE_NEW_IOSTREAMS */ +// +//template +//istream& operator>>(istream& __is, bitset<_Nb>& __x) { +// string __tmp; +// __tmp.reserve(_Nb); +// +// 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(0), _Nb); +// +// return __is; +//} +// +//template +//ostream& operator<<(ostream& __os, const bitset<_Nb>& __x) { +// string __tmp; +// __x._M_copy_to_string(__tmp); +// return __os << __tmp; +//} +// +//#endif /* __STL_USE_NEW_IOSTREAMS */ // ------------------------------------------------------------ // Lookup tables for find and count operations. diff --git a/src/kernel/templates/stl/bvector.h b/src/kernel/templates/stl/bvector.h index af494c5b5..bf69e34e0 100644 --- a/src/kernel/templates/stl/bvector.h +++ b/src/kernel/templates/stl/bvector.h @@ -27,15 +27,15 @@ #ifndef __SGI_STL_BVECTOR_H #define __SGI_STL_BVECTOR_H -#include +#include "stl_range_errors.h" #ifdef __STL_CLASS_PARTIAL_SPECIALIZATION -#include +#include "vector.h" #else -#include -#include +#include "algobase.h" +#include "alloc.h" #endif -#include +#include "stl_bvector.h" #ifdef __STL_USE_NAMESPACES diff --git a/src/kernel/templates/stl/char_traits.h b/src/kernel/templates/stl/char_traits.h index 091efc2c1..7e5eb896a 100644 --- a/src/kernel/templates/stl/char_traits.h +++ b/src/kernel/templates/stl/char_traits.h @@ -14,11 +14,11 @@ #ifndef __SGI_STL_CHAR_TRAITS_H #define __SGI_STL_CHAR_TRAITS_H -#include -#include +#include "string.h" +#include "wchar.h" #if defined(__STL_USE_NEW_IOSTREAMS) && !defined(__SGI_STL_IOSFWD) -#include +#include "iosfwd" #endif /* use new iostreams */ __STL_BEGIN_NAMESPACE diff --git a/src/kernel/templates/stl/container_concepts.h b/src/kernel/templates/stl/container_concepts.h index 10db8de4f..e2762bff9 100644 --- a/src/kernel/templates/stl/container_concepts.h +++ b/src/kernel/templates/stl/container_concepts.h @@ -15,7 +15,7 @@ #define __STL_CONTAINER_CONCEPTS_H -#include +#include "concept_checks.h" #ifdef __STL_USE_CONCEPT_CHECKS diff --git a/src/kernel/templates/stl/defalloc.h b/src/kernel/templates/stl/defalloc.h index 0bfcc2c20..29ebc1417 100644 --- a/src/kernel/templates/stl/defalloc.h +++ b/src/kernel/templates/stl/defalloc.h @@ -26,12 +26,12 @@ #ifndef DEFALLOC_H #define DEFALLOC_H -#include -#include -#include -#include -#include -#include +#include "new" +#include "stddef.h" +#include "stdlib.h" +#include "limits.h" +//#include "iostream.h" +#include "algobase.h" template diff --git a/src/kernel/templates/stl/deque b/src/kernel/templates/stl/deque index b823fa4c5..ca523c30a 100644 --- a/src/kernel/templates/stl/deque +++ b/src/kernel/templates/stl/deque @@ -27,12 +27,12 @@ #ifndef __SGI_STL_DEQUE #define __SGI_STL_DEQUE -#include -#include -#include -#include -#include -#include +#include "stl_range_errors.h" +#include "stl_algobase.h" +#include "stl_alloc.h" +#include "stl_construct.h" +#include "stl_uninitialized.h" +#include "stl_deque.h" #endif /* __SGI_STL_DEQUE */ diff --git a/src/kernel/templates/stl/deque.h b/src/kernel/templates/stl/deque.h index 2ffeba2e8..15ec1b07d 100644 --- a/src/kernel/templates/stl/deque.h +++ b/src/kernel/templates/stl/deque.h @@ -27,10 +27,10 @@ #ifndef __SGI_STL_DEQUE_H #define __SGI_STL_DEQUE_H -#include -#include -#include -#include +#include "stl_range_errors.h" +#include "algobase.h" +#include "alloc.h" +#include "stl_deque.h" #ifdef __STL_USE_NAMESPACES using __STD::deque; diff --git a/src/kernel/templates/stl/function.h b/src/kernel/templates/stl/function.h index 6474dd99f..20d64bd73 100644 --- a/src/kernel/templates/stl/function.h +++ b/src/kernel/templates/stl/function.h @@ -28,14 +28,14 @@ #define __SGI_STL_FUNCTION_H #ifndef __STL_CONFIG_H -#include +#include "stl_config.h" #endif #ifndef __SGI_STL_INTERNAL_RELOPS -#include +#include "stl_relops.h" #endif -#include +#include "stddef.h" #ifndef __SGI_STL_INTERNAL_FUNCTION_H -#include +#include "stl_function.h" #endif #ifdef __STL_USE_NAMESPACE_FOR_RELOPS diff --git a/src/kernel/templates/stl/functional b/src/kernel/templates/stl/functional index d046dbb03..a9f7540d8 100644 --- a/src/kernel/templates/stl/functional +++ b/src/kernel/templates/stl/functional @@ -15,9 +15,9 @@ #ifndef __SGI_STL_FUNCTIONAL #define __SGI_STL_FUNCTIONAL -#include -#include -#include +#include "stl_config.h" +#include "stddef.h" +#include "stl_function.h" #endif /* __SGI_STL_FUNCTIONAL */ diff --git a/src/kernel/templates/stl/hash_map b/src/kernel/templates/stl/hash_map index f7421e026..f84ee79ae 100644 --- a/src/kernel/templates/stl/hash_map +++ b/src/kernel/templates/stl/hash_map @@ -28,10 +28,10 @@ #define __SGI_STL_HASH_MAP #ifndef __SGI_STL_INTERNAL_HASHTABLE_H -#include +#include "stl_hashtable.h" #endif -#include +#include "stl_hash_map.h" #endif /* __SGI_STL_HASH_MAP */ diff --git a/src/kernel/templates/stl/hash_map.h b/src/kernel/templates/stl/hash_map.h index f34716270..f40f4b9d9 100644 --- a/src/kernel/templates/stl/hash_map.h +++ b/src/kernel/templates/stl/hash_map.h @@ -28,11 +28,11 @@ #define __SGI_STL_HASH_MAP_H #ifndef __SGI_STL_INTERNAL_HASHTABLE_H -#include +#include "stl_hashtable.h" #endif -#include -#include +#include "algobase.h" +#include "stl_hash_map.h" #ifdef __STL_USE_NAMESPACES using __STD::hash; diff --git a/src/kernel/templates/stl/hash_set b/src/kernel/templates/stl/hash_set index 2244f47cf..754eead97 100644 --- a/src/kernel/templates/stl/hash_set +++ b/src/kernel/templates/stl/hash_set @@ -28,10 +28,10 @@ #define __SGI_STL_HASH_SET #ifndef __SGI_STL_INTERNAL_HASHTABLE_H -#include +#include "stl_hashtable.h" #endif -#include +#include "stl_hash_set.h" #endif /* __SGI_STL_HASH_SET */ diff --git a/src/kernel/templates/stl/hash_set.h b/src/kernel/templates/stl/hash_set.h index d3e93c0c2..7a9a12758 100644 --- a/src/kernel/templates/stl/hash_set.h +++ b/src/kernel/templates/stl/hash_set.h @@ -28,11 +28,11 @@ #define __SGI_STL_HASH_SET_H #ifndef __SGI_STL_INTERNAL_HASHTABLE_H -#include +#include "stl_hashtable.h" #endif -#include -#include +#include "algobase.h" +#include "stl_hash_set.h" #ifdef __STL_USE_NAMESPACES using __STD::hash; diff --git a/src/kernel/templates/stl/hashtable.h b/src/kernel/templates/stl/hashtable.h index 15dbfc916..edbd91f2f 100644 --- a/src/kernel/templates/stl/hashtable.h +++ b/src/kernel/templates/stl/hashtable.h @@ -31,10 +31,10 @@ #ifndef __SGI_STL_HASHTABLE_H #define __SGI_STL_HASHTABLE_H -#include -#include -#include -#include +#include "stl_hashtable.h" +#include "algo.h" +#include "alloc.h" +#include "vector.h" #ifdef __STL_USE_NAMESPACES using __STD::hash; diff --git a/src/kernel/templates/stl/heap.h b/src/kernel/templates/stl/heap.h index 2ec93c07b..b383e4ed1 100644 --- a/src/kernel/templates/stl/heap.h +++ b/src/kernel/templates/stl/heap.h @@ -26,8 +26,8 @@ #ifndef __SGI_STL_HEAP_H #define __SGI_STL_HEAP_H -#include -#include +#include "stl_config.h" +#include "stl_heap.h" #ifdef __STL_USE_NAMESPACES diff --git a/src/kernel/templates/stl/iterator b/src/kernel/templates/stl/iterator index fe2b8e898..33866ee3f 100644 --- a/src/kernel/templates/stl/iterator +++ b/src/kernel/templates/stl/iterator @@ -27,18 +27,18 @@ #ifndef __SGI_STL_ITERATOR #define __SGI_STL_ITERATOR -#include -#include -#include +#include "stl_config.h" +#include "stl_relops.h" +#include "stddef.h" -#ifdef __STL_USE_NEW_IOSTREAMS -#include -#else /* __STL_USE_NEW_IOSTREAMS */ -#include -#endif /* __STL_USE_NEW_IOSTREAMS */ +//#ifdef __STL_USE_NEW_IOSTREAMS +//#include "iosfwd" +//#else /* __STL_USE_NEW_IOSTREAMS */ +//#include "iostream.h" +//#endif /* __STL_USE_NEW_IOSTREAMS */ -#include -#include +#include "stl_iterator_base.h" +#include "stl_iterator.h" #endif /* __SGI_STL_ITERATOR */ diff --git a/src/kernel/templates/stl/iterator.h b/src/kernel/templates/stl/iterator.h index 197278ba2..e86227de6 100644 --- a/src/kernel/templates/stl/iterator.h +++ b/src/kernel/templates/stl/iterator.h @@ -28,30 +28,30 @@ #define __SGI_STL_ITERATOR_H #ifndef __SGI_STL_FUNCTION_H -#include +#include "function.h" #endif -#include +#include "stddef.h" -#ifdef __STL_USE_NEW_IOSTREAMS -#include -#else /* __STL_USE_NEW_IOSTREAMS */ -#include -#endif /* __STL_USE_NEW_IOSTREAMS */ +//#ifdef __STL_USE_NEW_IOSTREAMS +//#include "iosfwd" +//#else /* __STL_USE_NEW_IOSTREAMS */ +//#include "iostream.h" +//#endif /* __STL_USE_NEW_IOSTREAMS */ #ifndef __SGI_STL_INTERNAL_ITERATOR_BASE_H -#include +#include "stl_iterator_base.h" #endif #ifndef __SGI_STL_INTERNAL_ITERATOR_H -#include +#include "stl_iterator.h" #endif #ifndef __TYPE_TRAITS_H -#include +#include "type_traits.h" #endif #ifndef __SGI_STL_INTERNAL_CONSTRUCT_H -#include +#include "stl_construct.h" #endif #ifndef __SGI_STL_INTERNAL_RAW_STORAGE_ITERATOR_H -#include +#include "stl_raw_storage_iter.h" #endif #ifdef __STL_USE_NAMESPACES @@ -94,8 +94,8 @@ using __STD::back_inserter; using __STD::reverse_iterator; using __STD::reverse_bidirectional_iterator; -using __STD::istream_iterator; -using __STD::ostream_iterator; +//using __STD::istream_iterator; +//using __STD::ostream_iterator; // Names from stl_construct.h using __STD::construct; diff --git a/src/kernel/templates/stl/limits b/src/kernel/templates/stl/limits index f1a9a094c..6438e77d3 100644 --- a/src/kernel/templates/stl/limits +++ b/src/kernel/templates/stl/limits @@ -19,9 +19,9 @@ #ifndef __SGI_CPP_LIMITS #define __SGI_CPP_LIMITS -#include -#include -#include +#include "limits.h" +#include "float.h" +#include "stl_config.h" __STL_BEGIN_NAMESPACE diff --git a/src/kernel/templates/stl/list b/src/kernel/templates/stl/list index 5294f39fe..95ca78a0c 100644 --- a/src/kernel/templates/stl/list +++ b/src/kernel/templates/stl/list @@ -27,11 +27,11 @@ #ifndef __SGI_STL_LIST #define __SGI_STL_LIST -#include -#include -#include -#include -#include +#include "stl_algobase.h" +#include "stl_alloc.h" +#include "stl_construct.h" +#include "stl_uninitialized.h" +#include "stl_list.h" #endif /* __SGI_STL_LIST */ diff --git a/src/kernel/templates/stl/list.h b/src/kernel/templates/stl/list.h index 4e6ee0b41..18737f767 100644 --- a/src/kernel/templates/stl/list.h +++ b/src/kernel/templates/stl/list.h @@ -27,9 +27,9 @@ #ifndef __SGI_STL_LIST_H #define __SGI_STL_LIST_H -#include -#include -#include +#include "algobase.h" +#include "alloc.h" +#include "stl_list.h" #ifdef __STL_USE_NAMESPACES using __STD::list; diff --git a/src/kernel/templates/stl/map b/src/kernel/templates/stl/map index 4cfb7652c..d64794d3b 100644 --- a/src/kernel/templates/stl/map +++ b/src/kernel/templates/stl/map @@ -28,10 +28,10 @@ #define __SGI_STL_MAP #ifndef __SGI_STL_INTERNAL_TREE_H -#include +#include "stl_tree.h" #endif -#include -#include +#include "stl_map.h" +#include "stl_multimap.h" #endif /* __SGI_STL_MAP */ diff --git a/src/kernel/templates/stl/map.h b/src/kernel/templates/stl/map.h index 902f66e54..9b3e201d4 100644 --- a/src/kernel/templates/stl/map.h +++ b/src/kernel/templates/stl/map.h @@ -28,11 +28,11 @@ #define __SGI_STL_MAP_H #ifndef __SGI_STL_INTERNAL_TREE_H -#include +#include "stl_tree.h" #endif -#include -#include -#include +#include "algobase.h" +#include "alloc.h" +#include "stl_map.h" #ifdef __STL_USE_NAMESPACES using __STD::rb_tree; diff --git a/src/kernel/templates/stl/memory b/src/kernel/templates/stl/memory index a1b096ce2..453af44c5 100644 --- a/src/kernel/templates/stl/memory +++ b/src/kernel/templates/stl/memory @@ -15,12 +15,12 @@ #ifndef __SGI_STL_MEMORY #define __SGI_STL_MEMORY -#include -#include -#include -#include -#include -#include +#include "stl_algobase.h" +#include "stl_alloc.h" +#include "stl_construct.h" +#include "stl_tempbuf.h" +#include "stl_uninitialized.h" +#include "stl_raw_storage_iter.h" __STL_BEGIN_NAMESPACE diff --git a/src/kernel/templates/stl/multimap.h b/src/kernel/templates/stl/multimap.h index 44b26bee5..8a392d400 100644 --- a/src/kernel/templates/stl/multimap.h +++ b/src/kernel/templates/stl/multimap.h @@ -28,11 +28,11 @@ #define __SGI_STL_MULTIMAP_H #ifndef __SGI_STL_INTERNAL_TREE_H -#include +#include "stl_tree.h" #endif -#include -#include -#include +#include "algobase.h" +#include "alloc.h" +#include "stl_multimap.h" #ifdef __STL_USE_NAMESPACES using __STD::rb_tree; diff --git a/src/kernel/templates/stl/multiset.h b/src/kernel/templates/stl/multiset.h index 91f0379d1..6f6e1a042 100644 --- a/src/kernel/templates/stl/multiset.h +++ b/src/kernel/templates/stl/multiset.h @@ -28,11 +28,11 @@ #define __SGI_STL_MULTISET_H #ifndef __SGI_STL_INTERNAL_TREE_H -#include +#include "stl_tree.h" #endif -#include -#include -#include +#include "algobase.h" +#include "alloc.h" +#include "stl_multiset.h" #ifdef __STL_USE_NAMESPACES using __STD::rb_tree; diff --git a/src/kernel/templates/stl/numeric b/src/kernel/templates/stl/numeric index 98e3237de..0fd105cb4 100644 --- a/src/kernel/templates/stl/numeric +++ b/src/kernel/templates/stl/numeric @@ -27,20 +27,20 @@ #ifndef __SGI_STL_NUMERIC #define __SGI_STL_NUMERIC -#include -#include -#include +#include "stl_config.h" +#include "stl_relops.h" +#include "stddef.h" -#ifdef __STL_USE_NEW_IOSTREAMS -#include -#else /* __STL_USE_NEW_IOSTREAMS */ -#include -#endif /* __STL_USE_NEW_IOSTREAMS */ +//#ifdef __STL_USE_NEW_IOSTREAMS +//#include "iostream" +//#else /* __STL_USE_NEW_IOSTREAMS */ +//#include "iostream.h" +//#endif /* __STL_USE_NEW_IOSTREAMS */ -#include -#include -#include -#include +#include "stl_iterator_base.h" +#include "stl_iterator.h" +#include "stl_function.h" +#include "stl_numeric.h" #endif /* __SGI_STL_NUMERIC */ diff --git a/src/kernel/templates/stl/pair.h b/src/kernel/templates/stl/pair.h index 00f5caddb..c681bba92 100644 --- a/src/kernel/templates/stl/pair.h +++ b/src/kernel/templates/stl/pair.h @@ -28,13 +28,13 @@ #define __SGI_STL_PAIR_H #ifndef __STL_CONFIG_H -#include +#include "stl_config.h" #endif #ifndef __SGI_STL_INTERNAL_RELOPS -#include +#include "stl_relops.h" #endif #ifndef __SGI_STL_INTERNAL_PAIR_H -#include +#include "stl_pair.h" #endif #ifdef __STL_USE_NAMESPACES diff --git a/src/kernel/templates/stl/pthread_alloc b/src/kernel/templates/stl/pthread_alloc index 33073da58..4bef4844e 100644 --- a/src/kernel/templates/stl/pthread_alloc +++ b/src/kernel/templates/stl/pthread_alloc @@ -27,9 +27,9 @@ // cache lines among processors, with potentially serious performance // consequences. -#include -#include -#include +#include "errno.h" +#include "stl_config.h" +#include "stl_alloc.h" #ifndef __RESTRICT # define __RESTRICT #endif diff --git a/src/kernel/templates/stl/pthread_alloc.h b/src/kernel/templates/stl/pthread_alloc.h index 774ef04ed..0345b92c7 100644 --- a/src/kernel/templates/stl/pthread_alloc.h +++ b/src/kernel/templates/stl/pthread_alloc.h @@ -14,7 +14,7 @@ #ifndef __SGI_STL_PTHREAD_ALLOC_H #define __SGI_STL_PTHREAD_ALLOC_H -#include +#include "pthread_alloc" #ifdef __STL_USE_NAMESPACES diff --git a/src/kernel/templates/stl/queue b/src/kernel/templates/stl/queue index f9417fb1f..84955f7a4 100644 --- a/src/kernel/templates/stl/queue +++ b/src/kernel/templates/stl/queue @@ -27,16 +27,16 @@ #ifndef __SGI_STL_QUEUE #define __SGI_STL_QUEUE -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "stl_algobase.h" +#include "stl_alloc.h" +#include "stl_construct.h" +#include "stl_uninitialized.h" +#include "stl_vector.h" +#include "stl_bvector.h" +#include "stl_heap.h" +#include "stl_deque.h" +#include "stl_function.h" +#include "stl_queue.h" #endif /* __SGI_STL_QUEUE */ diff --git a/src/kernel/templates/stl/rope b/src/kernel/templates/stl/rope index f86150000..909550b90 100644 --- a/src/kernel/templates/stl/rope +++ b/src/kernel/templates/stl/rope @@ -14,16 +14,16 @@ #ifndef __SGI_STL_ROPE #define __SGI_STL_ROPE -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "stl_algobase.h" +#include "stl_tempbuf.h" +#include "stl_algo.h" +#include "stl_function.h" +#include "stl_numeric.h" +#include "stl_alloc.h" +#include "stl_construct.h" +#include "stl_uninitialized.h" +#include "stl_hash_fun.h" +#include "stl_rope.h" #endif /* __SGI_STL_ROPE */ diff --git a/src/kernel/templates/stl/rope.h b/src/kernel/templates/stl/rope.h index d767fa32e..1ddcea952 100644 --- a/src/kernel/templates/stl/rope.h +++ b/src/kernel/templates/stl/rope.h @@ -14,8 +14,8 @@ #ifndef __SGI_STL_ROPE_H #define __SGI_STL_ROPE_H -#include -#include +#include "hashtable.h" +#include "stl_rope.h" #ifdef __STL_USE_NAMESPACES diff --git a/src/kernel/templates/stl/sequence_concepts.h b/src/kernel/templates/stl/sequence_concepts.h index bf8f37333..71b2ef6ff 100644 --- a/src/kernel/templates/stl/sequence_concepts.h +++ b/src/kernel/templates/stl/sequence_concepts.h @@ -14,7 +14,7 @@ #ifndef STL_SEQUENCE_CONCEPTS_H #define STL_SEQUENCE_CONCEPTS_H -#include +#include "container_concepts.h" #ifdef __STL_USE_CONCEPT_CHECKS diff --git a/src/kernel/templates/stl/set b/src/kernel/templates/stl/set index c836c4596..e45889e37 100644 --- a/src/kernel/templates/stl/set +++ b/src/kernel/templates/stl/set @@ -28,10 +28,10 @@ #define __SGI_STL_SET #ifndef __SGI_STL_INTERNAL_TREE_H -#include +#include "stl_tree.h" #endif -#include -#include +#include "stl_set.h" +#include "stl_multiset.h" #endif /* __SGI_STL_SET */ diff --git a/src/kernel/templates/stl/set.h b/src/kernel/templates/stl/set.h index 779f395c1..eb0248680 100644 --- a/src/kernel/templates/stl/set.h +++ b/src/kernel/templates/stl/set.h @@ -28,11 +28,11 @@ #define __SGI_STL_SET_H #ifndef __SGI_STL_INTERNAL_TREE_H -#include +#include "stl_tree.h" #endif -#include -#include -#include +#include "algobase.h" +#include "alloc.h" +#include "stl_set.h" #ifdef __STL_USE_NAMESPACES using __STD::rb_tree; diff --git a/src/kernel/templates/stl/slist b/src/kernel/templates/stl/slist index c3ec74204..a1fb333dd 100644 --- a/src/kernel/templates/stl/slist +++ b/src/kernel/templates/stl/slist @@ -15,11 +15,11 @@ #ifndef __SGI_STL_SLIST #define __SGI_STL_SLIST -#include -#include -#include -#include -#include +#include "stl_algobase.h" +#include "stl_alloc.h" +#include "stl_construct.h" +#include "stl_uninitialized.h" +#include "stl_slist.h" #endif /* __SGI_STL_SLIST */ diff --git a/src/kernel/templates/stl/slist.h b/src/kernel/templates/stl/slist.h index d2377b0cf..7495ae462 100644 --- a/src/kernel/templates/stl/slist.h +++ b/src/kernel/templates/stl/slist.h @@ -15,9 +15,9 @@ #ifndef __SGI_STL_SLIST_H #define __SGI_STL_SLIST_H -#include -#include -#include +#include "algobase.h" +#include "alloc.h" +#include "stl_slist.h" #ifdef __STL_USE_NAMESPACES using __STD::slist; diff --git a/src/kernel/templates/stl/stack b/src/kernel/templates/stl/stack index 36461d95b..34d1d98b5 100644 --- a/src/kernel/templates/stl/stack +++ b/src/kernel/templates/stl/stack @@ -27,12 +27,12 @@ #ifndef __SGI_STL_STACK #define __SGI_STL_STACK -#include -#include -#include -#include -#include -#include +#include "stl_algobase.h" +#include "stl_alloc.h" +#include "stl_construct.h" +#include "stl_uninitialized.h" +#include "stl_deque.h" +#include "stl_stack.h" #endif /* __SGI_STL_STACK */ diff --git a/src/kernel/templates/stl/stack.h b/src/kernel/templates/stl/stack.h index 89beca82f..5f29add05 100644 --- a/src/kernel/templates/stl/stack.h +++ b/src/kernel/templates/stl/stack.h @@ -27,11 +27,11 @@ #ifndef __SGI_STL_STACK_H #define __SGI_STL_STACK_H -#include -#include -#include -#include -#include +#include "vector.h" +#include "deque.h" +#include "heap.h" +#include "stl_stack.h" +#include "stl_queue.h" #ifdef __STL_USE_NAMESPACES using __STD::stack; diff --git a/src/kernel/templates/stl/stdexcept b/src/kernel/templates/stl/stdexcept index ca99369cb..c043664b7 100644 --- a/src/kernel/templates/stl/stdexcept +++ b/src/kernel/templates/stl/stdexcept @@ -14,12 +14,12 @@ #ifndef __SGI_STDEXCEPT #define __SGI_STDEXCEPT -#include +#include "stl_exception.h" #if defined(__STL_USE_EXCEPTIONS) || \ !(defined(_MIPS_SIM) && defined(_ABIO32) && _MIPS_SIM == _ABIO32) -#include +#include "stl_string_fwd.h" __STL_BEGIN_NAMESPACE @@ -84,7 +84,7 @@ public: __STL_END_NAMESPACE #ifndef __SGI_STL_STRING -#include +#include "string" #endif #endif /* Not o32, and no exceptions */ diff --git a/src/kernel/templates/stl/stl_algo.h b/src/kernel/templates/stl/stl_algo.h index 37dbf4ab7..a9be32f39 100644 --- a/src/kernel/templates/stl/stl_algo.h +++ b/src/kernel/templates/stl/stl_algo.h @@ -31,7 +31,7 @@ #ifndef __SGI_STL_INTERNAL_ALGO_H #define __SGI_STL_INTERNAL_ALGO_H -#include +#include "stl_heap.h" // See concept_checks.h for the concept-checking macros // __STL_REQUIRES, __STL_CONVERTIBLE, etc. diff --git a/src/kernel/templates/stl/stl_algobase.h b/src/kernel/templates/stl/stl_algobase.h index 35ed7ecdc..c55827bd1 100644 --- a/src/kernel/templates/stl/stl_algobase.h +++ b/src/kernel/templates/stl/stl_algobase.h @@ -33,33 +33,33 @@ #define __SGI_STL_INTERNAL_ALGOBASE_H #ifndef __STL_CONFIG_H -#include +#include "stl_config.h" #endif #ifndef __SGI_STL_INTERNAL_RELOPS -#include +#include "stl_relops.h" #endif #ifndef __SGI_STL_INTERNAL_PAIR_H -#include +#include "stl_pair.h" #endif #ifndef __TYPE_TRAITS_H -#include +#include "type_traits.h" #endif -#include -#include -#include -#include -#include +#include "string.h" +#include "limits.h" +#include "stdlib.h" +#include "stddef.h" +#include "new" -#ifdef __STL_USE_NEW_IOSTREAMS -#include -#else /* __STL_USE_NEW_IOSTREAMS */ -#include -#endif /* __STL_USE_NEW_IOSTREAMS */ +//#ifdef __STL_USE_NEW_IOSTREAMS +//#include "iosfwd" +//#else /* __STL_USE_NEW_IOSTREAMS */ +//#include "iostream.h" +//#endif /* __STL_USE_NEW_IOSTREAMS */ #ifndef __SGI_STL_INTERNAL_ITERATOR_H -#include -#include +#include "stl_iterator_base.h" +#include "stl_iterator.h" #endif // We pick up concept_checks.h from stl_iterator_base.h. diff --git a/src/kernel/templates/stl/stl_alloc.h b/src/kernel/templates/stl/stl_alloc.h index e96122a9d..ebc09f3ee 100644 --- a/src/kernel/templates/stl/stl_alloc.h +++ b/src/kernel/templates/stl/stl_alloc.h @@ -40,19 +40,20 @@ #ifndef __THROW_BAD_ALLOC # if defined(__STL_NO_BAD_ALLOC) || !defined(__STL_USE_EXCEPTIONS) -# include -# include -# define __THROW_BAD_ALLOC fprintf(stderr, "out of memory\n"); exit(1) +//# include +//# include +#include "asserts.hpp" +# define __THROW_BAD_ALLOC assert2(false,"out of memory"); # else /* Standard conforming out-of-memory handling */ # include # define __THROW_BAD_ALLOC throw std::bad_alloc() # endif #endif -#include -#include -#include -#include +#include "stddef.h" +#include "stdlib.h" +#include "string.h" +#include "asserts.hpp" #ifndef __RESTRICT # define __RESTRICT #endif diff --git a/src/kernel/templates/stl/stl_config.h b/src/kernel/templates/stl/stl_config.h index 6f371315d..b8cae3491 100644 --- a/src/kernel/templates/stl/stl_config.h +++ b/src/kernel/templates/stl/stl_config.h @@ -141,84 +141,84 @@ // * __stl_assert, either as a test or as a null macro, depending on // whether or not __STL_ASSERTIONS is defined. -# if defined(_PTHREADS) && !defined(_NOTHREADS) -# define __STL_PTHREADS -# endif - -# if defined(_UITHREADS) && !defined(_PTHREADS) && !defined(_NOTHREADS) -# define __STL_UITHREADS -# endif - -# if defined(__sgi) && !defined(__GNUC__) -# include -# if !defined(_BOOL) -# define __STL_NO_BOOL -# endif -# if defined(_MIPS_SIM) && _MIPS_SIM == _ABIO32 -# define __STL_STATIC_CONST_INIT_BUG -# endif -# if defined(_WCHAR_T_IS_KEYWORD) -# define __STL_HAS_WCHAR_T -# endif -# if !defined(_TYPENAME_IS_KEYWORD) -# define __STL_NEED_TYPENAME -# endif -# ifdef _PARTIAL_SPECIALIZATION_OF_CLASS_TEMPLATES -# define __STL_CLASS_PARTIAL_SPECIALIZATION -# endif -# if (_COMPILER_VERSION >= 730) && defined(_MIPS_SIM) && _MIPS_SIM != _ABIO32 -# define __STL_FUNCTION_TMPL_PARTIAL_ORDER -# endif -# ifdef _MEMBER_TEMPLATES -# define __STL_MEMBER_TEMPLATES -# define __STL_TEMPLATE_FRIENDS -# define __STL_MEMBER_TEMPLATE_CLASSES -# endif -# if defined(_MEMBER_TEMPLATE_KEYWORD) -# define __STL_MEMBER_TEMPLATE_KEYWORD -# endif -# if defined(_STANDARD_C_PLUS_PLUS) -# define __STL_EXPLICIT_FUNCTION_TMPL_ARGS -# endif -# if (_COMPILER_VERSION >= 730) && defined(_MIPS_SIM) && _MIPS_SIM != _ABIO32 -# define __STL_MEMBER_TEMPLATE_KEYWORD -# endif -# if COMPILER_VERSION < 720 || (defined(_MIPS_SIM) && _MIPS_SIM == _ABIO32) -# define __STL_DEFAULT_CONSTRUCTOR_BUG -# endif -# if !defined(_EXPLICIT_IS_KEYWORD) -# define __STL_NEED_EXPLICIT -# endif -# ifdef __EXCEPTIONS -# define __STL_USE_EXCEPTIONS -# endif -# if (_COMPILER_VERSION >= 721) && defined(_NAMESPACES) -# define __STL_HAS_NAMESPACES -# endif -# if (_COMPILER_VERSION < 721) || \ - !defined(__STL_HAS_NAMESPACES) || defined(__STL_NO_NAMESPACES) -# 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(_NOTHREADS) && !defined(__STL_PTHREADS) -# define __STL_SGI_THREADS -# endif -# if defined(_LONGLONG) && defined(_SGIAPI) && _SGIAPI -# define __STL_LONG_LONG -# endif -# if _COMPILER_VERSION >= 730 && defined(_STANDARD_C_PLUS_PLUS) -# define __STL_USE_NEW_IOSTREAMS -# endif -# if _COMPILER_VERSION >= 730 && defined(_STANDARD_C_PLUS_PLUS) -# define __STL_CAN_THROW_RANGE_ERRORS -# endif -# if _COMPILER_VERSION >= 730 && defined(_STANDARD_C_PLUS_PLUS) -# define __SGI_STL_USE_AUTO_PTR_CONVERSIONS -# endif -# endif +//# if defined(_PTHREADS) && !defined(_NOTHREADS) +//# define __STL_PTHREADS +//# endif +// +//# if defined(_UITHREADS) && !defined(_PTHREADS) && !defined(_NOTHREADS) +//# define __STL_UITHREADS +//# endif +// +//# if defined(__sgi) && !defined(__GNUC__) +//# include +//# if !defined(_BOOL) +//# define __STL_NO_BOOL +//# endif +//# if defined(_MIPS_SIM) && _MIPS_SIM == _ABIO32 +//# define __STL_STATIC_CONST_INIT_BUG +//# endif +//# if defined(_WCHAR_T_IS_KEYWORD) +//# define __STL_HAS_WCHAR_T +//# endif +//# if !defined(_TYPENAME_IS_KEYWORD) +//# define __STL_NEED_TYPENAME +//# endif +//# ifdef _PARTIAL_SPECIALIZATION_OF_CLASS_TEMPLATES +//# define __STL_CLASS_PARTIAL_SPECIALIZATION +//# endif +//# if (_COMPILER_VERSION >= 730) && defined(_MIPS_SIM) && _MIPS_SIM != _ABIO32 +//# define __STL_FUNCTION_TMPL_PARTIAL_ORDER +//# endif +//# ifdef _MEMBER_TEMPLATES +//# define __STL_MEMBER_TEMPLATES +//# define __STL_TEMPLATE_FRIENDS +//# define __STL_MEMBER_TEMPLATE_CLASSES +//# endif +//# if defined(_MEMBER_TEMPLATE_KEYWORD) +//# define __STL_MEMBER_TEMPLATE_KEYWORD +//# endif +//# if defined(_STANDARD_C_PLUS_PLUS) +//# define __STL_EXPLICIT_FUNCTION_TMPL_ARGS +//# endif +//# if (_COMPILER_VERSION >= 730) && defined(_MIPS_SIM) && _MIPS_SIM != _ABIO32 +//# define __STL_MEMBER_TEMPLATE_KEYWORD +//# endif +//# if COMPILER_VERSION < 720 || (defined(_MIPS_SIM) && _MIPS_SIM == _ABIO32) +//# define __STL_DEFAULT_CONSTRUCTOR_BUG +//# endif +//# if !defined(_EXPLICIT_IS_KEYWORD) +//# define __STL_NEED_EXPLICIT +//# endif +//# ifdef __EXCEPTIONS +//# define __STL_USE_EXCEPTIONS +//# endif +//# if (_COMPILER_VERSION >= 721) && defined(_NAMESPACES) +//# define __STL_HAS_NAMESPACES +//# endif +//# if (_COMPILER_VERSION < 721) || \ +// !defined(__STL_HAS_NAMESPACES) || defined(__STL_NO_NAMESPACES) +//# 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(_NOTHREADS) && !defined(__STL_PTHREADS) +//# define __STL_SGI_THREADS +//# endif +//# if defined(_LONGLONG) && defined(_SGIAPI) && _SGIAPI +//# define __STL_LONG_LONG +//# endif +//# if _COMPILER_VERSION >= 730 && defined(_STANDARD_C_PLUS_PLUS) +//# define __STL_USE_NEW_IOSTREAMS +//# endif +//# if _COMPILER_VERSION >= 730 && defined(_STANDARD_C_PLUS_PLUS) +//# define __STL_CAN_THROW_RANGE_ERRORS +//# endif +//# if _COMPILER_VERSION >= 730 && defined(_STANDARD_C_PLUS_PLUS) +//# define __SGI_STL_USE_AUTO_PTR_CONVERSIONS +//# endif +//# endif /* @@ -230,42 +230,70 @@ * macro __USLC__ being defined */ // SCO UDK 7 compiler (UnixWare 7x, OSR 5, UnixWare 2x) -# if defined(__USLC__) -# define __STL_HAS_WCHAR_T -# define __STL_CLASS_PARTIAL_SPECIALIZATION -# define __STL_PARTIAL_SPECIALIZATION_SYNTAX -# define __STL_FUNCTION_TMPL_PARTIAL_ORDER -# define __STL_MEMBER_TEMPLATES -# define __STL_MEMBER_TEMPLATE_CLASSES -# define __STL_USE_EXCEPTIONS -# define __STL_HAS_NAMESPACES -# define __STL_USE_NAMESPACES -# define __STL_LONG_LONG -# if defined(_REENTRANT) -# define _UITHREADS /* if UnixWare < 7.0.1 */ -# define __STL_UITHREADS -// use the following defines instead of the UI threads defines when -// you want to use POSIX threads -//# define _PTHREADS /* only if UnixWare >=7.0.1 */ -//# define __STL_PTHREADS -# endif -# endif +//# if defined(__USLC__) +//# define __STL_HAS_WCHAR_T +//# define __STL_CLASS_PARTIAL_SPECIALIZATION +//# define __STL_PARTIAL_SPECIALIZATION_SYNTAX +//# define __STL_FUNCTION_TMPL_PARTIAL_ORDER +//# define __STL_MEMBER_TEMPLATES +//# define __STL_MEMBER_TEMPLATE_CLASSES +//# define __STL_USE_EXCEPTIONS +//# define __STL_HAS_NAMESPACES +//# define __STL_USE_NAMESPACES +//# define __STL_LONG_LONG +//# if defined(_REENTRANT) +//# define _UITHREADS /* if UnixWare < 7.0.1 */ +//# define __STL_UITHREADS +//// use the following defines instead of the UI threads defines when +//// you want to use POSIX threads +////# define _PTHREADS /* only if UnixWare >=7.0.1 */ +////# define __STL_PTHREADS +//# endif +//# endif +//# ifdef __GNUC__ +//# if __GNUC__ == 2 && __GNUC_MINOR__ <= 7 +//# define __STL_STATIC_TEMPLATE_MEMBER_BUG +//# endif +//# if __GNUC__ < 2 +//# define __STL_NEED_TYPENAME +//# define __STL_NEED_EXPLICIT +//# endif +//# if __GNUC__ == 2 && __GNUC_MINOR__ <= 8 +//# define __STL_NO_EXCEPTION_HEADER +//# define __STL_NO_BAD_ALLOC +//# endif +//# if __GNUC__ == 2 && __GNUC_MINOR__ >= 8 +//# define __STL_CLASS_PARTIAL_SPECIALIZATION +//# define __STL_FUNCTION_TMPL_PARTIAL_ORDER +//# define __STL_EXPLICIT_FUNCTION_TMPL_ARGS +//# define __STL_MEMBER_TEMPLATES +//# define __STL_CAN_THROW_RANGE_ERRORS +// // g++ 2.8.1 supports member template functions, but not member +// // template nested classes. +//# if __GNUC_MINOR__ >= 9 +//# define __STL_MEMBER_TEMPLATE_CLASSES +//# define __STL_TEMPLATE_FRIENDS +//# define __SGI_STL_USE_AUTO_PTR_CONVERSIONS +//# define __STL_HAS_NAMESPACES +////# define __STL_USE_NEW_IOSTREAMS +//# endif +//# endif +//# define __STL_DEFAULT_CONSTRUCTOR_BUG +//# ifdef __EXCEPTIONS +//# define __STL_USE_EXCEPTIONS +//# endif +//# ifdef _REENTRANT +//# define __STL_PTHREADS +//# endif +//# if (__GNUC__ < 2) || (__GNUC__ == 2 && __GNUC_MINOR__ < 95) +//# define __STL_NO_FUNCTION_PTR_IN_CLASS_TEMPLATE +//# endif +//# endif + # ifdef __GNUC__ -# if __GNUC__ == 2 && __GNUC_MINOR__ <= 7 -# define __STL_STATIC_TEMPLATE_MEMBER_BUG -# endif -# if __GNUC__ < 2 -# define __STL_NEED_TYPENAME -# define __STL_NEED_EXPLICIT -# endif -# if __GNUC__ == 2 && __GNUC_MINOR__ <= 8 -# define __STL_NO_EXCEPTION_HEADER -# define __STL_NO_BAD_ALLOC -# endif -# if __GNUC__ == 2 && __GNUC_MINOR__ >= 8 # define __STL_CLASS_PARTIAL_SPECIALIZATION # define __STL_FUNCTION_TMPL_PARTIAL_ORDER # define __STL_EXPLICIT_FUNCTION_TMPL_ARGS @@ -273,155 +301,147 @@ # define __STL_CAN_THROW_RANGE_ERRORS // g++ 2.8.1 supports member template functions, but not member // template nested classes. -# if __GNUC_MINOR__ >= 9 # define __STL_MEMBER_TEMPLATE_CLASSES # define __STL_TEMPLATE_FRIENDS # define __SGI_STL_USE_AUTO_PTR_CONVERSIONS # define __STL_HAS_NAMESPACES -//# define __STL_USE_NEW_IOSTREAMS -# endif -# endif # define __STL_DEFAULT_CONSTRUCTOR_BUG -# ifdef __EXCEPTIONS -# define __STL_USE_EXCEPTIONS -# endif -# ifdef _REENTRANT -# define __STL_PTHREADS -# endif -# if (__GNUC__ < 2) || (__GNUC__ == 2 && __GNUC_MINOR__ < 95) -# define __STL_NO_FUNCTION_PTR_IN_CLASS_TEMPLATE -# endif +//# ifdef _REENTRANT +//# define __STL_PTHREADS +//# endif # endif -# if defined(__SUNPRO_CC) -# define __STL_NO_BOOL -# define __STL_NEED_TYPENAME -# define __STL_NEED_EXPLICIT -# define __STL_USE_EXCEPTIONS -# ifdef _REENTRANT -# define __STL_PTHREADS -# endif -# define __SGI_STL_NO_ARROW_OPERATOR -# define __STL_PARTIAL_SPECIALIZATION_SYNTAX -# define __STL_NO_EXCEPTION_HEADER -# define __STL_NO_BAD_ALLOC -# endif -# if defined(__COMO__) -# define __STL_MEMBER_TEMPLATES -# define __STL_MEMBER_TEMPLATE_CLASSES -# define __STL_TEMPLATE_FRIENDS -# define __STL_CLASS_PARTIAL_SPECIALIZATION -# define __STL_USE_EXCEPTIONS -# define __STL_HAS_NAMESPACES -# endif + +//# if defined(__SUNPRO_CC) +//# define __STL_NO_BOOL +//# define __STL_NEED_TYPENAME +//# define __STL_NEED_EXPLICIT +//# define __STL_USE_EXCEPTIONS +//# ifdef _REENTRANT +//# define __STL_PTHREADS +//# endif +//# define __SGI_STL_NO_ARROW_OPERATOR +//# define __STL_PARTIAL_SPECIALIZATION_SYNTAX +//# define __STL_NO_EXCEPTION_HEADER +//# define __STL_NO_BAD_ALLOC +//# endif + +//# if defined(__COMO__) +//# define __STL_MEMBER_TEMPLATES +//# define __STL_MEMBER_TEMPLATE_CLASSES +//# define __STL_TEMPLATE_FRIENDS +//# define __STL_CLASS_PARTIAL_SPECIALIZATION +//# define __STL_USE_EXCEPTIONS +//# define __STL_HAS_NAMESPACES +//# endif // Intel compiler, which uses the EDG front end. -# if defined(__ICL) -# define __STL_LONG_LONG -# define __STL_MEMBER_TEMPLATES -# define __STL_MEMBER_TEMPLATE_CLASSES -# define __STL_TEMPLATE_FRIENDS -# define __STL_FUNCTION_TMPL_PARTIAL_ORDER -# define __STL_CLASS_PARTIAL_SPECIALIZATION -# define __STL_NO_DRAND48 -# define __STL_HAS_NAMESPACES -# define __STL_USE_EXCEPTIONS -# define __STL_MEMBER_TEMPLATE_KEYWORD -# ifdef _CPPUNWIND -# define __STL_USE_EXCEPTIONS -# endif -# ifdef _MT -# define __STL_WIN32THREADS -# endif -# endif +//# if defined(__ICL) +//# define __STL_LONG_LONG +//# define __STL_MEMBER_TEMPLATES +//# define __STL_MEMBER_TEMPLATE_CLASSES +//# define __STL_TEMPLATE_FRIENDS +//# define __STL_FUNCTION_TMPL_PARTIAL_ORDER +//# define __STL_CLASS_PARTIAL_SPECIALIZATION +//# define __STL_NO_DRAND48 +//# define __STL_HAS_NAMESPACES +//# define __STL_USE_EXCEPTIONS +//# define __STL_MEMBER_TEMPLATE_KEYWORD +//# ifdef _CPPUNWIND +//# define __STL_USE_EXCEPTIONS +//# endif +//# ifdef _MT +//# define __STL_WIN32THREADS +//# endif +//# endif // Mingw32, egcs compiler using the Microsoft C runtime -# if defined(__MINGW32__) -# define __STL_NO_DRAND48 -# ifdef _MT -# define __STL_WIN32THREADS -# endif -# endif +//# if defined(__MINGW32__) +//# define __STL_NO_DRAND48 +//# ifdef _MT +//# define __STL_WIN32THREADS +//# endif +//# endif // Cygwin32, egcs compiler on MS Windows -# if defined(__CYGWIN__) -# define __STL_NO_DRAND48 -# endif +//# if defined(__CYGWIN__) +//# define __STL_NO_DRAND48 +//# endif // Microsoft compiler. -# if defined(_MSC_VER) && !defined(__ICL) && !defined(__MWERKS__) -# define __STL_NO_DRAND48 -# define __STL_STATIC_CONST_INIT_BUG -# define __STL_NEED_TYPENAME -# define __STL_NO_USING_CLAUSE_IN_CLASS -# define __STL_NO_FRIEND_TEMPLATE_CLASS -# if _MSC_VER < 1100 /* 1000 is version 4.0, 1100 is 5.0, 1200 is 6.0. */ -# define __STL_NEED_EXPLICIT -# define __STL_NO_BOOL -# define __STL_NO_BAD_ALLOC -# endif -# if _MSC_VER > 1000 -# include -# define __STL_DONT_USE_BOOL_TYPEDEF -# endif -# define __STL_NON_TYPE_TMPL_PARAM_BUG -# define __SGI_STL_NO_ARROW_OPERATOR -# define __STL_DEFAULT_CONSTRUCTOR_BUG -# ifdef _CPPUNWIND -# define __STL_USE_EXCEPTIONS -# endif -# ifdef _MT -# define __STL_WIN32THREADS -# endif -# if _MSC_VER >= 1200 -# define __STL_PARTIAL_SPECIALIZATION_SYNTAX -# define __STL_HAS_NAMESPACES -# define __STL_CAN_THROW_RANGE_ERRORS -# define NOMINMAX -# undef min -# undef max -// disable warning 'initializers put in unrecognized initialization area' -# pragma warning ( disable : 4075 ) -// disable warning 'empty controlled statement found' -# pragma warning ( disable : 4390 ) -// disable warning 'debug symbol greater than 255 chars' -# pragma warning ( disable : 4786 ) -# endif -# if _MSC_VER < 1100 -# define __STL_NO_EXCEPTION_HEADER -# define __STL_NO_BAD_ALLOC -# endif - // Because of a Microsoft front end bug, we must not provide a - // namespace qualifier when declaring a friend function. -# define __STD_QUALIFIER -# endif +//# if defined(_MSC_VER) && !defined(__ICL) && !defined(__MWERKS__) +//# define __STL_NO_DRAND48 +//# define __STL_STATIC_CONST_INIT_BUG +//# define __STL_NEED_TYPENAME +//# define __STL_NO_USING_CLAUSE_IN_CLASS +//# define __STL_NO_FRIEND_TEMPLATE_CLASS +//# if _MSC_VER < 1100 /* 1000 is version 4.0, 1100 is 5.0, 1200 is 6.0. */ +//# define __STL_NEED_EXPLICIT +//# define __STL_NO_BOOL +//# define __STL_NO_BAD_ALLOC +//# endif +//# if _MSC_VER > 1000 +//# include +//# define __STL_DONT_USE_BOOL_TYPEDEF +//# endif +//# define __STL_NON_TYPE_TMPL_PARAM_BUG +//# define __SGI_STL_NO_ARROW_OPERATOR +//# define __STL_DEFAULT_CONSTRUCTOR_BUG +//# ifdef _CPPUNWIND +//# define __STL_USE_EXCEPTIONS +//# endif +//# ifdef _MT +//# define __STL_WIN32THREADS +//# endif +//# if _MSC_VER >= 1200 +//# define __STL_PARTIAL_SPECIALIZATION_SYNTAX +//# define __STL_HAS_NAMESPACES +//# define __STL_CAN_THROW_RANGE_ERRORS +//# define NOMINMAX +//# undef min +//# undef max +//// disable warning 'initializers put in unrecognized initialization area' +//# pragma warning ( disable : 4075 ) +//// disable warning 'empty controlled statement found' +//# pragma warning ( disable : 4390 ) +//// disable warning 'debug symbol greater than 255 chars' +//# pragma warning ( disable : 4786 ) +//# endif +//# if _MSC_VER < 1100 +//# define __STL_NO_EXCEPTION_HEADER +//# define __STL_NO_BAD_ALLOC +//# endif +// // Because of a Microsoft front end bug, we must not provide a +// // namespace qualifier when declaring a friend function. +//# define __STD_QUALIFIER +//# endif -# if defined(__BORLANDC__) -# define __STL_NO_BAD_ALLOC -# define __STL_NO_DRAND48 -# define __STL_DEFAULT_CONSTRUCTOR_BUG -# if __BORLANDC__ >= 0x540 /* C++ Builder 4.0 */ -# define __STL_CLASS_PARTIAL_SPECIALIZATION -# define __STL_FUNCTION_TMPL_PARTIAL_ORDER -# define __STL_EXPLICIT_FUNCTION_TMPL_ARGS -# define __STL_MEMBER_TEMPLATES -# define __STL_TEMPLATE_FRIENDS -# else -# define __STL_NEED_TYPENAME -# define __STL_LIMITED_DEFAULT_TEMPLATES -# define __SGI_STL_NO_ARROW_OPERATOR -# define __STL_NON_TYPE_TMPL_PARAM_BUG -# endif -# ifdef _CPPUNWIND -# define __STL_USE_EXCEPTIONS -# endif -# ifdef __MT__ -# define __STL_WIN32THREADS -# endif -# endif +//# if defined(__BORLANDC__) +//# define __STL_NO_BAD_ALLOC +//# define __STL_NO_DRAND48 +//# define __STL_DEFAULT_CONSTRUCTOR_BUG +//# if __BORLANDC__ >= 0x540 /* C++ Builder 4.0 */ +//# define __STL_CLASS_PARTIAL_SPECIALIZATION +//# define __STL_FUNCTION_TMPL_PARTIAL_ORDER +//# define __STL_EXPLICIT_FUNCTION_TMPL_ARGS +//# define __STL_MEMBER_TEMPLATES +//# define __STL_TEMPLATE_FRIENDS +//# else +//# define __STL_NEED_TYPENAME +//# define __STL_LIMITED_DEFAULT_TEMPLATES +//# define __SGI_STL_NO_ARROW_OPERATOR +//# define __STL_NON_TYPE_TMPL_PARAM_BUG +//# endif +//# ifdef _CPPUNWIND +//# define __STL_USE_EXCEPTIONS +//# endif +//# ifdef __MT__ +//# define __STL_WIN32THREADS +//# endif +//# endif # if defined(__STL_NO_BOOL) && !defined(__STL_DONT_USE_BOOL_TYPEDEF) typedef int bool; @@ -462,6 +482,9 @@ # define __STL_TEMPLATE_NULL # endif + +#define __STL_USE_SGI_ALLOCATORS + // Use standard-conforming allocators if we have the necessary language // features. __STL_USE_SGI_ALLOCATORS is a hook so that users can // disable new-style allocators, and continue to use the same kind of @@ -491,20 +514,20 @@ // edit library headers. # if defined(__STL_HAS_NAMESPACES) && !defined(__STL_NO_NAMESPACES) # define __STL_USE_NAMESPACES -# define __STD std -# define __STL_BEGIN_NAMESPACE namespace std { +# define __STD cgistd +# define __STL_BEGIN_NAMESPACE namespace cgistd { # define __STL_END_NAMESPACE } # if defined(__STL_FUNCTION_TMPL_PARTIAL_ORDER) && \ !defined(__STL_NO_RELOPS_NAMESPACE) # define __STL_USE_NAMESPACE_FOR_RELOPS -# define __STL_BEGIN_RELOPS_NAMESPACE namespace std { namespace rel_ops { +# define __STL_BEGIN_RELOPS_NAMESPACE namespace cgistd { namespace rel_ops { # define __STL_END_RELOPS_NAMESPACE } } -# define __STD_RELOPS std::rel_ops +# define __STD_RELOPS cgistd::rel_ops # else /* Use std::rel_ops namespace */ # define __STL_USE_NAMESPACE_FOR_RELOPS -# define __STL_BEGIN_RELOPS_NAMESPACE namespace std { +# define __STL_BEGIN_RELOPS_NAMESPACE namespace cgistd { # define __STL_END_RELOPS_NAMESPACE } -# define __STD_RELOPS std +# define __STD_RELOPS cgistd # endif /* Use std::rel_ops namespace */ # else # define __STD @@ -524,7 +547,7 @@ // MR version is not expected to have it. # if defined(__STL_USE_NAMESPACES) && !defined(__STD_QUALIFIER) -# define __STD_QUALIFIER std:: +# define __STD_QUALIFIER cgistd:: # else # define __STD_QUALIFIER # endif diff --git a/src/kernel/templates/stl/stl_construct.h b/src/kernel/templates/stl/stl_construct.h index a17f9eef8..2ffe70ee6 100644 --- a/src/kernel/templates/stl/stl_construct.h +++ b/src/kernel/templates/stl/stl_construct.h @@ -31,7 +31,7 @@ #ifndef __SGI_STL_INTERNAL_CONSTRUCT_H #define __SGI_STL_INTERNAL_CONSTRUCT_H -#include +#include "new" __STL_BEGIN_NAMESPACE diff --git a/src/kernel/templates/stl/stl_deque.h b/src/kernel/templates/stl/stl_deque.h index 7978f7dd4..9fb8a63cc 100644 --- a/src/kernel/templates/stl/stl_deque.h +++ b/src/kernel/templates/stl/stl_deque.h @@ -28,7 +28,7 @@ * You should not attempt to use it directly. */ -#include +#include "concept_checks.h" #ifndef __SGI_STL_INTERNAL_DEQUE_H #define __SGI_STL_INTERNAL_DEQUE_H diff --git a/src/kernel/templates/stl/stl_exception.h b/src/kernel/templates/stl/stl_exception.h index 37b54d744..8b2c6a67e 100644 --- a/src/kernel/templates/stl/stl_exception.h +++ b/src/kernel/templates/stl/stl_exception.h @@ -27,11 +27,11 @@ // in , but it suffices to support a bare minimum of STL // functionality. -#include +#include "stl_config.h" #ifndef __STL_NO_EXCEPTION_HEADER -#include +#include "exception" #define __STL_EXCEPTION_BASE exception #else /* __STL_NO_EXCEPTION_HEADER */ diff --git a/src/kernel/templates/stl/stl_hash_fun.h b/src/kernel/templates/stl/stl_hash_fun.h index 44ab9bb56..3b68f30e6 100644 --- a/src/kernel/templates/stl/stl_hash_fun.h +++ b/src/kernel/templates/stl/stl_hash_fun.h @@ -31,7 +31,7 @@ #ifndef __SGI_STL_HASH_FUN_H #define __SGI_STL_HASH_FUN_H -#include +#include "stddef.h" __STL_BEGIN_NAMESPACE diff --git a/src/kernel/templates/stl/stl_hash_map.h b/src/kernel/templates/stl/stl_hash_map.h index 0d5bc8af4..229d71ee1 100644 --- a/src/kernel/templates/stl/stl_hash_map.h +++ b/src/kernel/templates/stl/stl_hash_map.h @@ -31,7 +31,7 @@ #ifndef __SGI_STL_INTERNAL_HASH_MAP_H #define __SGI_STL_INTERNAL_HASH_MAP_H -#include +#include "concept_checks.h" __STL_BEGIN_NAMESPACE diff --git a/src/kernel/templates/stl/stl_hash_set.h b/src/kernel/templates/stl/stl_hash_set.h index a4b845b87..97847ce34 100644 --- a/src/kernel/templates/stl/stl_hash_set.h +++ b/src/kernel/templates/stl/stl_hash_set.h @@ -31,7 +31,7 @@ #ifndef __SGI_STL_INTERNAL_HASH_SET_H #define __SGI_STL_INTERNAL_HASH_SET_H -#include +#include "concept_checks.h" __STL_BEGIN_NAMESPACE diff --git a/src/kernel/templates/stl/stl_hashtable.h b/src/kernel/templates/stl/stl_hashtable.h index 04a082352..92d288bb6 100644 --- a/src/kernel/templates/stl/stl_hashtable.h +++ b/src/kernel/templates/stl/stl_hashtable.h @@ -34,15 +34,15 @@ // Hashtable class, used to implement the hashed associative containers // hash_set, hash_map, hash_multiset, and hash_multimap. -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "stl_algobase.h" +#include "stl_alloc.h" +#include "stl_construct.h" +#include "stl_tempbuf.h" +#include "stl_algo.h" +#include "stl_uninitialized.h" +#include "stl_function.h" +#include "stl_vector.h" +#include "stl_hash_fun.h" __STL_BEGIN_NAMESPACE diff --git a/src/kernel/templates/stl/stl_iterator.h b/src/kernel/templates/stl/stl_iterator.h index 807871e84..5785a1342 100644 --- a/src/kernel/templates/stl/stl_iterator.h +++ b/src/kernel/templates/stl/stl_iterator.h @@ -583,377 +583,377 @@ operator+(_Dist __n, // using new, templatized iostreams than if we're using the old cfront // version. -#ifdef __STL_USE_NEW_IOSTREAMS - -template , - class _Dist = ptrdiff_t> -class istream_iterator { -public: - typedef _CharT char_type; - typedef _Traits traits_type; - typedef basic_istream<_CharT, _Traits> istream_type; - - typedef input_iterator_tag iterator_category; - typedef _Tp value_type; - typedef _Dist difference_type; - typedef const _Tp* pointer; - typedef const _Tp& reference; - - istream_iterator() : _M_stream(0), _M_ok(false) {} - istream_iterator(istream_type& __s) : _M_stream(&__s) { _M_read(); } - - reference operator*() const { return _M_value; } - pointer operator->() const { return &(operator*()); } - - istream_iterator& operator++() { - _M_read(); - return *this; - } - istream_iterator operator++(int) { - istream_iterator __tmp = *this; - _M_read(); - return __tmp; - } - - bool _M_equal(const istream_iterator& __x) const - { return (_M_ok == __x._M_ok) && (!_M_ok || _M_stream == __x._M_stream); } - -private: - istream_type* _M_stream; - _Tp _M_value; - bool _M_ok; - - void _M_read() { - _M_ok = (_M_stream && *_M_stream) ? true : false; - if (_M_ok) { - *_M_stream >> _M_value; - _M_ok = *_M_stream ? true : false; - } - } -}; - -template -inline bool -operator==(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x, - const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __y) { - return __x._M_equal(__y); -} - -#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER - -template -inline bool -operator!=(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x, - const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __y) { - return !__x._M_equal(__y); -} - -#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */ - -template > -class ostream_iterator { -public: - typedef _CharT char_type; - typedef _Traits traits_type; - typedef basic_ostream<_CharT, _Traits> ostream_type; - - typedef output_iterator_tag iterator_category; - typedef void value_type; - typedef void difference_type; - typedef void pointer; - typedef void reference; - - ostream_iterator(ostream_type& __s) : _M_stream(&__s), _M_string(0) {} - ostream_iterator(ostream_type& __s, const _CharT* __c) - : _M_stream(&__s), _M_string(__c) {} - ostream_iterator<_Tp>& operator=(const _Tp& __value) { - *_M_stream << __value; - if (_M_string) *_M_stream << _M_string; - return *this; - } - ostream_iterator<_Tp>& operator*() { return *this; } - ostream_iterator<_Tp>& operator++() { return *this; } - ostream_iterator<_Tp>& operator++(int) { return *this; } -private: - ostream_type* _M_stream; - const _CharT* _M_string; -}; - -// The default template argument is declared in iosfwd - -// We do not read any characters until operator* is called. The first -// time operator* is called, it calls getc. Subsequent calls to getc -// return a cached character, and calls to operator++ use snextc. Before -// operator* or operator++ has been called, _M_is_initialized is false. -template -class istreambuf_iterator - : public iterator -{ -public: - typedef _CharT char_type; - typedef _Traits traits_type; - typedef typename _Traits::int_type int_type; - typedef basic_streambuf<_CharT, _Traits> streambuf_type; - typedef basic_istream<_CharT, _Traits> istream_type; - -public: - istreambuf_iterator(streambuf_type* __p = 0) { this->_M_init(__p); } - istreambuf_iterator(istream_type& __is) { this->_M_init(__is.rdbuf()); } - - char_type operator*() const - { return _M_is_initialized ? _M_c : _M_dereference_aux(); } - - istreambuf_iterator& operator++() { this->_M_nextc(); return *this; } - istreambuf_iterator operator++(int) { - if (!_M_is_initialized) - _M_postincr_aux(); - istreambuf_iterator __tmp = *this; - this->_M_nextc(); - return __tmp; - } - - bool equal(const istreambuf_iterator& __i) const { - return this->_M_is_initialized && __i._M_is_initialized - ? this->_M_eof == __i._M_eof - : this->_M_equal_aux(__i); - } - -private: - void _M_init(streambuf_type* __p) { - _M_buf = __p; - _M_eof = !__p; - _M_is_initialized = _M_eof; - } - - char_type _M_dereference_aux() const; - bool _M_equal_aux(const istreambuf_iterator&) const; - void _M_postincr_aux(); - - void _M_nextc() { - int_type __c = _M_buf->snextc(); - _M_c = traits_type::to_char_type(__c); - _M_eof = traits_type::eq_int_type(__c, traits_type::eof()); - _M_is_initialized = true; - } - - void _M_getc() const { - int_type __c = _M_buf->sgetc(); - _M_c = traits_type::to_char_type(__c); - _M_eof = traits_type::eq_int_type(__c, traits_type::eof()); - _M_is_initialized = true; - } - -private: - streambuf_type* _M_buf; - mutable _CharT _M_c; - mutable bool _M_eof : 1; - mutable bool _M_is_initialized : 1; -}; - -template -_CharT istreambuf_iterator<_CharT, _Traits>::_M_dereference_aux() const -{ - this->_M_getc(); - return _M_c; -} - -template -bool istreambuf_iterator<_CharT, _Traits> - ::_M_equal_aux(const istreambuf_iterator& __i) const -{ - if (!this->_M_is_initialized) - this->_M_getc(); - if (!__i._M_is_initialized) - __i._M_getc(); - - return this->_M_eof == __i._M_eof; -} - -template -void istreambuf_iterator<_CharT, _Traits>::_M_postincr_aux() -{ - this->_M_getc(); -} - -template -inline bool operator==(const istreambuf_iterator<_CharT, _Traits>& __x, - const istreambuf_iterator<_CharT, _Traits>& __y) { - return __x.equal(__y); -} - -#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER - -template -inline bool operator!=(const istreambuf_iterator<_CharT, _Traits>& __x, - const istreambuf_iterator<_CharT, _Traits>& __y) { - return !__x.equal(__y); -} - -#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */ - -// The default template argument is declared in iosfwd -template -class ostreambuf_iterator - : public iterator -{ -public: - typedef _CharT char_type; - typedef _Traits traits_type; - typedef typename _Traits::int_type int_type; - typedef basic_streambuf<_CharT, _Traits> streambuf_type; - typedef basic_ostream<_CharT, _Traits> ostream_type; - -public: - ostreambuf_iterator(streambuf_type* __buf) : _M_buf(__buf), _M_ok(__buf) {} - ostreambuf_iterator(ostream_type& __o) - : _M_buf(__o.rdbuf()), _M_ok(__o.rdbuf() != 0) {} - - ostreambuf_iterator& operator=(char_type __c) { - _M_ok = _M_ok && !traits_type::eq_int_type(_M_buf->sputc(__c), - traits_type::eof()); - return *this; - } - - ostreambuf_iterator& operator*() { return *this; } - ostreambuf_iterator& operator++() { return *this; } - ostreambuf_iterator& operator++(int) { return *this; } - - bool failed() const { return !_M_ok; } - -private: - streambuf_type* _M_buf; - bool _M_ok; -}; - -#else /* __STL_USE_NEW_IOSTREAMS */ - -template class istream_iterator; - -template -inline bool operator==(const istream_iterator<_Tp, _Dist>&, - const istream_iterator<_Tp, _Dist>&); - -template -class istream_iterator { -#ifdef __STL_TEMPLATE_FRIENDS - template - friend bool operator==(const istream_iterator<_T1, _D1>&, - const istream_iterator<_T1, _D1>&); -#else /* __STL_TEMPLATE_FRIENDS */ - friend bool __STD_QUALIFIER - operator== __STL_NULL_TMPL_ARGS (const istream_iterator&, - const istream_iterator&); -#endif /* __STL_TEMPLATE_FRIENDS */ - -protected: - istream* _M_stream; - _Tp _M_value; - bool _M_end_marker; - void _M_read() { - _M_end_marker = (*_M_stream) ? true : false; - if (_M_end_marker) *_M_stream >> _M_value; - _M_end_marker = (*_M_stream) ? true : false; - } -public: - typedef input_iterator_tag iterator_category; - typedef _Tp value_type; - typedef _Dist difference_type; - typedef const _Tp* pointer; - typedef const _Tp& reference; - - istream_iterator() : _M_stream(&cin), _M_end_marker(false) {} - istream_iterator(istream& __s) : _M_stream(&__s) { _M_read(); } - reference operator*() const { return _M_value; } -#ifndef __SGI_STL_NO_ARROW_OPERATOR - pointer operator->() const { return &(operator*()); } -#endif /* __SGI_STL_NO_ARROW_OPERATOR */ - istream_iterator<_Tp, _Dist>& operator++() { - _M_read(); - return *this; - } - istream_iterator<_Tp, _Dist> operator++(int) { - istream_iterator<_Tp, _Dist> __tmp = *this; - _M_read(); - return __tmp; - } -}; - -#ifndef __STL_CLASS_PARTIAL_SPECIALIZATION - -template -inline input_iterator_tag -iterator_category(const istream_iterator<_Tp, _Dist>&) -{ - return input_iterator_tag(); -} - -template -inline _Tp* -value_type(const istream_iterator<_Tp, _Dist>&) { return (_Tp*) 0; } - -template -inline _Dist* -distance_type(const istream_iterator<_Tp, _Dist>&) { return (_Dist*)0; } - -#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */ - -template -inline bool operator==(const istream_iterator<_Tp, _Distance>& __x, - const istream_iterator<_Tp, _Distance>& __y) { - return (__x._M_stream == __y._M_stream && - __x._M_end_marker == __y._M_end_marker) || - __x._M_end_marker == false && __y._M_end_marker == false; -} - -#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER - -template -inline bool operator!=(const istream_iterator<_Tp, _Distance>& __x, - const istream_iterator<_Tp, _Distance>& __y) { - return !(__x == __y); -} - -#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */ - -template -class ostream_iterator { -protected: - ostream* _M_stream; - const char* _M_string; -public: - typedef output_iterator_tag iterator_category; - typedef void value_type; - typedef void difference_type; - typedef void pointer; - typedef void reference; - - ostream_iterator(ostream& __s) : _M_stream(&__s), _M_string(0) {} - ostream_iterator(ostream& __s, const char* __c) - : _M_stream(&__s), _M_string(__c) {} - ostream_iterator<_Tp>& operator=(const _Tp& __value) { - *_M_stream << __value; - if (_M_string) *_M_stream << _M_string; - return *this; - } - ostream_iterator<_Tp>& operator*() { return *this; } - ostream_iterator<_Tp>& operator++() { return *this; } - ostream_iterator<_Tp>& operator++(int) { return *this; } -}; - -#ifndef __STL_CLASS_PARTIAL_SPECIALIZATION - -template -inline output_iterator_tag -iterator_category(const ostream_iterator<_Tp>&) { - return output_iterator_tag(); -} - -#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */ - -#endif /* __STL_USE_NEW_IOSTREAMS */ +//#ifdef __STL_USE_NEW_IOSTREAMS +// +//template , +// class _Dist = ptrdiff_t> +//class istream_iterator { +//public: +// typedef _CharT char_type; +// typedef _Traits traits_type; +// typedef basic_istream<_CharT, _Traits> istream_type; +// +// typedef input_iterator_tag iterator_category; +// typedef _Tp value_type; +// typedef _Dist difference_type; +// typedef const _Tp* pointer; +// typedef const _Tp& reference; +// +// istream_iterator() : _M_stream(0), _M_ok(false) {} +// istream_iterator(istream_type& __s) : _M_stream(&__s) { _M_read(); } +// +// reference operator*() const { return _M_value; } +// pointer operator->() const { return &(operator*()); } +// +// istream_iterator& operator++() { +// _M_read(); +// return *this; +// } +// istream_iterator operator++(int) { +// istream_iterator __tmp = *this; +// _M_read(); +// return __tmp; +// } +// +// bool _M_equal(const istream_iterator& __x) const +// { return (_M_ok == __x._M_ok) && (!_M_ok || _M_stream == __x._M_stream); } +// +//private: +// istream_type* _M_stream; +// _Tp _M_value; +// bool _M_ok; +// +// void _M_read() { +// _M_ok = (_M_stream && *_M_stream) ? true : false; +// if (_M_ok) { +// *_M_stream >> _M_value; +// _M_ok = *_M_stream ? true : false; +// } +// } +//}; +// +//template +//inline bool +//operator==(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x, +// const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __y) { +// return __x._M_equal(__y); +//} +// +//#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER +// +//template +//inline bool +//operator!=(const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __x, +// const istream_iterator<_Tp, _CharT, _Traits, _Dist>& __y) { +// return !__x._M_equal(__y); +//} +// +//#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */ +// +//template > +//class ostream_iterator { +//public: +// typedef _CharT char_type; +// typedef _Traits traits_type; +// typedef basic_ostream<_CharT, _Traits> ostream_type; +// +// typedef output_iterator_tag iterator_category; +// typedef void value_type; +// typedef void difference_type; +// typedef void pointer; +// typedef void reference; +// +// ostream_iterator(ostream_type& __s) : _M_stream(&__s), _M_string(0) {} +// ostream_iterator(ostream_type& __s, const _CharT* __c) +// : _M_stream(&__s), _M_string(__c) {} +// ostream_iterator<_Tp>& operator=(const _Tp& __value) { +// *_M_stream << __value; +// if (_M_string) *_M_stream << _M_string; +// return *this; +// } +// ostream_iterator<_Tp>& operator*() { return *this; } +// ostream_iterator<_Tp>& operator++() { return *this; } +// ostream_iterator<_Tp>& operator++(int) { return *this; } +//private: +// ostream_type* _M_stream; +// const _CharT* _M_string; +//}; +// +//// The default template argument is declared in iosfwd +// +//// We do not read any characters until operator* is called. The first +//// time operator* is called, it calls getc. Subsequent calls to getc +//// return a cached character, and calls to operator++ use snextc. Before +//// operator* or operator++ has been called, _M_is_initialized is false. +//template +//class istreambuf_iterator +// : public iterator +//{ +//public: +// typedef _CharT char_type; +// typedef _Traits traits_type; +// typedef typename _Traits::int_type int_type; +// typedef basic_streambuf<_CharT, _Traits> streambuf_type; +// typedef basic_istream<_CharT, _Traits> istream_type; +// +//public: +// istreambuf_iterator(streambuf_type* __p = 0) { this->_M_init(__p); } +// istreambuf_iterator(istream_type& __is) { this->_M_init(__is.rdbuf()); } +// +// char_type operator*() const +// { return _M_is_initialized ? _M_c : _M_dereference_aux(); } +// +// istreambuf_iterator& operator++() { this->_M_nextc(); return *this; } +// istreambuf_iterator operator++(int) { +// if (!_M_is_initialized) +// _M_postincr_aux(); +// istreambuf_iterator __tmp = *this; +// this->_M_nextc(); +// return __tmp; +// } +// +// bool equal(const istreambuf_iterator& __i) const { +// return this->_M_is_initialized && __i._M_is_initialized +// ? this->_M_eof == __i._M_eof +// : this->_M_equal_aux(__i); +// } +// +//private: +// void _M_init(streambuf_type* __p) { +// _M_buf = __p; +// _M_eof = !__p; +// _M_is_initialized = _M_eof; +// } +// +// char_type _M_dereference_aux() const; +// bool _M_equal_aux(const istreambuf_iterator&) const; +// void _M_postincr_aux(); +// +// void _M_nextc() { +// int_type __c = _M_buf->snextc(); +// _M_c = traits_type::to_char_type(__c); +// _M_eof = traits_type::eq_int_type(__c, traits_type::eof()); +// _M_is_initialized = true; +// } +// +// void _M_getc() const { +// int_type __c = _M_buf->sgetc(); +// _M_c = traits_type::to_char_type(__c); +// _M_eof = traits_type::eq_int_type(__c, traits_type::eof()); +// _M_is_initialized = true; +// } +// +//private: +// streambuf_type* _M_buf; +// mutable _CharT _M_c; +// mutable bool _M_eof : 1; +// mutable bool _M_is_initialized : 1; +//}; +// +//template +//_CharT istreambuf_iterator<_CharT, _Traits>::_M_dereference_aux() const +//{ +// this->_M_getc(); +// return _M_c; +//} +// +//template +//bool istreambuf_iterator<_CharT, _Traits> +// ::_M_equal_aux(const istreambuf_iterator& __i) const +//{ +// if (!this->_M_is_initialized) +// this->_M_getc(); +// if (!__i._M_is_initialized) +// __i._M_getc(); +// +// return this->_M_eof == __i._M_eof; +//} +// +//template +//void istreambuf_iterator<_CharT, _Traits>::_M_postincr_aux() +//{ +// this->_M_getc(); +//} +// +//template +//inline bool operator==(const istreambuf_iterator<_CharT, _Traits>& __x, +// const istreambuf_iterator<_CharT, _Traits>& __y) { +// return __x.equal(__y); +//} +// +//#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER +// +//template +//inline bool operator!=(const istreambuf_iterator<_CharT, _Traits>& __x, +// const istreambuf_iterator<_CharT, _Traits>& __y) { +// return !__x.equal(__y); +//} +// +//#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */ +// +//// The default template argument is declared in iosfwd +//template +//class ostreambuf_iterator +// : public iterator +//{ +//public: +// typedef _CharT char_type; +// typedef _Traits traits_type; +// typedef typename _Traits::int_type int_type; +// typedef basic_streambuf<_CharT, _Traits> streambuf_type; +// typedef basic_ostream<_CharT, _Traits> ostream_type; +// +//public: +// ostreambuf_iterator(streambuf_type* __buf) : _M_buf(__buf), _M_ok(__buf) {} +// ostreambuf_iterator(ostream_type& __o) +// : _M_buf(__o.rdbuf()), _M_ok(__o.rdbuf() != 0) {} +// +// ostreambuf_iterator& operator=(char_type __c) { +// _M_ok = _M_ok && !traits_type::eq_int_type(_M_buf->sputc(__c), +// traits_type::eof()); +// return *this; +// } +// +// ostreambuf_iterator& operator*() { return *this; } +// ostreambuf_iterator& operator++() { return *this; } +// ostreambuf_iterator& operator++(int) { return *this; } +// +// bool failed() const { return !_M_ok; } +// +//private: +// streambuf_type* _M_buf; +// bool _M_ok; +//}; +// +//#else /* __STL_USE_NEW_IOSTREAMS */ +// +//template class istream_iterator; +// +//template +//inline bool operator==(const istream_iterator<_Tp, _Dist>&, +// const istream_iterator<_Tp, _Dist>&); +// +//template +//class istream_iterator { +//#ifdef __STL_TEMPLATE_FRIENDS +// template +// friend bool operator==(const istream_iterator<_T1, _D1>&, +// const istream_iterator<_T1, _D1>&); +//#else /* __STL_TEMPLATE_FRIENDS */ +// friend bool __STD_QUALIFIER +// operator== __STL_NULL_TMPL_ARGS (const istream_iterator&, +// const istream_iterator&); +//#endif /* __STL_TEMPLATE_FRIENDS */ +// +//protected: +// istream* _M_stream; +// _Tp _M_value; +// bool _M_end_marker; +// void _M_read() { +// _M_end_marker = (*_M_stream) ? true : false; +// if (_M_end_marker) *_M_stream >> _M_value; +// _M_end_marker = (*_M_stream) ? true : false; +// } +//public: +// typedef input_iterator_tag iterator_category; +// typedef _Tp value_type; +// typedef _Dist difference_type; +// typedef const _Tp* pointer; +// typedef const _Tp& reference; +// +// istream_iterator() : _M_stream(&cin), _M_end_marker(false) {} +// istream_iterator(istream& __s) : _M_stream(&__s) { _M_read(); } +// reference operator*() const { return _M_value; } +//#ifndef __SGI_STL_NO_ARROW_OPERATOR +// pointer operator->() const { return &(operator*()); } +//#endif /* __SGI_STL_NO_ARROW_OPERATOR */ +// istream_iterator<_Tp, _Dist>& operator++() { +// _M_read(); +// return *this; +// } +// istream_iterator<_Tp, _Dist> operator++(int) { +// istream_iterator<_Tp, _Dist> __tmp = *this; +// _M_read(); +// return __tmp; +// } +//}; +// +//#ifndef __STL_CLASS_PARTIAL_SPECIALIZATION +// +//template +//inline input_iterator_tag +//iterator_category(const istream_iterator<_Tp, _Dist>&) +//{ +// return input_iterator_tag(); +//} +// +//template +//inline _Tp* +//value_type(const istream_iterator<_Tp, _Dist>&) { return (_Tp*) 0; } +// +//template +//inline _Dist* +//distance_type(const istream_iterator<_Tp, _Dist>&) { return (_Dist*)0; } +// +//#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */ +// +//template +//inline bool operator==(const istream_iterator<_Tp, _Distance>& __x, +// const istream_iterator<_Tp, _Distance>& __y) { +// return (__x._M_stream == __y._M_stream && +// __x._M_end_marker == __y._M_end_marker) || +// __x._M_end_marker == false && __y._M_end_marker == false; +//} +// +//#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER +// +//template +//inline bool operator!=(const istream_iterator<_Tp, _Distance>& __x, +// const istream_iterator<_Tp, _Distance>& __y) { +// return !(__x == __y); +//} +// +//#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */ +// +//template +//class ostream_iterator { +//protected: +// ostream* _M_stream; +// const char* _M_string; +//public: +// typedef output_iterator_tag iterator_category; +// typedef void value_type; +// typedef void difference_type; +// typedef void pointer; +// typedef void reference; +// +// ostream_iterator(ostream& __s) : _M_stream(&__s), _M_string(0) {} +// ostream_iterator(ostream& __s, const char* __c) +// : _M_stream(&__s), _M_string(__c) {} +// ostream_iterator<_Tp>& operator=(const _Tp& __value) { +// *_M_stream << __value; +// if (_M_string) *_M_stream << _M_string; +// return *this; +// } +// ostream_iterator<_Tp>& operator*() { return *this; } +// ostream_iterator<_Tp>& operator++() { return *this; } +// ostream_iterator<_Tp>& operator++(int) { return *this; } +//}; +// +//#ifndef __STL_CLASS_PARTIAL_SPECIALIZATION +// +//template +//inline output_iterator_tag +//iterator_category(const ostream_iterator<_Tp>&) { +// return output_iterator_tag(); +//} +// +//#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */ +// +//#endif /* __STL_USE_NEW_IOSTREAMS */ __STL_END_NAMESPACE diff --git a/src/kernel/templates/stl/stl_iterator_base.h b/src/kernel/templates/stl/stl_iterator_base.h index 9c5422550..7165db199 100644 --- a/src/kernel/templates/stl/stl_iterator_base.h +++ b/src/kernel/templates/stl/stl_iterator_base.h @@ -35,7 +35,7 @@ // The internal file stl_iterator.h contains predefined iterators, // such as front_insert_iterator and istream_iterator. -#include +#include "concept_checks.h" __STL_BEGIN_NAMESPACE diff --git a/src/kernel/templates/stl/stl_list.h b/src/kernel/templates/stl/stl_list.h index 1aa603a79..78a7fcc8e 100644 --- a/src/kernel/templates/stl/stl_list.h +++ b/src/kernel/templates/stl/stl_list.h @@ -31,7 +31,7 @@ #ifndef __SGI_STL_INTERNAL_LIST_H #define __SGI_STL_INTERNAL_LIST_H -#include +#include "concept_checks.h" __STL_BEGIN_NAMESPACE diff --git a/src/kernel/templates/stl/stl_map.h b/src/kernel/templates/stl/stl_map.h index a2ea66c54..a67e5f4c6 100644 --- a/src/kernel/templates/stl/stl_map.h +++ b/src/kernel/templates/stl/stl_map.h @@ -31,7 +31,7 @@ #ifndef __SGI_STL_INTERNAL_MAP_H #define __SGI_STL_INTERNAL_MAP_H -#include +#include "concept_checks.h" __STL_BEGIN_NAMESPACE diff --git a/src/kernel/templates/stl/stl_multimap.h b/src/kernel/templates/stl/stl_multimap.h index ecd959c5e..78fb5ef02 100644 --- a/src/kernel/templates/stl/stl_multimap.h +++ b/src/kernel/templates/stl/stl_multimap.h @@ -31,7 +31,7 @@ #ifndef __SGI_STL_INTERNAL_MULTIMAP_H #define __SGI_STL_INTERNAL_MULTIMAP_H -#include +#include "concept_checks.h" __STL_BEGIN_NAMESPACE diff --git a/src/kernel/templates/stl/stl_multiset.h b/src/kernel/templates/stl/stl_multiset.h index 5365ffb2d..edea1b95b 100644 --- a/src/kernel/templates/stl/stl_multiset.h +++ b/src/kernel/templates/stl/stl_multiset.h @@ -31,7 +31,7 @@ #ifndef __SGI_STL_INTERNAL_MULTISET_H #define __SGI_STL_INTERNAL_MULTISET_H -#include +#include "concept_checks.h" __STL_BEGIN_NAMESPACE diff --git a/src/kernel/templates/stl/stl_queue.h b/src/kernel/templates/stl/stl_queue.h index 833e45f54..850f60771 100644 --- a/src/kernel/templates/stl/stl_queue.h +++ b/src/kernel/templates/stl/stl_queue.h @@ -31,7 +31,7 @@ #ifndef __SGI_STL_INTERNAL_QUEUE_H #define __SGI_STL_INTERNAL_QUEUE_H -#include +#include "sequence_concepts.h" __STL_BEGIN_NAMESPACE diff --git a/src/kernel/templates/stl/stl_range_errors.h b/src/kernel/templates/stl/stl_range_errors.h index 3ddde6dcb..d9dfd0639 100644 --- a/src/kernel/templates/stl/stl_range_errors.h +++ b/src/kernel/templates/stl/stl_range_errors.h @@ -22,7 +22,7 @@ // __STL_DONT_THROW_RANGE_ERRORS is a hook so that users can disable // this exception throwing. -#include +#include "stl_config.h" #if defined(__STL_CAN_THROW_RANGE_ERRORS) && \ defined(__STL_USE_EXCEPTIONS) && \ @@ -45,7 +45,7 @@ __STL_END_NAMESPACE // stdexcept header and throw the appropriate exceptions directly. #elif defined(__STL_THROW_RANGE_ERRORS) -#include +#include "stdexcept" __STL_BEGIN_NAMESPACE inline void __stl_throw_range_error(const char* __msg) diff --git a/src/kernel/templates/stl/stl_set.h b/src/kernel/templates/stl/stl_set.h index 1916d216a..d02be1620 100644 --- a/src/kernel/templates/stl/stl_set.h +++ b/src/kernel/templates/stl/stl_set.h @@ -31,7 +31,7 @@ #ifndef __SGI_STL_INTERNAL_SET_H #define __SGI_STL_INTERNAL_SET_H -#include +#include "concept_checks.h" __STL_BEGIN_NAMESPACE diff --git a/src/kernel/templates/stl/stl_slist.h b/src/kernel/templates/stl/stl_slist.h index a748d1ac1..1d9611cea 100644 --- a/src/kernel/templates/stl/stl_slist.h +++ b/src/kernel/templates/stl/stl_slist.h @@ -19,7 +19,7 @@ #ifndef __SGI_STL_INTERNAL_SLIST_H #define __SGI_STL_INTERNAL_SLIST_H -#include +#include "concept_checks.h" __STL_BEGIN_NAMESPACE diff --git a/src/kernel/templates/stl/stl_stack.h b/src/kernel/templates/stl/stl_stack.h index 0693e57fa..29a9e3f61 100644 --- a/src/kernel/templates/stl/stl_stack.h +++ b/src/kernel/templates/stl/stl_stack.h @@ -31,7 +31,7 @@ #ifndef __SGI_STL_INTERNAL_STACK_H #define __SGI_STL_INTERNAL_STACK_H -#include +#include "sequence_concepts.h" __STL_BEGIN_NAMESPACE diff --git a/src/kernel/templates/stl/stl_string_fwd.h b/src/kernel/templates/stl/stl_string_fwd.h index 8e59de750..11b58c11c 100644 --- a/src/kernel/templates/stl/stl_string_fwd.h +++ b/src/kernel/templates/stl/stl_string_fwd.h @@ -14,10 +14,10 @@ #ifndef __SGI_STL_STRING_FWD_H #define __SGI_STL_STRING_FWD_H -#include -#include -#include -#include +#include "stddef.h" +#include "stl_config.h" +#include "stl_alloc.h" +#include "char_traits.h" __STL_BEGIN_NAMESPACE diff --git a/src/kernel/templates/stl/stl_threads.h b/src/kernel/templates/stl/stl_threads.h index 4b0a6431e..187be8b46 100644 --- a/src/kernel/templates/stl/stl_threads.h +++ b/src/kernel/templates/stl/stl_threads.h @@ -25,15 +25,15 @@ // Schlick, 1999. #if defined(__STL_SGI_THREADS) -#include -#include +#include "mutex.h" +#include "time.h" #elif defined(__STL_PTHREADS) -#include +#include "pthread.h" #elif defined(__STL_UITHREADS) -#include -#include +#include "thread.h" +#include "synch.h" #elif defined(__STL_WIN32THREADS) -#include +#include "windows.h" #endif __STL_BEGIN_NAMESPACE diff --git a/src/kernel/templates/stl/stl_tree.h b/src/kernel/templates/stl/stl_tree.h index 1049ba33e..33600cb68 100644 --- a/src/kernel/templates/stl/stl_tree.h +++ b/src/kernel/templates/stl/stl_tree.h @@ -53,10 +53,10 @@ iterators invalidated are those referring to the deleted node. */ -#include -#include -#include -#include +#include "stl_algobase.h" +#include "stl_alloc.h" +#include "stl_construct.h" +#include "stl_function.h" __STL_BEGIN_NAMESPACE diff --git a/src/kernel/templates/stl/stl_vector.h b/src/kernel/templates/stl/stl_vector.h index 883fff9be..ee0ebe96b 100644 --- a/src/kernel/templates/stl/stl_vector.h +++ b/src/kernel/templates/stl/stl_vector.h @@ -31,7 +31,7 @@ #ifndef __SGI_STL_INTERNAL_VECTOR_H #define __SGI_STL_INTERNAL_VECTOR_H -#include +#include "concept_checks.h" __STL_BEGIN_NAMESPACE diff --git a/src/kernel/templates/stl/string b/src/kernel/templates/stl/string index 1ca65218a..3269c0c05 100644 --- a/src/kernel/templates/stl/string +++ b/src/kernel/templates/stl/string @@ -14,20 +14,20 @@ #ifndef __SGI_STL_STRING #define __SGI_STL_STRING -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "stl_config.h" +#include "stl_string_fwd.h" +#include "ctype.h" +#include "functional" +#include "stl_ctraits_fns.h" +#include "stdexcept" +#include "stl_iterator_base.h" +#include "memory" +#include "algorithm" #ifdef __STL_USE_NEW_IOSTREAMS -#include +#include "iosfwd" #else /* __STL_USE_NEW_IOSTREAMS */ -#include +#include "char_traits.h" #endif /* __STL_USE_NEW_IOSTREAMS */ // Standard C++ string class. This class has performance @@ -2017,329 +2017,329 @@ inline void swap(basic_string<_CharT,_Traits,_Alloc>& __x, // I/O. -#ifndef __STL_USE_NEW_IOSTREAMS -__STL_END_NAMESPACE -#include -__STL_BEGIN_NAMESPACE -#endif /* __STL_USE_NEW_IOSTREAMS */ +//#ifndef __STL_USE_NEW_IOSTREAMS +//__STL_END_NAMESPACE +//#include "iostream.h" +//__STL_BEGIN_NAMESPACE +//#endif /* __STL_USE_NEW_IOSTREAMS */ -#ifdef __STL_USE_NEW_IOSTREAMS - -template -inline bool -__sgi_string_fill(basic_ostream<_CharT, _Traits>& __os, - basic_streambuf<_CharT, _Traits>* __buf, - size_t __n) -{ - _CharT __f = __os.fill(); - size_t __i; - bool __ok = true; - - for (__i = 0; __i < __n; __i++) - __ok = __ok && !_Traits::eq_int_type(__buf->sputc(__f), _Traits::eof()); - return __ok; -} - -template -basic_ostream<_CharT, _Traits>& -operator<<(basic_ostream<_CharT, _Traits>& __os, - const basic_string<_CharT,_Traits,_Alloc>& __s) -{ - typename basic_ostream<_CharT, _Traits>::sentry __sentry(__os); - bool __ok = false; - - if (__sentry) { - __ok = true; - size_t __n = __s.size(); - size_t __pad_len = 0; - const bool __left = (__os.flags() & ios::left) != 0; - const size_t __w = __os.width(0); - basic_streambuf<_CharT, _Traits>* __buf = __os.rdbuf(); - - if (__w != 0 && __n < __w) - __pad_len = __w - __n; - - if (!__left) - __ok = __sgi_string_fill(__os, __buf, __pad_len); - - __ok = __ok && - __buf->sputn(__s.data(), streamsize(__n)) == streamsize(__n); - - if (__left) - __ok = __ok && __sgi_string_fill(__os, __buf, __pad_len); - } - - if (!__ok) - __os.setstate(ios_base::failbit); - - return __os; -} - -template -basic_istream<_CharT, _Traits>& -operator>>(basic_istream<_CharT, _Traits>& __is, - basic_string<_CharT,_Traits,_Alloc>& __s) -{ - typename basic_istream<_CharT, _Traits>::sentry __sentry(__is); - - if (__sentry) { - basic_streambuf<_CharT, _Traits>* __buf = __is.rdbuf(); - const ctype<_CharT>& __ctype = use_facet >(__is.getloc()); - - __s.clear(); - size_t __n = __is.width(0); - if (__n == 0) - __n = static_cast(-1); - else - __s.reserve(__n); - - - while (__n-- > 0) { - typename _Traits::int_type __c1 = __buf->sbumpc(); - if (_Traits::eq_int_type(__c1, _Traits::eof())) { - __is.setstate(ios_base::eofbit); - break; - } - else { - _CharT __c = _Traits::to_char_type(__c1); - - if (__ctype.is(ctype<_CharT>::space, __c)) { - if (_Traits::eq_int_type(__buf->sputbackc(__c), _Traits::eof())) - __is.setstate(ios_base::failbit); - break; - } - else - __s.push_back(__c); - } - } - - // If we have read no characters, then set failbit. - if (__s.size() == 0) - __is.setstate(ios_base::failbit); - } - else - __is.setstate(ios_base::failbit); - - return __is; -} - -template -basic_istream<_CharT, _Traits>& -getline(istream& __is, - basic_string<_CharT,_Traits,_Alloc>& __s, - _CharT __delim) -{ - size_t __nread = 0; - typename basic_istream<_CharT, _Traits>::sentry __sentry(__is, true); - if (__sentry) { - basic_streambuf<_CharT, _Traits>* __buf = __is.rdbuf(); - __s.clear(); - - int __c1; - while (__nread < __s.max_size()) { - int __c1 = __buf->sbumpc(); - if (_Traits::eq_int_type(__c1, _Traits::eof())) { - __is.setstate(ios_base::eofbit); - break; - } - else { - ++__nread; - _CharT __c = _Traits::to_char_type(__c1); - if (!_Traits::eq(__c, __delim)) - __s.push_back(__c); - else - break; // Character is extracted but not appended. - } - } - } - if (__nread == 0 || __nread >= __s.max_size()) - __is.setstate(ios_base::failbit); - - return __is; -} - -template -inline basic_istream<_CharT, _Traits>& -getline(basic_istream<_CharT, _Traits>& __is, - basic_string<_CharT,_Traits,_Alloc>& __s) -{ - return getline(__is, __s, '\n'); -} - -#else /* __STL_USE_NEW_IOSTREAMS */ - -inline void __sgi_string_fill(ostream& __os, streambuf* __buf, size_t __n) -{ - char __f = __os.fill(); - size_t __i; - - for (__i = 0; __i < __n; __i++) __buf->sputc(__f); -} - -template -ostream& operator<<(ostream& __os, - const basic_string<_CharT,_Traits,_Alloc>& __s) -{ - streambuf* __buf = __os.rdbuf(); - if (__buf) { - size_t __n = __s.size(); - size_t __pad_len = 0; - const bool __left = (__os.flags() & ios::left) != 0; - const size_t __w = __os.width(); - - if (__w > 0) { - __n = min(__w, __n); - __pad_len = __w - __n; - } - - if (!__left) - __sgi_string_fill(__os, __buf, __pad_len); - - const size_t __nwritten = __buf->sputn(__s.data(), __n); - - if (__left) - __sgi_string_fill(__os, __buf, __pad_len); - - if (__nwritten != __n) - __os.clear(__os.rdstate() | ios::failbit); - - __os.width(0); - } - else - __os.clear(__os.rdstate() | ios::badbit); - - return __os; -} - -template -istream& operator>>(istream& __is, basic_string<_CharT,_Traits,_Alloc>& __s) -{ - if (!__is) - return __is; - - streambuf* __buf = __is.rdbuf(); - if (__buf) { - -#ifdef __USLC__ -/* Jochen Schlick '1999 - operator >> modified. Work-around to get the - * output buffer flushed (necessary when using - * "cout" (without endl or flushing) followed by - * "cin >>" ...) - */ - if (__is.flags() & ios::skipws) { - _CharT __c; - do - __is.get(__c); - while (__is && isspace(__c)); - if (__is) - __is.putback(__c); - } -#else - if (__is.flags() & ios::skipws) { - int __c; - do { - __c = __buf->sbumpc(); - } - while (__c != EOF && isspace((unsigned char)__c)); - - if (__c == EOF) { - __is.clear(__is.rdstate() | ios::eofbit | ios::failbit); - } - else { - if (__buf->sputbackc(__c) == EOF) - __is.clear(__is.rdstate() | ios::failbit); - } - } -#endif - - // If we arrive at end of file (or fail for some other reason) while - // still discarding whitespace, then we don't try to read the string. - if (__is) { - __s.clear(); - - size_t __n = __is.width(); - if (__n == 0) - __n = static_cast(-1); - else - __s.reserve(__n); - - while (__n-- > 0) { - int __c1 = __buf->sbumpc(); - if (__c1 == EOF) { - __is.clear(__is.rdstate() | ios::eofbit); - break; - } - else { - _CharT __c = _Traits::to_char_type(__c1); - - if (isspace((unsigned char) __c)) { - if (__buf->sputbackc(__c) == EOF) - __is.clear(__is.rdstate() | ios::failbit); - break; - } - else - __s.push_back(__c); - } - } - - // If we have read no characters, then set failbit. - if (__s.size() == 0) - __is.clear(__is.rdstate() | ios::failbit); - } - - __is.width(0); - } - else // We have no streambuf. - __is.clear(__is.rdstate() | ios::badbit); - - return __is; -} - -template -istream& getline(istream& __is, - basic_string<_CharT,_Traits,_Alloc>& __s, - _CharT __delim) -{ - streambuf* __buf = __is.rdbuf(); - if (__buf) { - size_t __nread = 0; - if (__is) { - __s.clear(); - - while (__nread < __s.max_size()) { - int __c1 = __buf->sbumpc(); - if (__c1 == EOF) { - __is.clear(__is.rdstate() | ios::eofbit); - break; - } - else { - ++__nread; - _CharT __c = _Traits::to_char_type(__c1); - if (!_Traits::eq(__c, __delim)) - __s.push_back(__c); - else - break; // Character is extracted but not appended. - } - } - } - - if (__nread == 0 || __nread >= __s.max_size()) - __is.clear(__is.rdstate() | ios::failbit); - } - else - __is.clear(__is.rdstate() | ios::badbit); - - return __is; -} - -template -inline istream& -getline(istream& __is, basic_string<_CharT,_Traits,_Alloc>& __s) -{ - return getline(__is, __s, '\n'); -} - -#endif /* __STL_USE_NEW_IOSTREAMS */ +//#ifdef __STL_USE_NEW_IOSTREAMS +// +//template +//inline bool +//__sgi_string_fill(basic_ostream<_CharT, _Traits>& __os, +// basic_streambuf<_CharT, _Traits>* __buf, +// size_t __n) +//{ +// _CharT __f = __os.fill(); +// size_t __i; +// bool __ok = true; +// +// for (__i = 0; __i < __n; __i++) +// __ok = __ok && !_Traits::eq_int_type(__buf->sputc(__f), _Traits::eof()); +// return __ok; +//} +// +//template +//basic_ostream<_CharT, _Traits>& +//operator<<(basic_ostream<_CharT, _Traits>& __os, +// const basic_string<_CharT,_Traits,_Alloc>& __s) +//{ +// typename basic_ostream<_CharT, _Traits>::sentry __sentry(__os); +// bool __ok = false; +// +// if (__sentry) { +// __ok = true; +// size_t __n = __s.size(); +// size_t __pad_len = 0; +// const bool __left = (__os.flags() & ios::left) != 0; +// const size_t __w = __os.width(0); +// basic_streambuf<_CharT, _Traits>* __buf = __os.rdbuf(); +// +// if (__w != 0 && __n < __w) +// __pad_len = __w - __n; +// +// if (!__left) +// __ok = __sgi_string_fill(__os, __buf, __pad_len); +// +// __ok = __ok && +// __buf->sputn(__s.data(), streamsize(__n)) == streamsize(__n); +// +// if (__left) +// __ok = __ok && __sgi_string_fill(__os, __buf, __pad_len); +// } +// +// if (!__ok) +// __os.setstate(ios_base::failbit); +// +// return __os; +//} +// +//template +//basic_istream<_CharT, _Traits>& +//operator>>(basic_istream<_CharT, _Traits>& __is, +// basic_string<_CharT,_Traits,_Alloc>& __s) +//{ +// typename basic_istream<_CharT, _Traits>::sentry __sentry(__is); +// +// if (__sentry) { +// basic_streambuf<_CharT, _Traits>* __buf = __is.rdbuf(); +// const ctype<_CharT>& __ctype = use_facet >(__is.getloc()); +// +// __s.clear(); +// size_t __n = __is.width(0); +// if (__n == 0) +// __n = static_cast(-1); +// else +// __s.reserve(__n); +// +// +// while (__n-- > 0) { +// typename _Traits::int_type __c1 = __buf->sbumpc(); +// if (_Traits::eq_int_type(__c1, _Traits::eof())) { +// __is.setstate(ios_base::eofbit); +// break; +// } +// else { +// _CharT __c = _Traits::to_char_type(__c1); +// +// if (__ctype.is(ctype<_CharT>::space, __c)) { +// if (_Traits::eq_int_type(__buf->sputbackc(__c), _Traits::eof())) +// __is.setstate(ios_base::failbit); +// break; +// } +// else +// __s.push_back(__c); +// } +// } +// +// // If we have read no characters, then set failbit. +// if (__s.size() == 0) +// __is.setstate(ios_base::failbit); +// } +// else +// __is.setstate(ios_base::failbit); +// +// return __is; +//} +// +//template +//basic_istream<_CharT, _Traits>& +//getline(istream& __is, +// basic_string<_CharT,_Traits,_Alloc>& __s, +// _CharT __delim) +//{ +// size_t __nread = 0; +// typename basic_istream<_CharT, _Traits>::sentry __sentry(__is, true); +// if (__sentry) { +// basic_streambuf<_CharT, _Traits>* __buf = __is.rdbuf(); +// __s.clear(); +// +// int __c1; +// while (__nread < __s.max_size()) { +// int __c1 = __buf->sbumpc(); +// if (_Traits::eq_int_type(__c1, _Traits::eof())) { +// __is.setstate(ios_base::eofbit); +// break; +// } +// else { +// ++__nread; +// _CharT __c = _Traits::to_char_type(__c1); +// if (!_Traits::eq(__c, __delim)) +// __s.push_back(__c); +// else +// break; // Character is extracted but not appended. +// } +// } +// } +// if (__nread == 0 || __nread >= __s.max_size()) +// __is.setstate(ios_base::failbit); +// +// return __is; +//} +// +//template +//inline basic_istream<_CharT, _Traits>& +//getline(basic_istream<_CharT, _Traits>& __is, +// basic_string<_CharT,_Traits,_Alloc>& __s) +//{ +// return getline(__is, __s, '\n'); +//} +// +//#else /* __STL_USE_NEW_IOSTREAMS */ +// +//inline void __sgi_string_fill(ostream& __os, streambuf* __buf, size_t __n) +//{ +// char __f = __os.fill(); +// size_t __i; +// +// for (__i = 0; __i < __n; __i++) __buf->sputc(__f); +//} +// +//template +//ostream& operator<<(ostream& __os, +// const basic_string<_CharT,_Traits,_Alloc>& __s) +//{ +// streambuf* __buf = __os.rdbuf(); +// if (__buf) { +// size_t __n = __s.size(); +// size_t __pad_len = 0; +// const bool __left = (__os.flags() & ios::left) != 0; +// const size_t __w = __os.width(); +// +// if (__w > 0) { +// __n = min(__w, __n); +// __pad_len = __w - __n; +// } +// +// if (!__left) +// __sgi_string_fill(__os, __buf, __pad_len); +// +// const size_t __nwritten = __buf->sputn(__s.data(), __n); +// +// if (__left) +// __sgi_string_fill(__os, __buf, __pad_len); +// +// if (__nwritten != __n) +// __os.clear(__os.rdstate() | ios::failbit); +// +// __os.width(0); +// } +// else +// __os.clear(__os.rdstate() | ios::badbit); +// +// return __os; +//} +// +//template +//istream& operator>>(istream& __is, basic_string<_CharT,_Traits,_Alloc>& __s) +//{ +// if (!__is) +// return __is; +// +// streambuf* __buf = __is.rdbuf(); +// if (__buf) { +// +//#ifdef __USLC__ +///* Jochen Schlick '1999 - operator >> modified. Work-around to get the +// * output buffer flushed (necessary when using +// * "cout" (without endl or flushing) followed by +// * "cin >>" ...) +// */ +// if (__is.flags() & ios::skipws) { +// _CharT __c; +// do +// __is.get(__c); +// while (__is && isspace(__c)); +// if (__is) +// __is.putback(__c); +// } +//#else +// if (__is.flags() & ios::skipws) { +// int __c; +// do { +// __c = __buf->sbumpc(); +// } +// while (__c != EOF && isspace((unsigned char)__c)); +// +// if (__c == EOF) { +// __is.clear(__is.rdstate() | ios::eofbit | ios::failbit); +// } +// else { +// if (__buf->sputbackc(__c) == EOF) +// __is.clear(__is.rdstate() | ios::failbit); +// } +// } +//#endif +// +// // If we arrive at end of file (or fail for some other reason) while +// // still discarding whitespace, then we don't try to read the string. +// if (__is) { +// __s.clear(); +// +// size_t __n = __is.width(); +// if (__n == 0) +// __n = static_cast(-1); +// else +// __s.reserve(__n); +// +// while (__n-- > 0) { +// int __c1 = __buf->sbumpc(); +// if (__c1 == EOF) { +// __is.clear(__is.rdstate() | ios::eofbit); +// break; +// } +// else { +// _CharT __c = _Traits::to_char_type(__c1); +// +// if (isspace((unsigned char) __c)) { +// if (__buf->sputbackc(__c) == EOF) +// __is.clear(__is.rdstate() | ios::failbit); +// break; +// } +// else +// __s.push_back(__c); +// } +// } +// +// // If we have read no characters, then set failbit. +// if (__s.size() == 0) +// __is.clear(__is.rdstate() | ios::failbit); +// } +// +// __is.width(0); +// } +// else // We have no streambuf. +// __is.clear(__is.rdstate() | ios::badbit); +// +// return __is; +//} +// +//template +//istream& getline(istream& __is, +// basic_string<_CharT,_Traits,_Alloc>& __s, +// _CharT __delim) +//{ +// streambuf* __buf = __is.rdbuf(); +// if (__buf) { +// size_t __nread = 0; +// if (__is) { +// __s.clear(); +// +// while (__nread < __s.max_size()) { +// int __c1 = __buf->sbumpc(); +// if (__c1 == EOF) { +// __is.clear(__is.rdstate() | ios::eofbit); +// break; +// } +// else { +// ++__nread; +// _CharT __c = _Traits::to_char_type(__c1); +// if (!_Traits::eq(__c, __delim)) +// __s.push_back(__c); +// else +// break; // Character is extracted but not appended. +// } +// } +// } +// +// if (__nread == 0 || __nread >= __s.max_size()) +// __is.clear(__is.rdstate() | ios::failbit); +// } +// else +// __is.clear(__is.rdstate() | ios::badbit); +// +// return __is; +//} +// +//template +//inline istream& +//getline(istream& __is, basic_string<_CharT,_Traits,_Alloc>& __s) +//{ +// return getline(__is, __s, '\n'); +//} +// +//#endif /* __STL_USE_NEW_IOSTREAMS */ template void _S_string_copy(const basic_string<_CharT,_Traits,_Alloc>& __s, @@ -2366,7 +2366,7 @@ inline const char* __get_c_string(const string& __s) { return __s.c_str(); } __STL_END_NAMESPACE -#include +#include "stl_hash_fun.h" __STL_BEGIN_NAMESPACE diff --git a/src/kernel/templates/stl/tempbuf.h b/src/kernel/templates/stl/tempbuf.h index aa4f289c5..b5c3d4cd6 100644 --- a/src/kernel/templates/stl/tempbuf.h +++ b/src/kernel/templates/stl/tempbuf.h @@ -28,22 +28,22 @@ #define __SGI_STL_TEMPBUF_H #ifndef __SGI_STL_PAIR_H -#include +#include "pair.h" #endif -#include /* XXX should use */ -#include /* XXX should use */ +#include /* XXX should use */ +#include /* XXX should use */ #include /* XXX should use */ #ifndef __TYPE_TRAITS_H -#include +#include "type_traits.h" #endif #ifndef __SGI_STL_INTERNAL_CONSTRUCT_H -#include +#include "stl_construct.h" #endif #ifndef __SGI_STL_INTERNAL_UNINITIALIZED_H -#include +#include "stl_uninitialized.h" #endif #ifndef __SGI_STL_INTERNAL_TEMPBUF_H -#include +#include "stl_tempbuf.h" #endif #ifdef __STL_USE_NAMESPACES diff --git a/src/kernel/templates/stl/tree.h b/src/kernel/templates/stl/tree.h index 77c57cbbb..08a6f17ed 100644 --- a/src/kernel/templates/stl/tree.h +++ b/src/kernel/templates/stl/tree.h @@ -30,10 +30,10 @@ #define __SGI_STL_TREE_H #ifndef __SGI_STL_INTERNAL_TREE_H -#include +#include "stl_tree.h" #endif -#include -#include +#include "algobase.h" +#include "alloc.h" #ifdef __STL_USE_NAMESPACES using __STD::rb_tree; diff --git a/src/kernel/templates/stl/type_traits.h b/src/kernel/templates/stl/type_traits.h index b6a7dfc6d..f1b4e5f26 100644 --- a/src/kernel/templates/stl/type_traits.h +++ b/src/kernel/templates/stl/type_traits.h @@ -16,7 +16,7 @@ #define __TYPE_TRAITS_H #ifndef __STL_CONFIG_H -#include +#include "stl_config.h" #endif /* diff --git a/src/kernel/templates/stl/utility b/src/kernel/templates/stl/utility index df8c22438..ec2358b17 100644 --- a/src/kernel/templates/stl/utility +++ b/src/kernel/templates/stl/utility @@ -27,9 +27,9 @@ #ifndef __SGI_STL_UTILITY #define __SGI_STL_UTILITY -#include -#include -#include +#include "stl_config.h" +#include "stl_relops.h" +#include "stl_pair.h" #endif /* __SGI_STL_UTILITY */ diff --git a/src/kernel/templates/stl/valarray b/src/kernel/templates/stl/valarray index 814197dce..dddb7d2a6 100644 --- a/src/kernel/templates/stl/valarray +++ b/src/kernel/templates/stl/valarray @@ -14,12 +14,12 @@ #ifndef __SGI_STL_VALARRAY #define __SGI_STL_VALARRAY -#include -#include -#include -#include -#include -#include +#include "type_traits.h" +#include "math.h" +#include "algorithm" +#include "numeric" +#include "limits" +#include "new" __STL_BEGIN_NAMESPACE diff --git a/src/kernel/templates/stl/vector b/src/kernel/templates/stl/vector index 272f60fcf..c24c0096a 100644 --- a/src/kernel/templates/stl/vector +++ b/src/kernel/templates/stl/vector @@ -27,13 +27,13 @@ #ifndef __SGI_STL_VECTOR #define __SGI_STL_VECTOR -#include -#include -#include -#include -#include -#include -#include +#include "stl_range_errors.h" +#include "stl_algobase.h" +#include "stl_alloc.h" +#include "stl_construct.h" +#include "stl_uninitialized.h" +#include "stl_vector.h" +#include "stl_bvector.h" #endif /* __SGI_STL_VECTOR */ diff --git a/src/kernel/templates/stl/vector.h b/src/kernel/templates/stl/vector.h index f48d4fd2a..5a3ff5ae1 100644 --- a/src/kernel/templates/stl/vector.h +++ b/src/kernel/templates/stl/vector.h @@ -27,10 +27,10 @@ #ifndef __SGI_STL_VECTOR_H #define __SGI_STL_VECTOR_H -#include -#include -#include -#include +#include "stl_range_errors.h" +#include "algobase.h" +#include "alloc.h" +#include "stl_vector.h" #ifdef __STL_USE_NAMESPACES using __STD::vector;