Commit d53d7f6e by Phil Edwards

algo.h: Use std not __STD.

2001-03-04  Phil Edwards  <pme@sources.redhat.com>

	http://gcc.gnu.org/ml/libstdc++/2001-03/msg00015.html
	* include/backward/algo.h:  Use std not __STD.  Remove unneeded
	macros and "never happens" code.  Adjust to C++STYLE guidelines.
	* include/backward/algobase.h:  Likewise.
	* include/backward/alloc.h:  Likewise.
	* include/backward/bvector.h:  Likewise.
	* include/backward/deque.h:  Likewise.
	* include/backward/function.h:  Likewise.
	* include/backward/hash_map.h:  Likewise.
	* include/backward/hash_set.h:  Likewise.
	* include/backward/hashtable.h:  Likewise.
	* include/backward/heap.h:  Likewise.
	* include/backward/iterator.h:  Likewise.
	* include/backward/list.h:  Likewise.
	* include/backward/map.h:  Likewise.
	* include/backward/multimap.h:  Likewise.
	* include/backward/multiset.h:  Likewise.
	* include/backward/pair.h:  Likewise.
	* include/backward/rope.h:  Likewise.
	* include/backward/set.h:  Likewise.
	* include/backward/slist.h:  Likewise.
	* include/backward/stack.h:  Likewise.
	* include/backward/strstream:  Likewise.
	* include/backward/tempbuf.h:  Likewise.
	* include/backward/tree.h:  Likewise.
	* include/backward/vector.h:  Likewise.
	* include/bits/basic_ios.h:  Likewise.
	* include/bits/basic_ios.tcc:  Likewise.
	* include/bits/basic_string.h:  Likewise.
	* include/bits/c++config:  Likewise.
	* include/bits/concept_checks.h:  Likewise.
	* include/bits/fpos.h:  Likewise.
	* include/bits/fstream.tcc:  Likewise.
	* include/bits/functexcept.h:  Likewise.
	* include/bits/ios_base.h:  Likewise.
	* include/bits/istream.tcc:  Likewise.
	* include/bits/mask_array.h:  Likewise.
	* include/bits/ostream.tcc:  Likewise.
	* include/bits/pthread_allocimpl.h:  Likewise.
	* include/bits/sbuf_iter.h:  Likewise.
	* include/bits/slice.h:  Likewise.
	* include/bits/slice_array.h:  Likewise.
	* include/bits/sstream.tcc:  Likewise.
	* include/bits/std_bitset.h:  Likewise.
	* include/bits/std_fstream.h:  Likewise.
	* include/bits/std_iomanip.h:  Likewise.
	* include/bits/std_ios.h:  Likewise.
	* include/bits/std_istream.h:  Likewise.
	* include/bits/std_iterator.h:  Likewise.
	* include/bits/std_memory.h:  Likewise.
	* include/bits/std_ostream.h:  Likewise.
	* include/bits/std_sstream.h:  Likewise.
	* include/bits/std_streambuf.h:  Likewise.
	* include/bits/std_string.h:  Likewise.
	* include/bits/std_valarray.h:  Likewise.
	* include/bits/stl_algo.h:  Likewise.
	* include/bits/stl_algobase.h:  Likewise.
	* include/bits/stl_alloc.h:  Likewise.
	* include/bits/stl_construct.h:  Likewise.
	* include/bits/stl_deque.h:  Likewise.
	* include/bits/stl_function.h:  Likewise.
	* include/bits/stl_heap.h:  Likewise.
	* include/bits/stl_iterator.h:  Likewise.
	* include/bits/stl_iterator_base.h:  Likewise.
	* include/bits/stl_list.h:  Likewise.
	* include/bits/stl_map.h:  Likewise.
	* include/bits/stl_multimap.h:  Likewise.
	* include/bits/stl_multiset.h:  Likewise.
	* include/bits/stl_numeric.h:  Likewise.
	* include/bits/stl_pair.h:  Likewise.
	* include/bits/stl_pthread_alloc.h:  Likewise.
	* include/bits/stl_queue.h:  Likewise.
	* include/bits/stl_raw_storage_iter.h:  Likewise.
	* include/bits/stl_relops.h:  Likewise.
	* include/bits/stl_set.h:  Likewise.
	* include/bits/stl_stack.h:  Likewise.
	* include/bits/stl_tempbuf.h:  Likewise.
	* include/bits/stl_threads.h:  Likewise.
	* include/bits/stl_tree.h:  Likewise.
	* include/bits/stl_uninitialized.h:  Likewise.
	* include/bits/stl_vector.h:  Likewise.
	* include/bits/streambuf.tcc:  Likewise.
	* include/bits/type_traits.h:  Likewise.
	* include/bits/valarray_meta.h:  Likewise.
	* include/ext/bvector:  Likewise.
	* include/ext/hash_map:  Likewise.
	* include/ext/hash_set:  Likewise.
	* include/ext/ropeimpl.h:  Likewise.
	* include/ext/slist:  Likewise.
	* include/ext/stl_bvector.h:  Likewise.
	* include/ext/stl_hash_fun.h:  Likewise.
	* include/ext/stl_hashtable.h:  Likewise.
	* include/ext/stl_rope.h:  Likewise.
	* src/complex_io.cc:  Likewise.
	* src/ios.cc:  Likewise.
	* src/locale-inst.cc:  Likewise.
	* src/locale.cc:  Likewise.
	* src/localename.cc:  Likewise.
	* src/misc-inst.cc:  Likewise.
	* src/stdexcept.cc:  Likewise.
	* src/stl-inst.cc:  Likewise.
	* src/strstream.cc:  Likewise.
	* src/valarray-inst.cc:  Likewise.

From-SVN: r40239
parent 04c8d9b9
2001-03-04 Phil Edwards <pme@sources.redhat.com>
http://gcc.gnu.org/ml/libstdc++/2001-03/msg00015.html
* include/backward/algo.h: Use std not __STD. Remove unneeded
macros and "never happens" code. Adjust to C++STYLE guidelines.
* include/backward/algobase.h: Likewise.
* include/backward/alloc.h: Likewise.
* include/backward/bvector.h: Likewise.
* include/backward/deque.h: Likewise.
* include/backward/function.h: Likewise.
* include/backward/hash_map.h: Likewise.
* include/backward/hash_set.h: Likewise.
* include/backward/hashtable.h: Likewise.
* include/backward/heap.h: Likewise.
* include/backward/iterator.h: Likewise.
* include/backward/list.h: Likewise.
* include/backward/map.h: Likewise.
* include/backward/multimap.h: Likewise.
* include/backward/multiset.h: Likewise.
* include/backward/pair.h: Likewise.
* include/backward/rope.h: Likewise.
* include/backward/set.h: Likewise.
* include/backward/slist.h: Likewise.
* include/backward/stack.h: Likewise.
* include/backward/strstream: Likewise.
* include/backward/tempbuf.h: Likewise.
* include/backward/tree.h: Likewise.
* include/backward/vector.h: Likewise.
* include/bits/basic_ios.h: Likewise.
* include/bits/basic_ios.tcc: Likewise.
* include/bits/basic_string.h: Likewise.
* include/bits/c++config: Likewise.
* include/bits/concept_checks.h: Likewise.
* include/bits/fpos.h: Likewise.
* include/bits/fstream.tcc: Likewise.
* include/bits/functexcept.h: Likewise.
* include/bits/ios_base.h: Likewise.
* include/bits/istream.tcc: Likewise.
* include/bits/mask_array.h: Likewise.
* include/bits/ostream.tcc: Likewise.
* include/bits/pthread_allocimpl.h: Likewise.
* include/bits/sbuf_iter.h: Likewise.
* include/bits/slice.h: Likewise.
* include/bits/slice_array.h: Likewise.
* include/bits/sstream.tcc: Likewise.
* include/bits/std_bitset.h: Likewise.
* include/bits/std_fstream.h: Likewise.
* include/bits/std_iomanip.h: Likewise.
* include/bits/std_ios.h: Likewise.
* include/bits/std_istream.h: Likewise.
* include/bits/std_iterator.h: Likewise.
* include/bits/std_memory.h: Likewise.
* include/bits/std_ostream.h: Likewise.
* include/bits/std_sstream.h: Likewise.
* include/bits/std_streambuf.h: Likewise.
* include/bits/std_string.h: Likewise.
* include/bits/std_valarray.h: Likewise.
* include/bits/stl_algo.h: Likewise.
* include/bits/stl_algobase.h: Likewise.
* include/bits/stl_alloc.h: Likewise.
* include/bits/stl_construct.h: Likewise.
* include/bits/stl_deque.h: Likewise.
* include/bits/stl_function.h: Likewise.
* include/bits/stl_heap.h: Likewise.
* include/bits/stl_iterator.h: Likewise.
* include/bits/stl_iterator_base.h: Likewise.
* include/bits/stl_list.h: Likewise.
* include/bits/stl_map.h: Likewise.
* include/bits/stl_multimap.h: Likewise.
* include/bits/stl_multiset.h: Likewise.
* include/bits/stl_numeric.h: Likewise.
* include/bits/stl_pair.h: Likewise.
* include/bits/stl_pthread_alloc.h: Likewise.
* include/bits/stl_queue.h: Likewise.
* include/bits/stl_raw_storage_iter.h: Likewise.
* include/bits/stl_relops.h: Likewise.
* include/bits/stl_set.h: Likewise.
* include/bits/stl_stack.h: Likewise.
* include/bits/stl_tempbuf.h: Likewise.
* include/bits/stl_threads.h: Likewise.
* include/bits/stl_tree.h: Likewise.
* include/bits/stl_uninitialized.h: Likewise.
* include/bits/stl_vector.h: Likewise.
* include/bits/streambuf.tcc: Likewise.
* include/bits/type_traits.h: Likewise.
* include/bits/valarray_meta.h: Likewise.
* include/ext/bvector: Likewise.
* include/ext/hash_map: Likewise.
* include/ext/hash_set: Likewise.
* include/ext/ropeimpl.h: Likewise.
* include/ext/slist: Likewise.
* include/ext/stl_bvector.h: Likewise.
* include/ext/stl_hash_fun.h: Likewise.
* include/ext/stl_hashtable.h: Likewise.
* include/ext/stl_rope.h: Likewise.
* src/complex_io.cc: Likewise.
* src/ios.cc: Likewise.
* src/locale-inst.cc: Likewise.
* src/locale.cc: Likewise.
* src/localename.cc: Likewise.
* src/misc-inst.cc: Likewise.
* src/stdexcept.cc: Likewise.
* src/stl-inst.cc: Likewise.
* src/strstream.cc: Likewise.
* src/valarray-inst.cc: Likewise.
2001-03-03 Benjamin Kosnik <bkoz@redhat.com> 2001-03-03 Benjamin Kosnik <bkoz@redhat.com>
* src/misc-inst.cc (__copy_streambufs): Fix typo for alpha. * src/misc-inst.cc (__copy_streambufs): Fix typo for alpha.
......
...@@ -32,80 +32,76 @@ ...@@ -32,80 +32,76 @@
#include <bits/stl_algo.h> #include <bits/stl_algo.h>
#include <bits/stl_numeric.h> #include <bits/stl_numeric.h>
#ifdef __STL_USE_NAMESPACES
// Names from <stl_algo.h> // Names from <stl_algo.h>
using __STD::for_each; using std::for_each;
using __STD::find; using std::find;
using __STD::find_if; using std::find_if;
using __STD::adjacent_find; using std::adjacent_find;
using __STD::count; using std::count;
using __STD::count_if; using std::count_if;
using __STD::search; using std::search;
using __STD::search_n; using std::search_n;
using __STD::swap_ranges; using std::swap_ranges;
using __STD::transform; using std::transform;
using __STD::replace; using std::replace;
using __STD::replace_if; using std::replace_if;
using __STD::replace_copy; using std::replace_copy;
using __STD::replace_copy_if; using std::replace_copy_if;
using __STD::generate; using std::generate;
using __STD::generate_n; using std::generate_n;
using __STD::remove; using std::remove;
using __STD::remove_if; using std::remove_if;
using __STD::remove_copy; using std::remove_copy;
using __STD::remove_copy_if; using std::remove_copy_if;
using __STD::unique; using std::unique;
using __STD::unique_copy; using std::unique_copy;
using __STD::reverse; using std::reverse;
using __STD::reverse_copy; using std::reverse_copy;
using __STD::rotate; using std::rotate;
using __STD::rotate_copy; using std::rotate_copy;
using __STD::random_shuffle; using std::random_shuffle;
using __STD::random_sample; using std::random_sample;
using __STD::random_sample_n; using std::random_sample_n;
using __STD::partition; using std::partition;
using __STD::stable_partition; using std::stable_partition;
using __STD::sort; using std::sort;
using __STD::stable_sort; using std::stable_sort;
using __STD::partial_sort; using std::partial_sort;
using __STD::partial_sort_copy; using std::partial_sort_copy;
using __STD::nth_element; using std::nth_element;
using __STD::lower_bound; using std::lower_bound;
using __STD::upper_bound; using std::upper_bound;
using __STD::equal_range; using std::equal_range;
using __STD::binary_search; using std::binary_search;
using __STD::merge; using std::merge;
using __STD::inplace_merge; using std::inplace_merge;
using __STD::includes; using std::includes;
using __STD::set_union; using std::set_union;
using __STD::set_intersection; using std::set_intersection;
using __STD::set_difference; using std::set_difference;
using __STD::set_symmetric_difference; using std::set_symmetric_difference;
using __STD::min_element; using std::min_element;
using __STD::max_element; using std::max_element;
using __STD::next_permutation; using std::next_permutation;
using __STD::prev_permutation; using std::prev_permutation;
using __STD::find_first_of; using std::find_first_of;
using __STD::find_end; using std::find_end;
using __STD::is_sorted; using std::is_sorted;
using __STD::is_heap; using std::is_heap;
// Names from stl_heap.h // Names from stl_heap.h
using __STD::push_heap; using std::push_heap;
using __STD::pop_heap; using std::pop_heap;
using __STD::make_heap; using std::make_heap;
using __STD::sort_heap; using std::sort_heap;
// Names from stl_numeric.h // Names from stl_numeric.h
using __STD::accumulate; using std::accumulate;
using __STD::inner_product; using std::inner_product;
using __STD::partial_sum; using std::partial_sum;
using __STD::adjacent_difference; using std::adjacent_difference;
using __STD::power; using std::power;
using __STD::iota; using std::iota;
#endif /* __STL_USE_NAMESPACES */
#endif /* _CPP_BACKWARD_ALGO_H */ #endif /* _CPP_BACKWARD_ALGO_H */
......
...@@ -39,30 +39,26 @@ ...@@ -39,30 +39,26 @@
#include <bits/stl_uninitialized.h> #include <bits/stl_uninitialized.h>
#endif #endif
#ifdef __STL_USE_NAMESPACES
// Names from stl_algobase.h // Names from stl_algobase.h
using __STD::iter_swap; using std::iter_swap;
using __STD::swap; using std::swap;
using __STD::min; using std::min;
using __STD::max; using std::max;
using __STD::copy; using std::copy;
using __STD::copy_backward; using std::copy_backward;
using __STD::copy_n; using std::copy_n;
using __STD::fill; using std::fill;
using __STD::fill_n; using std::fill_n;
using __STD::mismatch; using std::mismatch;
using __STD::equal; using std::equal;
using __STD::lexicographical_compare; using std::lexicographical_compare;
using __STD::lexicographical_compare_3way; using std::lexicographical_compare_3way;
// Names from stl_uninitialized.h // Names from stl_uninitialized.h
using __STD::uninitialized_copy; using std::uninitialized_copy;
using __STD::uninitialized_copy_n; using std::uninitialized_copy_n;
using __STD::uninitialized_fill; using std::uninitialized_fill;
using __STD::uninitialized_fill_n; using std::uninitialized_fill_n;
#endif /* __STL_USE_NAMESPACES */
#endif /* _CPP_BACKWARD_ALGOBASE_H */ #endif /* _CPP_BACKWARD_ALGOBASE_H */
......
...@@ -19,25 +19,16 @@ ...@@ -19,25 +19,16 @@
#include <bits/stl_alloc.h> #include <bits/stl_alloc.h>
#endif #endif
#ifdef __STL_USE_NAMESPACES using std::__malloc_alloc_template;
using std::malloc_alloc;
using __STD::__malloc_alloc_template; using std::simple_alloc;
using __STD::malloc_alloc; using std::debug_alloc;
using __STD::simple_alloc;
using __STD::debug_alloc;
#ifndef __USE_MALLOC #ifndef __USE_MALLOC
using __STD::__default_alloc_template; using std::__default_alloc_template;
#endif #endif
using __STD::alloc; using std::alloc;
using __STD::single_client_alloc; using std::single_client_alloc;
#ifdef __STL_STATIC_TEMPLATE_MEMBER_BUG using std::allocator;
using __STD::__malloc_alloc_oom_handler;
#endif /* __STL_STATIC_TEMPLATE_MEMBER_BUG */
#ifdef __STL_USE_STD_ALLOCATORS
using __STD::allocator;
#endif /* __STL_USE_STD_ALLOCATORS */
#endif /* __STL_USE_NAMESPACES */
#endif /* _CPP_BACKWARD_ALLOC_H */ #endif /* _CPP_BACKWARD_ALLOC_H */
......
...@@ -27,20 +27,11 @@ ...@@ -27,20 +27,11 @@
#ifndef _CPP_BACKWARD_BVECTOR_H #ifndef _CPP_BACKWARD_BVECTOR_H
#define _CPP_BACKWARD_BVECTOR_H 1 #define _CPP_BACKWARD_BVECTOR_H 1
#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
#include "vector.h" #include "vector.h"
#else
#include "algobase.h"
#include "alloc.h"
#endif
#include <bits/stl_bvector.h> #include <bits/stl_bvector.h>
#ifdef __STL_USE_NAMESPACES using std::bit_vector;
using __STD::bit_vector;
#endif /* __STL_USE_NAMESPACES */
#endif /* _CPP_BACKWARD_BVECTOR_H */ #endif /* _CPP_BACKWARD_BVECTOR_H */
......
...@@ -31,9 +31,7 @@ ...@@ -31,9 +31,7 @@
#include "alloc.h" #include "alloc.h"
#include <bits/std_deque.h> #include <bits/std_deque.h>
#ifdef __STL_USE_NAMESPACES using std::deque;
using __STD::deque;
#endif /* __STL_USE_NAMESPACES */
#endif /* _CPP_BACKWARD_DEQUE_H */ #endif /* _CPP_BACKWARD_DEQUE_H */
......
...@@ -33,68 +33,64 @@ ...@@ -33,68 +33,64 @@
#include <bits/stl_function.h> #include <bits/stl_function.h>
#endif #endif
#ifdef __STL_USE_NAMESPACES
// Names from stl_function.h // Names from stl_function.h
using __STD::unary_function; using std::unary_function;
using __STD::binary_function; using std::binary_function;
using __STD::plus; using std::plus;
using __STD::minus; using std::minus;
using __STD::multiplies; using std::multiplies;
using __STD::divides; using std::divides;
using __STD::identity_element; using std::identity_element;
using __STD::modulus; using std::modulus;
using __STD::negate; using std::negate;
using __STD::equal_to; using std::equal_to;
using __STD::not_equal_to; using std::not_equal_to;
using __STD::greater; using std::greater;
using __STD::less; using std::less;
using __STD::greater_equal; using std::greater_equal;
using __STD::less_equal; using std::less_equal;
using __STD::logical_and; using std::logical_and;
using __STD::logical_or; using std::logical_or;
using __STD::logical_not; using std::logical_not;
using __STD::unary_negate; using std::unary_negate;
using __STD::binary_negate; using std::binary_negate;
using __STD::not1; using std::not1;
using __STD::not2; using std::not2;
using __STD::binder1st; using std::binder1st;
using __STD::binder2nd; using std::binder2nd;
using __STD::bind1st; using std::bind1st;
using __STD::bind2nd; using std::bind2nd;
using __STD::unary_compose; using std::unary_compose;
using __STD::binary_compose; using std::binary_compose;
using __STD::compose1; using std::compose1;
using __STD::compose2; using std::compose2;
using __STD::pointer_to_unary_function; using std::pointer_to_unary_function;
using __STD::pointer_to_binary_function; using std::pointer_to_binary_function;
using __STD::ptr_fun; using std::ptr_fun;
using __STD::identity; using std::identity;
using __STD::select1st; using std::select1st;
using __STD::select2nd; using std::select2nd;
using __STD::project1st; using std::project1st;
using __STD::project2nd; using std::project2nd;
using __STD::constant_void_fun; using std::constant_void_fun;
using __STD::constant_unary_fun; using std::constant_unary_fun;
using __STD::constant_binary_fun; using std::constant_binary_fun;
using __STD::constant0; using std::constant0;
using __STD::constant1; using std::constant1;
using __STD::constant2; using std::constant2;
using __STD::subtractive_rng; using std::subtractive_rng;
using __STD::mem_fun_t; using std::mem_fun_t;
using __STD::const_mem_fun_t; using std::const_mem_fun_t;
using __STD::mem_fun_ref_t; using std::mem_fun_ref_t;
using __STD::const_mem_fun_ref_t; using std::const_mem_fun_ref_t;
using __STD::mem_fun1_t; using std::mem_fun1_t;
using __STD::const_mem_fun1_t; using std::const_mem_fun1_t;
using __STD::mem_fun1_ref_t; using std::mem_fun1_ref_t;
using __STD::const_mem_fun1_ref_t; using std::const_mem_fun1_ref_t;
using __STD::mem_fun; using std::mem_fun;
using __STD::mem_fun_ref; using std::mem_fun_ref;
using __STD::mem_fun1; using std::mem_fun1;
using __STD::mem_fun1_ref; using std::mem_fun1_ref;
#endif /* __STL_USE_NAMESPACES */
#endif /* _CPP_BACKWARD_FUNCTION_H */ #endif /* _CPP_BACKWARD_FUNCTION_H */
......
...@@ -34,13 +34,10 @@ ...@@ -34,13 +34,10 @@
#include "algobase.h" #include "algobase.h"
#include <bits/stl_hash_map.h> #include <bits/stl_hash_map.h>
#ifdef __STL_USE_NAMESPACES using std::hash;
using __STD::hash; using std::hashtable;
using __STD::hashtable; using std::hash_map;
using __STD::hash_map; using std::hash_multimap;
using __STD::hash_multimap;
#endif /* __STL_USE_NAMESPACES */
#endif /* _CPP_BACKWARD_HASH_MAP_H */ #endif /* _CPP_BACKWARD_HASH_MAP_H */
......
...@@ -34,11 +34,9 @@ ...@@ -34,11 +34,9 @@
#include "algobase.h" #include "algobase.h"
#include <bits/stl_hash_set.h> #include <bits/stl_hash_set.h>
#ifdef __STL_USE_NAMESPACES using std::hash;
using __STD::hash; using std::hashtable;
using __STD::hashtable; using std::hash_set;
using __STD::hash_set; using std::hash_multiset;
using __STD::hash_multiset;
#endif /* __STL_USE_NAMESPACES */
#endif /* _CPP_BACKWARD_HASH_SET_H */ #endif /* _CPP_BACKWARD_HASH_SET_H */
...@@ -36,10 +36,8 @@ ...@@ -36,10 +36,8 @@
#include "alloc.h" #include "alloc.h"
#include "vector.h" #include "vector.h"
#ifdef __STL_USE_NAMESPACES using std::hash;
using __STD::hash; using std::hashtable;
using __STD::hashtable;
#endif /* __STL_USE_NAMESPACES */
#endif /* _CPP_BACKWARD_HASHTABLE_H */ #endif /* _CPP_BACKWARD_HASHTABLE_H */
......
...@@ -29,15 +29,10 @@ ...@@ -29,15 +29,10 @@
#include <bits/c++config.h> #include <bits/c++config.h>
#include <bits/stl_heap.h> #include <bits/stl_heap.h>
#ifdef __STL_USE_NAMESPACES using std::push_heap;
using std::pop_heap;
using __STD::push_heap; using std::make_heap;
using __STD::pop_heap; using std::sort_heap;
using __STD::make_heap;
using __STD::sort_heap;
#endif /* __STL_USE_NAMESPACES */
#endif /* _CPP_BACKWARD_HEAP_H */ #endif /* _CPP_BACKWARD_HEAP_H */
......
...@@ -45,57 +45,51 @@ ...@@ -45,57 +45,51 @@
#include <bits/stl_raw_storage_iter.h> #include <bits/stl_raw_storage_iter.h>
#endif #endif
#ifdef __STL_USE_NAMESPACES
// Names from stl_iterator.h // Names from stl_iterator.h
using __STD::input_iterator_tag; using std::input_iterator_tag;
using __STD::output_iterator_tag; using std::output_iterator_tag;
using __STD::forward_iterator_tag; using std::forward_iterator_tag;
using __STD::bidirectional_iterator_tag; using std::bidirectional_iterator_tag;
using __STD::random_access_iterator_tag; using std::random_access_iterator_tag;
#if 0 #if 0
using __STD::iterator; using std::iterator;
#endif #endif
using __STD::input_iterator; using std::input_iterator;
using __STD::output_iterator; using std::output_iterator;
using __STD::forward_iterator; using std::forward_iterator;
using __STD::bidirectional_iterator; using std::bidirectional_iterator;
using __STD::random_access_iterator; using std::random_access_iterator;
#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION using std::iterator_traits;
using __STD::iterator_traits;
#endif
using __STD::iterator_category; using std::iterator_category;
using __STD::distance_type; using std::distance_type;
using __STD::value_type; using std::value_type;
using __STD::distance; using std::distance;
using __STD::advance; using std::advance;
using __STD::insert_iterator; using std::insert_iterator;
using __STD::front_insert_iterator; using std::front_insert_iterator;
using __STD::back_insert_iterator; using std::back_insert_iterator;
using __STD::inserter; using std::inserter;
using __STD::front_inserter; using std::front_inserter;
using __STD::back_inserter; using std::back_inserter;
using __STD::reverse_iterator; using std::reverse_iterator;
using __STD::reverse_bidirectional_iterator; using std::reverse_bidirectional_iterator;
using __STD::istream_iterator; using std::istream_iterator;
using __STD::ostream_iterator; using std::ostream_iterator;
// Names from stl_construct.h // Names from stl_construct.h
using __STD::construct; using std::construct;
using __STD::destroy; using std::destroy;
// Names from stl_raw_storage_iter.h // Names from stl_raw_storage_iter.h
using __STD::raw_storage_iterator; using std::raw_storage_iterator;
#endif /* __STL_USE_NAMESPACES */
#endif /* _CPP_BACKWARD_ITERATOR_H */ #endif /* _CPP_BACKWARD_ITERATOR_H */
......
...@@ -31,9 +31,7 @@ ...@@ -31,9 +31,7 @@
#include "alloc.h" #include "alloc.h"
#include <bits/std_list.h> #include <bits/std_list.h>
#ifdef __STL_USE_NAMESPACES using std::list;
using __STD::list;
#endif /* __STL_USE_NAMESPACES */
#endif /* _CPP_BACKWARD_LIST_H */ #endif /* _CPP_BACKWARD_LIST_H */
......
...@@ -30,9 +30,7 @@ ...@@ -30,9 +30,7 @@
#include "tree.h" #include "tree.h"
#include <bits/stl_map.h> #include <bits/stl_map.h>
#ifdef __STL_USE_NAMESPACES using std::map;
using __STD::map;
#endif /* __STL_USE_NAMESPACES */
#endif /* _CPP_BACKWARD_MAP_H */ #endif /* _CPP_BACKWARD_MAP_H */
......
...@@ -30,9 +30,7 @@ ...@@ -30,9 +30,7 @@
#include "tree.h" #include "tree.h"
#include <bits/stl_multimap.h> #include <bits/stl_multimap.h>
#ifdef __STL_USE_NAMESPACES using std::multimap;
using __STD::multimap;
#endif /* __STL_USE_NAMESPACES */
#endif /* _CPP_BACKWARD_MULTIMAP_H */ #endif /* _CPP_BACKWARD_MULTIMAP_H */
......
...@@ -30,9 +30,7 @@ ...@@ -30,9 +30,7 @@
#include "tree.h" #include "tree.h"
#include <bits/stl_multiset.h> #include <bits/stl_multiset.h>
#ifdef __STL_USE_NAMESPACES using std::multiset;
using __STD::multiset;
#endif /* __STL_USE_NAMESPACES */
#endif /* _CPP_BACKWARD_MULTISET_H */ #endif /* _CPP_BACKWARD_MULTISET_H */
......
...@@ -32,12 +32,8 @@ ...@@ -32,12 +32,8 @@
#include <bits/stl_pair.h> #include <bits/stl_pair.h>
#endif #endif
#ifdef __STL_USE_NAMESPACES using std::pair;
using std::make_pair;
using __STD::pair;
using __STD::make_pair;
#endif /* __STL_USE_NAMESPACES */
#endif /* _CPP_BACKWARD_PAIR_H */ #endif /* _CPP_BACKWARD_PAIR_H */
......
...@@ -17,15 +17,11 @@ ...@@ -17,15 +17,11 @@
#include "hashtable.h" #include "hashtable.h"
#include <bits/stl_rope.h> #include <bits/stl_rope.h>
#ifdef __STL_USE_NAMESPACES using std::char_producer;
using std::sequence_buffer;
using __STD::char_producer; using std::rope;
using __STD::sequence_buffer; using std::crope;
using __STD::rope; using std::wrope;
using __STD::crope;
using __STD::wrope;
#endif /* __STL_USE_NAMESPACES */
#endif /* _CPP_BACKWARD_ROPE_H */ #endif /* _CPP_BACKWARD_ROPE_H */
......
...@@ -30,9 +30,7 @@ ...@@ -30,9 +30,7 @@
#include "tree.h" #include "tree.h"
#include <bits/stl_set.h> #include <bits/stl_set.h>
#ifdef __STL_USE_NAMESPACES using std::set;
using __STD::set;
#endif /* __STL_USE_NAMESPACES */
#endif /* _CPP_BACKWARD_SET_H */ #endif /* _CPP_BACKWARD_SET_H */
......
...@@ -17,9 +17,7 @@ ...@@ -17,9 +17,7 @@
#include <ext/slist> #include <ext/slist>
#ifdef __STL_USE_NAMESPACES using std::slist;
using __STD::slist;
#endif /* __STL_USE_NAMESPACES */
#endif /* _CPP_BACKWARD_SLIST_H */ #endif /* _CPP_BACKWARD_SLIST_H */
......
...@@ -33,11 +33,9 @@ ...@@ -33,11 +33,9 @@
#include <bits/stl_stack.h> #include <bits/stl_stack.h>
#include <bits/stl_queue.h> #include <bits/stl_queue.h>
#ifdef __STL_USE_NAMESPACES using std::stack;
using __STD::stack; using std::queue;
using __STD::queue; using std::priority_queue;
using __STD::priority_queue;
#endif /* __STL_USE_NAMESPACES */
#endif /* _CPP_BACKWARD_STACK_H */ #endif /* _CPP_BACKWARD_STACK_H */
......
...@@ -29,7 +29,8 @@ ...@@ -29,7 +29,8 @@
#include <bits/std_ostream.h> #include <bits/std_ostream.h>
#include <bits/std_string.h> #include <bits/std_string.h>
__STL_BEGIN_NAMESPACE namespace std
{
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// Class strstreambuf, a streambuf class that manages an array of char. // Class strstreambuf, a streambuf class that manages an array of char.
...@@ -150,7 +151,7 @@ private: ...@@ -150,7 +151,7 @@ private:
strstreambuf _M_buf; strstreambuf _M_buf;
}; };
__STL_END_NAMESPACE } // namespace std
#endif /* __SGI_STL_STRSTREAM */ #endif /* __SGI_STL_STRSTREAM */
......
...@@ -47,13 +47,9 @@ ...@@ -47,13 +47,9 @@
#include <bits/stl_tempbuf.h> #include <bits/stl_tempbuf.h>
#endif #endif
#ifdef __STL_USE_NAMESPACES using std::get_temporary_buffer;
using std::return_temporary_buffer;
using __STD::get_temporary_buffer; using std::_Temporary_buffer;
using __STD::return_temporary_buffer;
using __STD::_Temporary_buffer;
#endif /* __STL_USE_NAMESPACES */
#endif /* _CPP_BACKWARD_TEMPBUF_H */ #endif /* _CPP_BACKWARD_TEMPBUF_H */
......
...@@ -35,9 +35,7 @@ ...@@ -35,9 +35,7 @@
#include "algobase.h" #include "algobase.h"
#include "alloc.h" #include "alloc.h"
#ifdef __STL_USE_NAMESPACES using std::rb_tree;
using __STD::rb_tree;
#endif /* __STL_USE_NAMESPACES */
#endif /* _CPP_BACKWARD_TREE_H */ #endif /* _CPP_BACKWARD_TREE_H */
......
...@@ -31,9 +31,7 @@ ...@@ -31,9 +31,7 @@
#include "alloc.h" #include "alloc.h"
#include <bits/stl_vector.h> #include <bits/stl_vector.h>
#ifdef __STL_USE_NAMESPACES using std::vector;
using __STD::vector;
#endif /* __STL_USE_NAMESPACES */
#endif /* _CPP_BACKWARD_VECTOR_H */ #endif /* _CPP_BACKWARD_VECTOR_H */
......
...@@ -214,9 +214,3 @@ namespace std { ...@@ -214,9 +214,3 @@ namespace std {
#endif /* _CPP_BITS_BASICIOS_H */ #endif /* _CPP_BITS_BASICIOS_H */
...@@ -135,6 +135,3 @@ namespace std { ...@@ -135,6 +135,3 @@ namespace std {
#endif /* _CPP_BITS_BASICIOS_TCC */ #endif /* _CPP_BITS_BASICIOS_TCC */
...@@ -38,7 +38,8 @@ ...@@ -38,7 +38,8 @@
#include <bits/atomicity.h> #include <bits/atomicity.h>
namespace std { namespace std
{
// Documentation? What's that? // Documentation? What's that?
// Nathan Myers <ncm@cantrip.org>. // Nathan Myers <ncm@cantrip.org>.
......
...@@ -55,7 +55,6 @@ ...@@ -55,7 +55,6 @@
// Use corrected code from the committee library group's issues list. // Use corrected code from the committee library group's issues list.
#define _GLIBCPP_RESOLVE_LIB_DEFECTS 1 #define _GLIBCPP_RESOLVE_LIB_DEFECTS 1
// From SGI's stl_config.h; generic settings and user hooks (_NOTHREADS). // From SGI's stl_config.h; generic settings and user hooks (_NOTHREADS).
#if defined(_PTHREADS) && !defined(_NOTHREADS) #if defined(_PTHREADS) && !defined(_NOTHREADS)
# define __STL_PTHREADS # define __STL_PTHREADS
...@@ -64,18 +63,13 @@ ...@@ -64,18 +63,13 @@
# define __STL_UITHREADS # define __STL_UITHREADS
#endif #endif
// Also from SGI's stl_config.h; settings for GCC. // Concept-checking code is on by default unless users define
#define __STL_HAS_WCHAR_T // the _STL_NO_CONCEPT_CHECKS hook.
#define __STL_MEMBER_TEMPLATES #if !defined(_STL_NO_CONCEPT_CHECKS)
#define __STL_MEMBER_TEMPLATE_CLASSES # define __STL_USE_CONCEPT_CHECKS
#define __STL_TEMPLATE_FRIENDS #endif
#define __STL_CLASS_PARTIAL_SPECIALIZATION
#define __STL_PARTIAL_SPECIALIZATION_SYNTAX // This is also a user hook, but via -f[no-]exceptions, not direct #defines.
#define __STL_FUNCTION_TMPL_PARTIAL_ORDER
#define __STL_EXPLICIT_FUNCTION_TMPL_ARGS
#define __SGI_STL_USE_AUTO_PTR_CONVERSIONS
#define __STL_HAS_NAMESPACES
#define __STL_USE_NAMESPACES
#ifdef __EXCEPTIONS #ifdef __EXCEPTIONS
# define __STL_USE_EXCEPTIONS # define __STL_USE_EXCEPTIONS
# define __STL_TRY try # define __STL_TRY try
...@@ -92,26 +86,34 @@ ...@@ -92,26 +86,34 @@
# define __STL_NOTHROW # define __STL_NOTHROW
# define __STL_UNWIND(action) # define __STL_UNWIND(action)
#endif #endif
#define __STL_THROW_RANGE_ERRORS
#define __STL_CAN_THROW_RANGE_ERRORS // This is the "underlying allocator"
#define __STL_USE_STD_ALLOCATORS #define __USE_MALLOC
#define __USE_MALLOC // As the "underlying allocator"
//#define __STL_USE_NEW_IOSTREAMS //990209 bkoz--use standard .h includes. // Define this to permit user-level control of the expansion of string
// buffers (via a fn pointer), see basic_string.* for more.
//#define _GLIBCPP_ALLOC_CONTROL
// The remainder of the prewritten config is mostly automatic; all the
// user hooks are listed above.
#ifdef _REENTRANT #ifdef _REENTRANT
# define __STL_THREADS # define __STL_THREADS
#endif #endif
#ifdef _PTHREADS #ifdef _PTHREADS
# define __STL_PTHREADS # define __STL_PTHREADS
#endif #endif
#ifndef __STRICT_ANSI__ //#ifndef __STRICT_ANSI__
# define __STL_LONG_LONG //# define __STL_LONG_LONG
#endif //#endif
// 20010302 pme -- this is only used in bits/concept_checks.h
//#if (__GNUC__ < 2) || (__GNUC__ == 2 && __GNUC_MINOR__ < 95) //#if (__GNUC__ < 2) || (__GNUC__ == 2 && __GNUC_MINOR__ < 95)
# define __STL_NO_FUNCTION_PTR_IN_CLASS_TEMPLATE # define __STL_NO_FUNCTION_PTR_IN_CLASS_TEMPLATE
//#endif //#endif
// Also from SGI's stl_config.h; settings for GCC. // Mingw32, GCC compiler using the Microsoft C runtime (settings taken from
// Mingw32, GCC compiler using the Microsoft C runtime // SGI's stl_config.h)
#if defined(__MINGW32__) #if defined(__MINGW32__)
# define __STL_NO_DRAND48 # define __STL_NO_DRAND48
# ifdef _MT # ifdef _MT
...@@ -119,30 +121,14 @@ ...@@ -119,30 +121,14 @@
# endif # endif
#endif #endif
// Cygwin32, GCC compiler on MS Windows // Cygwin32, GCC compiler on MS Windows (settings taken from SGI's
// stl_config.h)
#if defined(__CYGWIN__) #if defined(__CYGWIN__)
# define __STL_NO_DRAND48 # define __STL_NO_DRAND48
#endif #endif
// The old stl_config.h would use the above settings in chains of // XXX Only used in the SGI rope extensions; this is from stl_config.h and
// if/then/else tests to define the following. // should be cleaned up.
#define __STL_DEPENDENT_DEFAULT_TMPL(_Tp) = _Tp
#define __STL_TEMPLATE
#define __STL_NULL_TMPL_ARGS <>
#define __STL_TEMPLATE_NULL template<>
#define __STL_DEFAULT_ALLOCATOR(T) allocator< T >
#define __STL_USE_NAMESPACES
#define __STD std
#define __STL_BEGIN_NAMESPACE namespace std {
#define __STL_END_NAMESPACE }
#define __STL_USE_NAMESPACE_FOR_RELOPS
#define __STL_BEGIN_RELOPS_NAMESPACE namespace std { namespace rel_ops {
#define __STL_END_RELOPS_NAMESPACE } }
#define __STD_RELOPS std::rel_ops
#define __STD_QUALIFIER std::
#ifdef __STL_ASSERTIONS #ifdef __STL_ASSERTIONS
# include <stdio.h> # include <stdio.h>
# define __stl_assert(expr) \ # define __stl_assert(expr) \
...@@ -152,6 +138,7 @@ ...@@ -152,6 +138,7 @@
# define __stl_assert(expr) # define __stl_assert(expr)
#endif #endif
#if defined(__STL_WIN32THREADS) || defined(__STL_SGI_THREADS) \ #if defined(__STL_WIN32THREADS) || defined(__STL_SGI_THREADS) \
|| defined(__STL_PTHREADS) || defined(__STL_UITHREADS) || defined(__STL_PTHREADS) || defined(__STL_UITHREADS)
# define __STL_THREADS # define __STL_THREADS
...@@ -160,12 +147,6 @@ ...@@ -160,12 +147,6 @@
# define __STL_VOLATILE # define __STL_VOLATILE
#endif #endif
#if defined(__STL_CLASS_PARTIAL_SPECIALIZATION) \
&& defined(__STL_MEMBER_TEMPLATES) \
&& !defined(_STL_NO_CONCEPT_CHECKS)
# define __STL_USE_CONCEPT_CHECKS
#endif
// End of prewritten config; the discovered settings follow. // End of prewritten config; the discovered settings follow.
......
...@@ -490,34 +490,35 @@ struct _STL_ERROR { ...@@ -490,34 +490,35 @@ struct _STL_ERROR {
/* Associated Type Requirements */ /* Associated Type Requirements */
__STL_BEGIN_NAMESPACE namespace std
{
template <class _Iterator> struct iterator_traits; template <class _Iterator> struct iterator_traits;
__STL_END_NAMESPACE } // namespace std
template <class _Iter> template <class _Iter>
struct __value_type_type_definition_requirement_violation { struct __value_type_type_definition_requirement_violation {
typedef typename __STD::iterator_traits<_Iter>::value_type value_type; typedef typename std::iterator_traits<_Iter>::value_type value_type;
}; };
template <class _Iter> template <class _Iter>
struct __difference_type_type_definition_requirement_violation { struct __difference_type_type_definition_requirement_violation {
typedef typename __STD::iterator_traits<_Iter>::difference_type typedef typename std::iterator_traits<_Iter>::difference_type
difference_type; difference_type;
}; };
template <class _Iter> template <class _Iter>
struct __reference_type_definition_requirement_violation { struct __reference_type_definition_requirement_violation {
typedef typename __STD::iterator_traits<_Iter>::reference reference; typedef typename std::iterator_traits<_Iter>::reference reference;
}; };
template <class _Iter> template <class _Iter>
struct __pointer_type_definition_requirement_violation { struct __pointer_type_definition_requirement_violation {
typedef typename __STD::iterator_traits<_Iter>::pointer pointer; typedef typename std::iterator_traits<_Iter>::pointer pointer;
}; };
template <class _Iter> template <class _Iter>
struct __iterator_category_type_definition_requirement_violation { struct __iterator_category_type_definition_requirement_violation {
typedef typename __STD::iterator_traits<_Iter>::iterator_category typedef typename std::iterator_traits<_Iter>::iterator_category
iterator_category; iterator_category;
}; };
...@@ -797,8 +798,7 @@ _Allocator_requirement_violation(_Alloc __a) { ...@@ -797,8 +798,7 @@ _Allocator_requirement_violation(_Alloc __a) {
__pointer__typedef_requirement_violation<_Alloc>(); __pointer__typedef_requirement_violation<_Alloc>();
__const_pointer__typedef_requirement_violation<_Alloc>(); __const_pointer__typedef_requirement_violation<_Alloc>();
typedef typename _Alloc::value_type _Tp; typedef typename _Alloc::value_type _Tp;
//__STL_REQUIRES_SAME_TYPE(typename _Alloc::__STL_TEMPLATE rebind<_Tp>::other, // __STL_REQUIRES_SAME_TYPE(typename _Alloc::template rebind<_Tp>::other, _Alloc);
// _Alloc);
} }
}; };
......
...@@ -41,7 +41,8 @@ ...@@ -41,7 +41,8 @@
// not have included the std_ios file. // not have included the std_ios file.
#include <bits/c++io.h> #include <bits/c++io.h>
namespace std { namespace std
{
// 27.4.1 Types // 27.4.1 Types
......
...@@ -580,11 +580,3 @@ namespace std ...@@ -580,11 +580,3 @@ namespace std
#endif // _CPP_BITS_FSTREAM_TCC #endif // _CPP_BITS_FSTREAM_TCC
...@@ -82,3 +82,4 @@ namespace std ...@@ -82,3 +82,4 @@ namespace std
void void
__throw_ios_failure(const char* __s); __throw_ios_failure(const char* __s);
} // namespace std } // namespace std
...@@ -36,7 +36,8 @@ ...@@ -36,7 +36,8 @@
#pragma GCC system_header #pragma GCC system_header
namespace std { namespace std
{
// The following definitions of bitmask types are enums, not ints, // The following definitions of bitmask types are enums, not ints,
// as permitted (but not required) in the standard, in order to provide // as permitted (but not required) in the standard, in order to provide
...@@ -568,11 +569,3 @@ namespace std { ...@@ -568,11 +569,3 @@ namespace std {
#endif /* _CPP_BITS_IOSBASE_H */ #endif /* _CPP_BITS_IOSBASE_H */
...@@ -1207,16 +1207,3 @@ namespace std { ...@@ -1207,16 +1207,3 @@ namespace std {
// mode:C++ // mode:C++
// End: // End:
// The template and inlines for the -*- C++ -*- mask_array class. // The template and inlines for the -*- C++ -*- mask_array class.
// Copyright (C) 1997-2001, 2000 Free Software Foundation, Inc. // Copyright (C) 1997-2001 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
......
...@@ -672,12 +672,3 @@ namespace std { ...@@ -672,12 +672,3 @@ namespace std {
// mode:C++ // mode:C++
// End: // End:
...@@ -34,11 +34,10 @@ ...@@ -34,11 +34,10 @@
# define __RESTRICT # define __RESTRICT
#endif #endif
#ifndef __STL_NO_BAD_ALLOC #include <new>
# include <new>
#endif
__STL_BEGIN_NAMESPACE namespace std
{
#define __STL_DATA_ALIGNMENT 8 #define __STL_DATA_ALIGNMENT 8
...@@ -213,7 +212,7 @@ _Pthread_alloc_template<_Max_size>::_S_get_per_thread_state() ...@@ -213,7 +212,7 @@ _Pthread_alloc_template<_Max_size>::_S_get_per_thread_state()
_Pthread_alloc_per_thread_state<_Max_size> * __result; _Pthread_alloc_per_thread_state<_Max_size> * __result;
if (!_S_key_initialized) { if (!_S_key_initialized) {
if (pthread_key_create(&_S_key, _S_destructor)) { if (pthread_key_create(&_S_key, _S_destructor)) {
__THROW_BAD_ALLOC; // defined in stl_alloc.h std::__throw_bad_alloc(); // defined in funcexcept.h
} }
_S_key_initialized = true; _S_key_initialized = true;
} }
...@@ -221,7 +220,7 @@ _Pthread_alloc_template<_Max_size>::_S_get_per_thread_state() ...@@ -221,7 +220,7 @@ _Pthread_alloc_template<_Max_size>::_S_get_per_thread_state()
__ret_code = pthread_setspecific(_S_key, __result); __ret_code = pthread_setspecific(_S_key, __result);
if (__ret_code) { if (__ret_code) {
if (__ret_code == ENOMEM) { if (__ret_code == ENOMEM) {
__THROW_BAD_ALLOC; std::__throw_bad_alloc();
} else { } else {
// EINVAL // EINVAL
abort(); abort();
...@@ -377,7 +376,6 @@ template <size_t _Max_size> ...@@ -377,7 +376,6 @@ template <size_t _Max_size>
size_t _Pthread_alloc_template<_Max_size> size_t _Pthread_alloc_template<_Max_size>
::_S_heap_size = 0; ::_S_heap_size = 0;
#ifdef __STL_USE_STD_ALLOCATORS
template <class _Tp> template <class _Tp>
class pthread_allocator { class pthread_allocator {
...@@ -484,9 +482,7 @@ struct _Alloc_traits<_Tp, pthread_allocator<_Atype> > ...@@ -484,9 +482,7 @@ struct _Alloc_traits<_Tp, pthread_allocator<_Atype> >
}; };
#endif /* __STL_USE_STD_ALLOCATORS */ } // namespace std
__STL_END_NAMESPACE
#endif /* _CPP_BITS_PTHREAD_ALLOCIMPL_H */ #endif /* _CPP_BITS_PTHREAD_ALLOCIMPL_H */
......
...@@ -250,17 +250,3 @@ namespace std ...@@ -250,17 +250,3 @@ namespace std
#endif /* _CPP_BITS_SBUF_ITER_H */ #endif /* _CPP_BITS_SBUF_ITER_H */
// The template and inlines for the -*- C++ -*- slice class. // The template and inlines for the -*- C++ -*- slice class.
// Copyright (C) 1997-1999 Free Software Foundation, Inc. // Copyright (C) 1997-1999, 2001 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -34,7 +34,8 @@ ...@@ -34,7 +34,8 @@
#pragma GCC system_header #pragma GCC system_header
namespace std { namespace std
{
class slice class slice
{ {
......
// The template and inlines for the -*- C++ -*- slice_array class. // The template and inlines for the -*- C++ -*- slice_array class.
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc. // Copyright (C) 1997-1999, 2000, 2001 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -34,7 +34,8 @@ ...@@ -34,7 +34,8 @@
#pragma GCC system_header #pragma GCC system_header
namespace std { namespace std
{
template<typename _Tp> template<typename _Tp>
class slice_array class slice_array
......
// String based streams -*- C++ -*- // String based streams -*- C++ -*-
// Copyright (C) 1997-1999 Free Software Foundation, Inc. // Copyright (C) 1997-1999, 2001 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -36,7 +36,8 @@ ...@@ -36,7 +36,8 @@
#include <bits/std_sstream.h> #include <bits/std_sstream.h>
namespace std { namespace std
{
template <class _CharT, class _Traits, class _Alloc> template <class _CharT, class _Traits, class _Alloc>
basic_stringbuf<_CharT, _Traits, _Alloc>::int_type basic_stringbuf<_CharT, _Traits, _Alloc>::int_type
...@@ -210,11 +211,3 @@ namespace std { ...@@ -210,11 +211,3 @@ namespace std {
#endif /* _CPP_BITS_SSTREAM_TCC */ #endif /* _CPP_BITS_SSTREAM_TCC */
...@@ -38,21 +38,14 @@ ...@@ -38,21 +38,14 @@
#include <bits/std_stdexcept.h> // for invalid_argument, out_of_range, #include <bits/std_stdexcept.h> // for invalid_argument, out_of_range,
// overflow_error // overflow_error
#ifdef __STL_USE_NEW_IOSTREAMS
#include <iostream>
#else
#include <bits/std_iostream.h> // for istream, ostream #include <bits/std_iostream.h> // for istream, ostream
#endif
#define _GLIBCPP_BITSET_BITS_PER_WORD (CHAR_BIT*sizeof(unsigned long)) #define _GLIBCPP_BITSET_BITS_PER_WORD (CHAR_BIT*sizeof(unsigned long))
#define __BITSET_WORDS(__n) \ #define __BITSET_WORDS(__n) \
((__n) < 1 ? 1 : ((__n) + _GLIBCPP_BITSET_BITS_PER_WORD - 1)/_GLIBCPP_BITSET_BITS_PER_WORD) ((__n) < 1 ? 1 : ((__n) + _GLIBCPP_BITSET_BITS_PER_WORD - 1)/_GLIBCPP_BITSET_BITS_PER_WORD)
__STL_BEGIN_NAMESPACE namespace std
{
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#pragma set woff 1209
#endif
// structure to aid in counting bits // structure to aid in counting bits
template<bool __dummy> template<bool __dummy>
...@@ -315,7 +308,7 @@ _Base_bitset<_Nw>::_M_do_find_next(size_t __prev, size_t __not_found) const ...@@ -315,7 +308,7 @@ _Base_bitset<_Nw>::_M_do_find_next(size_t __prev, size_t __not_found) const
// Base class: specialization for a single word. // Base class: specialization for a single word.
// //
__STL_TEMPLATE_NULL struct _Base_bitset<1> { template<> struct _Base_bitset<1> {
typedef unsigned long _WordT; typedef unsigned long _WordT;
_WordT _M_w; _WordT _M_w;
...@@ -381,7 +374,7 @@ template <size_t _Extrabits> struct _Sanitize { ...@@ -381,7 +374,7 @@ template <size_t _Extrabits> struct _Sanitize {
{ __val &= ~((~static_cast<unsigned long>(0)) << _Extrabits); } { __val &= ~((~static_cast<unsigned long>(0)) << _Extrabits); }
}; };
__STL_TEMPLATE_NULL struct _Sanitize<0> { template<> struct _Sanitize<0> {
static void _M_do_sanitize(unsigned long) {} static void _M_do_sanitize(unsigned long) {}
}; };
...@@ -466,7 +459,6 @@ public: ...@@ -466,7 +459,6 @@ public:
bitset(unsigned long __val) : _Base_bitset<__BITSET_WORDS(_Nb)>(__val) bitset(unsigned long __val) : _Base_bitset<__BITSET_WORDS(_Nb)>(__val)
{ _M_do_sanitize(); } { _M_do_sanitize(); }
#ifdef __STL_MEMBER_TEMPLATES
template<class _CharT, class _Traits, class _Alloc> template<class _CharT, class _Traits, class _Alloc>
explicit bitset(const basic_string<_CharT, _Traits, _Alloc>& __s, explicit bitset(const basic_string<_CharT, _Traits, _Alloc>& __s,
size_t __pos = 0) size_t __pos = 0)
...@@ -487,17 +479,6 @@ public: ...@@ -487,17 +479,6 @@ public:
__STL_THROW(out_of_range("bitset")); __STL_THROW(out_of_range("bitset"));
_M_copy_from_string(__s, __pos, __n); _M_copy_from_string(__s, __pos, __n);
} }
#else /* __STL_MEMBER_TEMPLATES */
explicit bitset(const basic_string<char>& __s,
size_t __pos = 0,
size_t __n = basic_string<char>::npos)
: _Base()
{
if (__pos > __s.size())
__STL_THROW(out_of_range("bitset"));
_M_copy_from_string(__s, __pos, __n);
}
#endif /* __STL_MEMBER_TEMPLATES */
// 23.3.5.2 bitset operations: // 23.3.5.2 bitset operations:
bitset<_Nb>& operator&=(const bitset<_Nb>& __rhs) { bitset<_Nb>& operator&=(const bitset<_Nb>& __rhs) {
...@@ -619,18 +600,14 @@ public: ...@@ -619,18 +600,14 @@ public:
unsigned long to_ulong() const { return this->_M_do_to_ulong(); } unsigned long to_ulong() const { return this->_M_do_to_ulong(); }
#if defined(__STL_MEMBER_TEMPLATES) && \
defined(__STL_EXPLICIT_FUNCTION_TMPL_ARGS)
template <class _CharT, class _Traits, class _Alloc> template <class _CharT, class _Traits, class _Alloc>
basic_string<_CharT, _Traits, _Alloc> to_string() const { basic_string<_CharT, _Traits, _Alloc> to_string() const {
basic_string<_CharT, _Traits, _Alloc> __result; basic_string<_CharT, _Traits, _Alloc> __result;
_M_copy_to_string(__result); _M_copy_to_string(__result);
return __result; return __result;
} }
#endif /* member templates and explicit function template args */
// Helper functions for string operations. // Helper functions for string operations.
#ifdef __STL_MEMBER_TEMPLATES
template<class _CharT, class _Traits, class _Alloc> template<class _CharT, class _Traits, class _Alloc>
void _M_copy_from_string(const basic_string<_CharT,_Traits,_Alloc>& __s, void _M_copy_from_string(const basic_string<_CharT,_Traits,_Alloc>& __s,
size_t, size_t,
...@@ -638,10 +615,6 @@ public: ...@@ -638,10 +615,6 @@ public:
template<class _CharT, class _Traits, class _Alloc> template<class _CharT, class _Traits, class _Alloc>
void _M_copy_to_string(basic_string<_CharT,_Traits,_Alloc>&) const; void _M_copy_to_string(basic_string<_CharT,_Traits,_Alloc>&) const;
#else /* __STL_MEMBER_TEMPLATES */
void _M_copy_from_string(const basic_string<char>&, size_t, size_t);
void _M_copy_to_string(basic_string<char>&) const;
#endif /* __STL_MEMBER_TEMPLATES */
size_t count() const { return this->_M_do_count(); } size_t count() const { return this->_M_do_count(); }
...@@ -689,8 +662,6 @@ public: ...@@ -689,8 +662,6 @@ public:
// Definitions of non-inline member functions. // Definitions of non-inline member functions.
// //
#ifdef __STL_MEMBER_TEMPLATES
template <size_t _Nb> template <size_t _Nb>
template<class _CharT, class _Traits, class _Alloc> template<class _CharT, class _Traits, class _Alloc>
void bitset<_Nb> void bitset<_Nb>
...@@ -725,40 +696,6 @@ void bitset<_Nb> ...@@ -725,40 +696,6 @@ void bitset<_Nb>
__s[_Nb - 1 - __i] = '1'; __s[_Nb - 1 - __i] = '1';
} }
#else /* __STL_MEMBER_TEMPLATES */
template <size_t _Nb>
void bitset<_Nb>::_M_copy_from_string(const basic_string<char>& __s,
size_t __pos, size_t __n)
{
reset();
size_t __tmp = _Nb;
const size_t __nbits = min(__tmp, min(__n, __s.size() - __pos));
for (size_t __i = 0; __i < __nbits; ++__i) {
switch(__s[__pos + __nbits - __i - 1]) {
case '0':
break;
case '1':
set(__i);
break;
default:
__STL_THROW(invalid_argument("bitset"));
}
}
}
template <size_t _Nb>
void bitset<_Nb>::_M_copy_to_string(basic_string<char>& __s) const
{
__s.assign(_Nb, '0');
for (size_t __i = 0; __i < _Nb; ++__i)
if (_Unchecked_test(__i))
__s[_Nb - 1 - __i] = '1';
}
#endif /* __STL_MEMBER_TEMPLATES */
// ------------------------------------------------------------ // ------------------------------------------------------------
// //
...@@ -787,8 +724,6 @@ inline bitset<_Nb> operator^(const bitset<_Nb>& __x, const bitset<_Nb>& __y) { ...@@ -787,8 +724,6 @@ inline bitset<_Nb> operator^(const bitset<_Nb>& __x, const bitset<_Nb>& __y) {
return __result; return __result;
} }
#ifdef __STL_USE_NEW_IOSTREAMS
template <class _CharT, class _Traits, size_t _Nb> template <class _CharT, class _Traits, size_t _Nb>
basic_istream<_CharT, _Traits>& basic_istream<_CharT, _Traits>&
operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x) operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x)
...@@ -802,7 +737,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x) ...@@ -802,7 +737,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x)
if (__sentry) { if (__sentry) {
basic_streambuf<_CharT, _Traits>* __buf = __is.rdbuf(); basic_streambuf<_CharT, _Traits>* __buf = __is.rdbuf();
for (size_t __i = 0; __i < _Nb; ++__i) { for (size_t __i = 0; __i < _Nb; ++__i) {
static _Traits::int_type __eof = _Traits::eof(); static typename _Traits::int_type __eof = _Traits::eof();
typename _Traits::int_type __c1 = __buf->sbumpc(); typename _Traits::int_type __c1 = __buf->sbumpc();
if (_Traits::eq_int_type(__c1, __eof)) { if (_Traits::eq_int_type(__c1, __eof)) {
...@@ -840,59 +775,7 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Nb>& __x) ...@@ -840,59 +775,7 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Nb>& __x)
return __os << __tmp; return __os << __tmp;
} }
#else /* __STL_USE_NEW_IOSTREAMS */ } // namespace std
template <size_t _Nb>
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<size_t>(0), _Nb);
return __is;
}
template <size_t _Nb>
ostream& operator<<(ostream& __os, const bitset<_Nb>& __x) {
string __tmp;
__x._M_copy_to_string(__tmp);
return __os << __tmp;
}
#endif /* __STL_USE_NEW_IOSTREAMS */
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#pragma reset woff 1209
#endif
__STL_END_NAMESPACE
#undef __BITSET_WORDS #undef __BITSET_WORDS
......
...@@ -416,8 +416,3 @@ namespace std { ...@@ -416,8 +416,3 @@ namespace std {
#endif /* _CPP_FSTREAM */ #endif /* _CPP_FSTREAM */
// Standard stream manipulators -*- C++ -*- // Standard stream manipulators -*- C++ -*-
// Copyright (C) 1997-1999 Free Software Foundation, Inc. // Copyright (C) 1997-1999, 2001 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -40,7 +40,8 @@ ...@@ -40,7 +40,8 @@
#include <bits/std_istream.h> #include <bits/std_istream.h>
#include <bits/std_functional.h> #include <bits/std_functional.h>
namespace std { namespace std
{
struct _Resetiosflags { ios_base::fmtflags _M_mask; }; struct _Resetiosflags { ios_base::fmtflags _M_mask; };
...@@ -215,7 +216,3 @@ namespace std { ...@@ -215,7 +216,3 @@ namespace std {
#endif /* __IOMANIP */ #endif /* __IOMANIP */
...@@ -47,7 +47,3 @@ ...@@ -47,7 +47,3 @@
#endif /* _CPP_IOS */ #endif /* _CPP_IOS */
// Input streams -*- C++ -*- // Input streams -*- C++ -*-
// Copyright (C) 1997-1999 Free Software Foundation, Inc. // Copyright (C) 1997-1999, 2001 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -39,7 +39,8 @@ ...@@ -39,7 +39,8 @@
#include <bits/std_ios.h> #include <bits/std_ios.h>
#include <bits/std_limits.h> // For numeric_limits #include <bits/std_limits.h> // For numeric_limits
namespace std { namespace std
{
// 27.6.1.1 Template class basic_istream // 27.6.1.1 Template class basic_istream
template<typename _CharT, typename _Traits> template<typename _CharT, typename _Traits>
...@@ -300,10 +301,3 @@ namespace std { ...@@ -300,10 +301,3 @@ namespace std {
#endif /* _CPP_ISTREAM */ #endif /* _CPP_ISTREAM */
...@@ -40,7 +40,3 @@ ...@@ -40,7 +40,3 @@
// mode:C++ // mode:C++
// End: // End:
...@@ -25,18 +25,14 @@ ...@@ -25,18 +25,14 @@
#include <bits/stl_uninitialized.h> #include <bits/stl_uninitialized.h>
#include <bits/stl_raw_storage_iter.h> #include <bits/stl_raw_storage_iter.h>
__STL_BEGIN_NAMESPACE namespace std
{
#if defined(__SGI_STL_USE_AUTO_PTR_CONVERSIONS) && \
defined(__STL_MEMBER_TEMPLATES)
template<class _Tp1> struct auto_ptr_ref { template<class _Tp1> struct auto_ptr_ref {
_Tp1* _M_ptr; _Tp1* _M_ptr;
auto_ptr_ref(_Tp1* __p) : _M_ptr(__p) {} auto_ptr_ref(_Tp1* __p) : _M_ptr(__p) {}
}; };
#endif
template <class _Tp> class auto_ptr { template <class _Tp> class auto_ptr {
private: private:
_Tp* _M_ptr; _Tp* _M_ptr;
...@@ -47,23 +43,19 @@ public: ...@@ -47,23 +43,19 @@ public:
explicit auto_ptr(_Tp* __p = 0) __STL_NOTHROW : _M_ptr(__p) {} explicit auto_ptr(_Tp* __p = 0) __STL_NOTHROW : _M_ptr(__p) {}
auto_ptr(auto_ptr& __a) __STL_NOTHROW : _M_ptr(__a.release()) {} auto_ptr(auto_ptr& __a) __STL_NOTHROW : _M_ptr(__a.release()) {}
#ifdef __STL_MEMBER_TEMPLATES
template <class _Tp1> auto_ptr(auto_ptr<_Tp1>& __a) __STL_NOTHROW template <class _Tp1> auto_ptr(auto_ptr<_Tp1>& __a) __STL_NOTHROW
: _M_ptr(__a.release()) {} : _M_ptr(__a.release()) {}
#endif /* __STL_MEMBER_TEMPLATES */
auto_ptr& operator=(auto_ptr& __a) __STL_NOTHROW { auto_ptr& operator=(auto_ptr& __a) __STL_NOTHROW {
reset(__a.release()); reset(__a.release());
return *this; return *this;
} }
#ifdef __STL_MEMBER_TEMPLATES
template <class _Tp1> template <class _Tp1>
auto_ptr& operator=(auto_ptr<_Tp1>& __a) __STL_NOTHROW { auto_ptr& operator=(auto_ptr<_Tp1>& __a) __STL_NOTHROW {
reset(__a.release()); reset(__a.release());
return *this; return *this;
} }
#endif /* __STL_MEMBER_TEMPLATES */
// Note: The C++ standard says there is supposed to be an empty throw // Note: The C++ standard says there is supposed to be an empty throw
// specification here, but omitting it is standard conforming. Its // specification here, but omitting it is standard conforming. Its
...@@ -96,10 +88,6 @@ public: ...@@ -96,10 +88,6 @@ public:
// present-day compilers, however, do not enforce that requirement---and, // present-day compilers, however, do not enforce that requirement---and,
// in fact, most present-day compilers do not support the language // in fact, most present-day compilers do not support the language
// features that these conversions rely on. // features that these conversions rely on.
#if defined(__SGI_STL_USE_AUTO_PTR_CONVERSIONS) && \
defined(__STL_MEMBER_TEMPLATES)
public: public:
auto_ptr(auto_ptr_ref<_Tp> __ref) __STL_NOTHROW auto_ptr(auto_ptr_ref<_Tp> __ref) __STL_NOTHROW
: _M_ptr(__ref._M_ptr) {} : _M_ptr(__ref._M_ptr) {}
...@@ -116,11 +104,9 @@ public: ...@@ -116,11 +104,9 @@ public:
{ return auto_ptr_ref<_Tp>(this->release()); } { return auto_ptr_ref<_Tp>(this->release()); }
template <class _Tp1> operator auto_ptr<_Tp1>() __STL_NOTHROW template <class _Tp1> operator auto_ptr<_Tp1>() __STL_NOTHROW
{ return auto_ptr<_Tp1>(this->release()); } { return auto_ptr<_Tp1>(this->release()); }
#endif /* auto ptr conversions && member templates */
}; };
__STL_END_NAMESPACE } // namespace std
#endif /* _CPP_MEMORY */ #endif /* _CPP_MEMORY */
......
...@@ -38,8 +38,8 @@ ...@@ -38,8 +38,8 @@
#include <bits/std_ios.h> #include <bits/std_ios.h>
namespace std { namespace std
{
// 27.6.2.1 Template class basic_ostream // 27.6.2.1 Template class basic_ostream
template<typename _CharT, typename _Traits> template<typename _CharT, typename _Traits>
class basic_ostream : virtual public basic_ios<_CharT, _Traits> class basic_ostream : virtual public basic_ios<_CharT, _Traits>
......
...@@ -39,8 +39,8 @@ ...@@ -39,8 +39,8 @@
#include <bits/std_istream.h> #include <bits/std_istream.h>
#include <bits/std_ostream.h> #include <bits/std_ostream.h>
namespace std { namespace std
{
template<typename _CharT, typename _Traits, typename _Alloc> template<typename _CharT, typename _Traits, typename _Alloc>
class basic_stringbuf : public basic_streambuf<_CharT, _Traits> class basic_stringbuf : public basic_streambuf<_CharT, _Traits>
{ {
...@@ -350,19 +350,5 @@ namespace std { ...@@ -350,19 +350,5 @@ namespace std {
#endif #endif
#endif #endif
#endif /* _CPP_SSTREAM */ #endif /* _CPP_SSTREAM */
...@@ -42,8 +42,8 @@ ...@@ -42,8 +42,8 @@
#include <bits/localefwd.h> #include <bits/localefwd.h>
#include <bits/ios_base.h> #include <bits/ios_base.h>
namespace std { namespace std
{
template<typename _CharT, typename _Traits> template<typename _CharT, typename _Traits>
streamsize streamsize
__copy_streambufs(basic_ios<_CharT, _Traits>& _ios, __copy_streambufs(basic_ios<_CharT, _Traits>& _ios,
...@@ -537,13 +537,3 @@ namespace std { ...@@ -537,13 +537,3 @@ namespace std {
#endif /* _CPP_STREAMBUF */ #endif /* _CPP_STREAMBUF */
...@@ -52,15 +52,3 @@ ...@@ -52,15 +52,3 @@
#endif /* _CPP_STRING */ #endif /* _CPP_STRING */
// The template and inlines for the -*- C++ -*- valarray class. // The template and inlines for the -*- C++ -*- valarray class.
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc. // Copyright (C) 1997-1999, 2000, 2001 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -42,8 +42,8 @@ ...@@ -42,8 +42,8 @@
#include <bits/std_functional.h> #include <bits/std_functional.h>
#include <bits/std_algorithm.h> #include <bits/std_algorithm.h>
namespace std { namespace std
{
template<class _Clos, typename _Tp> class _Expr; template<class _Clos, typename _Tp> class _Expr;
template<typename _Tp1, typename _Tp2> class _ValArray; template<typename _Tp1, typename _Tp2> class _ValArray;
...@@ -82,13 +82,13 @@ namespace std { ...@@ -82,13 +82,13 @@ namespace std {
template<class _Tp> class mask_array; // masked array template<class _Tp> class mask_array; // masked array
template<class _Tp> class indirect_array; // indirected array template<class _Tp> class indirect_array; // indirected array
} } // namespace std
#include <bits/valarray_array.h> #include <bits/valarray_array.h>
#include <bits/valarray_meta.h> #include <bits/valarray_meta.h>
namespace std { namespace std
{
template<class _Tp> class valarray template<class _Tp> class valarray
{ {
public: public:
...@@ -254,8 +254,8 @@ namespace std { ...@@ -254,8 +254,8 @@ namespace std {
#include <bits/mask_array.h> #include <bits/mask_array.h>
#include <bits/indirect_array.h> #include <bits/indirect_array.h>
namespace std { namespace std
{
template<typename _Tp> template<typename _Tp>
inline valarray<_Tp>::valarray () : _M_size (0), _M_data (0) {} inline valarray<_Tp>::valarray () : _M_size (0), _M_data (0) {}
...@@ -627,7 +627,8 @@ _DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(>>, shift_right) ...@@ -627,7 +627,8 @@ _DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(>>, shift_right)
} // std:: } // std::
namespace std { namespace std
{
#define _DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(_Op, _Name) \ #define _DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(_Op, _Name) \
template<class _Tp> template<class _Dom> \ template<class _Tp> template<class _Dom> \
......
...@@ -36,12 +36,8 @@ ...@@ -36,12 +36,8 @@
// See concept_checks.h for the concept-checking macros // See concept_checks.h for the concept-checking macros
// __STL_REQUIRES, __STL_CONVERTIBLE, etc. // __STL_REQUIRES, __STL_CONVERTIBLE, etc.
namespace std
__STL_BEGIN_NAMESPACE {
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#pragma set woff 1209
#endif
// __median (an extension, not present in the C++ standard). // __median (an extension, not present in the C++ standard).
...@@ -113,8 +109,6 @@ inline _InputIter find_if(_InputIter __first, _InputIter __last, ...@@ -113,8 +109,6 @@ inline _InputIter find_if(_InputIter __first, _InputIter __last,
return __first; return __first;
} }
#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
template <class _RandomAccessIter, class _Tp> template <class _RandomAccessIter, class _Tp>
_RandomAccessIter find(_RandomAccessIter __first, _RandomAccessIter __last, _RandomAccessIter find(_RandomAccessIter __first, _RandomAccessIter __last,
const _Tp& __val, const _Tp& __val,
...@@ -191,8 +185,6 @@ _RandomAccessIter find_if(_RandomAccessIter __first, _RandomAccessIter __last, ...@@ -191,8 +185,6 @@ _RandomAccessIter find_if(_RandomAccessIter __first, _RandomAccessIter __last,
} }
} }
#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
template <class _InputIter, class _Tp> template <class _InputIter, class _Tp>
inline _InputIter find(_InputIter __first, _InputIter __last, inline _InputIter find(_InputIter __first, _InputIter __last,
const _Tp& __val) const _Tp& __val)
...@@ -277,8 +269,6 @@ void count_if(_InputIter __first, _InputIter __last, _Predicate __pred, ...@@ -277,8 +269,6 @@ void count_if(_InputIter __first, _InputIter __last, _Predicate __pred,
++__n; ++__n;
} }
#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
template <class _InputIter, class _Tp> template <class _InputIter, class _Tp>
typename iterator_traits<_InputIter>::difference_type typename iterator_traits<_InputIter>::difference_type
count(_InputIter __first, _InputIter __last, const _Tp& __value) { count(_InputIter __first, _InputIter __last, const _Tp& __value) {
...@@ -307,8 +297,6 @@ count_if(_InputIter __first, _InputIter __last, _Predicate __pred) { ...@@ -307,8 +297,6 @@ count_if(_InputIter __first, _InputIter __last, _Predicate __pred) {
} }
#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
// search. // search.
template <class _ForwardIter1, class _ForwardIter2> template <class _ForwardIter1, class _ForwardIter2>
...@@ -3098,8 +3086,6 @@ _ForwardIter1 __find_end(_ForwardIter1 __first1, _ForwardIter1 __last1, ...@@ -3098,8 +3086,6 @@ _ForwardIter1 __find_end(_ForwardIter1 __first1, _ForwardIter1 __last1,
} }
// find_end for bidirectional iterators. Requires partial specialization. // find_end for bidirectional iterators. Requires partial specialization.
#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
template <class _BidirectionalIter1, class _BidirectionalIter2> template <class _BidirectionalIter1, class _BidirectionalIter2>
_BidirectionalIter1 _BidirectionalIter1
__find_end(_BidirectionalIter1 __first1, _BidirectionalIter1 __last1, __find_end(_BidirectionalIter1 __first1, _BidirectionalIter1 __last1,
...@@ -3152,7 +3138,6 @@ __find_end(_BidirectionalIter1 __first1, _BidirectionalIter1 __last1, ...@@ -3152,7 +3138,6 @@ __find_end(_BidirectionalIter1 __first1, _BidirectionalIter1 __last1,
return __result; return __result;
} }
} }
#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
// Dispatching functions for find_end. // Dispatching functions for find_end.
...@@ -3284,11 +3269,7 @@ bool is_sorted(_ForwardIter __first, _ForwardIter __last, ...@@ -3284,11 +3269,7 @@ bool is_sorted(_ForwardIter __first, _ForwardIter __last,
return true; return true;
} }
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32) } // namespace std
#pragma reset woff 1209
#endif
__STL_END_NAMESPACE
#endif /* __SGI_STL_INTERNAL_ALGO_H */ #endif /* __SGI_STL_INTERNAL_ALGO_H */
......
...@@ -45,18 +45,14 @@ ...@@ -45,18 +45,14 @@
#include <bits/std_cstddef.h> #include <bits/std_cstddef.h>
#include <new> #include <new>
#ifdef __STL_USE_NEW_IOSTREAMS
#include <iosfwd>
#else /* __STL_USE_NEW_IOSTREAMS */
#include <bits/std_iosfwd.h> #include <bits/std_iosfwd.h>
#endif /* __STL_USE_NEW_IOSTREAMS */
#include <bits/stl_iterator_base.h> #include <bits/stl_iterator_base.h>
#include <bits/stl_iterator.h> #include <bits/stl_iterator.h>
// We pick up concept_checks.h from stl_iterator_base.h. // We pick up concept_checks.h from stl_iterator_base.h.
__STL_BEGIN_NAMESPACE namespace std
{
// swap and iter_swap // swap and iter_swap
...@@ -89,8 +85,6 @@ inline void swap(_Tp& __a, _Tp& __b) { ...@@ -89,8 +85,6 @@ inline void swap(_Tp& __a, _Tp& __b) {
//-------------------------------------------------- //--------------------------------------------------
// min and max // min and max
#if !defined(__BORLANDC__) || __BORLANDC__ >= 0x540 /* C++ Builder 4.0 */
#undef min #undef min
#undef max #undef max
...@@ -108,8 +102,6 @@ inline const _Tp& max(const _Tp& __a, const _Tp& __b) { ...@@ -108,8 +102,6 @@ inline const _Tp& max(const _Tp& __a, const _Tp& __b) {
if (__a < __b) return __b; return __a; if (__a < __b) return __b; return __a;
} }
#endif /* __BORLANDC__ */
template <class _Tp, class _Compare> template <class _Tp, class _Compare>
inline const _Tp& min(const _Tp& __a, const _Tp& __b, _Compare __comp) { inline const _Tp& min(const _Tp& __a, const _Tp& __b, _Compare __comp) {
//return __comp(__b, __a) ? __b : __a; //return __comp(__b, __a) ? __b : __a;
...@@ -161,7 +153,6 @@ __copy_trivial(const _Tp* __first, const _Tp* __last, _Tp* __result) { ...@@ -161,7 +153,6 @@ __copy_trivial(const _Tp* __first, const _Tp* __last, _Tp* __result) {
return __result + (__last - __first); return __result + (__last - __first);
} }
#if defined(__STL_FUNCTION_TMPL_PARTIAL_ORDER)
template <class _InputIter, class _OutputIter> template <class _InputIter, class _OutputIter>
inline _OutputIter __copy_aux2(_InputIter __first, _InputIter __last, inline _OutputIter __copy_aux2(_InputIter __first, _InputIter __last,
...@@ -240,91 +231,6 @@ inline _OutputIter copy(_InputIter __first, _InputIter __last, ...@@ -240,91 +231,6 @@ inline _OutputIter copy(_InputIter __first, _InputIter __last,
return __copy_ni1(__first, __last, __result, __Normal()); return __copy_ni1(__first, __last, __result, __Normal());
} }
// Hack for compilers that don't have partial ordering of function templates
// but do have partial specialization of class templates.
#elif defined(__STL_CLASS_PARTIAL_SPECIALIZATION)
template <class _InputIter, class _OutputIter, class _BoolType>
struct __copy_dispatch {
static _OutputIter copy(_InputIter __first, _InputIter __last,
_OutputIter __result) {
typedef typename iterator_traits<_InputIter>::iterator_category _Category;
typedef typename iterator_traits<_InputIter>::difference_type _Distance;
return __copy(__first, __last, __result, _Category(), (_Distance*) 0);
}
};
template <class _Tp>
struct __copy_dispatch<_Tp*, _Tp*, __true_type>
{
static _Tp* copy(const _Tp* __first, const _Tp* __last, _Tp* __result) {
return __copy_trivial(__first, __last, __result);
}
};
template <class _Tp>
struct __copy_dispatch<const _Tp*, _Tp*, __true_type>
{
static _Tp* copy(const _Tp* __first, const _Tp* __last, _Tp* __result) {
return __copy_trivial(__first, __last, __result);
}
};
template <class _InputIter, class _OutputIter>
inline _OutputIter copy(_InputIter __first, _InputIter __last,
_OutputIter __result) {
__STL_REQUIRES(_InputIter, _InputIterator);
__STL_REQUIRES(_OutputIter, _OutputIterator);
typedef typename iterator_traits<_InputIter>::value_type _Tp;
typedef typename __type_traits<_Tp>::has_trivial_assignment_operator
_Trivial;
return __copy_dispatch<_InputIter, _OutputIter, _Trivial>
::copy(__first, __last, __result);
}
// Fallback for compilers with neither partial ordering nor partial
// specialization. Define the faster version for the basic builtin
// types.
#else /* __STL_CLASS_PARTIAL_SPECIALIZATION */
template <class _InputIter, class _OutputIter>
inline _OutputIter copy(_InputIter __first, _InputIter __last,
_OutputIter __result)
{
return __copy(__first, __last, __result,
__ITERATOR_CATEGORY(__first),
__DISTANCE_TYPE(__first));
}
#define __SGI_STL_DECLARE_COPY_TRIVIAL(_Tp) \
inline _Tp* copy(const _Tp* __first, const _Tp* __last, _Tp* __result) { \
memmove(__result, __first, sizeof(_Tp) * (__last - __first)); \
return __result + (__last - __first); \
}
__SGI_STL_DECLARE_COPY_TRIVIAL(char)
__SGI_STL_DECLARE_COPY_TRIVIAL(signed char)
__SGI_STL_DECLARE_COPY_TRIVIAL(unsigned char)
__SGI_STL_DECLARE_COPY_TRIVIAL(short)
__SGI_STL_DECLARE_COPY_TRIVIAL(unsigned short)
__SGI_STL_DECLARE_COPY_TRIVIAL(int)
__SGI_STL_DECLARE_COPY_TRIVIAL(unsigned int)
__SGI_STL_DECLARE_COPY_TRIVIAL(long)
__SGI_STL_DECLARE_COPY_TRIVIAL(unsigned long)
#ifdef __STL_HAS_WCHAR_T
__SGI_STL_DECLARE_COPY_TRIVIAL(wchar_t)
#endif
#ifdef _STL_LONG_LONG
__SGI_STL_DECLARE_COPY_TRIVIAL(long long)
__SGI_STL_DECLARE_COPY_TRIVIAL(unsigned long long)
#endif
__SGI_STL_DECLARE_COPY_TRIVIAL(float)
__SGI_STL_DECLARE_COPY_TRIVIAL(double)
__SGI_STL_DECLARE_COPY_TRIVIAL(long double)
#undef __SGI_STL_DECLARE_COPY_TRIVIAL
#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
//-------------------------------------------------- //--------------------------------------------------
// copy_backward // copy_backward
...@@ -353,7 +259,6 @@ inline _BidirectionalIter __copy_backward(_RandomAccessIter __first, ...@@ -353,7 +259,6 @@ inline _BidirectionalIter __copy_backward(_RandomAccessIter __first,
return __result; return __result;
} }
#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
// This dispatch class is a workaround for compilers that do not // This dispatch class is a workaround for compilers that do not
// have partial ordering of function templates. All we're doing is // have partial ordering of function templates. All we're doing is
...@@ -443,17 +348,6 @@ inline _BI2 copy_backward(_BI1 __first, _BI1 __last, _BI2 __result) { ...@@ -443,17 +348,6 @@ inline _BI2 copy_backward(_BI1 __first, _BI1 __last, _BI2 __result) {
__Normal()); __Normal());
} }
#else /* __STL_CLASS_PARTIAL_SPECIALIZATION */
template <class _BI1, class _BI2>
inline _BI2 copy_backward(_BI1 __first, _BI1 __last, _BI2 __result) {
return __copy_backward(__first, __last, __result,
__ITERATOR_CATEGORY(__first),
__DISTANCE_TYPE(__first));
}
#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
//-------------------------------------------------- //--------------------------------------------------
// copy_n (not part of the C++ standard) // copy_n (not part of the C++ standard)
...@@ -531,8 +425,6 @@ inline void fill(char* __first, char* __last, const char& __c) { ...@@ -531,8 +425,6 @@ inline void fill(char* __first, char* __last, const char& __c) {
memset(__first, static_cast<unsigned char>(__tmp), __last - __first); memset(__first, static_cast<unsigned char>(__tmp), __last - __first);
} }
#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
template <class _Size> template <class _Size>
inline unsigned char* fill_n(unsigned char* __first, _Size __n, inline unsigned char* fill_n(unsigned char* __first, _Size __n,
const unsigned char& __c) { const unsigned char& __c) {
...@@ -553,7 +445,6 @@ inline char* fill_n(char* __first, _Size __n, const char& __c) { ...@@ -553,7 +445,6 @@ inline char* fill_n(char* __first, _Size __n, const char& __c) {
return __first + __n; return __first + __n;
} }
#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
//-------------------------------------------------- //--------------------------------------------------
// equal and mismatch // equal and mismatch
...@@ -746,7 +637,7 @@ int lexicographical_compare_3way(_InputIter1 __first1, _InputIter1 __last1, ...@@ -746,7 +637,7 @@ int lexicographical_compare_3way(_InputIter1 __first1, _InputIter1 __last1,
return __lexicographical_compare_3way(__first1, __last1, __first2, __last2); return __lexicographical_compare_3way(__first1, __last1, __first2, __last2);
} }
__STL_END_NAMESPACE } // namespace std
#endif /* __SGI_STL_INTERNAL_ALGOBASE_H */ #endif /* __SGI_STL_INTERNAL_ALGOBASE_H */
......
...@@ -18,19 +18,6 @@ ...@@ -18,19 +18,6 @@
#ifndef __SGI_STL_INTERNAL_ALLOC_H #ifndef __SGI_STL_INTERNAL_ALLOC_H
#define __SGI_STL_INTERNAL_ALLOC_H #define __SGI_STL_INTERNAL_ALLOC_H
#ifdef __SUNPRO_CC
# define __PRIVATE public
// Extra access restrictions prevent us from really making some things
// private.
#else
# define __PRIVATE private
#endif
#ifdef __STL_STATIC_TEMPLATE_MEMBER_BUG
# define __USE_MALLOC
#endif
// This implements some standard node allocators. These are // This implements some standard node allocators. These are
// NOT the same as the allocators in the C++ draft standard or in // NOT the same as the allocators in the C++ draft standard or in
// in the original STL. They do not encapsulate different pointer // in the original STL. They do not encapsulate different pointer
...@@ -38,17 +25,7 @@ ...@@ -38,17 +25,7 @@
// The allocation primitives are intended to allocate individual objects, // The allocation primitives are intended to allocate individual objects,
// not larger arenas as with the original STL allocators. // not larger arenas as with the original STL allocators.
#ifndef __THROW_BAD_ALLOC #include <bits/functexcept.h> // for __throw_bad_alloc
# if defined(__STL_NO_BAD_ALLOC) || !defined(__STL_USE_EXCEPTIONS)
# include <bits/std_cstdio.h>
# include <bits/std_cstdlib.h>
# define __THROW_BAD_ALLOC fprintf(stderr, "out of memory\n"); exit(1)
# else /* Standard conforming out-of-memory handling */
# include <new>
# define __THROW_BAD_ALLOC throw std::bad_alloc()
# endif
#endif
#include <bits/std_cstddef.h> #include <bits/std_cstddef.h>
#include <bits/std_cstdlib.h> #include <bits/std_cstdlib.h>
#include <bits/std_cstring.h> #include <bits/std_cstring.h>
...@@ -88,23 +65,11 @@ ...@@ -88,23 +65,11 @@
# define __NODE_ALLOCATOR_THREADS false # define __NODE_ALLOCATOR_THREADS false
#endif #endif
__STL_BEGIN_NAMESPACE namespace std
{
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#pragma set woff 1174
#endif
// Malloc-based allocator. Typically slower than default alloc below. // Malloc-based allocator. Typically slower than default alloc below.
// Typically thread-safe and more storage efficient. // Typically thread-safe and more storage efficient.
#ifdef __STL_STATIC_TEMPLATE_MEMBER_BUG
# ifdef __DECLARE_GLOBALS_HERE
void (* __malloc_alloc_oom_handler)() = 0;
// g++ 2.7.2 does not handle static template data members.
# else
extern void (* __malloc_alloc_oom_handler)();
# endif
#endif
template <int __inst> template <int __inst>
class __malloc_alloc_template { class __malloc_alloc_template {
...@@ -112,10 +77,7 @@ private: ...@@ -112,10 +77,7 @@ private:
static void* _S_oom_malloc(size_t); static void* _S_oom_malloc(size_t);
static void* _S_oom_realloc(void*, size_t); static void* _S_oom_realloc(void*, size_t);
#ifndef __STL_STATIC_TEMPLATE_MEMBER_BUG
static void (* __malloc_alloc_oom_handler)(); static void (* __malloc_alloc_oom_handler)();
#endif
public: public:
...@@ -149,10 +111,8 @@ public: ...@@ -149,10 +111,8 @@ public:
// malloc_alloc out-of-memory handling // malloc_alloc out-of-memory handling
#ifndef __STL_STATIC_TEMPLATE_MEMBER_BUG
template <int __inst> template <int __inst>
void (* __malloc_alloc_template<__inst>::__malloc_alloc_oom_handler)() = 0; void (* __malloc_alloc_template<__inst>::__malloc_alloc_oom_handler)() = 0;
#endif
template <int __inst> template <int __inst>
void* void*
...@@ -163,7 +123,7 @@ __malloc_alloc_template<__inst>::_S_oom_malloc(size_t __n) ...@@ -163,7 +123,7 @@ __malloc_alloc_template<__inst>::_S_oom_malloc(size_t __n)
for (;;) { for (;;) {
__my_malloc_handler = __malloc_alloc_oom_handler; __my_malloc_handler = __malloc_alloc_oom_handler;
if (0 == __my_malloc_handler) { __THROW_BAD_ALLOC; } if (0 == __my_malloc_handler) { std::__throw_bad_alloc(); }
(*__my_malloc_handler)(); (*__my_malloc_handler)();
__result = malloc(__n); __result = malloc(__n);
if (__result) return(__result); if (__result) return(__result);
...@@ -178,7 +138,7 @@ void* __malloc_alloc_template<__inst>::_S_oom_realloc(void* __p, size_t __n) ...@@ -178,7 +138,7 @@ void* __malloc_alloc_template<__inst>::_S_oom_realloc(void* __p, size_t __n)
for (;;) { for (;;) {
__my_malloc_handler = __malloc_alloc_oom_handler; __my_malloc_handler = __malloc_alloc_oom_handler;
if (0 == __my_malloc_handler) { __THROW_BAD_ALLOC; } if (0 == __my_malloc_handler) { std::__throw_bad_alloc(); }
(*__my_malloc_handler)(); (*__my_malloc_handler)();
__result = realloc(__p, __n); __result = realloc(__p, __n);
if (__result) return(__result); if (__result) return(__result);
...@@ -278,40 +238,26 @@ typedef malloc_alloc single_client_alloc; ...@@ -278,40 +238,26 @@ typedef malloc_alloc single_client_alloc;
// Node that containers built on different allocator instances have // Node that containers built on different allocator instances have
// different types, limiting the utility of this approach. // different types, limiting the utility of this approach.
#if defined(__SUNPRO_CC) || defined(__GNUC__)
// breaks if we make these template class members:
enum {_ALIGN = 8};
enum {_MAX_BYTES = 128};
enum {_NFREELISTS = 16}; // _MAX_BYTES/_ALIGN
#endif
template <bool threads, int inst> template <bool threads, int inst>
class __default_alloc_template { class __default_alloc_template {
private: private:
// Really we should use static const int x = N // Really we should use static const int x = N
// instead of enum { x = N }, but few compilers accept the former. // instead of enum { x = N }, but few compilers accept the former.
#if ! (defined(__SUNPRO_CC) || defined(__GNUC__)) enum {_ALIGN = 8};
enum {_ALIGN = 8}; enum {_MAX_BYTES = 128};
enum {_MAX_BYTES = 128}; enum {_NFREELISTS = 16}; // _MAX_BYTES/_ALIGN
enum {_NFREELISTS = 16}; // _MAX_BYTES/_ALIGN
# endif
static size_t static size_t
_S_round_up(size_t __bytes) _S_round_up(size_t __bytes)
{ return (((__bytes) + (size_t) _ALIGN-1) & ~((size_t) _ALIGN - 1)); } { return (((__bytes) + (size_t) _ALIGN-1) & ~((size_t) _ALIGN - 1)); }
__PRIVATE:
union _Obj { union _Obj {
union _Obj* _M_free_list_link; union _Obj* _M_free_list_link;
char _M_client_data[1]; /* The client sees this. */ char _M_client_data[1]; /* The client sees this. */
}; };
private:
# if defined(__SUNPRO_CC) || defined(__GNUC__) || defined(__HP_aCC) static _Obj* __STL_VOLATILE _S_free_list[];
static _Obj* __STL_VOLATILE _S_free_list[];
// Specifying a size results in duplicate def for 4.1 // Specifying a size results in duplicate def for 4.1
# else
static _Obj* __STL_VOLATILE _S_free_list[_NFREELISTS];
# endif
static size_t _S_freelist_index(size_t __bytes) { static size_t _S_freelist_index(size_t __bytes) {
return (((__bytes) + (size_t)_ALIGN-1)/(size_t)_ALIGN - 1); return (((__bytes) + (size_t)_ALIGN-1)/(size_t)_ALIGN - 1);
} }
...@@ -409,14 +355,12 @@ inline bool operator==(const __default_alloc_template<__threads, __inst>&, ...@@ -409,14 +355,12 @@ inline bool operator==(const __default_alloc_template<__threads, __inst>&,
return true; return true;
} }
# ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
template <bool __threads, int __inst> template <bool __threads, int __inst>
inline bool operator!=(const __default_alloc_template<__threads, __inst>&, inline bool operator!=(const __default_alloc_template<__threads, __inst>&,
const __default_alloc_template<__threads, __inst>&) const __default_alloc_template<__threads, __inst>&)
{ {
return false; return false;
} }
# endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
...@@ -563,11 +507,7 @@ size_t __default_alloc_template<__threads, __inst>::_S_heap_size = 0; ...@@ -563,11 +507,7 @@ size_t __default_alloc_template<__threads, __inst>::_S_heap_size = 0;
template <bool __threads, int __inst> template <bool __threads, int __inst>
typename __default_alloc_template<__threads, __inst>::_Obj* __STL_VOLATILE typename __default_alloc_template<__threads, __inst>::_Obj* __STL_VOLATILE
__default_alloc_template<__threads, __inst> ::_S_free_list[ __default_alloc_template<__threads, __inst> ::_S_free_list[
# if defined(__SUNPRO_CC) || defined(__GNUC__) || defined(__HP_aCC)
_NFREELISTS
# else
__default_alloc_template<__threads, __inst>::_NFREELISTS __default_alloc_template<__threads, __inst>::_NFREELISTS
# endif
] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; ] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, };
// The 16 zeros are necessary to make version 4.1 of the SunPro // The 16 zeros are necessary to make version 4.1 of the SunPro
// compiler happy. Otherwise it appears to allocate too little // compiler happy. Otherwise it appears to allocate too little
...@@ -583,8 +523,6 @@ __default_alloc_template<__threads, __inst> ::_S_free_list[ ...@@ -583,8 +523,6 @@ __default_alloc_template<__threads, __inst> ::_S_free_list[
// templates, the typename keyword, and the use of the template keyword // templates, the typename keyword, and the use of the template keyword
// to refer to a template member of a dependent type. // to refer to a template member of a dependent type.
#ifdef __STL_USE_STD_ALLOCATORS
template <class _Tp> template <class _Tp>
class allocator { class allocator {
typedef alloc _Alloc; // The underlying allocator. typedef alloc _Alloc; // The underlying allocator.
...@@ -726,14 +664,12 @@ inline bool operator==(const __allocator<_Tp, _Alloc>& __a1, ...@@ -726,14 +664,12 @@ inline bool operator==(const __allocator<_Tp, _Alloc>& __a1,
return __a1.__underlying_alloc == __a2.__underlying_alloc; return __a1.__underlying_alloc == __a2.__underlying_alloc;
} }
#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
template <class _Tp, class _Alloc> template <class _Tp, class _Alloc>
inline bool operator!=(const __allocator<_Tp, _Alloc>& __a1, inline bool operator!=(const __allocator<_Tp, _Alloc>& __a1,
const __allocator<_Tp, _Alloc>& __a2) const __allocator<_Tp, _Alloc>& __a2)
{ {
return __a1.__underlying_alloc != __a2.__underlying_alloc; return __a1.__underlying_alloc != __a2.__underlying_alloc;
} }
#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
// Comparison operators for all of the predifined SGI-style allocators. // Comparison operators for all of the predifined SGI-style allocators.
// This ensures that __allocator<malloc_alloc> (for example) will // This ensures that __allocator<malloc_alloc> (for example) will
...@@ -746,14 +682,12 @@ inline bool operator==(const __malloc_alloc_template<inst>&, ...@@ -746,14 +682,12 @@ inline bool operator==(const __malloc_alloc_template<inst>&,
return true; return true;
} }
#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
template <int __inst> template <int __inst>
inline bool operator!=(const __malloc_alloc_template<__inst>&, inline bool operator!=(const __malloc_alloc_template<__inst>&,
const __malloc_alloc_template<__inst>&) const __malloc_alloc_template<__inst>&)
{ {
return false; return false;
} }
#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
template <class _Alloc> template <class _Alloc>
inline bool operator==(const debug_alloc<_Alloc>&, inline bool operator==(const debug_alloc<_Alloc>&,
...@@ -761,13 +695,11 @@ inline bool operator==(const debug_alloc<_Alloc>&, ...@@ -761,13 +695,11 @@ inline bool operator==(const debug_alloc<_Alloc>&,
return true; return true;
} }
#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
template <class _Alloc> template <class _Alloc>
inline bool operator!=(const debug_alloc<_Alloc>&, inline bool operator!=(const debug_alloc<_Alloc>&,
const debug_alloc<_Alloc>&) { const debug_alloc<_Alloc>&) {
return false; return false;
} }
#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
// Another allocator adaptor: _Alloc_traits. This serves two // Another allocator adaptor: _Alloc_traits. This serves two
// purposes. First, make it possible to write containers that can use // purposes. First, make it possible to write containers that can use
...@@ -801,8 +733,7 @@ template <class _Tp, class _Allocator> ...@@ -801,8 +733,7 @@ template <class _Tp, class _Allocator>
struct _Alloc_traits struct _Alloc_traits
{ {
static const bool _S_instanceless = false; static const bool _S_instanceless = false;
typedef typename _Allocator::__STL_TEMPLATE rebind<_Tp>::other typedef typename _Allocator::template rebind<_Tp>::other allocator_type;
allocator_type;
}; };
template <class _Tp, class _Allocator> template <class _Tp, class _Allocator>
...@@ -882,16 +813,7 @@ struct _Alloc_traits<_Tp, __allocator<_Tp1, debug_alloc<_Alloc> > > ...@@ -882,16 +813,7 @@ struct _Alloc_traits<_Tp, __allocator<_Tp1, debug_alloc<_Alloc> > >
typedef __allocator<_Tp, debug_alloc<_Alloc> > allocator_type; typedef __allocator<_Tp, debug_alloc<_Alloc> > allocator_type;
}; };
} // namespace std
#endif /* __STL_USE_STD_ALLOCATORS */
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#pragma reset woff 1174
#endif
__STL_END_NAMESPACE
#undef __PRIVATE
#endif /* __SGI_STL_INTERNAL_ALLOC_H */ #endif /* __SGI_STL_INTERNAL_ALLOC_H */
......
...@@ -33,7 +33,8 @@ ...@@ -33,7 +33,8 @@
#include <new> #include <new>
__STL_BEGIN_NAMESPACE namespace std
{
// construct and destroy. These functions are not part of the C++ standard, // construct and destroy. These functions are not part of the C++ standard,
// and are provided for backward compatibility with the HP STL. We also // and are provided for backward compatibility with the HP STL. We also
...@@ -88,9 +89,7 @@ inline void _Destroy(int*, int*) {} ...@@ -88,9 +89,7 @@ inline void _Destroy(int*, int*) {}
inline void _Destroy(long*, long*) {} inline void _Destroy(long*, long*) {}
inline void _Destroy(float*, float*) {} inline void _Destroy(float*, float*) {}
inline void _Destroy(double*, double*) {} inline void _Destroy(double*, double*) {}
#ifdef __STL_HAS_WCHAR_T
inline void _Destroy(wchar_t*, wchar_t*) {} inline void _Destroy(wchar_t*, wchar_t*) {}
#endif /* __STL_HAS_WCHAR_T */
// -------------------------------------------------- // --------------------------------------------------
// Old names from the HP STL. // Old names from the HP STL.
...@@ -115,7 +114,7 @@ inline void destroy(_ForwardIterator __first, _ForwardIterator __last) { ...@@ -115,7 +114,7 @@ inline void destroy(_ForwardIterator __first, _ForwardIterator __last) {
_Destroy(__first, __last); _Destroy(__first, __last);
} }
__STL_END_NAMESPACE } // namespace std
#endif /* _CPP_BITS_STL_CONSTRUCT_H */ #endif /* _CPP_BITS_STL_CONSTRUCT_H */
......
...@@ -31,7 +31,8 @@ ...@@ -31,7 +31,8 @@
#ifndef __SGI_STL_INTERNAL_FUNCTION_H #ifndef __SGI_STL_INTERNAL_FUNCTION_H
#define __SGI_STL_INTERNAL_FUNCTION_H #define __SGI_STL_INTERNAL_FUNCTION_H
__STL_BEGIN_NAMESPACE namespace std
{
template <class _Arg, class _Result> template <class _Arg, class _Result>
struct unary_function { struct unary_function {
...@@ -589,8 +590,6 @@ private: ...@@ -589,8 +590,6 @@ private:
_Ret (_Tp::*_M_f)(_Arg) const; _Ret (_Tp::*_M_f)(_Arg) const;
}; };
#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
template <class _Tp> template <class _Tp>
class mem_fun_t<void, _Tp> : public unary_function<_Tp*,void> { class mem_fun_t<void, _Tp> : public unary_function<_Tp*,void> {
public: public:
...@@ -666,7 +665,6 @@ private: ...@@ -666,7 +665,6 @@ private:
void (_Tp::*_M_f)(_Arg) const; void (_Tp::*_M_f)(_Arg) const;
}; };
#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
// Mem_fun adaptor helper functions. There are only two: // Mem_fun adaptor helper functions. There are only two:
// mem_fun and mem_fun_ref. (mem_fun1 and mem_fun1_ref // mem_fun and mem_fun_ref. (mem_fun1 and mem_fun1_ref
...@@ -723,7 +721,7 @@ inline const_mem_fun1_ref_t<_Ret,_Tp,_Arg> ...@@ -723,7 +721,7 @@ inline const_mem_fun1_ref_t<_Ret,_Tp,_Arg>
mem_fun1_ref(_Ret (_Tp::*__f)(_Arg) const) mem_fun1_ref(_Ret (_Tp::*__f)(_Arg) const)
{ return const_mem_fun1_ref_t<_Ret,_Tp,_Arg>(__f); } { return const_mem_fun1_ref_t<_Ret,_Tp,_Arg>(__f); }
__STL_END_NAMESPACE } // namespace std
#endif /* __SGI_STL_INTERNAL_FUNCTION_H */ #endif /* __SGI_STL_INTERNAL_FUNCTION_H */
......
...@@ -30,11 +30,8 @@ ...@@ -30,11 +30,8 @@
#ifndef _CPP_BITS_STL_HEAP_H #ifndef _CPP_BITS_STL_HEAP_H
#define _CPP_BITS_STL_HEAP_H 1 #define _CPP_BITS_STL_HEAP_H 1
__STL_BEGIN_NAMESPACE namespace std
{
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#pragma set woff 1209
#endif
// Heap-manipulation functions: push_heap, pop_heap, make_heap, sort_heap. // Heap-manipulation functions: push_heap, pop_heap, make_heap, sort_heap.
...@@ -284,11 +281,7 @@ sort_heap(_RandomAccessIterator __first, ...@@ -284,11 +281,7 @@ sort_heap(_RandomAccessIterator __first,
pop_heap(__first, __last--, __comp); pop_heap(__first, __last--, __comp);
} }
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32) } // namespace std
#pragma reset woff 1209
#endif
__STL_END_NAMESPACE
#endif /* _CPP_BITS_STL_HEAP_H */ #endif /* _CPP_BITS_STL_HEAP_H */
......
...@@ -37,7 +37,8 @@ ...@@ -37,7 +37,8 @@
#include <bits/concept_checks.h> #include <bits/concept_checks.h>
__STL_BEGIN_NAMESPACE namespace std
{
struct input_iterator_tag {}; struct input_iterator_tag {};
struct output_iterator_tag {}; struct output_iterator_tag {};
...@@ -91,7 +92,6 @@ template <class _Tp, class _Distance> struct random_access_iterator { ...@@ -91,7 +92,6 @@ template <class _Tp, class _Distance> struct random_access_iterator {
typedef _Tp& reference; typedef _Tp& reference;
}; };
#ifdef __STL_USE_NAMESPACES
template <class _Category, class _Tp, class _Distance = ptrdiff_t, template <class _Category, class _Tp, class _Distance = ptrdiff_t,
class _Pointer = _Tp*, class _Reference = _Tp&> class _Pointer = _Tp*, class _Reference = _Tp&>
struct iterator { struct iterator {
...@@ -101,9 +101,6 @@ struct iterator { ...@@ -101,9 +101,6 @@ struct iterator {
typedef _Pointer pointer; typedef _Pointer pointer;
typedef _Reference reference; typedef _Reference reference;
}; };
#endif /* __STL_USE_NAMESPACES */
#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
template <class _Iterator> template <class _Iterator>
struct iterator_traits { struct iterator_traits {
...@@ -178,92 +175,6 @@ value_type(const _Iter& __i) { return __value_type(__i); } ...@@ -178,92 +175,6 @@ value_type(const _Iter& __i) { return __value_type(__i); }
#define __DISTANCE_TYPE(__i) __distance_type(__i) #define __DISTANCE_TYPE(__i) __distance_type(__i)
#define __VALUE_TYPE(__i) __value_type(__i) #define __VALUE_TYPE(__i) __value_type(__i)
#else /* __STL_CLASS_PARTIAL_SPECIALIZATION */
template <class _Tp, class _Distance>
inline input_iterator_tag
iterator_category(const input_iterator<_Tp, _Distance>&)
{ return input_iterator_tag(); }
inline output_iterator_tag iterator_category(const output_iterator&)
{ return output_iterator_tag(); }
template <class _Tp, class _Distance>
inline forward_iterator_tag
iterator_category(const forward_iterator<_Tp, _Distance>&)
{ return forward_iterator_tag(); }
template <class _Tp, class _Distance>
inline bidirectional_iterator_tag
iterator_category(const bidirectional_iterator<_Tp, _Distance>&)
{ return bidirectional_iterator_tag(); }
template <class _Tp, class _Distance>
inline random_access_iterator_tag
iterator_category(const random_access_iterator<_Tp, _Distance>&)
{ return random_access_iterator_tag(); }
template <class _Tp>
inline random_access_iterator_tag iterator_category(const _Tp*)
{ return random_access_iterator_tag(); }
template <class _Tp, class _Distance>
inline _Tp* value_type(const input_iterator<_Tp, _Distance>&)
{ return (_Tp*)(0); }
template <class _Tp, class _Distance>
inline _Tp* value_type(const forward_iterator<_Tp, _Distance>&)
{ return (_Tp*)(0); }
template <class _Tp, class _Distance>
inline _Tp* value_type(const bidirectional_iterator<_Tp, _Distance>&)
{ return (_Tp*)(0); }
template <class _Tp, class _Distance>
inline _Tp* value_type(const random_access_iterator<_Tp, _Distance>&)
{ return (_Tp*)(0); }
template <class _Tp>
inline _Tp* value_type(const _Tp*) { return (_Tp*)(0); }
template <class _Tp, class _Distance>
inline _Distance* distance_type(const input_iterator<_Tp, _Distance>&)
{
return (_Distance*)(0);
}
template <class _Tp, class _Distance>
inline _Distance* distance_type(const forward_iterator<_Tp, _Distance>&)
{
return (_Distance*)(0);
}
template <class _Tp, class _Distance>
inline _Distance*
distance_type(const bidirectional_iterator<_Tp, _Distance>&)
{
return (_Distance*)(0);
}
template <class _Tp, class _Distance>
inline _Distance*
distance_type(const random_access_iterator<_Tp, _Distance>&)
{
return (_Distance*)(0);
}
template <class _Tp>
inline ptrdiff_t* distance_type(const _Tp*) { return (ptrdiff_t*)(0); }
// Without partial specialization we can't use iterator_traits, so
// we must keep the old iterator query functions around.
#define __ITERATOR_CATEGORY(__i) iterator_category(__i)
#define __DISTANCE_TYPE(__i) distance_type(__i)
#define __VALUE_TYPE(__i) value_type(__i)
#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
template <class _InputIterator, class _Distance> template <class _InputIterator, class _Distance>
inline void __distance(_InputIterator __first, _InputIterator __last, inline void __distance(_InputIterator __first, _InputIterator __last,
_Distance& __n, input_iterator_tag) _Distance& __n, input_iterator_tag)
...@@ -288,8 +199,6 @@ inline void distance(_InputIterator __first, ...@@ -288,8 +199,6 @@ inline void distance(_InputIterator __first,
__distance(__first, __last, __n, iterator_category(__first)); __distance(__first, __last, __n, iterator_category(__first));
} }
#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
template <class _InputIterator> template <class _InputIterator>
inline typename iterator_traits<_InputIterator>::difference_type inline typename iterator_traits<_InputIterator>::difference_type
__distance(_InputIterator __first, _InputIterator __last, input_iterator_tag) __distance(_InputIterator __first, _InputIterator __last, input_iterator_tag)
...@@ -318,17 +227,11 @@ distance(_InputIterator __first, _InputIterator __last) { ...@@ -318,17 +227,11 @@ distance(_InputIterator __first, _InputIterator __last) {
return __distance(__first, __last, _Category()); return __distance(__first, __last, _Category());
} }
#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
template <class _InputIter, class _Distance> template <class _InputIter, class _Distance>
inline void __advance(_InputIter& __i, _Distance __n, input_iterator_tag) { inline void __advance(_InputIter& __i, _Distance __n, input_iterator_tag) {
while (__n--) ++__i; while (__n--) ++__i;
} }
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#pragma set woff 1183
#endif
template <class _BidirectionalIterator, class _Distance> template <class _BidirectionalIterator, class _Distance>
inline void __advance(_BidirectionalIterator& __i, _Distance __n, inline void __advance(_BidirectionalIterator& __i, _Distance __n,
bidirectional_iterator_tag) { bidirectional_iterator_tag) {
...@@ -339,10 +242,6 @@ inline void __advance(_BidirectionalIterator& __i, _Distance __n, ...@@ -339,10 +242,6 @@ inline void __advance(_BidirectionalIterator& __i, _Distance __n,
while (__n++) --__i; while (__n++) --__i;
} }
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#pragma reset woff 1183
#endif
template <class _RandomAccessIterator, class _Distance> template <class _RandomAccessIterator, class _Distance>
inline void __advance(_RandomAccessIterator& __i, _Distance __n, inline void __advance(_RandomAccessIterator& __i, _Distance __n,
random_access_iterator_tag) { random_access_iterator_tag) {
...@@ -356,12 +255,11 @@ inline void advance(_InputIterator& __i, _Distance __n) { ...@@ -356,12 +255,11 @@ inline void advance(_InputIterator& __i, _Distance __n) {
__advance(__i, __n, iterator_category(__i)); __advance(__i, __n, iterator_category(__i));
} }
__STL_END_NAMESPACE } // namespace std
#endif /* __SGI_STL_INTERNAL_ITERATOR_BASE_H */ #endif /* __SGI_STL_INTERNAL_ITERATOR_BASE_H */
// Local Variables: // Local Variables:
// mode:C++ // mode:C++
// End: // End:
...@@ -33,12 +33,8 @@ ...@@ -33,12 +33,8 @@
#include <bits/concept_checks.h> #include <bits/concept_checks.h>
__STL_BEGIN_NAMESPACE namespace std
{
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#pragma set woff 1174
#pragma set woff 1375
#endif
struct _List_node_base { struct _List_node_base {
_List_node_base* _M_next; _List_node_base* _M_next;
...@@ -87,10 +83,7 @@ struct _List_iterator : public _List_iterator_base { ...@@ -87,10 +83,7 @@ struct _List_iterator : public _List_iterator_base {
_List_iterator(const iterator& __x) : _List_iterator_base(__x._M_node) {} _List_iterator(const iterator& __x) : _List_iterator_base(__x._M_node) {}
reference operator*() const { return ((_Node*) _M_node)->_M_data; } reference operator*() const { return ((_Node*) _M_node)->_M_data; }
#ifndef __SGI_STL_NO_ARROW_OPERATOR
pointer operator->() const { return &(operator*()); } pointer operator->() const { return &(operator*()); }
#endif /* __SGI_STL_NO_ARROW_OPERATOR */
_Self& operator++() { _Self& operator++() {
this->_M_incr(); this->_M_incr();
...@@ -112,29 +105,6 @@ struct _List_iterator : public _List_iterator_base { ...@@ -112,29 +105,6 @@ struct _List_iterator : public _List_iterator_base {
} }
}; };
#ifndef __STL_CLASS_PARTIAL_SPECIALIZATION
inline bidirectional_iterator_tag
iterator_category(const _List_iterator_base&)
{
return bidirectional_iterator_tag();
}
template <class _Tp, class _Ref, class _Ptr>
inline _Tp*
value_type(const _List_iterator<_Tp, _Ref, _Ptr>&)
{
return 0;
}
inline ptrdiff_t*
distance_type(const _List_iterator_base&)
{
return 0;
}
#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
// Base class that encapsulates details of allocators. Three cases: // Base class that encapsulates details of allocators. Three cases:
// an ordinary standard-conforming allocator, a standard-conforming // an ordinary standard-conforming allocator, a standard-conforming
...@@ -143,7 +113,6 @@ distance_type(const _List_iterator_base&) ...@@ -143,7 +113,6 @@ distance_type(const _List_iterator_base&)
// compatibility and because we want to avoid wasting storage on an // compatibility and because we want to avoid wasting storage on an
// allocator instance if it isn't necessary. // allocator instance if it isn't necessary.
#ifdef __STL_USE_STD_ALLOCATORS
// Base for general standard-conforming allocators. // Base for general standard-conforming allocators.
template <class _Tp, class _Allocator, bool _IsStatic> template <class _Tp, class _Allocator, bool _IsStatic>
...@@ -212,37 +181,6 @@ public: ...@@ -212,37 +181,6 @@ public:
void clear(); void clear();
}; };
#else /* __STL_USE_STD_ALLOCATORS */
template <class _Tp, class _Alloc>
class _List_base
{
public:
typedef _Alloc allocator_type;
allocator_type get_allocator() const { return allocator_type(); }
_List_base(const allocator_type&) {
_M_node = _M_get_node();
_M_node->_M_next = _M_node;
_M_node->_M_prev = _M_node;
}
~_List_base() {
clear();
_M_put_node(_M_node);
}
void clear();
protected:
typedef simple_alloc<_List_node<_Tp>, _Alloc> _Alloc_type;
_List_node<_Tp>* _M_get_node() { return _Alloc_type::allocate(1); }
void _M_put_node(_List_node<_Tp>* __p) { _Alloc_type::deallocate(__p, 1); }
protected:
_List_node<_Tp>* _M_node;
};
#endif /* __STL_USE_STD_ALLOCATORS */
template <class _Tp, class _Alloc> template <class _Tp, class _Alloc>
void void
...@@ -286,24 +224,13 @@ public: ...@@ -286,24 +224,13 @@ public:
typedef _List_iterator<_Tp,_Tp&,_Tp*> iterator; typedef _List_iterator<_Tp,_Tp&,_Tp*> iterator;
typedef _List_iterator<_Tp,const _Tp&,const _Tp*> const_iterator; typedef _List_iterator<_Tp,const _Tp&,const _Tp*> const_iterator;
#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
typedef reverse_iterator<const_iterator> const_reverse_iterator; typedef reverse_iterator<const_iterator> const_reverse_iterator;
typedef reverse_iterator<iterator> reverse_iterator; typedef reverse_iterator<iterator> reverse_iterator;
#else /* __STL_CLASS_PARTIAL_SPECIALIZATION */
typedef reverse_bidirectional_iterator<const_iterator,value_type,
const_reference,difference_type>
const_reverse_iterator;
typedef reverse_bidirectional_iterator<iterator,value_type,reference,
difference_type>
reverse_iterator;
#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
protected: protected:
#ifdef __STL_HAS_NAMESPACES
using _Base::_M_node; using _Base::_M_node;
using _Base::_M_put_node; using _Base::_M_put_node;
using _Base::_M_get_node; using _Base::_M_get_node;
#endif /* __STL_HAS_NAMESPACES */
protected: protected:
_Node* _M_create_node(const _Tp& __x) _Node* _M_create_node(const _Tp& __x)
...@@ -358,7 +285,7 @@ public: ...@@ -358,7 +285,7 @@ public:
reference back() { return *(--end()); } reference back() { return *(--end()); }
const_reference back() const { return *(--end()); } const_reference back() const { return *(--end()); }
void swap(list<_Tp, _Alloc>& __x) { __STD::swap(_M_node, __x._M_node); } void swap(list<_Tp, _Alloc>& __x) { std::swap(_M_node, __x._M_node); }
iterator insert(iterator __position, const _Tp& __x) { iterator insert(iterator __position, const _Tp& __x) {
_Node* __tmp = _M_create_node(__x); _Node* __tmp = _M_create_node(__x);
...@@ -369,9 +296,8 @@ public: ...@@ -369,9 +296,8 @@ public:
return __tmp; return __tmp;
} }
iterator insert(iterator __position) { return insert(__position, _Tp()); } iterator insert(iterator __position) { return insert(__position, _Tp()); }
#ifdef __STL_MEMBER_TEMPLATES
// Check whether it's an integral type. If so, it's not an iterator.
// Check whether it's an integral type. If so, it's not an iterator.
template<class _Integer> template<class _Integer>
void _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x, void _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x,
__true_type) { __true_type) {
...@@ -389,11 +315,6 @@ public: ...@@ -389,11 +315,6 @@ public:
_M_insert_dispatch(__pos, __first, __last, _Integral()); _M_insert_dispatch(__pos, __first, __last, _Integral());
} }
#else /* __STL_MEMBER_TEMPLATES */
void insert(iterator __position, const _Tp* __first, const _Tp* __last);
void insert(iterator __position,
const_iterator __first, const_iterator __last);
#endif /* __STL_MEMBER_TEMPLATES */
void insert(iterator __pos, size_type __n, const _Tp& __x) void insert(iterator __pos, size_type __n, const _Tp& __x)
{ _M_fill_insert(__pos, __n, __x); } { _M_fill_insert(__pos, __n, __x); }
void _M_fill_insert(iterator __pos, size_type __n, const _Tp& __x); void _M_fill_insert(iterator __pos, size_type __n, const _Tp& __x);
...@@ -432,8 +353,6 @@ public: ...@@ -432,8 +353,6 @@ public:
: _Base(allocator_type()) : _Base(allocator_type())
{ insert(begin(), __n, _Tp()); } { insert(begin(), __n, _Tp()); }
#ifdef __STL_MEMBER_TEMPLATES
// We don't need any dispatching tricks here, because insert does all of // We don't need any dispatching tricks here, because insert does all of
// that anyway. // that anyway.
template <class _InputIterator> template <class _InputIterator>
...@@ -442,18 +361,6 @@ public: ...@@ -442,18 +361,6 @@ public:
: _Base(__a) : _Base(__a)
{ insert(begin(), __first, __last); } { insert(begin(), __first, __last); }
#else /* __STL_MEMBER_TEMPLATES */
list(const _Tp* __first, const _Tp* __last,
const allocator_type& __a = allocator_type())
: _Base(__a)
{ this->insert(begin(), __first, __last); }
list(const_iterator __first, const_iterator __last,
const allocator_type& __a = allocator_type())
: _Base(__a)
{ this->insert(begin(), __first, __last); }
#endif /* __STL_MEMBER_TEMPLATES */
list(const list<_Tp, _Alloc>& __x) : _Base(__x.get_allocator()) list(const list<_Tp, _Alloc>& __x) : _Base(__x.get_allocator())
{ insert(begin(), __x.begin(), __x.end()); } { insert(begin(), __x.begin(), __x.end()); }
...@@ -471,8 +378,6 @@ public: ...@@ -471,8 +378,6 @@ public:
void _M_fill_assign(size_type __n, const _Tp& __val); void _M_fill_assign(size_type __n, const _Tp& __val);
#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator> template <class _InputIterator>
void assign(_InputIterator __first, _InputIterator __last) { void assign(_InputIterator __first, _InputIterator __last) {
typedef typename _Is_integer<_InputIterator>::_Integral _Integral; typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
...@@ -487,8 +392,6 @@ public: ...@@ -487,8 +392,6 @@ public:
void _M_assign_dispatch(_InputIterator __first, _InputIterator __last, void _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
__false_type); __false_type);
#endif /* __STL_MEMBER_TEMPLATES */
protected: protected:
void transfer(iterator __position, iterator __first, iterator __last) { void transfer(iterator __position, iterator __first, iterator __last) {
if (__position != __last) { if (__position != __last) {
...@@ -526,12 +429,10 @@ public: ...@@ -526,12 +429,10 @@ public:
void reverse(); void reverse();
void sort(); void sort();
#ifdef __STL_MEMBER_TEMPLATES
template <class _Predicate> void remove_if(_Predicate); template <class _Predicate> void remove_if(_Predicate);
template <class _BinaryPredicate> void unique(_BinaryPredicate); template <class _BinaryPredicate> void unique(_BinaryPredicate);
template <class _StrictWeakOrdering> void merge(list&, _StrictWeakOrdering); template <class _StrictWeakOrdering> void merge(list&, _StrictWeakOrdering);
template <class _StrictWeakOrdering> void sort(_StrictWeakOrdering); template <class _StrictWeakOrdering> void sort(_StrictWeakOrdering);
#endif /* __STL_MEMBER_TEMPLATES */
}; };
template <class _Tp, class _Alloc> template <class _Tp, class _Alloc>
...@@ -559,8 +460,6 @@ inline bool operator<(const list<_Tp,_Alloc>& __x, ...@@ -559,8 +460,6 @@ inline bool operator<(const list<_Tp,_Alloc>& __x,
__y.begin(), __y.end()); __y.begin(), __y.end());
} }
#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
template <class _Tp, class _Alloc> template <class _Tp, class _Alloc>
inline bool operator!=(const list<_Tp,_Alloc>& __x, inline bool operator!=(const list<_Tp,_Alloc>& __x,
const list<_Tp,_Alloc>& __y) { const list<_Tp,_Alloc>& __y) {
...@@ -592,10 +491,6 @@ swap(list<_Tp, _Alloc>& __x, list<_Tp, _Alloc>& __y) ...@@ -592,10 +491,6 @@ swap(list<_Tp, _Alloc>& __x, list<_Tp, _Alloc>& __y)
__x.swap(__y); __x.swap(__y);
} }
#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
#ifdef __STL_MEMBER_TEMPLATES
template <class _Tp, class _Alloc> template <class _InputIter> template <class _Tp, class _Alloc> template <class _InputIter>
void void
list<_Tp, _Alloc>::_M_insert_dispatch(iterator __position, list<_Tp, _Alloc>::_M_insert_dispatch(iterator __position,
...@@ -606,28 +501,6 @@ list<_Tp, _Alloc>::_M_insert_dispatch(iterator __position, ...@@ -606,28 +501,6 @@ list<_Tp, _Alloc>::_M_insert_dispatch(iterator __position,
insert(__position, *__first); insert(__position, *__first);
} }
#else /* __STL_MEMBER_TEMPLATES */
template <class _Tp, class _Alloc>
void
list<_Tp, _Alloc>::insert(iterator __position,
const _Tp* __first, const _Tp* __last)
{
for ( ; __first != __last; ++__first)
insert(__position, *__first);
}
template <class _Tp, class _Alloc>
void
list<_Tp, _Alloc>::insert(iterator __position,
const_iterator __first, const_iterator __last)
{
for ( ; __first != __last; ++__first)
insert(__position, *__first);
}
#endif /* __STL_MEMBER_TEMPLATES */
template <class _Tp, class _Alloc> template <class _Tp, class _Alloc>
void void
list<_Tp, _Alloc>::_M_fill_insert(iterator __position, list<_Tp, _Alloc>::_M_fill_insert(iterator __position,
...@@ -688,8 +561,6 @@ void list<_Tp, _Alloc>::_M_fill_assign(size_type __n, const _Tp& __val) { ...@@ -688,8 +561,6 @@ void list<_Tp, _Alloc>::_M_fill_assign(size_type __n, const _Tp& __val) {
erase(__i, end()); erase(__i, end());
} }
#ifdef __STL_MEMBER_TEMPLATES
template <class _Tp, class _Alloc> template <class _InputIter> template <class _Tp, class _Alloc> template <class _InputIter>
void void
list<_Tp, _Alloc>::_M_assign_dispatch(_InputIter __first2, _InputIter __last2, list<_Tp, _Alloc>::_M_assign_dispatch(_InputIter __first2, _InputIter __last2,
...@@ -705,8 +576,6 @@ list<_Tp, _Alloc>::_M_assign_dispatch(_InputIter __first2, _InputIter __last2, ...@@ -705,8 +576,6 @@ list<_Tp, _Alloc>::_M_assign_dispatch(_InputIter __first2, _InputIter __last2,
insert(__last1, __first2, __last2); insert(__last1, __first2, __last2);
} }
#endif /* __STL_MEMBER_TEMPLATES */
template <class _Tp, class _Alloc> template <class _Tp, class _Alloc>
void list<_Tp, _Alloc>::remove(const _Tp& __value) void list<_Tp, _Alloc>::remove(const _Tp& __value)
{ {
...@@ -758,7 +627,7 @@ inline void __List_base_reverse(_List_node_base* __p) ...@@ -758,7 +627,7 @@ inline void __List_base_reverse(_List_node_base* __p)
{ {
_List_node_base* __tmp = __p; _List_node_base* __tmp = __p;
do { do {
__STD::swap(__tmp->_M_next, __tmp->_M_prev); std::swap(__tmp->_M_next, __tmp->_M_prev);
__tmp = __tmp->_M_prev; // Old next node is now prev. __tmp = __tmp->_M_prev; // Old next node is now prev.
} while (__tmp != __p); } while (__tmp != __p);
} }
...@@ -794,8 +663,6 @@ void list<_Tp, _Alloc>::sort() ...@@ -794,8 +663,6 @@ void list<_Tp, _Alloc>::sort()
} }
} }
#ifdef __STL_MEMBER_TEMPLATES
template <class _Tp, class _Alloc> template <class _Predicate> template <class _Tp, class _Alloc> template <class _Predicate>
void list<_Tp, _Alloc>::remove_if(_Predicate __pred) void list<_Tp, _Alloc>::remove_if(_Predicate __pred)
{ {
...@@ -869,14 +736,7 @@ void list<_Tp, _Alloc>::sort(_StrictWeakOrdering __comp) ...@@ -869,14 +736,7 @@ void list<_Tp, _Alloc>::sort(_StrictWeakOrdering __comp)
} }
} }
#endif /* __STL_MEMBER_TEMPLATES */ } // namespace std
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#pragma reset woff 1174
#pragma reset woff 1375
#endif
__STL_END_NAMESPACE
#endif /* __SGI_STL_INTERNAL_LIST_H */ #endif /* __SGI_STL_INTERNAL_LIST_H */
......
...@@ -33,12 +33,8 @@ ...@@ -33,12 +33,8 @@
#include <bits/concept_checks.h> #include <bits/concept_checks.h>
__STL_BEGIN_NAMESPACE namespace std
{
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#pragma set woff 1174
#pragma set woff 1375
#endif
template <class _Key, class _Tp, class _Compare = less<_Key>, template <class _Key, class _Tp, class _Compare = less<_Key>,
class _Alloc = allocator<pair<const _Key, _Tp> > > class _Alloc = allocator<pair<const _Key, _Tp> > >
...@@ -94,7 +90,6 @@ public: ...@@ -94,7 +90,6 @@ public:
const allocator_type& __a = allocator_type()) const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) {} : _M_t(__comp, __a) {}
#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator> template <class _InputIterator>
map(_InputIterator __first, _InputIterator __last) map(_InputIterator __first, _InputIterator __last)
: _M_t(_Compare(), allocator_type()) : _M_t(_Compare(), allocator_type())
...@@ -104,27 +99,8 @@ public: ...@@ -104,27 +99,8 @@ public:
map(_InputIterator __first, _InputIterator __last, const _Compare& __comp, map(_InputIterator __first, _InputIterator __last, const _Compare& __comp,
const allocator_type& __a = allocator_type()) const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) { _M_t.insert_unique(__first, __last); } : _M_t(__comp, __a) { _M_t.insert_unique(__first, __last); }
#else
map(const value_type* __first, const value_type* __last)
: _M_t(_Compare(), allocator_type())
{ _M_t.insert_unique(__first, __last); }
map(const value_type* __first,
const value_type* __last, const _Compare& __comp,
const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) { _M_t.insert_unique(__first, __last); }
map(const_iterator __first, const_iterator __last)
: _M_t(_Compare(), allocator_type())
{ _M_t.insert_unique(__first, __last); }
map(const_iterator __first, const_iterator __last, const _Compare& __comp,
const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) { _M_t.insert_unique(__first, __last); }
#endif /* __STL_MEMBER_TEMPLATES */
map(const map<_Key,_Tp,_Compare,_Alloc>& __x) : _M_t(__x._M_t) {} map(const map<_Key,_Tp,_Compare,_Alloc>& __x) : _M_t(__x._M_t) {}
map<_Key,_Tp,_Compare,_Alloc>& map<_Key,_Tp,_Compare,_Alloc>&
operator=(const map<_Key, _Tp, _Compare, _Alloc>& __x) operator=(const map<_Key, _Tp, _Compare, _Alloc>& __x)
{ {
...@@ -164,19 +140,10 @@ public: ...@@ -164,19 +140,10 @@ public:
{ return _M_t.insert_unique(__x); } { return _M_t.insert_unique(__x); }
iterator insert(iterator position, const value_type& __x) iterator insert(iterator position, const value_type& __x)
{ return _M_t.insert_unique(position, __x); } { return _M_t.insert_unique(position, __x); }
#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator> template <class _InputIterator>
void insert(_InputIterator __first, _InputIterator __last) { void insert(_InputIterator __first, _InputIterator __last) {
_M_t.insert_unique(__first, __last); _M_t.insert_unique(__first, __last);
} }
#else
void insert(const value_type* __first, const value_type* __last) {
_M_t.insert_unique(__first, __last);
}
void insert(const_iterator __first, const_iterator __last) {
_M_t.insert_unique(__first, __last);
}
#endif /* __STL_MEMBER_TEMPLATES */
void erase(iterator __position) { _M_t.erase(__position); } void erase(iterator __position) { _M_t.erase(__position); }
size_type erase(const key_type& __x) { return _M_t.erase(__x); } size_type erase(const key_type& __x) { return _M_t.erase(__x); }
...@@ -207,19 +174,12 @@ public: ...@@ -207,19 +174,12 @@ public:
return _M_t.equal_range(__x); return _M_t.equal_range(__x);
} }
#ifdef __STL_TEMPLATE_FRIENDS
template <class _K1, class _T1, class _C1, class _A1> template <class _K1, class _T1, class _C1, class _A1>
friend bool operator== (const map<_K1, _T1, _C1, _A1>&, friend bool operator== (const map<_K1, _T1, _C1, _A1>&,
const map<_K1, _T1, _C1, _A1>&); const map<_K1, _T1, _C1, _A1>&);
template <class _K1, class _T1, class _C1, class _A1> template <class _K1, class _T1, class _C1, class _A1>
friend bool operator< (const map<_K1, _T1, _C1, _A1>&, friend bool operator< (const map<_K1, _T1, _C1, _A1>&,
const map<_K1, _T1, _C1, _A1>&); const map<_K1, _T1, _C1, _A1>&);
#else /* __STL_TEMPLATE_FRIENDS */
friend bool __STD_QUALIFIER
operator== __STL_NULL_TMPL_ARGS (const map&, const map&);
friend bool __STD_QUALIFIER
operator< __STL_NULL_TMPL_ARGS (const map&, const map&);
#endif /* __STL_TEMPLATE_FRIENDS */
}; };
template <class _Key, class _Tp, class _Compare, class _Alloc> template <class _Key, class _Tp, class _Compare, class _Alloc>
...@@ -234,8 +194,6 @@ inline bool operator<(const map<_Key,_Tp,_Compare,_Alloc>& __x, ...@@ -234,8 +194,6 @@ inline bool operator<(const map<_Key,_Tp,_Compare,_Alloc>& __x,
return __x._M_t < __y._M_t; return __x._M_t < __y._M_t;
} }
#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
template <class _Key, class _Tp, class _Compare, class _Alloc> template <class _Key, class _Tp, class _Compare, class _Alloc>
inline bool operator!=(const map<_Key,_Tp,_Compare,_Alloc>& __x, inline bool operator!=(const map<_Key,_Tp,_Compare,_Alloc>& __x,
const map<_Key,_Tp,_Compare,_Alloc>& __y) { const map<_Key,_Tp,_Compare,_Alloc>& __y) {
...@@ -266,14 +224,7 @@ inline void swap(map<_Key,_Tp,_Compare,_Alloc>& __x, ...@@ -266,14 +224,7 @@ inline void swap(map<_Key,_Tp,_Compare,_Alloc>& __x,
__x.swap(__y); __x.swap(__y);
} }
#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */ } // namespace std
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#pragma reset woff 1174
#pragma reset woff 1375
#endif
__STL_END_NAMESPACE
#endif /* _CPP_BITS_STL_MAP_H */ #endif /* _CPP_BITS_STL_MAP_H */
......
...@@ -33,12 +33,8 @@ ...@@ -33,12 +33,8 @@
#include <bits/concept_checks.h> #include <bits/concept_checks.h>
__STL_BEGIN_NAMESPACE namespace std
{
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#pragma set woff 1174
#pragma set woff 1375
#endif
// Forward declaration of operators < and ==, needed for friend declaration. // Forward declaration of operators < and ==, needed for friend declaration.
...@@ -107,7 +103,6 @@ public: ...@@ -107,7 +103,6 @@ public:
const allocator_type& __a = allocator_type()) const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) { } : _M_t(__comp, __a) { }
#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator> template <class _InputIterator>
multimap(_InputIterator __first, _InputIterator __last) multimap(_InputIterator __first, _InputIterator __last)
: _M_t(_Compare(), allocator_type()) : _M_t(_Compare(), allocator_type())
...@@ -118,25 +113,8 @@ public: ...@@ -118,25 +113,8 @@ public:
const _Compare& __comp, const _Compare& __comp,
const allocator_type& __a = allocator_type()) const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) { _M_t.insert_equal(__first, __last); } : _M_t(__comp, __a) { _M_t.insert_equal(__first, __last); }
#else
multimap(const value_type* __first, const value_type* __last)
: _M_t(_Compare(), allocator_type())
{ _M_t.insert_equal(__first, __last); }
multimap(const value_type* __first, const value_type* __last,
const _Compare& __comp,
const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) { _M_t.insert_equal(__first, __last); }
multimap(const_iterator __first, const_iterator __last)
: _M_t(_Compare(), allocator_type())
{ _M_t.insert_equal(__first, __last); }
multimap(const_iterator __first, const_iterator __last,
const _Compare& __comp,
const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) { _M_t.insert_equal(__first, __last); }
#endif /* __STL_MEMBER_TEMPLATES */
multimap(const multimap<_Key,_Tp,_Compare,_Alloc>& __x) : _M_t(__x._M_t) { } multimap(const multimap<_Key,_Tp,_Compare,_Alloc>& __x) : _M_t(__x._M_t) { }
multimap<_Key,_Tp,_Compare,_Alloc>& multimap<_Key,_Tp,_Compare,_Alloc>&
operator=(const multimap<_Key,_Tp,_Compare,_Alloc>& __x) { operator=(const multimap<_Key,_Tp,_Compare,_Alloc>& __x) {
_M_t = __x._M_t; _M_t = __x._M_t;
...@@ -168,19 +146,10 @@ public: ...@@ -168,19 +146,10 @@ public:
iterator insert(iterator __position, const value_type& __x) { iterator insert(iterator __position, const value_type& __x) {
return _M_t.insert_equal(__position, __x); return _M_t.insert_equal(__position, __x);
} }
#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator> template <class _InputIterator>
void insert(_InputIterator __first, _InputIterator __last) { void insert(_InputIterator __first, _InputIterator __last) {
_M_t.insert_equal(__first, __last); _M_t.insert_equal(__first, __last);
} }
#else
void insert(const value_type* __first, const value_type* __last) {
_M_t.insert_equal(__first, __last);
}
void insert(const_iterator __first, const_iterator __last) {
_M_t.insert_equal(__first, __last);
}
#endif /* __STL_MEMBER_TEMPLATES */
void erase(iterator __position) { _M_t.erase(__position); } void erase(iterator __position) { _M_t.erase(__position); }
size_type erase(const key_type& __x) { return _M_t.erase(__x); } size_type erase(const key_type& __x) { return _M_t.erase(__x); }
void erase(iterator __first, iterator __last) void erase(iterator __first, iterator __last)
...@@ -207,19 +176,12 @@ public: ...@@ -207,19 +176,12 @@ public:
return _M_t.equal_range(__x); return _M_t.equal_range(__x);
} }
#ifdef __STL_TEMPLATE_FRIENDS
template <class _K1, class _T1, class _C1, class _A1> template <class _K1, class _T1, class _C1, class _A1>
friend bool operator== (const multimap<_K1, _T1, _C1, _A1>&, friend bool operator== (const multimap<_K1, _T1, _C1, _A1>&,
const multimap<_K1, _T1, _C1, _A1>&); const multimap<_K1, _T1, _C1, _A1>&);
template <class _K1, class _T1, class _C1, class _A1> template <class _K1, class _T1, class _C1, class _A1>
friend bool operator< (const multimap<_K1, _T1, _C1, _A1>&, friend bool operator< (const multimap<_K1, _T1, _C1, _A1>&,
const multimap<_K1, _T1, _C1, _A1>&); const multimap<_K1, _T1, _C1, _A1>&);
#else /* __STL_TEMPLATE_FRIENDS */
friend bool __STD_QUALIFIER
operator== __STL_NULL_TMPL_ARGS (const multimap&, const multimap&);
friend bool __STD_QUALIFIER
operator< __STL_NULL_TMPL_ARGS (const multimap&, const multimap&);
#endif /* __STL_TEMPLATE_FRIENDS */
}; };
template <class _Key, class _Tp, class _Compare, class _Alloc> template <class _Key, class _Tp, class _Compare, class _Alloc>
...@@ -234,8 +196,6 @@ inline bool operator<(const multimap<_Key,_Tp,_Compare,_Alloc>& __x, ...@@ -234,8 +196,6 @@ inline bool operator<(const multimap<_Key,_Tp,_Compare,_Alloc>& __x,
return __x._M_t < __y._M_t; return __x._M_t < __y._M_t;
} }
#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
template <class _Key, class _Tp, class _Compare, class _Alloc> template <class _Key, class _Tp, class _Compare, class _Alloc>
inline bool operator!=(const multimap<_Key,_Tp,_Compare,_Alloc>& __x, inline bool operator!=(const multimap<_Key,_Tp,_Compare,_Alloc>& __x,
const multimap<_Key,_Tp,_Compare,_Alloc>& __y) { const multimap<_Key,_Tp,_Compare,_Alloc>& __y) {
...@@ -266,14 +226,7 @@ inline void swap(multimap<_Key,_Tp,_Compare,_Alloc>& __x, ...@@ -266,14 +226,7 @@ inline void swap(multimap<_Key,_Tp,_Compare,_Alloc>& __x,
__x.swap(__y); __x.swap(__y);
} }
#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */ } // namespace std
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#pragma reset woff 1174
#pragma reset woff 1375
#endif
__STL_END_NAMESPACE
#endif /* __SGI_STL_INTERNAL_MULTIMAP_H */ #endif /* __SGI_STL_INTERNAL_MULTIMAP_H */
......
...@@ -33,12 +33,8 @@ ...@@ -33,12 +33,8 @@
#include <bits/concept_checks.h> #include <bits/concept_checks.h>
__STL_BEGIN_NAMESPACE namespace std
{
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#pragma set woff 1174
#pragma set woff 1375
#endif
// Forward declaration of operators < and ==, needed for friend declaration. // Forward declaration of operators < and ==, needed for friend declaration.
...@@ -93,8 +89,6 @@ public: ...@@ -93,8 +89,6 @@ public:
const allocator_type& __a = allocator_type()) const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) {} : _M_t(__comp, __a) {}
#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator> template <class _InputIterator>
multiset(_InputIterator __first, _InputIterator __last) multiset(_InputIterator __first, _InputIterator __last)
: _M_t(_Compare(), allocator_type()) : _M_t(_Compare(), allocator_type())
...@@ -106,29 +100,8 @@ public: ...@@ -106,29 +100,8 @@ public:
const allocator_type& __a = allocator_type()) const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) { _M_t.insert_equal(__first, __last); } : _M_t(__comp, __a) { _M_t.insert_equal(__first, __last); }
#else
multiset(const value_type* __first, const value_type* __last)
: _M_t(_Compare(), allocator_type())
{ _M_t.insert_equal(__first, __last); }
multiset(const value_type* __first, const value_type* __last,
const _Compare& __comp,
const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) { _M_t.insert_equal(__first, __last); }
multiset(const_iterator __first, const_iterator __last)
: _M_t(_Compare(), allocator_type())
{ _M_t.insert_equal(__first, __last); }
multiset(const_iterator __first, const_iterator __last,
const _Compare& __comp,
const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) { _M_t.insert_equal(__first, __last); }
#endif /* __STL_MEMBER_TEMPLATES */
multiset(const multiset<_Key,_Compare,_Alloc>& __x) : _M_t(__x._M_t) {} multiset(const multiset<_Key,_Compare,_Alloc>& __x) : _M_t(__x._M_t) {}
multiset<_Key,_Compare,_Alloc>& multiset<_Key,_Compare,_Alloc>&
operator=(const multiset<_Key,_Compare,_Alloc>& __x) { operator=(const multiset<_Key,_Compare,_Alloc>& __x) {
_M_t = __x._M_t; _M_t = __x._M_t;
...@@ -159,19 +132,10 @@ public: ...@@ -159,19 +132,10 @@ public:
return _M_t.insert_equal((_Rep_iterator&)__position, __x); return _M_t.insert_equal((_Rep_iterator&)__position, __x);
} }
#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator> template <class _InputIterator>
void insert(_InputIterator __first, _InputIterator __last) { void insert(_InputIterator __first, _InputIterator __last) {
_M_t.insert_equal(__first, __last); _M_t.insert_equal(__first, __last);
} }
#else
void insert(const value_type* __first, const value_type* __last) {
_M_t.insert_equal(__first, __last);
}
void insert(const_iterator __first, const_iterator __last) {
_M_t.insert_equal(__first, __last);
}
#endif /* __STL_MEMBER_TEMPLATES */
void erase(iterator __position) { void erase(iterator __position) {
typedef typename _Rep_type::iterator _Rep_iterator; typedef typename _Rep_type::iterator _Rep_iterator;
_M_t.erase((_Rep_iterator&)__position); _M_t.erase((_Rep_iterator&)__position);
...@@ -199,19 +163,12 @@ public: ...@@ -199,19 +163,12 @@ public:
return _M_t.equal_range(__x); return _M_t.equal_range(__x);
} }
#ifdef __STL_TEMPLATE_FRIENDS
template <class _K1, class _C1, class _A1> template <class _K1, class _C1, class _A1>
friend bool operator== (const multiset<_K1,_C1,_A1>&, friend bool operator== (const multiset<_K1,_C1,_A1>&,
const multiset<_K1,_C1,_A1>&); const multiset<_K1,_C1,_A1>&);
template <class _K1, class _C1, class _A1> template <class _K1, class _C1, class _A1>
friend bool operator< (const multiset<_K1,_C1,_A1>&, friend bool operator< (const multiset<_K1,_C1,_A1>&,
const multiset<_K1,_C1,_A1>&); const multiset<_K1,_C1,_A1>&);
#else /* __STL_TEMPLATE_FRIENDS */
friend bool __STD_QUALIFIER
operator== __STL_NULL_TMPL_ARGS (const multiset&, const multiset&);
friend bool __STD_QUALIFIER
operator< __STL_NULL_TMPL_ARGS (const multiset&, const multiset&);
#endif /* __STL_TEMPLATE_FRIENDS */
}; };
template <class _Key, class _Compare, class _Alloc> template <class _Key, class _Compare, class _Alloc>
...@@ -226,8 +183,6 @@ inline bool operator<(const multiset<_Key,_Compare,_Alloc>& __x, ...@@ -226,8 +183,6 @@ inline bool operator<(const multiset<_Key,_Compare,_Alloc>& __x,
return __x._M_t < __y._M_t; return __x._M_t < __y._M_t;
} }
#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
template <class _Key, class _Compare, class _Alloc> template <class _Key, class _Compare, class _Alloc>
inline bool operator!=(const multiset<_Key,_Compare,_Alloc>& __x, inline bool operator!=(const multiset<_Key,_Compare,_Alloc>& __x,
const multiset<_Key,_Compare,_Alloc>& __y) { const multiset<_Key,_Compare,_Alloc>& __y) {
...@@ -258,14 +213,7 @@ inline void swap(multiset<_Key,_Compare,_Alloc>& __x, ...@@ -258,14 +213,7 @@ inline void swap(multiset<_Key,_Compare,_Alloc>& __x,
__x.swap(__y); __x.swap(__y);
} }
#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */ } // namespace std
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#pragma reset woff 1174
#pragma reset woff 1375
#endif
__STL_END_NAMESPACE
#endif /* __SGI_STL_INTERNAL_MULTISET_H */ #endif /* __SGI_STL_INTERNAL_MULTISET_H */
......
...@@ -32,7 +32,8 @@ ...@@ -32,7 +32,8 @@
#ifndef _CPP_BITS_STL_NUMERIC_H #ifndef _CPP_BITS_STL_NUMERIC_H
#define _CPP_BITS_STL_NUMERIC_H 1 #define _CPP_BITS_STL_NUMERIC_H 1
__STL_BEGIN_NAMESPACE namespace std
{
template <class _InputIterator, class _Tp> template <class _InputIterator, class _Tp>
_Tp accumulate(_InputIterator __first, _InputIterator __last, _Tp __init) _Tp accumulate(_InputIterator __first, _InputIterator __last, _Tp __init)
...@@ -246,7 +247,7 @@ iota(_ForwardIter __first, _ForwardIter __last, _Tp __value) ...@@ -246,7 +247,7 @@ iota(_ForwardIter __first, _ForwardIter __last, _Tp __value)
*__first++ = __value++; *__first++ = __value++;
} }
__STL_END_NAMESPACE } // namespace std
#endif /* _CPP_BITS_STL_NUMERIC_H */ #endif /* _CPP_BITS_STL_NUMERIC_H */
......
...@@ -31,7 +31,8 @@ ...@@ -31,7 +31,8 @@
#ifndef __SGI_STL_INTERNAL_PAIR_H #ifndef __SGI_STL_INTERNAL_PAIR_H
#define __SGI_STL_INTERNAL_PAIR_H #define __SGI_STL_INTERNAL_PAIR_H
__STL_BEGIN_NAMESPACE namespace std
{
template <class _T1, class _T2> template <class _T1, class _T2>
struct pair { struct pair {
...@@ -43,10 +44,8 @@ struct pair { ...@@ -43,10 +44,8 @@ struct pair {
pair() : first(_T1()), second(_T2()) {} pair() : first(_T1()), second(_T2()) {}
pair(const _T1& __a, const _T2& __b) : first(__a), second(__b) {} pair(const _T1& __a, const _T2& __b) : first(__a), second(__b) {}
#ifdef __STL_MEMBER_TEMPLATES
template <class _U1, class _U2> template <class _U1, class _U2>
pair(const pair<_U1, _U2>& __p) : first(__p.first), second(__p.second) {} pair(const pair<_U1, _U2>& __p) : first(__p.first), second(__p.second) {}
#endif
}; };
template <class _T1, class _T2> template <class _T1, class _T2>
...@@ -62,8 +61,6 @@ inline bool operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) ...@@ -62,8 +61,6 @@ inline bool operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
(!(__y.first < __x.first) && __x.second < __y.second); (!(__y.first < __x.first) && __x.second < __y.second);
} }
#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
template <class _T1, class _T2> template <class _T1, class _T2>
inline bool operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) { inline bool operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) {
return !(__x == __y); return !(__x == __y);
...@@ -84,8 +81,6 @@ inline bool operator>=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) { ...@@ -84,8 +81,6 @@ inline bool operator>=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) {
return !(__x < __y); return !(__x < __y);
} }
#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
template <class _T1, class _T2> template <class _T1, class _T2>
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS #ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
//181. make_pair() unintended behavior //181. make_pair() unintended behavior
...@@ -97,7 +92,7 @@ inline pair<_T1, _T2> make_pair(const _T1& __x, const _T2& __y) ...@@ -97,7 +92,7 @@ inline pair<_T1, _T2> make_pair(const _T1& __x, const _T2& __y)
return pair<_T1, _T2>(__x, __y); return pair<_T1, _T2>(__x, __y);
} }
__STL_END_NAMESPACE } // namespace std
#endif /* __SGI_STL_INTERNAL_PAIR_H */ #endif /* __SGI_STL_INTERNAL_PAIR_H */
......
...@@ -16,13 +16,8 @@ ...@@ -16,13 +16,8 @@
#include <bits/pthread_allocimpl.h> #include <bits/pthread_allocimpl.h>
#ifdef __STL_USE_NAMESPACES using std::_Pthread_alloc_template;
using std::pthread_alloc;
using __STD::_Pthread_alloc_template;
using __STD::pthread_alloc;
#endif /* __STL_USE_NAMESPACES */
#endif /* _CPP_BITS_STL_PTHREAD_ALLOC_H */ #endif /* _CPP_BITS_STL_PTHREAD_ALLOC_H */
......
...@@ -33,7 +33,8 @@ ...@@ -33,7 +33,8 @@
#include <bits/sequence_concepts.h> #include <bits/sequence_concepts.h>
__STL_BEGIN_NAMESPACE namespace std
{
// Forward declarations of operators < and ==, needed for friend declaration. // Forward declarations of operators < and ==, needed for friend declaration.
...@@ -60,20 +61,12 @@ class queue { ...@@ -60,20 +61,12 @@ class queue {
__STL_CLASS_REQUIRES_SAME_TYPE(_Tp, _Sequence_value_type); __STL_CLASS_REQUIRES_SAME_TYPE(_Tp, _Sequence_value_type);
#ifdef __STL_MEMBER_TEMPLATES
template <class _Tp1, class _Seq1> template <class _Tp1, class _Seq1>
friend bool operator== (const queue<_Tp1, _Seq1>&, friend bool operator== (const queue<_Tp1, _Seq1>&,
const queue<_Tp1, _Seq1>&); const queue<_Tp1, _Seq1>&);
template <class _Tp1, class _Seq1> template <class _Tp1, class _Seq1>
friend bool operator< (const queue<_Tp1, _Seq1>&, friend bool operator< (const queue<_Tp1, _Seq1>&,
const queue<_Tp1, _Seq1>&); const queue<_Tp1, _Seq1>&);
#else /* __STL_MEMBER_TEMPLATES */
friend bool __STD_QUALIFIER
operator== __STL_NULL_TMPL_ARGS (const queue&, const queue&);
friend bool __STD_QUALIFIER
operator< __STL_NULL_TMPL_ARGS (const queue&, const queue&);
#endif /* __STL_MEMBER_TEMPLATES */
public: public:
typedef typename _Sequence::value_type value_type; typedef typename _Sequence::value_type value_type;
typedef typename _Sequence::size_type size_type; typedef typename _Sequence::size_type size_type;
...@@ -111,8 +104,6 @@ operator<(const queue<_Tp, _Sequence>& __x, const queue<_Tp, _Sequence>& __y) ...@@ -111,8 +104,6 @@ operator<(const queue<_Tp, _Sequence>& __x, const queue<_Tp, _Sequence>& __y)
return __x.c < __y.c; return __x.c < __y.c;
} }
#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
template <class _Tp, class _Sequence> template <class _Tp, class _Sequence>
bool bool
operator!=(const queue<_Tp, _Sequence>& __x, const queue<_Tp, _Sequence>& __y) operator!=(const queue<_Tp, _Sequence>& __x, const queue<_Tp, _Sequence>& __y)
...@@ -141,12 +132,9 @@ operator>=(const queue<_Tp, _Sequence>& __x, const queue<_Tp, _Sequence>& __y) ...@@ -141,12 +132,9 @@ operator>=(const queue<_Tp, _Sequence>& __x, const queue<_Tp, _Sequence>& __y)
return !(__x < __y); return !(__x < __y);
} }
#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
template <class _Tp, template <class _Tp,
class _Sequence __STL_DEPENDENT_DEFAULT_TMPL(vector<_Tp>), class _Sequence = vector<_Tp>,
class _Compare class _Compare = less<typename _Sequence::value_type> >
__STL_DEPENDENT_DEFAULT_TMPL(less<typename _Sequence::value_type>) >
class priority_queue { class priority_queue {
public: public:
...@@ -174,7 +162,6 @@ public: ...@@ -174,7 +162,6 @@ public:
: c(__s), comp(__x) : c(__s), comp(__x)
{ make_heap(c.begin(), c.end(), comp); } { make_heap(c.begin(), c.end(), comp); }
#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator> template <class _InputIterator>
priority_queue(_InputIterator __first, _InputIterator __last) priority_queue(_InputIterator __first, _InputIterator __last)
: c(__first, __last) { make_heap(c.begin(), c.end(), comp); } : c(__first, __last) { make_heap(c.begin(), c.end(), comp); }
...@@ -194,24 +181,6 @@ public: ...@@ -194,24 +181,6 @@ public:
make_heap(c.begin(), c.end(), comp); make_heap(c.begin(), c.end(), comp);
} }
#else /* __STL_MEMBER_TEMPLATES */
priority_queue(const value_type* __first, const value_type* __last)
: c(__first, __last) { make_heap(c.begin(), c.end(), comp); }
priority_queue(const value_type* __first, const value_type* __last,
const _Compare& __x)
: c(__first, __last), comp(__x)
{ make_heap(c.begin(), c.end(), comp); }
priority_queue(const value_type* __first, const value_type* __last,
const _Compare& __x, const _Sequence& __c)
: c(__c), comp(__x)
{
c.insert(c.end(), __first, __last);
make_heap(c.begin(), c.end(), comp);
}
#endif /* __STL_MEMBER_TEMPLATES */
bool empty() const { return c.empty(); } bool empty() const { return c.empty(); }
size_type size() const { return c.size(); } size_type size() const { return c.size(); }
const_reference top() const { return c.front(); } const_reference top() const { return c.front(); }
...@@ -233,7 +202,7 @@ public: ...@@ -233,7 +202,7 @@ public:
// no equality is provided // no equality is provided
__STL_END_NAMESPACE } // namespace std
#endif /* __SGI_STL_INTERNAL_QUEUE_H */ #endif /* __SGI_STL_INTERNAL_QUEUE_H */
......
...@@ -31,7 +31,8 @@ ...@@ -31,7 +31,8 @@
#ifndef _CPP_BITS_STL_RAW_STORAGE_ITERATOR_H #ifndef _CPP_BITS_STL_RAW_STORAGE_ITERATOR_H
#define _CPP_BITS_STL_RAW_STORAGE_ITERATOR_H 1 #define _CPP_BITS_STL_RAW_STORAGE_ITERATOR_H 1
__STL_BEGIN_NAMESPACE namespace std
{
template <class _ForwardIterator, class _Tp> template <class _ForwardIterator, class _Tp>
class raw_storage_iterator { class raw_storage_iterator {
...@@ -61,18 +62,8 @@ public: ...@@ -61,18 +62,8 @@ public:
} }
}; };
#ifndef __STL_CLASS_PARTIAL_SPECIALIZATION
template <class _ForwardIterator, class _Tp>
inline output_iterator_tag
iterator_category(const raw_storage_iterator<_ForwardIterator, _Tp>&)
{
return output_iterator_tag();
}
#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
__STL_END_NAMESPACE } // namespace std
#endif /* _CPP_BITS_STL_RAW_STORAGE_ITERATOR_H */ #endif /* _CPP_BITS_STL_RAW_STORAGE_ITERATOR_H */
......
...@@ -41,7 +41,10 @@ ...@@ -41,7 +41,10 @@
#ifndef _CPP_BITS_STL_RELOPS_H #ifndef _CPP_BITS_STL_RELOPS_H
#define _CPP_BITS_STL_RELOPS_H 1 #define _CPP_BITS_STL_RELOPS_H 1
__STL_BEGIN_RELOPS_NAMESPACE namespace std
{
namespace rel_ops
{
template <class _Tp> template <class _Tp>
inline bool operator!=(const _Tp& __x, const _Tp& __y) { inline bool operator!=(const _Tp& __x, const _Tp& __y) {
...@@ -63,7 +66,8 @@ inline bool operator>=(const _Tp& __x, const _Tp& __y) { ...@@ -63,7 +66,8 @@ inline bool operator>=(const _Tp& __x, const _Tp& __y) {
return !(__x < __y); return !(__x < __y);
} }
__STL_END_RELOPS_NAMESPACE } // namespace rel_ops
} // namespace std
#endif /* _CPP_BITS_STL_RELOPS_H */ #endif /* _CPP_BITS_STL_RELOPS_H */
......
...@@ -33,12 +33,8 @@ ...@@ -33,12 +33,8 @@
#include <bits/concept_checks.h> #include <bits/concept_checks.h>
__STL_BEGIN_NAMESPACE namespace std
{
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#pragma set woff 1174
#pragma set woff 1375
#endif
// Forward declarations of operators < and ==, needed for friend declaration. // Forward declarations of operators < and ==, needed for friend declaration.
...@@ -93,7 +89,6 @@ public: ...@@ -93,7 +89,6 @@ public:
const allocator_type& __a = allocator_type()) const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) {} : _M_t(__comp, __a) {}
#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator> template <class _InputIterator>
set(_InputIterator __first, _InputIterator __last) set(_InputIterator __first, _InputIterator __last)
: _M_t(_Compare(), allocator_type()) : _M_t(_Compare(), allocator_type())
...@@ -103,24 +98,6 @@ public: ...@@ -103,24 +98,6 @@ public:
set(_InputIterator __first, _InputIterator __last, const _Compare& __comp, set(_InputIterator __first, _InputIterator __last, const _Compare& __comp,
const allocator_type& __a = allocator_type()) const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) { _M_t.insert_unique(__first, __last); } : _M_t(__comp, __a) { _M_t.insert_unique(__first, __last); }
#else
set(const value_type* __first, const value_type* __last)
: _M_t(_Compare(), allocator_type())
{ _M_t.insert_unique(__first, __last); }
set(const value_type* __first,
const value_type* __last, const _Compare& __comp,
const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) { _M_t.insert_unique(__first, __last); }
set(const_iterator __first, const_iterator __last)
: _M_t(_Compare(), allocator_type())
{ _M_t.insert_unique(__first, __last); }
set(const_iterator __first, const_iterator __last, const _Compare& __comp,
const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) { _M_t.insert_unique(__first, __last); }
#endif /* __STL_MEMBER_TEMPLATES */
set(const set<_Key,_Compare,_Alloc>& __x) : _M_t(__x._M_t) {} set(const set<_Key,_Compare,_Alloc>& __x) : _M_t(__x._M_t) {}
set<_Key,_Compare,_Alloc>& operator=(const set<_Key, _Compare, _Alloc>& __x) set<_Key,_Compare,_Alloc>& operator=(const set<_Key, _Compare, _Alloc>& __x)
...@@ -153,19 +130,10 @@ public: ...@@ -153,19 +130,10 @@ public:
typedef typename _Rep_type::iterator _Rep_iterator; typedef typename _Rep_type::iterator _Rep_iterator;
return _M_t.insert_unique((_Rep_iterator&)__position, __x); return _M_t.insert_unique((_Rep_iterator&)__position, __x);
} }
#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator> template <class _InputIterator>
void insert(_InputIterator __first, _InputIterator __last) { void insert(_InputIterator __first, _InputIterator __last) {
_M_t.insert_unique(__first, __last); _M_t.insert_unique(__first, __last);
} }
#else
void insert(const_iterator __first, const_iterator __last) {
_M_t.insert_unique(__first, __last);
}
void insert(const value_type* __first, const value_type* __last) {
_M_t.insert_unique(__first, __last);
}
#endif /* __STL_MEMBER_TEMPLATES */
void erase(iterator __position) { void erase(iterator __position) {
typedef typename _Rep_type::iterator _Rep_iterator; typedef typename _Rep_type::iterator _Rep_iterator;
_M_t.erase((_Rep_iterator&)__position); _M_t.erase((_Rep_iterator&)__position);
...@@ -195,17 +163,10 @@ public: ...@@ -195,17 +163,10 @@ public:
return _M_t.equal_range(__x); return _M_t.equal_range(__x);
} }
#ifdef __STL_TEMPLATE_FRIENDS
template <class _K1, class _C1, class _A1> template <class _K1, class _C1, class _A1>
friend bool operator== (const set<_K1,_C1,_A1>&, const set<_K1,_C1,_A1>&); friend bool operator== (const set<_K1,_C1,_A1>&, const set<_K1,_C1,_A1>&);
template <class _K1, class _C1, class _A1> template <class _K1, class _C1, class _A1>
friend bool operator< (const set<_K1,_C1,_A1>&, const set<_K1,_C1,_A1>&); friend bool operator< (const set<_K1,_C1,_A1>&, const set<_K1,_C1,_A1>&);
#else /* __STL_TEMPLATE_FRIENDS */
friend bool __STD_QUALIFIER
operator== __STL_NULL_TMPL_ARGS (const set&, const set&);
friend bool __STD_QUALIFIER
operator< __STL_NULL_TMPL_ARGS (const set&, const set&);
#endif /* __STL_TEMPLATE_FRIENDS */
}; };
template <class _Key, class _Compare, class _Alloc> template <class _Key, class _Compare, class _Alloc>
...@@ -220,8 +181,6 @@ inline bool operator<(const set<_Key,_Compare,_Alloc>& __x, ...@@ -220,8 +181,6 @@ inline bool operator<(const set<_Key,_Compare,_Alloc>& __x,
return __x._M_t < __y._M_t; return __x._M_t < __y._M_t;
} }
#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
template <class _Key, class _Compare, class _Alloc> template <class _Key, class _Compare, class _Alloc>
inline bool operator!=(const set<_Key,_Compare,_Alloc>& __x, inline bool operator!=(const set<_Key,_Compare,_Alloc>& __x,
const set<_Key,_Compare,_Alloc>& __y) { const set<_Key,_Compare,_Alloc>& __y) {
...@@ -252,14 +211,7 @@ inline void swap(set<_Key,_Compare,_Alloc>& __x, ...@@ -252,14 +211,7 @@ inline void swap(set<_Key,_Compare,_Alloc>& __x,
__x.swap(__y); __x.swap(__y);
} }
#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */ } // namespace std
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#pragma reset woff 1174
#pragma reset woff 1375
#endif
__STL_END_NAMESPACE
#endif /* __SGI_STL_INTERNAL_SET_H */ #endif /* __SGI_STL_INTERNAL_SET_H */
......
...@@ -33,7 +33,8 @@ ...@@ -33,7 +33,8 @@
#include <bits/sequence_concepts.h> #include <bits/sequence_concepts.h>
__STL_BEGIN_NAMESPACE namespace std
{
// Forward declarations of operators == and <, needed for friend declaration. // Forward declarations of operators == and <, needed for friend declaration.
...@@ -59,20 +60,12 @@ class stack { ...@@ -59,20 +60,12 @@ class stack {
__STL_CLASS_REQUIRES_SAME_TYPE(_Tp, _Sequence_value_type); __STL_CLASS_REQUIRES_SAME_TYPE(_Tp, _Sequence_value_type);
#ifdef __STL_MEMBER_TEMPLATES
template <class _Tp1, class _Seq1> template <class _Tp1, class _Seq1>
friend bool operator== (const stack<_Tp1, _Seq1>&, friend bool operator== (const stack<_Tp1, _Seq1>&,
const stack<_Tp1, _Seq1>&); const stack<_Tp1, _Seq1>&);
template <class _Tp1, class _Seq1> template <class _Tp1, class _Seq1>
friend bool operator< (const stack<_Tp1, _Seq1>&, friend bool operator< (const stack<_Tp1, _Seq1>&,
const stack<_Tp1, _Seq1>&); const stack<_Tp1, _Seq1>&);
#else /* __STL_MEMBER_TEMPLATES */
friend bool __STD_QUALIFIER
operator== __STL_NULL_TMPL_ARGS (const stack&, const stack&);
friend bool __STD_QUALIFIER
operator< __STL_NULL_TMPL_ARGS (const stack&, const stack&);
#endif /* __STL_MEMBER_TEMPLATES */
public: public:
typedef typename _Sequence::value_type value_type; typedef typename _Sequence::value_type value_type;
typedef typename _Sequence::size_type size_type; typedef typename _Sequence::size_type size_type;
...@@ -106,8 +99,6 @@ bool operator<(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y) ...@@ -106,8 +99,6 @@ bool operator<(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y)
return __x.c < __y.c; return __x.c < __y.c;
} }
#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
template <class _Tp, class _Seq> template <class _Tp, class _Seq>
bool operator!=(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y) bool operator!=(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y)
{ {
...@@ -132,9 +123,7 @@ bool operator>=(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y) ...@@ -132,9 +123,7 @@ bool operator>=(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y)
return !(__x < __y); return !(__x < __y);
} }
#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */ } // namespace std
__STL_END_NAMESPACE
#endif /* __SGI_STL_INTERNAL_STACK_H */ #endif /* __SGI_STL_INTERNAL_STACK_H */
......
...@@ -31,7 +31,8 @@ ...@@ -31,7 +31,8 @@
#ifndef __SGI_STL_INTERNAL_TEMPBUF_H #ifndef __SGI_STL_INTERNAL_TEMPBUF_H
#define __SGI_STL_INTERNAL_TEMPBUF_H #define __SGI_STL_INTERNAL_TEMPBUF_H
__STL_BEGIN_NAMESPACE namespace std
{
template <class _Tp> template <class _Tp>
pair<_Tp*, ptrdiff_t> pair<_Tp*, ptrdiff_t>
...@@ -50,15 +51,11 @@ __get_temporary_buffer(ptrdiff_t __len, _Tp*) ...@@ -50,15 +51,11 @@ __get_temporary_buffer(ptrdiff_t __len, _Tp*)
return pair<_Tp*, ptrdiff_t>((_Tp*)0, 0); return pair<_Tp*, ptrdiff_t>((_Tp*)0, 0);
} }
#ifdef __STL_EXPLICIT_FUNCTION_TMPL_ARGS
template <class _Tp> template <class _Tp>
inline pair<_Tp*, ptrdiff_t> get_temporary_buffer(ptrdiff_t __len) { inline pair<_Tp*, ptrdiff_t> get_temporary_buffer(ptrdiff_t __len) {
return __get_temporary_buffer(__len, (_Tp*) 0); return __get_temporary_buffer(__len, (_Tp*) 0);
} }
#endif /* __STL_EXPLICIT_FUNCTION_TMPL_ARGS */
// This overload is not required by the standard; it is an extension. // This overload is not required by the standard; it is an extension.
// It is supported for backward compatibility with the HP STL, and // It is supported for backward compatibility with the HP STL, and
// because not all compilers support the language feature (explicit // because not all compilers support the language feature (explicit
...@@ -109,12 +106,8 @@ public: ...@@ -109,12 +106,8 @@ public:
_Temporary_buffer(_ForwardIterator __first, _ForwardIterator __last) { _Temporary_buffer(_ForwardIterator __first, _ForwardIterator __last) {
// Workaround for a __type_traits bug in the pre-7.3 compiler. // Workaround for a __type_traits bug in the pre-7.3 compiler.
# if defined(__sgi) && !defined(__GNUC__) && _COMPILER_VERSION < 730
typedef typename __type_traits<_Tp>::is_POD_type _Trivial;
# else
typedef typename __type_traits<_Tp>::has_trivial_default_constructor typedef typename __type_traits<_Tp>::has_trivial_default_constructor
_Trivial; _Trivial;
# endif
__STL_TRY { __STL_TRY {
_M_len = 0; _M_len = 0;
...@@ -141,9 +134,7 @@ private: ...@@ -141,9 +134,7 @@ private:
template <class _ForwardIterator, template <class _ForwardIterator,
class _Tp class _Tp
#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
= typename iterator_traits<_ForwardIterator>::value_type = typename iterator_traits<_ForwardIterator>::value_type
#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
> >
struct temporary_buffer : public _Temporary_buffer<_ForwardIterator, _Tp> struct temporary_buffer : public _Temporary_buffer<_ForwardIterator, _Tp>
{ {
...@@ -152,7 +143,7 @@ struct temporary_buffer : public _Temporary_buffer<_ForwardIterator, _Tp> ...@@ -152,7 +143,7 @@ struct temporary_buffer : public _Temporary_buffer<_ForwardIterator, _Tp>
~temporary_buffer() {} ~temporary_buffer() {}
}; };
__STL_END_NAMESPACE } // namespace std
#endif /* __SGI_STL_INTERNAL_TEMPBUF_H */ #endif /* __SGI_STL_INTERNAL_TEMPBUF_H */
......
...@@ -36,8 +36,8 @@ ...@@ -36,8 +36,8 @@
#include <windows.h> #include <windows.h>
#endif #endif
__STL_BEGIN_NAMESPACE namespace std
{
// Class _Refcount_Base provides a type, _RC_t, a data member, // Class _Refcount_Base provides a type, _RC_t, a data member,
// _M_ref_count, and member functions _M_incr and _M_decr, which perform // _M_ref_count, and member functions _M_incr and _M_decr, which perform
...@@ -365,7 +365,7 @@ private: ...@@ -365,7 +365,7 @@ private:
_STL_auto_lock(const _STL_auto_lock&); _STL_auto_lock(const _STL_auto_lock&);
}; };
__STL_END_NAMESPACE } // namespace std
#endif /* __SGI_STL_INTERNAL_THREADS_H */ #endif /* __SGI_STL_INTERNAL_THREADS_H */
...@@ -373,7 +373,3 @@ __STL_END_NAMESPACE ...@@ -373,7 +373,3 @@ __STL_END_NAMESPACE
// mode:C++ // mode:C++
// End: // End:
...@@ -58,11 +58,8 @@ iterators invalidated are those referring to the deleted node. ...@@ -58,11 +58,8 @@ iterators invalidated are those referring to the deleted node.
#include <bits/stl_construct.h> #include <bits/stl_construct.h>
#include <bits/stl_function.h> #include <bits/stl_function.h>
__STL_BEGIN_NAMESPACE namespace std
{
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#pragma set woff 1375
#endif
typedef bool _Rb_tree_Color_type; typedef bool _Rb_tree_Color_type;
const _Rb_tree_Color_type _S_rb_tree_red = false; const _Rb_tree_Color_type _S_rb_tree_red = false;
...@@ -165,9 +162,7 @@ struct _Rb_tree_iterator : public _Rb_tree_base_iterator ...@@ -165,9 +162,7 @@ struct _Rb_tree_iterator : public _Rb_tree_base_iterator
_Rb_tree_iterator(const iterator& __it) { _M_node = __it._M_node; } _Rb_tree_iterator(const iterator& __it) { _M_node = __it._M_node; }
reference operator*() const { return _Link_type(_M_node)->_M_value_field; } reference operator*() const { return _Link_type(_M_node)->_M_value_field; }
#ifndef __SGI_STL_NO_ARROW_OPERATOR
pointer operator->() const { return &(operator*()); } pointer operator->() const { return &(operator*()); }
#endif /* __SGI_STL_NO_ARROW_OPERATOR */
_Self& operator++() { _M_increment(); return *this; } _Self& operator++() { _M_increment(); return *this; }
_Self operator++(int) { _Self operator++(int) {
...@@ -220,25 +215,6 @@ inline bool operator!=(const _Rb_tree_iterator<_Value, _Value&, _Value*>& __x, ...@@ -220,25 +215,6 @@ inline bool operator!=(const _Rb_tree_iterator<_Value, _Value&, _Value*>& __x,
return __x._M_node != __y._M_node; return __x._M_node != __y._M_node;
} }
#ifndef __STL_CLASS_PARTIAL_SPECIALIZATION
inline bidirectional_iterator_tag
iterator_category(const _Rb_tree_base_iterator&) {
return bidirectional_iterator_tag();
}
inline _Rb_tree_base_iterator::difference_type*
distance_type(const _Rb_tree_base_iterator&) {
return (_Rb_tree_base_iterator::difference_type*) 0;
}
template <class _Value, class _Ref, class _Ptr>
inline _Value* value_type(const _Rb_tree_iterator<_Value, _Ref, _Ptr>&) {
return (_Value*) 0;
}
#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
inline void inline void
_Rb_tree_rotate_left(_Rb_tree_node_base* __x, _Rb_tree_node_base*& __root) _Rb_tree_rotate_left(_Rb_tree_node_base* __x, _Rb_tree_node_base*& __root)
{ {
...@@ -361,7 +337,7 @@ _Rb_tree_rebalance_for_erase(_Rb_tree_node_base* __z, ...@@ -361,7 +337,7 @@ _Rb_tree_rebalance_for_erase(_Rb_tree_node_base* __z,
else else
__z->_M_parent->_M_right = __y; __z->_M_parent->_M_right = __y;
__y->_M_parent = __z->_M_parent; __y->_M_parent = __z->_M_parent;
__STD::swap(__y->_M_color, __z->_M_color); std::swap(__y->_M_color, __z->_M_color);
__y = __z; __y = __z;
// __y now points to node to be actually deleted // __y now points to node to be actually deleted
} }
...@@ -459,8 +435,6 @@ _Rb_tree_rebalance_for_erase(_Rb_tree_node_base* __z, ...@@ -459,8 +435,6 @@ _Rb_tree_rebalance_for_erase(_Rb_tree_node_base* __z,
// having an empty base class, we arbitrarily move one of rb_tree's // having an empty base class, we arbitrarily move one of rb_tree's
// data members into the base class. // data members into the base class.
#ifdef __STL_USE_STD_ALLOCATORS
// _Base for general standard-conforming allocators. // _Base for general standard-conforming allocators.
template <class _Tp, class _Alloc, bool _S_instanceless> template <class _Tp, class _Alloc, bool _S_instanceless>
class _Rb_tree_alloc_base { class _Rb_tree_alloc_base {
...@@ -519,30 +493,6 @@ struct _Rb_tree_base ...@@ -519,30 +493,6 @@ struct _Rb_tree_base
}; };
#else /* __STL_USE_STD_ALLOCATORS */
template <class _Tp, class _Alloc>
struct _Rb_tree_base
{
typedef _Alloc allocator_type;
allocator_type get_allocator() const { return allocator_type(); }
_Rb_tree_base(const allocator_type&)
: _M_header(0) { _M_header = _M_get_node(); }
~_Rb_tree_base() { _M_put_node(_M_header); }
protected:
_Rb_tree_node<_Tp>* _M_header;
typedef simple_alloc<_Rb_tree_node<_Tp>, _Alloc> _Alloc_type;
_Rb_tree_node<_Tp>* _M_get_node()
{ return _Alloc_type::allocate(1); }
void _M_put_node(_Rb_tree_node<_Tp>* __p)
{ _Alloc_type::deallocate(__p, 1); }
};
#endif /* __STL_USE_STD_ALLOCATORS */
template <class _Key, class _Value, class _KeyOfValue, class _Compare, template <class _Key, class _Value, class _KeyOfValue, class _Compare,
class _Alloc = allocator<_Value> > class _Alloc = allocator<_Value> >
...@@ -567,11 +517,9 @@ public: ...@@ -567,11 +517,9 @@ public:
allocator_type get_allocator() const { return _Base::get_allocator(); } allocator_type get_allocator() const { return _Base::get_allocator(); }
protected: protected:
#ifdef __STL_USE_NAMESPACES
using _Base::_M_get_node; using _Base::_M_get_node;
using _Base::_M_put_node; using _Base::_M_put_node;
using _Base::_M_header; using _Base::_M_header;
#endif /* __STL_USE_NAMESPACES */
protected: protected:
...@@ -648,17 +596,8 @@ public: ...@@ -648,17 +596,8 @@ public:
typedef _Rb_tree_iterator<value_type, const_reference, const_pointer> typedef _Rb_tree_iterator<value_type, const_reference, const_pointer>
const_iterator; const_iterator;
#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
typedef reverse_iterator<const_iterator> const_reverse_iterator; typedef reverse_iterator<const_iterator> const_reverse_iterator;
typedef reverse_iterator<iterator> reverse_iterator; typedef reverse_iterator<iterator> reverse_iterator;
#else /* __STL_CLASS_PARTIAL_SPECIALIZATION */
typedef reverse_bidirectional_iterator<iterator, value_type, reference,
difference_type>
reverse_iterator;
typedef reverse_bidirectional_iterator<const_iterator, value_type,
const_reference, difference_type>
const_reverse_iterator;
#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
private: private:
iterator _M_insert(_Base_ptr __x, _Base_ptr __y, const value_type& __v); iterator _M_insert(_Base_ptr __x, _Base_ptr __y, const value_type& __v);
...@@ -726,9 +665,9 @@ public: ...@@ -726,9 +665,9 @@ public:
size_type max_size() const { return size_type(-1); } size_type max_size() const { return size_type(-1); }
void swap(_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __t) { void swap(_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __t) {
__STD::swap(_M_header, __t._M_header); std::swap(_M_header, __t._M_header);
__STD::swap(_M_node_count, __t._M_node_count); std::swap(_M_node_count, __t._M_node_count);
__STD::swap(_M_key_compare, __t._M_key_compare); std::swap(_M_key_compare, __t._M_key_compare);
} }
public: public:
...@@ -739,17 +678,10 @@ public: ...@@ -739,17 +678,10 @@ public:
iterator insert_unique(iterator __position, const value_type& __x); iterator insert_unique(iterator __position, const value_type& __x);
iterator insert_equal(iterator __position, const value_type& __x); iterator insert_equal(iterator __position, const value_type& __x);
#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator> template <class _InputIterator>
void insert_unique(_InputIterator __first, _InputIterator __last); void insert_unique(_InputIterator __first, _InputIterator __last);
template <class _InputIterator> template <class _InputIterator>
void insert_equal(_InputIterator __first, _InputIterator __last); void insert_equal(_InputIterator __first, _InputIterator __last);
#else /* __STL_MEMBER_TEMPLATES */
void insert_unique(const_iterator __first, const_iterator __last);
void insert_unique(const value_type* __first, const value_type* __last);
void insert_equal(const_iterator __first, const_iterator __last);
void insert_equal(const value_type* __first, const value_type* __last);
#endif /* __STL_MEMBER_TEMPLATES */
void erase(iterator __position); void erase(iterator __position);
size_type erase(const key_type& __x); size_type erase(const key_type& __x);
...@@ -802,8 +734,6 @@ operator<(const _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __x, ...@@ -802,8 +734,6 @@ operator<(const _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __x,
__y.begin(), __y.end()); __y.begin(), __y.end());
} }
#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
template <class _Key, class _Value, class _KeyOfValue, template <class _Key, class _Value, class _KeyOfValue,
class _Compare, class _Alloc> class _Compare, class _Alloc>
inline bool inline bool
...@@ -846,8 +776,6 @@ swap(_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __x, ...@@ -846,8 +776,6 @@ swap(_Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>& __x,
__x.swap(__y); __x.swap(__y);
} }
#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
template <class _Key, class _Value, class _KeyOfValue, template <class _Key, class _Value, class _KeyOfValue,
class _Compare, class _Alloc> class _Compare, class _Alloc>
...@@ -1021,8 +949,6 @@ _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc> ...@@ -1021,8 +949,6 @@ _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>
} }
} }
#ifdef __STL_MEMBER_TEMPLATES
template <class _Key, class _Val, class _KoV, class _Cmp, class _Alloc> template <class _Key, class _Val, class _KoV, class _Cmp, class _Alloc>
template<class _II> template<class _II>
void _Rb_tree<_Key,_Val,_KoV,_Cmp,_Alloc> void _Rb_tree<_Key,_Val,_KoV,_Cmp,_Alloc>
...@@ -1040,45 +966,6 @@ void _Rb_tree<_Key,_Val,_KoV,_Cmp,_Alloc> ...@@ -1040,45 +966,6 @@ void _Rb_tree<_Key,_Val,_KoV,_Cmp,_Alloc>
insert_unique(*__first); insert_unique(*__first);
} }
#else /* __STL_MEMBER_TEMPLATES */
template <class _Key, class _Val, class _KoV, class _Cmp, class _Alloc>
void
_Rb_tree<_Key,_Val,_KoV,_Cmp,_Alloc>
::insert_equal(const _Val* __first, const _Val* __last)
{
for ( ; __first != __last; ++__first)
insert_equal(*__first);
}
template <class _Key, class _Val, class _KoV, class _Cmp, class _Alloc>
void
_Rb_tree<_Key,_Val,_KoV,_Cmp,_Alloc>
::insert_equal(const_iterator __first, const_iterator __last)
{
for ( ; __first != __last; ++__first)
insert_equal(*__first);
}
template <class _Key, class _Val, class _KoV, class _Cmp, class _Alloc>
void
_Rb_tree<_Key,_Val,_KoV,_Cmp,_Alloc>
::insert_unique(const _Val* __first, const _Val* __last)
{
for ( ; __first != __last; ++__first)
insert_unique(*__first);
}
template <class _Key, class _Val, class _KoV, class _Cmp, class _Alloc>
void _Rb_tree<_Key,_Val,_KoV,_Cmp,_Alloc>
::insert_unique(const_iterator __first, const_iterator __last)
{
for ( ; __first != __last; ++__first)
insert_unique(*__first);
}
#endif /* __STL_MEMBER_TEMPLATES */
template <class _Key, class _Value, class _KeyOfValue, template <class _Key, class _Value, class _KeyOfValue,
class _Compare, class _Alloc> class _Compare, class _Alloc>
inline void _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc> inline void _Rb_tree<_Key,_Value,_KeyOfValue,_Compare,_Alloc>
...@@ -1381,11 +1268,7 @@ struct rb_tree : public _Rb_tree<_Key, _Value, _KeyOfValue, _Compare, _Alloc> ...@@ -1381,11 +1268,7 @@ struct rb_tree : public _Rb_tree<_Key, _Value, _KeyOfValue, _Compare, _Alloc>
~rb_tree() {} ~rb_tree() {}
}; };
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32) } // namespace std
#pragma reset woff 1375
#endif
__STL_END_NAMESPACE
#endif /* __SGI_STL_INTERNAL_TREE_H */ #endif /* __SGI_STL_INTERNAL_TREE_H */
......
...@@ -33,7 +33,8 @@ ...@@ -33,7 +33,8 @@
#include <bits/std_cstring.h> #include <bits/std_cstring.h>
__STL_BEGIN_NAMESPACE namespace std
{
// uninitialized_copy // uninitialized_copy
...@@ -272,7 +273,7 @@ __uninitialized_copy_fill(_InputIter __first1, _InputIter __last1, ...@@ -272,7 +273,7 @@ __uninitialized_copy_fill(_InputIter __first1, _InputIter __last1,
__STL_UNWIND(_Destroy(__first2, __mid2)); __STL_UNWIND(_Destroy(__first2, __mid2));
} }
__STL_END_NAMESPACE } // namespace std
#endif /* _CPP_BITS_STL_UNINITIALIZED_H */ #endif /* _CPP_BITS_STL_UNINITIALIZED_H */
......
...@@ -223,7 +223,3 @@ namespace std { ...@@ -223,7 +223,3 @@ namespace std {
#endif // _CPP_BITS_STREAMBUF_TCC #endif // _CPP_BITS_STREAMBUF_TCC
// The template and inlines for the -*- C++ -*- internal _Meta class. // The template and inlines for the -*- C++ -*- internal _Meta class.
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc. // Copyright (C) 1997-1999, 2000, 2001 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -34,7 +34,8 @@ ...@@ -34,7 +34,8 @@
#pragma GCC system_header #pragma GCC system_header
namespace std { namespace std
{
// //
// Implementing a loosened valarray return value is tricky. // Implementing a loosened valarray return value is tricky.
......
...@@ -31,11 +31,7 @@ ...@@ -31,11 +31,7 @@
#include <bits/std_vector.h> #include <bits/std_vector.h>
#include <ext/stl_bvector.h> #include <ext/stl_bvector.h>
#ifdef __STL_USE_NAMESPACES using std::bit_vector;
using __STD::bit_vector;
#endif /* __STL_USE_NAMESPACES */
#endif /* __SGI_STL_BVECTOR_H */ #endif /* __SGI_STL_BVECTOR_H */
......
...@@ -33,12 +33,8 @@ ...@@ -33,12 +33,8 @@
#include <ext/stl_hashtable.h> #include <ext/stl_hashtable.h>
__STL_BEGIN_NAMESPACE namespace std
{
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#pragma set woff 1174
#pragma set woff 1375
#endif
// Forward declaration of equality operator; needed for friend declaration. // Forward declaration of equality operator; needed for friend declaration.
...@@ -95,7 +91,6 @@ public: ...@@ -95,7 +91,6 @@ public:
const allocator_type& __a = allocator_type()) const allocator_type& __a = allocator_type())
: _M_ht(__n, __hf, __eql, __a) {} : _M_ht(__n, __hf, __eql, __a) {}
#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator> template <class _InputIterator>
hash_map(_InputIterator __f, _InputIterator __l) hash_map(_InputIterator __f, _InputIterator __l)
: _M_ht(100, hasher(), key_equal(), allocator_type()) : _M_ht(100, hasher(), key_equal(), allocator_type())
...@@ -116,54 +111,15 @@ public: ...@@ -116,54 +111,15 @@ public:
: _M_ht(__n, __hf, __eql, __a) : _M_ht(__n, __hf, __eql, __a)
{ _M_ht.insert_unique(__f, __l); } { _M_ht.insert_unique(__f, __l); }
#else
hash_map(const value_type* __f, const value_type* __l)
: _M_ht(100, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_unique(__f, __l); }
hash_map(const value_type* __f, const value_type* __l, size_type __n)
: _M_ht(__n, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_unique(__f, __l); }
hash_map(const value_type* __f, const value_type* __l, size_type __n,
const hasher& __hf)
: _M_ht(__n, __hf, key_equal(), allocator_type())
{ _M_ht.insert_unique(__f, __l); }
hash_map(const value_type* __f, const value_type* __l, size_type __n,
const hasher& __hf, const key_equal& __eql,
const allocator_type& __a = allocator_type())
: _M_ht(__n, __hf, __eql, __a)
{ _M_ht.insert_unique(__f, __l); }
hash_map(const_iterator __f, const_iterator __l)
: _M_ht(100, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_unique(__f, __l); }
hash_map(const_iterator __f, const_iterator __l, size_type __n)
: _M_ht(__n, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_unique(__f, __l); }
hash_map(const_iterator __f, const_iterator __l, size_type __n,
const hasher& __hf)
: _M_ht(__n, __hf, key_equal(), allocator_type())
{ _M_ht.insert_unique(__f, __l); }
hash_map(const_iterator __f, const_iterator __l, size_type __n,
const hasher& __hf, const key_equal& __eql,
const allocator_type& __a = allocator_type())
: _M_ht(__n, __hf, __eql, __a)
{ _M_ht.insert_unique(__f, __l); }
#endif /*__STL_MEMBER_TEMPLATES */
public: public:
size_type size() const { return _M_ht.size(); } size_type size() const { return _M_ht.size(); }
size_type max_size() const { return _M_ht.max_size(); } size_type max_size() const { return _M_ht.max_size(); }
bool empty() const { return _M_ht.empty(); } bool empty() const { return _M_ht.empty(); }
void swap(hash_map& __hs) { _M_ht.swap(__hs._M_ht); } void swap(hash_map& __hs) { _M_ht.swap(__hs._M_ht); }
#ifdef __STL_MEMBER_TEMPLATES
template <class _K1, class _T1, class _HF, class _EqK, class _Al> template <class _K1, class _T1, class _HF, class _EqK, class _Al>
friend bool operator== (const hash_map<_K1, _T1, _HF, _EqK, _Al>&, friend bool operator== (const hash_map<_K1, _T1, _HF, _EqK, _Al>&,
const hash_map<_K1, _T1, _HF, _EqK, _Al>&); const hash_map<_K1, _T1, _HF, _EqK, _Al>&);
#else /* __STL_MEMBER_TEMPLATES */
friend bool __STD_QUALIFIER
operator== __STL_NULL_TMPL_ARGS (const hash_map&, const hash_map&);
#endif /* __STL_MEMBER_TEMPLATES */
#include <bits/concept_checks.h> #include <bits/concept_checks.h>
...@@ -175,17 +131,9 @@ public: ...@@ -175,17 +131,9 @@ public:
public: public:
pair<iterator,bool> insert(const value_type& __obj) pair<iterator,bool> insert(const value_type& __obj)
{ return _M_ht.insert_unique(__obj); } { return _M_ht.insert_unique(__obj); }
#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator> template <class _InputIterator>
void insert(_InputIterator __f, _InputIterator __l) void insert(_InputIterator __f, _InputIterator __l)
{ _M_ht.insert_unique(__f,__l); } { _M_ht.insert_unique(__f,__l); }
#else
void insert(const value_type* __f, const value_type* __l) {
_M_ht.insert_unique(__f,__l);
}
void insert(const_iterator __f, const_iterator __l)
{ _M_ht.insert_unique(__f, __l); }
#endif /*__STL_MEMBER_TEMPLATES */
pair<iterator,bool> insert_noresize(const value_type& __obj) pair<iterator,bool> insert_noresize(const value_type& __obj)
{ return _M_ht.insert_unique_noresize(__obj); } { return _M_ht.insert_unique_noresize(__obj); }
...@@ -225,8 +173,6 @@ operator==(const hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1, ...@@ -225,8 +173,6 @@ operator==(const hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1,
return __hm1._M_ht == __hm2._M_ht; return __hm1._M_ht == __hm2._M_ht;
} }
#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
template <class _Key, class _Tp, class _HashFcn, class _EqlKey, class _Alloc> template <class _Key, class _Tp, class _HashFcn, class _EqlKey, class _Alloc>
inline bool inline bool
operator!=(const hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1, operator!=(const hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1,
...@@ -242,8 +188,6 @@ swap(hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1, ...@@ -242,8 +188,6 @@ swap(hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1,
__hm1.swap(__hm2); __hm1.swap(__hm2);
} }
#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
// Forward declaration of equality operator; needed for friend declaration. // Forward declaration of equality operator; needed for friend declaration.
template <class _Key, class _Tp, template <class _Key, class _Tp,
...@@ -306,7 +250,6 @@ public: ...@@ -306,7 +250,6 @@ public:
const allocator_type& __a = allocator_type()) const allocator_type& __a = allocator_type())
: _M_ht(__n, __hf, __eql, __a) {} : _M_ht(__n, __hf, __eql, __a) {}
#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator> template <class _InputIterator>
hash_multimap(_InputIterator __f, _InputIterator __l) hash_multimap(_InputIterator __f, _InputIterator __l)
: _M_ht(100, hasher(), key_equal(), allocator_type()) : _M_ht(100, hasher(), key_equal(), allocator_type())
...@@ -327,54 +270,15 @@ public: ...@@ -327,54 +270,15 @@ public:
: _M_ht(__n, __hf, __eql, __a) : _M_ht(__n, __hf, __eql, __a)
{ _M_ht.insert_equal(__f, __l); } { _M_ht.insert_equal(__f, __l); }
#else
hash_multimap(const value_type* __f, const value_type* __l)
: _M_ht(100, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_equal(__f, __l); }
hash_multimap(const value_type* __f, const value_type* __l, size_type __n)
: _M_ht(__n, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_equal(__f, __l); }
hash_multimap(const value_type* __f, const value_type* __l, size_type __n,
const hasher& __hf)
: _M_ht(__n, __hf, key_equal(), allocator_type())
{ _M_ht.insert_equal(__f, __l); }
hash_multimap(const value_type* __f, const value_type* __l, size_type __n,
const hasher& __hf, const key_equal& __eql,
const allocator_type& __a = allocator_type())
: _M_ht(__n, __hf, __eql, __a)
{ _M_ht.insert_equal(__f, __l); }
hash_multimap(const_iterator __f, const_iterator __l)
: _M_ht(100, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_equal(__f, __l); }
hash_multimap(const_iterator __f, const_iterator __l, size_type __n)
: _M_ht(__n, hasher(), key_equal(), allocator_type())
{ _M_ht.insert_equal(__f, __l); }
hash_multimap(const_iterator __f, const_iterator __l, size_type __n,
const hasher& __hf)
: _M_ht(__n, __hf, key_equal(), allocator_type())
{ _M_ht.insert_equal(__f, __l); }
hash_multimap(const_iterator __f, const_iterator __l, size_type __n,
const hasher& __hf, const key_equal& __eql,
const allocator_type& __a = allocator_type())
: _M_ht(__n, __hf, __eql, __a)
{ _M_ht.insert_equal(__f, __l); }
#endif /*__STL_MEMBER_TEMPLATES */
public: public:
size_type size() const { return _M_ht.size(); } size_type size() const { return _M_ht.size(); }
size_type max_size() const { return _M_ht.max_size(); } size_type max_size() const { return _M_ht.max_size(); }
bool empty() const { return _M_ht.empty(); } bool empty() const { return _M_ht.empty(); }
void swap(hash_multimap& __hs) { _M_ht.swap(__hs._M_ht); } void swap(hash_multimap& __hs) { _M_ht.swap(__hs._M_ht); }
#ifdef __STL_MEMBER_TEMPLATES
template <class _K1, class _T1, class _HF, class _EqK, class _Al> template <class _K1, class _T1, class _HF, class _EqK, class _Al>
friend bool operator== (const hash_multimap<_K1, _T1, _HF, _EqK, _Al>&, friend bool operator== (const hash_multimap<_K1, _T1, _HF, _EqK, _Al>&,
const hash_multimap<_K1, _T1, _HF, _EqK, _Al>&); const hash_multimap<_K1, _T1, _HF, _EqK, _Al>&);
#else /* __STL_MEMBER_TEMPLATES */
friend bool __STD_QUALIFIER
operator== __STL_NULL_TMPL_ARGS (const hash_multimap&,const hash_multimap&);
#endif /* __STL_MEMBER_TEMPLATES */
iterator begin() { return _M_ht.begin(); } iterator begin() { return _M_ht.begin(); }
iterator end() { return _M_ht.end(); } iterator end() { return _M_ht.end(); }
...@@ -384,17 +288,9 @@ public: ...@@ -384,17 +288,9 @@ public:
public: public:
iterator insert(const value_type& __obj) iterator insert(const value_type& __obj)
{ return _M_ht.insert_equal(__obj); } { return _M_ht.insert_equal(__obj); }
#ifdef __STL_MEMBER_TEMPLATES
template <class _InputIterator> template <class _InputIterator>
void insert(_InputIterator __f, _InputIterator __l) void insert(_InputIterator __f, _InputIterator __l)
{ _M_ht.insert_equal(__f,__l); } { _M_ht.insert_equal(__f,__l); }
#else
void insert(const value_type* __f, const value_type* __l) {
_M_ht.insert_equal(__f,__l);
}
void insert(const_iterator __f, const_iterator __l)
{ _M_ht.insert_equal(__f, __l); }
#endif /*__STL_MEMBER_TEMPLATES */
iterator insert_noresize(const value_type& __obj) iterator insert_noresize(const value_type& __obj)
{ return _M_ht.insert_equal_noresize(__obj); } { return _M_ht.insert_equal_noresize(__obj); }
...@@ -431,8 +327,6 @@ operator==(const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm1, ...@@ -431,8 +327,6 @@ operator==(const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm1,
return __hm1._M_ht == __hm2._M_ht; return __hm1._M_ht == __hm2._M_ht;
} }
#ifdef __STL_FUNCTION_TMPL_PARTIAL_ORDER
template <class _Key, class _Tp, class _HF, class _EqKey, class _Alloc> template <class _Key, class _Tp, class _HF, class _EqKey, class _Alloc>
inline bool inline bool
operator!=(const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm1, operator!=(const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm1,
...@@ -448,13 +342,10 @@ swap(hash_multimap<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1, ...@@ -448,13 +342,10 @@ swap(hash_multimap<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1,
__hm1.swap(__hm2); __hm1.swap(__hm2);
} }
#endif /* __STL_FUNCTION_TMPL_PARTIAL_ORDER */
// Specialization of insert_iterator so that it will work for hash_map // Specialization of insert_iterator so that it will work for hash_map
// and hash_multimap. // and hash_multimap.
#ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
template <class _Key, class _Tp, class _HashFn, class _EqKey, class _Alloc> template <class _Key, class _Tp, class _HashFn, class _EqKey, class _Alloc>
class insert_iterator<hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc> > { class insert_iterator<hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc> > {
protected: protected:
...@@ -508,14 +399,7 @@ public: ...@@ -508,14 +399,7 @@ public:
insert_iterator<_Container>& operator++(int) { return *this; } insert_iterator<_Container>& operator++(int) { return *this; }
}; };
#endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */ } // namespace std
#if defined(__sgi) && !defined(__GNUC__) && (_MIPS_SIM != _MIPS_SIM_ABI32)
#pragma reset woff 1174
#pragma reset woff 1375
#endif
__STL_END_NAMESPACE
#endif /* __SGI_STL_INTERNAL_HASH_MAP_H */ #endif /* __SGI_STL_INTERNAL_HASH_MAP_H */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment