diff --git a/cint/lib/prec_stl/list b/cint/lib/prec_stl/list index 19868050141a6629c5d6fbdc8ddfd1e0f0e8f6bf..b18eaa7bd584dff7ed0b2f7a1d134b3a35242661 100644 --- a/cint/lib/prec_stl/list +++ b/cint/lib/prec_stl/list @@ -1,399 +1,403 @@ -// lib/prec_stl/list - -#pragma ifndef PREC_STL_LIST -#pragma define PREC_STL_LIST -#pragma link off global PREC_STL_LIST; -#pragma link C++ nestedtypedef; -#pragma link C++ nestedclass; -#if defined(G__HP_aCC) || defined(G__SUNPRO_C) -#pragma mask_newdelete 0x1c; -#else -#pragma mask_newdelete 0x10; -#endif - -// Imported from ANSI/ISO C++ 1997/Nov draft -// Got some ideas from Scott Snyder, Fermi-lab -// Modified by Masaharu Goto -// SGI KCC porting by Philippe Canal, Fermi-lab - -#include <_iterator> -#include <_memory> - -#if defined(G__ANSIISOLIB) || (G__GNUC>=3) -template<class T,class Allocator=std::allocator<T> > -#elif defined(G__GNUC) && !defined(G__KCC) - -#if (G__GNUC_MINOR>=95) -template<class T,class Allocator=allocator<T> > -#else -template<class T,class Allocator=alloc> -#endif - -#elif defined(G__HPUX) -template<class T,class Allocator=allocator> -#else -template<class T,class Allocator=std::allocator<T> > -#endif -class list { - public: - typedef T value_type; - typedef Allocator allocator_type; -#if (defined(G__GNUC) && !defined (G__KCC)) || defined(G__HPUX) - typedef void* void_pointer; - //typedef __list_node<T> list_node; - //typedef simple_alloc<list_node, Alloc> list_node_allocator; - //typedef list_node* link_type; - typedef value_type* pointer; - typedef const value_type* const_pointer; - typedef value_type& reference; - typedef const value_type& const_reference; - typedef size_t size_type; - typedef ptrdiff_t difference_type; -#else - typedef typename Allocator::pointer pointer; - typedef typename Allocator::const_pointer const_pointer; - typedef typename Allocator::reference reference; - typedef typename Allocator::const_reference const_reference; - typedef typename Allocator::size_type size_type; - typedef typename Allocator::difference_type difference_type; -#endif - - class iterator -#if defined(G__VISUAL) - : public _Bidit<T,difference_type> -#elif defined(G__SUNPRO_C) || defined(G__BORLANDCC5) -#elif (G__GNUC>=3 && G__GNUC_MINOR>=1) -#elif defined(G__INTEL_COMPILER) -#elif defined(G__KCC) -#elif defined(G__AIX) -#elif defined(G__ALPHA) -#else - : public bidirectional_iterator<T,difference_type> -#endif - { - public: - iterator() ; - iterator(const iterator& x) ; -#if !defined(G__BORLAND) && !defined(G__KCC) && !(defined (G__SGI)&&!defined(G__GNU)) && !defined(G__ALPHA) - iterator& operator=(const iterator& x) ; -#endif - T& operator*() const ; - iterator& operator++(); - iterator operator++(int a); - iterator& operator--(); - iterator operator--(int a); - bool operator==(const iterator& x) ; -#ifndef G__HPUX - bool operator!=(const iterator& x) ; -#endif - }; -#ifdef G__HPUX - friend bool operator!=(const list::iterator& x,const list::iterator& y)const; -#endif - -#if 0 - typedef reverse_iterator<iterator> reverse_iterator; -#else - class reverse_iterator -#if defined(G__VISUAL) - : public _Bidit<T,difference_type> -#elif defined(G__SUNPRO_C) || defined(G__BORLANDCC5) -#elif (G__GNUC>=3 && G__GNUC_MINOR>=1) -#elif defined(G__INTEL_COMPILER) -#elif defined(G__KCC) -#elif defined(G__AIX) -#elif defined(G__ALPHA) -#else - : public bidirectional_iterator<T,difference_type> -#endif - { - public: - reverse_iterator(const reverse_iterator& x) ; -#if !defined(G__BORLAND) && !defined(G__KCC) && !(defined (G__SGI)&&!defined(G__GNU)) && !defined(G__ALPHA) - reverse_iterator& operator=(const reverse_iterator& x) ; -#endif - T& operator*() const ; - reverse_iterator& operator++(); - reverse_iterator operator++(int a); - reverse_iterator& operator--(); - reverse_iterator operator--(int a); - private: - }; -#endif - friend bool operator==(const list::reverse_iterator& x - ,const list::reverse_iterator& y) const; - friend bool operator!=(const list::reverse_iterator& x - ,const list::reverse_iterator& y) const; - - typedef const iterator const_iterator; - typedef const reverse_iterator const_reverse_iterator; - -#if 0 - friend bidirectional_iterator_tag - iterator_category(bidirectional_iterator<T,distance_type>& x); - //friend bidirectional_iterator_tag - // iterator_category(list::iterator& x); - //friend bidirectional_iterator_tag - // iterator_category(list::reverse_iterator& x); -#endif - - list() ; - iterator begin() ; - iterator end() ; - reverse_iterator rbegin() ; - reverse_iterator rend() ; -#ifdef G__CONSTNESSFLAG - const_iterator begin(void) const; - const_iterator end(void) const; - const_reverse_iterator rbegin(void) const; - const_reverse_iterator rend(void) const; -#endif - bool empty() const ; - size_type size() const ; - size_type max_size() const ; - T& front() const ; - T& back() const ; - void swap(list& x) ; - iterator insert(iterator position,const T& x); - void insert(iterator position,T* first,T* last); - void insert(iterator position,iterator first,iterator last); - void insert(iterator position,size_type n,const T& x); - void push_front(const T& x); - void push_back(const T& x); - void erase(iterator position); - void erase(iterator first,iterator last); - void clear() ; - void pop_front(); - void pop_back(); - list(size_type n,const T& value=T()) ; -#if 0 - template <class InputIterator> - deque(InputIterator first, InputIterator last, - const Allocator& = Allocator()); -#else -#if (defined(G__GNUC) && !defined (G__KCC)) - list(const T* first,const T* last) ; -#endif - list(const_iterator first, const_iterator last) ; -#endif - list(const list& x) ; - ~list() ; - list& operator=(const list& x) ; - void splice(iterator position,list& x); - void splice(iterator position,list& x,iterator i); - void splice(iterator position,list& x,iterator first,iterator last); - void remove(const T& value); - void unique(); - void merge(list& x); - void reverse(); - void sort(); - - friend bool operator==(const list& x, const list& y); - friend bool operator< (const list& x, const list& y); - friend bool operator!=(const list& x, const list& y); - friend bool operator> (const list& x, const list& y); - friend bool operator>=(const list& x, const list& y); - friend bool operator<=(const list& x, const list& y); - - // specialized algorithms: -#ifndef G__GNUC - // doesn't work on egcs nor VC++5.0 - //friend void swap(list& x, list& y); -#endif - -#ifndef G__NOALGORITHM - // Generic algorithm -#if defined(G__GNUC) || defined(G__BORLAND) || defined(G__KCC) - - // input iter - friend list::iterator - find(list::iterator first,list::iterator last,const T& value); - // forward iter - friend list::iterator - find_end(list::iterator first1,list::iterator last1, - list::iterator first2,list::iterator last2); - friend list::iterator - find_first_of(list::iterator first1,list::iterator last1, - list::iterator first2,list::iterator last2); - friend list::iterator - adjacent_find(list::iterator first,list::iterator last); - // input iter -#if !defined(G__BORLAND) - friend list::difference_type - count(list::iterator first,list::iterator last,const T& value); -#endif -#if 0 - friend pair<list::iterator,list::iterator> - mismatch(list::iterator first1,list::iterator last1, - list::iterator first2); -#endif - friend bool - equal(list::iterator first1,list::iterator last1, - list::iterator first2); - // forward iter - friend list::iterator - search(list::iterator first1,list::iterator last1, - list::iterator first2,list::iterator last2); - friend list::iterator - search_n(list::iterator first,list::iterator last - ,list::size_type count,const T& value); - // input and output iter -> forward iter - friend list::iterator - copy(list::iterator first,list::iterator last, - list::iterator result); - // bidirectional iter - friend list::iterator - copy_backward(list::iterator first,list::iterator last, - list::iterator result); - // just value_type - friend void swap(T& a,T& b); - // forward iter - friend list::iterator - swap_ranges(list::iterator first1,list::iterator last1, - list::iterator first2); - friend void iter_swap(list::iterator a,list::iterator b); - friend void replace(list::iterator first,list::iterator last, - const T& old_value,const T& new_value); - // input, output iter -> forward iter - friend list::iterator - replace_copy(list::iterator first,list::iterator last, - list::iterator result, - const T& old_value,const T& new_value); - // forward iter - friend void - fill(list::iterator first,list::iterator last,const T& value); -#if (G__GNUC>=3) || defined (G__KCC) - friend void - fill_n(list::iterator first,list::size_type n,const T& value); -#endif - friend list::iterator - remove(list::iterator first,list::iterator last,const T& value); - // input,output iter -> forward iter - friend list::iterator - remove_copy(list::iterator first,list::iterator last, - list::iterator result,const T& value); - friend list::iterator - unique(list::iterator first,list::iterator last); - friend list::iterator - unique_copy(list::iterator first,list::iterator last, - list::iterator result); - friend void reverse(list::iterator first,list::iterator last); - friend list::iterator - reverse_copy(list::iterator first,list::iterator last, - list::iterator result); - // forward iter - friend void rotate(list::iterator first,list::iterator mid, - list::iterator last); - // forward iter - friend list::iterator - rotate_copy(list::iterator first,list::iterator mid, - list::iterator last,list::iterator result); -#if 0 - // randomaccess iter - friend void random_shuffle(list::iterator first,list::iterator last); - // randomaccess iter - friend void sort(list::iterator first,list::iterator last); - friend void stable_sort(list::iterator first,list::iterator last); - friend void partial_sort(list::iterator first,list::iterator mid, - list::iterator last); - friend list::iterator - partial_sort_copy(list::iterator first,list::iterator last, - list::iterator result_first, - list::iterator result_last); - friend void nth_element(list::iterator first,list::iterator nth, - list::iterator last); -#endif - // forward iter - friend list::iterator - lower_bound(list::iterator first,list::iterator last,const T& value); - friend list::iterator - upper_bound(list::iterator first,list::iterator last,const T& value); -#if 0 - friend pair<list::iterator,list::iterator> - equal_range(list::iterator first,list::iterator last,const T& value); -#endif - friend bool binary_search(list::iterator first,list::iterator last, - const T& value); - friend list::iterator merge(list::iterator first1,list::iterator last1, - list::iterator first2,list::iterator last2, - list::iterator result); - friend void inplace_merge(list::iterator first,list::iterator middle, - list::iterator last); - friend bool includes(list::iterator first1,list::iterator last1, - list::iterator first2,list::iterator last2); - friend list::iterator - set_union(list::iterator first1,list::iterator last1, - list::iterator first2,list::iterator last2, - list::iterator result); - friend list::iterator - set_intersection(list::iterator first1,list::iterator last1, - list::iterator first2,list::iterator last2, - list::iterator result); - friend list::iterator - set_difference(list::iterator first1,list::iterator last1, - list::iterator first2,list::iterator last2, - list::iterator result); - friend list::iterator - set_symmetric_difference(list::iterator first1,list::iterator last1, - list::iterator first2,list::iterator last2, - list::iterator result); -#if 0 - // random access - friend void push_heap(list::iterator first,list::iterator last); - friend void pop_heap(list::iterator first,list::iterator last); - friend void make_heap(list::iterator first,list::iterator last); - friend void sort_heap(list::iterator first,list::iterator last); -#endif - // min,max, just value_type - friend const T& min(const T& a,const T& b); - friend const T& max(const T& a,const T& b); - // forward iter - friend list::iterator - min_element(list::iterator first,list::iterator last); - friend list::iterator - max_element(list::iterator first,list::iterator last); - // input iter - friend bool - lexicographical_compare(list::iterator first1,list::iterator last1, - list::iterator first2,list::iterator last2); - // bidirectional iter - friend bool next_permutation(list::iterator first,list::iterator last); - friend bool prev_permutation(list::iterator first,list::iterator last); - -#elif defined(G__VISUAL) - friend void reverse(list::iterator first,list::iterator last); -#if 0 - friend void sort(list::iterator first,list::iterator last); -#endif - - friend list::iterator - find(list::iterator first,list::iterator last,const T& value); - friend list::iterator - search(list::iterator first1,list::iterator last1, - list::iterator first2,list::iterator last2); - friend list::iterator - copy(list::iterator first,list::iterator last, - list::iterator result); - friend void - fill(list::iterator first,list::iterator last,const T& value); -#if 0 - friend list::iterator - remove(list::iterator first,list::iterator last,const T& value); - friend list::iterator - unique(list::iterator first,list::iterator last); -#endif - -#endif // G__GNUC || G__BORLAND -#endif // G__NOALGORITHM - - // Generic algorithm - //friend void reverse(list::iterator first,list::iterator last); - //friend void reverse(list::reverse_iterator first,list::reverse_itetator last); - - - // iterator_category resolution - //friend bidirectional_iterator_tag iterator_category(list::iterator x); -}; - -#pragma endif - +// lib/prec_stl/list + +#pragma ifndef PREC_STL_LIST +#pragma define PREC_STL_LIST +#pragma link off global PREC_STL_LIST; +#pragma link C++ nestedtypedef; +#pragma link C++ nestedclass; +#if defined(G__HP_aCC) || defined(G__SUNPRO_C) +#pragma mask_newdelete 0x1c; +#else +#pragma mask_newdelete 0x10; +#endif + +// Imported from ANSI/ISO C++ 1997/Nov draft +// Got some ideas from Scott Snyder, Fermi-lab +// Modified by Masaharu Goto +// SGI KCC porting by Philippe Canal, Fermi-lab + +#include <_iterator> +#include <_memory> + +#if defined(G__ANSIISOLIB) || (G__GNUC>=3) +template<class T,class Allocator=std::allocator<T> > +#elif defined(G__GNUC) && !defined(G__KCC) + +#if (G__GNUC_MINOR>=95) +template<class T,class Allocator=allocator<T> > +#else +template<class T,class Allocator=alloc> +#endif + +#elif defined(G__HPUX) +template<class T,class Allocator=allocator> +#else +template<class T,class Allocator=std::allocator<T> > +#endif +class list { + public: + typedef T value_type; + typedef Allocator allocator_type; +#if (defined(G__GNUC) && !defined (G__KCC)) || defined(G__HPUX) + typedef void* void_pointer; + //typedef __list_node<T> list_node; + //typedef simple_alloc<list_node, Alloc> list_node_allocator; + //typedef list_node* link_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type& reference; + typedef const value_type& const_reference; + typedef size_t size_type; + typedef ptrdiff_t difference_type; +#else + typedef typename Allocator::pointer pointer; + typedef typename Allocator::const_pointer const_pointer; + typedef typename Allocator::reference reference; + typedef typename Allocator::const_reference const_reference; + typedef typename Allocator::size_type size_type; + typedef typename Allocator::difference_type difference_type; +#endif + + class iterator +#if defined(G__VISUAL) && (G__MSC_VER>=1300) + : public _Bidit<T, difference_type, const_pointer, const_reference> +#elif defined(G__VISUAL) + : public _Bidit<T,difference_type> +#elif defined(G__SUNPRO_C) || defined(G__BORLANDCC5) +#elif (G__GNUC>=3 && G__GNUC_MINOR>=1) +#elif defined(G__INTEL_COMPILER) +#elif defined(G__KCC) +#elif defined(G__AIX) +#elif defined(G__ALPHA) +#else + : public bidirectional_iterator<T,difference_type> +#endif + { + public: + iterator() ; + iterator(const iterator& x) ; +#if !defined(G__BORLAND) && !defined(G__KCC) && !(defined (G__SGI)&&!defined(G__GNU)) && !defined(G__ALPHA) + iterator& operator=(const iterator& x) ; +#endif + T& operator*() const ; + iterator& operator++(); + iterator operator++(int a); + iterator& operator--(); + iterator operator--(int a); + bool operator==(const iterator& x) ; +#ifndef G__HPUX + bool operator!=(const iterator& x) ; +#endif + }; +#ifdef G__HPUX + friend bool operator!=(const list::iterator& x,const list::iterator& y)const; +#endif + +#if 0 + typedef reverse_iterator<iterator> reverse_iterator; +#else + class reverse_iterator +#if defined(G__VISUAL) && (G__MSC_VER>=1300) + : public _Bidit<T, difference_type, const_pointer, const_reference> +#elif defined(G__VISUAL) + : public _Bidit<T,difference_type> +#elif defined(G__SUNPRO_C) || defined(G__BORLANDCC5) +#elif (G__GNUC>=3 && G__GNUC_MINOR>=1) +#elif defined(G__INTEL_COMPILER) +#elif defined(G__KCC) +#elif defined(G__AIX) +#elif defined(G__ALPHA) +#else + : public bidirectional_iterator<T,difference_type> +#endif + { + public: + reverse_iterator(const reverse_iterator& x) ; +#if !defined(G__BORLAND) && !defined(G__KCC) && !(defined (G__SGI)&&!defined(G__GNU)) && !defined(G__ALPHA) + reverse_iterator& operator=(const reverse_iterator& x) ; +#endif + T& operator*() const ; + reverse_iterator& operator++(); + reverse_iterator operator++(int a); + reverse_iterator& operator--(); + reverse_iterator operator--(int a); + private: + }; +#endif + friend bool operator==(const list::reverse_iterator& x + ,const list::reverse_iterator& y) const; + friend bool operator!=(const list::reverse_iterator& x + ,const list::reverse_iterator& y) const; + + typedef const iterator const_iterator; + typedef const reverse_iterator const_reverse_iterator; + +#if 0 + friend bidirectional_iterator_tag + iterator_category(bidirectional_iterator<T,distance_type>& x); + //friend bidirectional_iterator_tag + // iterator_category(list::iterator& x); + //friend bidirectional_iterator_tag + // iterator_category(list::reverse_iterator& x); +#endif + + list() ; + iterator begin() ; + iterator end() ; + reverse_iterator rbegin() ; + reverse_iterator rend() ; +#ifdef G__CONSTNESSFLAG + const_iterator begin(void) const; + const_iterator end(void) const; + const_reverse_iterator rbegin(void) const; + const_reverse_iterator rend(void) const; +#endif + bool empty() const ; + size_type size() const ; + size_type max_size() const ; + T& front() const ; + T& back() const ; + void swap(list& x) ; + iterator insert(iterator position,const T& x); + void insert(iterator position,T* first,T* last); + void insert(iterator position,iterator first,iterator last); + void insert(iterator position,size_type n,const T& x); + void push_front(const T& x); + void push_back(const T& x); + void erase(iterator position); + void erase(iterator first,iterator last); + void clear() ; + void pop_front(); + void pop_back(); + list(size_type n,const T& value=T()) ; +#if 0 + template <class InputIterator> + deque(InputIterator first, InputIterator last, + const Allocator& = Allocator()); +#else +#if (defined(G__GNUC) && !defined (G__KCC)) + list(const T* first,const T* last) ; +#endif + list(const_iterator first, const_iterator last) ; +#endif + list(const list& x) ; + ~list() ; + list& operator=(const list& x) ; + void splice(iterator position,list& x); + void splice(iterator position,list& x,iterator i); + void splice(iterator position,list& x,iterator first,iterator last); + void remove(const T& value); + void unique(); + void merge(list& x); + void reverse(); + void sort(); + + friend bool operator==(const list& x, const list& y); + friend bool operator< (const list& x, const list& y); + friend bool operator!=(const list& x, const list& y); + friend bool operator> (const list& x, const list& y); + friend bool operator>=(const list& x, const list& y); + friend bool operator<=(const list& x, const list& y); + + // specialized algorithms: +#ifndef G__GNUC + // doesn't work on egcs nor VC++5.0 + //friend void swap(list& x, list& y); +#endif + +#ifndef G__NOALGORITHM + // Generic algorithm +#if defined(G__GNUC) || defined(G__BORLAND) || defined(G__KCC) + + // input iter + friend list::iterator + find(list::iterator first,list::iterator last,const T& value); + // forward iter + friend list::iterator + find_end(list::iterator first1,list::iterator last1, + list::iterator first2,list::iterator last2); + friend list::iterator + find_first_of(list::iterator first1,list::iterator last1, + list::iterator first2,list::iterator last2); + friend list::iterator + adjacent_find(list::iterator first,list::iterator last); + // input iter +#if !defined(G__BORLAND) + friend list::difference_type + count(list::iterator first,list::iterator last,const T& value); +#endif +#if 0 + friend pair<list::iterator,list::iterator> + mismatch(list::iterator first1,list::iterator last1, + list::iterator first2); +#endif + friend bool + equal(list::iterator first1,list::iterator last1, + list::iterator first2); + // forward iter + friend list::iterator + search(list::iterator first1,list::iterator last1, + list::iterator first2,list::iterator last2); + friend list::iterator + search_n(list::iterator first,list::iterator last + ,list::size_type count,const T& value); + // input and output iter -> forward iter + friend list::iterator + copy(list::iterator first,list::iterator last, + list::iterator result); + // bidirectional iter + friend list::iterator + copy_backward(list::iterator first,list::iterator last, + list::iterator result); + // just value_type + friend void swap(T& a,T& b); + // forward iter + friend list::iterator + swap_ranges(list::iterator first1,list::iterator last1, + list::iterator first2); + friend void iter_swap(list::iterator a,list::iterator b); + friend void replace(list::iterator first,list::iterator last, + const T& old_value,const T& new_value); + // input, output iter -> forward iter + friend list::iterator + replace_copy(list::iterator first,list::iterator last, + list::iterator result, + const T& old_value,const T& new_value); + // forward iter + friend void + fill(list::iterator first,list::iterator last,const T& value); +#if (G__GNUC>=3) || defined (G__KCC) + friend void + fill_n(list::iterator first,list::size_type n,const T& value); +#endif + friend list::iterator + remove(list::iterator first,list::iterator last,const T& value); + // input,output iter -> forward iter + friend list::iterator + remove_copy(list::iterator first,list::iterator last, + list::iterator result,const T& value); + friend list::iterator + unique(list::iterator first,list::iterator last); + friend list::iterator + unique_copy(list::iterator first,list::iterator last, + list::iterator result); + friend void reverse(list::iterator first,list::iterator last); + friend list::iterator + reverse_copy(list::iterator first,list::iterator last, + list::iterator result); + // forward iter + friend void rotate(list::iterator first,list::iterator mid, + list::iterator last); + // forward iter + friend list::iterator + rotate_copy(list::iterator first,list::iterator mid, + list::iterator last,list::iterator result); +#if 0 + // randomaccess iter + friend void random_shuffle(list::iterator first,list::iterator last); + // randomaccess iter + friend void sort(list::iterator first,list::iterator last); + friend void stable_sort(list::iterator first,list::iterator last); + friend void partial_sort(list::iterator first,list::iterator mid, + list::iterator last); + friend list::iterator + partial_sort_copy(list::iterator first,list::iterator last, + list::iterator result_first, + list::iterator result_last); + friend void nth_element(list::iterator first,list::iterator nth, + list::iterator last); +#endif + // forward iter + friend list::iterator + lower_bound(list::iterator first,list::iterator last,const T& value); + friend list::iterator + upper_bound(list::iterator first,list::iterator last,const T& value); +#if 0 + friend pair<list::iterator,list::iterator> + equal_range(list::iterator first,list::iterator last,const T& value); +#endif + friend bool binary_search(list::iterator first,list::iterator last, + const T& value); + friend list::iterator merge(list::iterator first1,list::iterator last1, + list::iterator first2,list::iterator last2, + list::iterator result); + friend void inplace_merge(list::iterator first,list::iterator middle, + list::iterator last); + friend bool includes(list::iterator first1,list::iterator last1, + list::iterator first2,list::iterator last2); + friend list::iterator + set_union(list::iterator first1,list::iterator last1, + list::iterator first2,list::iterator last2, + list::iterator result); + friend list::iterator + set_intersection(list::iterator first1,list::iterator last1, + list::iterator first2,list::iterator last2, + list::iterator result); + friend list::iterator + set_difference(list::iterator first1,list::iterator last1, + list::iterator first2,list::iterator last2, + list::iterator result); + friend list::iterator + set_symmetric_difference(list::iterator first1,list::iterator last1, + list::iterator first2,list::iterator last2, + list::iterator result); +#if 0 + // random access + friend void push_heap(list::iterator first,list::iterator last); + friend void pop_heap(list::iterator first,list::iterator last); + friend void make_heap(list::iterator first,list::iterator last); + friend void sort_heap(list::iterator first,list::iterator last); +#endif + // min,max, just value_type + friend const T& min(const T& a,const T& b); + friend const T& max(const T& a,const T& b); + // forward iter + friend list::iterator + min_element(list::iterator first,list::iterator last); + friend list::iterator + max_element(list::iterator first,list::iterator last); + // input iter + friend bool + lexicographical_compare(list::iterator first1,list::iterator last1, + list::iterator first2,list::iterator last2); + // bidirectional iter + friend bool next_permutation(list::iterator first,list::iterator last); + friend bool prev_permutation(list::iterator first,list::iterator last); + +#elif defined(G__VISUAL) + friend void reverse(list::iterator first,list::iterator last); +#if 0 + friend void sort(list::iterator first,list::iterator last); +#endif + + friend list::iterator + find(list::iterator first,list::iterator last,const T& value); + friend list::iterator + search(list::iterator first1,list::iterator last1, + list::iterator first2,list::iterator last2); + friend list::iterator + copy(list::iterator first,list::iterator last, + list::iterator result); + friend void + fill(list::iterator first,list::iterator last,const T& value); +#if 0 + friend list::iterator + remove(list::iterator first,list::iterator last,const T& value); + friend list::iterator + unique(list::iterator first,list::iterator last); +#endif + +#endif // G__GNUC || G__BORLAND +#endif // G__NOALGORITHM + + // Generic algorithm + //friend void reverse(list::iterator first,list::iterator last); + //friend void reverse(list::reverse_iterator first,list::reverse_itetator last); + + + // iterator_category resolution + //friend bidirectional_iterator_tag iterator_category(list::iterator x); +}; + +#pragma endif + diff --git a/cint/lib/prec_stl/map b/cint/lib/prec_stl/map index f62c524e3680069c47ee4fb91b2d826e6b9d0082..6c5a8f43e25add7708bcf6f67651afc20d43d520 100644 --- a/cint/lib/prec_stl/map +++ b/cint/lib/prec_stl/map @@ -1,238 +1,242 @@ -// lib/prec_stl/map - -#pragma ifndef PREC_STL_MAP -#pragma define PREC_STL_MAP -#pragma link off global PREC_STL_MAP; -#pragma link C++ nestedtypedef; -#pragma link C++ nestedclass; -#if defined(G__HP_aCC) || defined(G__SUNPRO_C) -#pragma mask_newdelete 0x1c; -#else -#pragma mask_newdelete 0x10; -#endif - -// Imported from ANSI/ISO C++ 1997/Nov draft -// Got some ideas from Scott Snyder, Fermi-lab -// Modified by Masaharu Goto -// SGI KCC porting by Philippe Canal, Fermi-lab - -#include <_utility> -#include <_memory> -#include <_iterator> -#include <_functional> - -////////////////////////////////////////////////////////////////////////// -#if defined(G__ANSIISOLIB) || (G__GNUC>=3) || defined(G__INTEL_COMPILER) -template<class Key,class T,class Compare=std::less<Key> - ,class Allocator=std::allocator<pair<const Key, T> > > - -#elif defined(G__SUNPRO_CC) && (G__SUNPRO_CC>=0x500) -template<class Key,class T,class Compare=std::less<Key> - ,class Allocator=std::allocator<pair<const Key, T> > > - -#elif defined(G__GNUC) && !defined(G__KCC) - -#if (G__GNUC_MINOR>=95) -template<class Key,class T,class Compare=std::less<Key> - ,class Allocator=allocator<T> > -#else -template<class Key,class T,class Compare=std::less<Key> - ,class Allocator=alloc> -#endif - -#elif defined(G__HPUX) -template<class Key,class T,class Compare=std::less<Key> - ,class Allocator=allocator> - -#else -template<class Key,class T,class Compare=std::less<Key> - ,class Allocator=std::allocator<T> > - //,class Allocator=std::allocator<pair<const Key,T> > > -#endif -class map { - public: - typedef Key key_type; - typedef T mapped_type; - typedef pair<Key,T> value_type; - //typedef pair<const Key,T> value_type; - typedef Compare key_compare; - typedef Allocator allocator_type; -#if (defined(G__GNUC) && !defined(G__KCC)) || defined(G__HPUX) - //typedef Key* pointer; - //typedef const Key* const_pointer; - //typedef Key& reference; - //typedef const Key& const_reference; - typedef size_t size_type; - typedef ptrdiff_t difference_type; -#else - typedef typename Allocator::pointer pointer; - typedef typename Allocator::const_pointer const_pointer; - typedef typename Allocator::reference reference; - typedef typename Allocator::const_reference const_reference; - typedef typename Allocator::size_type size_type; - typedef typename Allocator::difference_type difference_type; -#endif - - class iterator -#if defined(G__VISUAL) - : public _Bidit<T,difference_type> -#elif defined(G__SUNPRO_C) || defined(G__BORLANDCC5) -#elif (G__GNUC>=3 && G__GNUC_MINOR>=1) -#elif defined(G__INTEL_COMPILER) -#elif defined(G__KCC) -#elif defined(G__AIX) -#elif defined(G__ALPHA) -#else - : public bidirectional_iterator<T,difference_type> -#endif - { - public: - iterator() ; - iterator(const iterator& x) ; -#if !defined(G__BORLAND) && !defined(G__KCC) && !(defined (G__SGI)&&!defined(G__GNU)) && !defined(G__ALPHA) - iterator& operator=(const iterator& x) ; -#endif - value_type& operator*() ; - iterator& operator++(); - iterator operator++(int a); - iterator& operator--(); - iterator operator--(int a); -#ifdef G__VISUAL - bool operator==(const iterator& x) ; - bool operator!=(const iterator& x) ; -#endif -#ifdef G__HPUX - bool operator==(const iterator& x) ; -#endif - }; -#if defined(G__GNUC) && !defined(G__KCC) - friend bool operator==(const map::iterator& x ,const map::iterator& y) const; - friend bool operator!=(const map::iterator& x ,const map::iterator& y) const; -#endif -#ifdef G__HPUX - friend bool operator!=(const map::iterator& x,const map::iterator& y)const; -#endif - - class reverse_iterator -#if defined(G__VISUAL) - : public _Bidit<T,difference_type> -#elif defined(G__SUNPRO_C) || defined(G__BORLANDCC5) -#elif (G__GNUC>=3 && G__GNUC_MINOR>=1) -#elif defined(G__INTEL_COMPILER) -#elif defined(G__KCC) -#elif defined(G__AIX) -#elif defined(G__ALPHA) -#else - : public bidirectional_iterator<T,difference_type> -#endif - { - public: - reverse_iterator(const reverse_iterator& x); -#if !defined(G__BORLAND) && !defined(G__KCC) && !(defined (G__SGI)&&!defined(G__GNU)) && !defined(G__ALPHA) - reverse_iterator& operator=(const reverse_iterator& x) ; -#endif - value_type& operator*() ; - reverse_iterator& operator++(); - reverse_iterator operator++(int a); - reverse_iterator& operator--(); - reverse_iterator operator--(int a); - private: - }; - friend bool operator==(const map::reverse_iterator& x - ,const map::reverse_iterator& y) const; - friend bool operator!=(const map::reverse_iterator& x - ,const map::reverse_iterator& y) const; - - typedef const iterator const_iterator; - typedef const reverse_iterator const_reverse_iterator; - - // _lib.map.cons_ construct/copy/destroy: - map(); -#if 0 - template <class InputIterator> - map(InputIterator first, InputIterator last, - const Compare& comp = Compare(), const Allocator& = Allocator()); -#endif -#if defined(G__GNUC) || defined(G__KCC) - map(iterator first, iterator last); - map(reverse_iterator first, reverse_iterator last); -#endif - map(const map& x); - ~map(); - map& operator=(const map& x); - // iterators: - iterator begin(); - iterator end(); - reverse_iterator rbegin(); - reverse_iterator rend(); -#ifdef G__CONSTNESSFLAG - const_iterator begin(void) const; - const_iterator end(void) const; - const_reverse_iterator rbegin(void) const; - const_reverse_iterator rend(void) const; -#endif - // capacity: - bool empty() const; - size_type size() const; - size_type max_size() const; - // _lib.map.access_ element access: - T& operator[](const Key& x); - // modifiers: - pair<map::iterator, bool> insert(const value_type& x); - iterator insert(iterator position, const value_type& x); -#if defined(G__KCC) - template <class InputIterator> - void insert(InputIterator first, InputIterator last); -#endif -#if defined(G__GNUC) && !defined (G__KCC) - void insert(iterator first, iterator last); - void insert(reverse_iterator first, reverse_iterator last); -#endif - void erase(iterator position); - size_type erase(const Key& x); - void erase(iterator first, iterator last); - void swap(map&); - void clear(); - // observers: - //key_compare key_comp() const; - //value_compare value_comp() const; - // _lib.map.ops_ map operations: - iterator find(const Key& x); - //const_iterator find(const Key& x) const; - size_type count(const Key& x) const; - iterator lower_bound(const Key& x); - //const_iterator lower_bound(const Key& x) const; - iterator upper_bound(const Key& x); - //const_iterator upper_bound(const Key& x) const; -#if 0 - pair<iterator,iterator> equal_range(const Key& x); - pair<const_iterator,const_iterator> equal_range(const Key& x) const; -#endif - - friend bool operator==(const map& x, const map& y); - friend bool operator< (const map& x, const map& y); - friend bool operator!=(const map& x, const map& y); - friend bool operator> (const map& x, const map& y); - friend bool operator>=(const map& x, const map& y); - friend bool operator<=(const map& x, const map& y); - // specialized algorithms: -#if !defined(G__GNUC) && !defined(G__KCC) - // doesn't work on egcs nor VC++5.0 - //friend void swap(map& x, map& y); -#endif - -#ifndef G__NOALGORITHM - // Generic algorithm - friend map::iterator - search(map::iterator first1,map::iterator last1, - map::iterator first2,map::iterator last2); -#endif - - // iterator_category resolution - //friend bidirectional_iterator_tag iterator_category(map::iterator x); - -}; - -////////////////////////////////////////////////////////////////////////// - -#pragma endif +// lib/prec_stl/map + +#pragma ifndef PREC_STL_MAP +#pragma define PREC_STL_MAP +#pragma link off global PREC_STL_MAP; +#pragma link C++ nestedtypedef; +#pragma link C++ nestedclass; +#if defined(G__HP_aCC) || defined(G__SUNPRO_C) +#pragma mask_newdelete 0x1c; +#else +#pragma mask_newdelete 0x10; +#endif + +// Imported from ANSI/ISO C++ 1997/Nov draft +// Got some ideas from Scott Snyder, Fermi-lab +// Modified by Masaharu Goto +// SGI KCC porting by Philippe Canal, Fermi-lab + +#include <_utility> +#include <_memory> +#include <_iterator> +#include <_functional> + +////////////////////////////////////////////////////////////////////////// +#if defined(G__ANSIISOLIB) || (G__GNUC>=3) || defined(G__INTEL_COMPILER) +template<class Key,class T,class Compare=std::less<Key> + ,class Allocator=std::allocator<pair<const Key, T> > > + +#elif defined(G__SUNPRO_CC) && (G__SUNPRO_CC>=0x500) +template<class Key,class T,class Compare=std::less<Key> + ,class Allocator=std::allocator<pair<const Key, T> > > + +#elif defined(G__GNUC) && !defined(G__KCC) + +#if (G__GNUC_MINOR>=95) +template<class Key,class T,class Compare=std::less<Key> + ,class Allocator=allocator<T> > +#else +template<class Key,class T,class Compare=std::less<Key> + ,class Allocator=alloc> +#endif + +#elif defined(G__HPUX) +template<class Key,class T,class Compare=std::less<Key> + ,class Allocator=allocator> + +#else +template<class Key,class T,class Compare=std::less<Key> + ,class Allocator=std::allocator<T> > + //,class Allocator=std::allocator<pair<const Key,T> > > +#endif +class map { + public: + typedef Key key_type; + typedef T mapped_type; + typedef pair<Key,T> value_type; + //typedef pair<const Key,T> value_type; + typedef Compare key_compare; + typedef Allocator allocator_type; +#if (defined(G__GNUC) && !defined(G__KCC)) || defined(G__HPUX) + //typedef Key* pointer; + //typedef const Key* const_pointer; + //typedef Key& reference; + //typedef const Key& const_reference; + typedef size_t size_type; + typedef ptrdiff_t difference_type; +#else + typedef typename Allocator::pointer pointer; + typedef typename Allocator::const_pointer const_pointer; + typedef typename Allocator::reference reference; + typedef typename Allocator::const_reference const_reference; + typedef typename Allocator::size_type size_type; + typedef typename Allocator::difference_type difference_type; +#endif + + class iterator +#if defined(G__VISUAL) && (G__MSC_VER>=1300) + : public _Bidit<T, difference_type, const_pointer, const_reference> +#elif defined(G__VISUAL) + : public _Bidit<T,difference_type> +#elif defined(G__SUNPRO_C) || defined(G__BORLANDCC5) +#elif (G__GNUC>=3 && G__GNUC_MINOR>=1) +#elif defined(G__INTEL_COMPILER) +#elif defined(G__KCC) +#elif defined(G__AIX) +#elif defined(G__ALPHA) +#else + : public bidirectional_iterator<T,difference_type> +#endif + { + public: + iterator() ; + iterator(const iterator& x) ; +#if !defined(G__BORLAND) && !defined(G__KCC) && !(defined (G__SGI)&&!defined(G__GNU)) && !defined(G__ALPHA) + iterator& operator=(const iterator& x) ; +#endif + value_type& operator*() ; + iterator& operator++(); + iterator operator++(int a); + iterator& operator--(); + iterator operator--(int a); +#ifdef G__VISUAL + bool operator==(const iterator& x) ; + bool operator!=(const iterator& x) ; +#endif +#ifdef G__HPUX + bool operator==(const iterator& x) ; +#endif + }; +#if defined(G__GNUC) && !defined(G__KCC) + friend bool operator==(const map::iterator& x ,const map::iterator& y) const; + friend bool operator!=(const map::iterator& x ,const map::iterator& y) const; +#endif +#ifdef G__HPUX + friend bool operator!=(const map::iterator& x,const map::iterator& y)const; +#endif + + class reverse_iterator +#if defined(G__VISUAL) && (G__MSC_VER>=1300) + : public _Bidit<T, difference_type, const_pointer, const_reference> +#elif defined(G__VISUAL) + : public _Bidit<T,difference_type> +#elif defined(G__SUNPRO_C) || defined(G__BORLANDCC5) +#elif (G__GNUC>=3 && G__GNUC_MINOR>=1) +#elif defined(G__INTEL_COMPILER) +#elif defined(G__KCC) +#elif defined(G__AIX) +#elif defined(G__ALPHA) +#else + : public bidirectional_iterator<T,difference_type> +#endif + { + public: + reverse_iterator(const reverse_iterator& x); +#if !defined(G__BORLAND) && !defined(G__KCC) && !(defined (G__SGI)&&!defined(G__GNU)) && !defined(G__ALPHA) + reverse_iterator& operator=(const reverse_iterator& x) ; +#endif + value_type& operator*() ; + reverse_iterator& operator++(); + reverse_iterator operator++(int a); + reverse_iterator& operator--(); + reverse_iterator operator--(int a); + private: + }; + friend bool operator==(const map::reverse_iterator& x + ,const map::reverse_iterator& y) const; + friend bool operator!=(const map::reverse_iterator& x + ,const map::reverse_iterator& y) const; + + typedef const iterator const_iterator; + typedef const reverse_iterator const_reverse_iterator; + + // _lib.map.cons_ construct/copy/destroy: + map(); +#if 0 + template <class InputIterator> + map(InputIterator first, InputIterator last, + const Compare& comp = Compare(), const Allocator& = Allocator()); +#endif +#if defined(G__GNUC) || defined(G__KCC) + map(iterator first, iterator last); + map(reverse_iterator first, reverse_iterator last); +#endif + map(const map& x); + ~map(); + map& operator=(const map& x); + // iterators: + iterator begin(); + iterator end(); + reverse_iterator rbegin(); + reverse_iterator rend(); +#ifdef G__CONSTNESSFLAG + const_iterator begin(void) const; + const_iterator end(void) const; + const_reverse_iterator rbegin(void) const; + const_reverse_iterator rend(void) const; +#endif + // capacity: + bool empty() const; + size_type size() const; + size_type max_size() const; + // _lib.map.access_ element access: + T& operator[](const Key& x); + // modifiers: + pair<map::iterator, bool> insert(const value_type& x); + iterator insert(iterator position, const value_type& x); +#if defined(G__KCC) + template <class InputIterator> + void insert(InputIterator first, InputIterator last); +#endif +#if defined(G__GNUC) && !defined (G__KCC) + void insert(iterator first, iterator last); + void insert(reverse_iterator first, reverse_iterator last); +#endif + void erase(iterator position); + size_type erase(const Key& x); + void erase(iterator first, iterator last); + void swap(map&); + void clear(); + // observers: + //key_compare key_comp() const; + //value_compare value_comp() const; + // _lib.map.ops_ map operations: + iterator find(const Key& x); + //const_iterator find(const Key& x) const; + size_type count(const Key& x) const; + iterator lower_bound(const Key& x); + //const_iterator lower_bound(const Key& x) const; + iterator upper_bound(const Key& x); + //const_iterator upper_bound(const Key& x) const; +#if 0 + pair<iterator,iterator> equal_range(const Key& x); + pair<const_iterator,const_iterator> equal_range(const Key& x) const; +#endif + + friend bool operator==(const map& x, const map& y); + friend bool operator< (const map& x, const map& y); + friend bool operator!=(const map& x, const map& y); + friend bool operator> (const map& x, const map& y); + friend bool operator>=(const map& x, const map& y); + friend bool operator<=(const map& x, const map& y); + // specialized algorithms: +#if !defined(G__GNUC) && !defined(G__KCC) + // doesn't work on egcs nor VC++5.0 + //friend void swap(map& x, map& y); +#endif + +#ifndef G__NOALGORITHM + // Generic algorithm + friend map::iterator + search(map::iterator first1,map::iterator last1, + map::iterator first2,map::iterator last2); +#endif + + // iterator_category resolution + //friend bidirectional_iterator_tag iterator_category(map::iterator x); + +}; + +////////////////////////////////////////////////////////////////////////// + +#pragma endif diff --git a/cint/lib/prec_stl/multimap b/cint/lib/prec_stl/multimap index 8c7fefedae321719bd915ce0f98fbb2db3c10fba..89909783091260fbdbf83ffb497ee5f6f0946ef3 100644 --- a/cint/lib/prec_stl/multimap +++ b/cint/lib/prec_stl/multimap @@ -1,247 +1,251 @@ -// lib/prec_stl/multimap - -#pragma ifndef PREC_STL_MULTIMAP -#pragma define PREC_STL_MULTIMAP -#pragma link off global PREC_STL_MULTIMAP; -#pragma link C++ nestedtypedef; -#pragma link C++ nestedclass; -#if defined(G__HP_aCC) || defined(G__SUNPRO_C) -#pragma mask_newdelete 0x1c; -#else -#pragma mask_newdelete 0x10; -#endif - -// Imported from ANSI/ISO C++ 1997/Nov draft -// Got some ideas from Scott Snyder, Fermi-lab -// Modified by Masaharu Goto -// SGI KCC porting by Philippe Canal, Fermi-lab - -#include <_utility> -#include <_memory> -#include <_iterator> -#include <_functional> - -////////////////////////////////////////////////////////////////////////// -#if defined(G__ANSIISOLIB) || (G__GNUC>=3) || defined(G__INTEL_COMPILER) -// This does not work yet. Don't know why. -template<class Key,class T,class Compare=std::less<Key> - ,class Allocator=std::allocator<pair<const Key,T> > > - -#elif defined(G__SUNPRO_CC) && (G__SUNPRO_CC>=0x500) -template<class Key,class T,class Compare=std::less<Key> - ,class Allocator=std::allocator<pair<const Key,T> > > - - -#elif defined(G__GNUC) && !defined(G__KCC) -#if (G__GNUC_MINOR>=95) -template<class Key,class T,class Compare=std::less<Key> - ,class Allocator=allocator<T> > -#else -template<class Key,class T,class Compare=std::less<Key> - ,class Allocator=alloc> -#endif - -#elif defined(G__HPUX) -template<class Key,class T,class Compare=std::less<Key> - ,class Allocator=allocator> - -#else -template<class Key,class T,class Compare=std::less<Key> - ,class Allocator=std::allocator<T> > - //,class Allocator=std::allocator<pair<const Key,T> > > -#endif -class multimap { - public: - typedef Key key_type; - typedef T mapped_type; - typedef pair<Key,T> value_type; - //typedef pair<const Key,T> value_type; - typedef Compare key_compare; - typedef Allocator allocator_type; -#if (defined(G__GNUC) && !defined (G__KCC)) || defined(G__HPUX) - //typedef Key* pointer; - //typedef const Key* const_pointer; - //typedef Key& reference; - //typedef const Key& const_reference; - typedef size_t size_type; - typedef ptrdiff_t difference_type; -#else - typedef typename Allocator::pointer pointer; - typedef typename Allocator::const_pointer const_pointer; - typedef typename Allocator::reference reference; - typedef typename Allocator::const_reference const_reference; - typedef typename Allocator::size_type size_type; - typedef typename Allocator::difference_type difference_type; -#endif - - class iterator -#if defined(G__VISUAL) - : public _Bidit<T,difference_type> -#elif defined(G__SUNPRO_C) || defined(G__BORLANDCC5) -#elif (G__GNUC>=3 && G__GNUC_MINOR>=1) -#elif defined(G__INTEL_COMPILER) -#elif defined(G__KCC) -#elif defined(G__AIX) -#elif defined(G__ALPHA) -#else - : public bidirectional_iterator<T,difference_type> -#endif - { - public: - iterator() ; - iterator(const iterator& x) ; -#if !defined(G__BORLAND) && !defined(G__KCC) && !(defined (G__SGI)&&!defined(G__GNU)) && !defined(G__ALPHA) - iterator& operator=(const iterator& x) ; -#endif - value_type& operator*() ; - iterator& operator++(); - iterator operator++(int a); - iterator& operator--(); - iterator operator--(int a); -#ifdef G__VISUAL - bool operator==(const iterator& x) ; - bool operator!=(const iterator& x) ; -#endif -#ifdef G__HPUX - bool operator==(const iterator& x) ; -#endif - }; -#if defined(G__GNUC) && !defined (G__KCC) - friend bool operator==(const multimap::iterator& x ,const multimap::iterator& y) const; - friend bool operator!=(const multimap::iterator& x ,const multimap::iterator& y) const; -#endif -#ifdef G__HPUX - friend bool operator!=(const multimap::iterator& x,const multimap::iterator& y)const; -#endif - - class reverse_iterator -#if defined(G__VISUAL) - : public _Bidit<T,difference_type> -#elif defined(G__SUNPRO_C) || defined(G__BORLANDCC5) -#elif (G__GNUC>=3 && G__GNUC_MINOR>=1) -#elif defined(G__INTEL_COMPILER) -#elif defined(G__KCC) -#elif defined(G__AIX) -#elif defined(G__ALPHA) -#else - : public bidirectional_iterator<T,difference_type> -#endif - { - public: - reverse_iterator(const reverse_iterator& x); -#if !defined(G__BORLAND) && !defined(G__KCC) && !(defined (G__SGI)&&!defined(G__GNU)) && !defined(G__ALPHA) - reverse_iterator& operator=(const reverse_iterator& x) ; -#endif - value_type& operator*() ; - reverse_iterator& operator++(); - reverse_iterator operator++(int a); - reverse_iterator& operator--(); - reverse_iterator operator--(int a); - private: - }; - friend bool operator==(const multimap::reverse_iterator& x - ,const multimap::reverse_iterator& y) const; - friend bool operator!=(const multimap::reverse_iterator& x - ,const multimap::reverse_iterator& y) const; - - typedef const iterator const_iterator; - typedef const reverse_iterator const_reverse_iterator; - - // _lib.multimap.cons_ construct/copy/destroy: - multimap(); -#if 0 - template <class InputIterator> - multimap(InputIterator first, InputIterator last, - const Compare& comp = Compare(), const Allocator& = Allocator()); -#endif -#if defined(G__GNUC) && !defined (G__KCC) - multimap(iterator first, iterator last); - multimap(reverse_iterator first, reverse_iterator last); -#endif - multimap(const multimap& x); - ~multimap(); - multimap& operator=(const multimap& x); - // iterators: - iterator begin(); - iterator end(); - reverse_iterator rbegin(); - reverse_iterator rend(); -#ifdef G__CONSTNESSFLAG - const_iterator begin(void) const; - const_iterator end(void) const; - const_reverse_iterator rbegin(void) const; - const_reverse_iterator rend(void) const; -#endif - // capacity: - bool empty() const; - size_type size() const; - size_type max_size() const; - // _lib.multimap.access_ element access: - //T& operator[](const Key& x); - // modifiers: - iterator insert(const value_type& x); - iterator insert(iterator position, const value_type& x); -#if defined(G__KCC) - template <class InputIterator> - void insert(InputIterator first, InputIterator last); -#endif -#if defined(G__GNUC) && !defined (G__KCC) - void insert(iterator first, iterator last); - void insert(reverse_iterator first, reverse_iterator last); -#endif - void erase(iterator position); - size_type erase(const Key& x); - void erase(iterator first, iterator last); - void swap(multimap&); - void clear(); - // observers: - //key_compare key_comp() const; - //value_compare value_comp() const; - // _lib.multimap.ops_ multimap operations: - iterator find(const Key& x); - //const_iterator find(const Key& x) const; - size_type count(const Key& x) const; - iterator lower_bound(const Key& x); - //const_iterator lower_bound(const Key& x) const; - iterator upper_bound(const Key& x); - //const_iterator upper_bound(const Key& x) const; -#if 0 - pair<iterator,iterator> equal_range(const Key& x); - pair<const_iterator,const_iterator> equal_range(const Key& x) const; -#endif - - friend bool operator==(const multimap& x, const multimap& y); - friend bool operator< (const multimap& x, const multimap& y); - friend bool operator!=(const multimap& x, const multimap& y); - friend bool operator> (const multimap& x, const multimap& y); - friend bool operator>=(const multimap& x, const multimap& y); - friend bool operator<=(const multimap& x, const multimap& y); - // specialized algorithms: -#ifndef G__GNUC - // doesn't work on egcs nor VC++5.0 - //friend void swap(multimap& x, multimap& y); -#endif - -#ifndef G__NOALGORITHM - // Generic algorithm - friend multimap::iterator - search(multimap::iterator first1,multimap::iterator last1, - multimap::iterator first2,multimap::iterator last2); -#endif - - - // Generic algorithm - //friend void reverse(multimap::iterator first,multimap::iterator last); - //friend void reverse(multimap::reverse_iterator first,multimap::reverse_itetator last); - - // iterator_category resolution - //friend bidirectional_iterator_tag iterator_category(multimap::iterator x); - -}; - -////////////////////////////////////////////////////////////////////////// - -#pragma endif - - - +// lib/prec_stl/multimap + +#pragma ifndef PREC_STL_MULTIMAP +#pragma define PREC_STL_MULTIMAP +#pragma link off global PREC_STL_MULTIMAP; +#pragma link C++ nestedtypedef; +#pragma link C++ nestedclass; +#if defined(G__HP_aCC) || defined(G__SUNPRO_C) +#pragma mask_newdelete 0x1c; +#else +#pragma mask_newdelete 0x10; +#endif + +// Imported from ANSI/ISO C++ 1997/Nov draft +// Got some ideas from Scott Snyder, Fermi-lab +// Modified by Masaharu Goto +// SGI KCC porting by Philippe Canal, Fermi-lab + +#include <_utility> +#include <_memory> +#include <_iterator> +#include <_functional> + +////////////////////////////////////////////////////////////////////////// +#if defined(G__ANSIISOLIB) || (G__GNUC>=3) || defined(G__INTEL_COMPILER) +// This does not work yet. Don't know why. +template<class Key,class T,class Compare=std::less<Key> + ,class Allocator=std::allocator<pair<const Key,T> > > + +#elif defined(G__SUNPRO_CC) && (G__SUNPRO_CC>=0x500) +template<class Key,class T,class Compare=std::less<Key> + ,class Allocator=std::allocator<pair<const Key,T> > > + + +#elif defined(G__GNUC) && !defined(G__KCC) +#if (G__GNUC_MINOR>=95) +template<class Key,class T,class Compare=std::less<Key> + ,class Allocator=allocator<T> > +#else +template<class Key,class T,class Compare=std::less<Key> + ,class Allocator=alloc> +#endif + +#elif defined(G__HPUX) +template<class Key,class T,class Compare=std::less<Key> + ,class Allocator=allocator> + +#else +template<class Key,class T,class Compare=std::less<Key> + ,class Allocator=std::allocator<T> > + //,class Allocator=std::allocator<pair<const Key,T> > > +#endif +class multimap { + public: + typedef Key key_type; + typedef T mapped_type; + typedef pair<Key,T> value_type; + //typedef pair<const Key,T> value_type; + typedef Compare key_compare; + typedef Allocator allocator_type; +#if (defined(G__GNUC) && !defined (G__KCC)) || defined(G__HPUX) + //typedef Key* pointer; + //typedef const Key* const_pointer; + //typedef Key& reference; + //typedef const Key& const_reference; + typedef size_t size_type; + typedef ptrdiff_t difference_type; +#else + typedef typename Allocator::pointer pointer; + typedef typename Allocator::const_pointer const_pointer; + typedef typename Allocator::reference reference; + typedef typename Allocator::const_reference const_reference; + typedef typename Allocator::size_type size_type; + typedef typename Allocator::difference_type difference_type; +#endif + + class iterator +#if defined(G__VISUAL) && (G__MSC_VER>=1300) + : public _Bidit<T, difference_type, const_pointer, const_reference> +#elif defined(G__VISUAL) + : public _Bidit<T,difference_type> +#elif defined(G__SUNPRO_C) || defined(G__BORLANDCC5) +#elif (G__GNUC>=3 && G__GNUC_MINOR>=1) +#elif defined(G__INTEL_COMPILER) +#elif defined(G__KCC) +#elif defined(G__AIX) +#elif defined(G__ALPHA) +#else + : public bidirectional_iterator<T,difference_type> +#endif + { + public: + iterator() ; + iterator(const iterator& x) ; +#if !defined(G__BORLAND) && !defined(G__KCC) && !(defined (G__SGI)&&!defined(G__GNU)) && !defined(G__ALPHA) + iterator& operator=(const iterator& x) ; +#endif + value_type& operator*() ; + iterator& operator++(); + iterator operator++(int a); + iterator& operator--(); + iterator operator--(int a); +#ifdef G__VISUAL + bool operator==(const iterator& x) ; + bool operator!=(const iterator& x) ; +#endif +#ifdef G__HPUX + bool operator==(const iterator& x) ; +#endif + }; +#if defined(G__GNUC) && !defined (G__KCC) + friend bool operator==(const multimap::iterator& x ,const multimap::iterator& y) const; + friend bool operator!=(const multimap::iterator& x ,const multimap::iterator& y) const; +#endif +#ifdef G__HPUX + friend bool operator!=(const multimap::iterator& x,const multimap::iterator& y)const; +#endif + + class reverse_iterator +#if defined(G__VISUAL) && (G__MSC_VER>=1300) + : public _Bidit<T, difference_type, const_pointer, const_reference> +#elif defined(G__VISUAL) + : public _Bidit<T,difference_type> +#elif defined(G__SUNPRO_C) || defined(G__BORLANDCC5) +#elif (G__GNUC>=3 && G__GNUC_MINOR>=1) +#elif defined(G__INTEL_COMPILER) +#elif defined(G__KCC) +#elif defined(G__AIX) +#elif defined(G__ALPHA) +#else + : public bidirectional_iterator<T,difference_type> +#endif + { + public: + reverse_iterator(const reverse_iterator& x); +#if !defined(G__BORLAND) && !defined(G__KCC) && !(defined (G__SGI)&&!defined(G__GNU)) && !defined(G__ALPHA) + reverse_iterator& operator=(const reverse_iterator& x) ; +#endif + value_type& operator*() ; + reverse_iterator& operator++(); + reverse_iterator operator++(int a); + reverse_iterator& operator--(); + reverse_iterator operator--(int a); + private: + }; + friend bool operator==(const multimap::reverse_iterator& x + ,const multimap::reverse_iterator& y) const; + friend bool operator!=(const multimap::reverse_iterator& x + ,const multimap::reverse_iterator& y) const; + + typedef const iterator const_iterator; + typedef const reverse_iterator const_reverse_iterator; + + // _lib.multimap.cons_ construct/copy/destroy: + multimap(); +#if 0 + template <class InputIterator> + multimap(InputIterator first, InputIterator last, + const Compare& comp = Compare(), const Allocator& = Allocator()); +#endif +#if defined(G__GNUC) && !defined (G__KCC) + multimap(iterator first, iterator last); + multimap(reverse_iterator first, reverse_iterator last); +#endif + multimap(const multimap& x); + ~multimap(); + multimap& operator=(const multimap& x); + // iterators: + iterator begin(); + iterator end(); + reverse_iterator rbegin(); + reverse_iterator rend(); +#ifdef G__CONSTNESSFLAG + const_iterator begin(void) const; + const_iterator end(void) const; + const_reverse_iterator rbegin(void) const; + const_reverse_iterator rend(void) const; +#endif + // capacity: + bool empty() const; + size_type size() const; + size_type max_size() const; + // _lib.multimap.access_ element access: + //T& operator[](const Key& x); + // modifiers: + iterator insert(const value_type& x); + iterator insert(iterator position, const value_type& x); +#if defined(G__KCC) + template <class InputIterator> + void insert(InputIterator first, InputIterator last); +#endif +#if defined(G__GNUC) && !defined (G__KCC) + void insert(iterator first, iterator last); + void insert(reverse_iterator first, reverse_iterator last); +#endif + void erase(iterator position); + size_type erase(const Key& x); + void erase(iterator first, iterator last); + void swap(multimap&); + void clear(); + // observers: + //key_compare key_comp() const; + //value_compare value_comp() const; + // _lib.multimap.ops_ multimap operations: + iterator find(const Key& x); + //const_iterator find(const Key& x) const; + size_type count(const Key& x) const; + iterator lower_bound(const Key& x); + //const_iterator lower_bound(const Key& x) const; + iterator upper_bound(const Key& x); + //const_iterator upper_bound(const Key& x) const; +#if 0 + pair<iterator,iterator> equal_range(const Key& x); + pair<const_iterator,const_iterator> equal_range(const Key& x) const; +#endif + + friend bool operator==(const multimap& x, const multimap& y); + friend bool operator< (const multimap& x, const multimap& y); + friend bool operator!=(const multimap& x, const multimap& y); + friend bool operator> (const multimap& x, const multimap& y); + friend bool operator>=(const multimap& x, const multimap& y); + friend bool operator<=(const multimap& x, const multimap& y); + // specialized algorithms: +#ifndef G__GNUC + // doesn't work on egcs nor VC++5.0 + //friend void swap(multimap& x, multimap& y); +#endif + +#ifndef G__NOALGORITHM + // Generic algorithm + friend multimap::iterator + search(multimap::iterator first1,multimap::iterator last1, + multimap::iterator first2,multimap::iterator last2); +#endif + + + // Generic algorithm + //friend void reverse(multimap::iterator first,multimap::iterator last); + //friend void reverse(multimap::reverse_iterator first,multimap::reverse_itetator last); + + // iterator_category resolution + //friend bidirectional_iterator_tag iterator_category(multimap::iterator x); + +}; + +////////////////////////////////////////////////////////////////////////// + +#pragma endif + + + diff --git a/cint/lib/prec_stl/multiset b/cint/lib/prec_stl/multiset index 1787a7f1cdd9ce477a49f8f99db6023ebd97fd50..800a5d8a5df1302a510781cba9134a0ce83381c1 100644 --- a/cint/lib/prec_stl/multiset +++ b/cint/lib/prec_stl/multiset @@ -1,267 +1,271 @@ -// lib/prec_stl/multiset - -#pragma ifndef PREC_STL_MULTISET -#pragma define PREC_STL_MULTISET -#pragma link off global PREC_STL_MULTISET; -#pragma link C++ nestedtypedef; -#pragma link C++ nestedclass; -#if defined(G__HP_aCC) || defined(G__SUNPRO_C) -#pragma mask_newdelete 0x1c; -#else -#pragma mask_newdelete 0x10; -#endif - -// Imported from ANSI/ISO C++ 1997/Nov draft -// Got some ideas from Scott Snyder, Fermi-lab -// Modified by Masaharu Goto -// SGI KCC porting by Philippe Canal, Fermi-lab - -#include <_utility> -#include <_memory> -#include <_iterator> -#include <_functional> - -#if defined(G__ANSIISOLIB) || (G__GNUC>=3) -template<class Key,class Compare=std::less<Key> - ,class Allocator=std::allocator<Key> > -#elif defined(G__GNUC) && !defined(G__KCC) -#if (G__GNUC_MINOR>=95) -template<class Key,class Compare=std::less<Key> - ,class Allocator=allocator<Key> > -#else -template<class Key,class Compare=std::less<Key> - ,class Allocator=alloc> -#endif -#elif defined(G__HPUX) -template<class Key,class Compare=std::less<Key> - ,class Allocator=allocator> -#else -template<class Key,class Compare=std::less<Key> - ,class Allocator=std::allocator<Key> > -#endif -class multiset { - public: - // types: - typedef Key key_type; - typedef Key value_type; - typedef Compare key_compare; - typedef Compare value_compare; - typedef Allocator allocator_type; -#if (defined(G__GNUC) && !defined (G__KCC)) || defined(G__HPUX) - typedef Key* pointer; - typedef const Key* const_pointer; - typedef Key& reference; - typedef const Key& const_reference; - typedef size_t size_type; - typedef ptrdiff_t difference_type; -#else - typedef typename Allocator::pointer pointer; - typedef typename Allocator::const_pointer const_pointer; - typedef typename Allocator::reference reference; - typedef typename Allocator::const_reference const_reference; - typedef typename Allocator::size_type size_type; - typedef typename Allocator::difference_type difference_type; -#endif - - class iterator -#if defined(G__VISUAL) - : public _Bidit<Key,difference_type> -#elif defined(G__SUNPRO_C) || defined(G__BORLANDCC5) -#elif (G__GNUC>=3 && G__GNUC_MINOR>=1) -#elif defined(G__INTEL_COMPILER) -#elif defined(G__KCC) -#elif defined(G__AIX) -#elif defined(G__ALPHA) -#else - : public bidirectional_iterator<Key,difference_type> -#endif - { - public: - iterator() ; - iterator(const iterator& x) ; -#if !defined(G__BORLAND) && !defined(G__KCC) && !(defined (G__SGI)&&!defined(G__GNU)) && !defined(G__ALPHA) - iterator& operator=(const iterator& x) ; -#endif -#if defined(G__VISUAL) || (defined(G__GNUC) && !defined (G__KCC)) - value_type operator*() const; -#else - value_type& operator*() const; -#endif - iterator& operator++(); - iterator operator++(int a); - iterator& operator--(); - iterator operator--(int a); -#ifdef G__VISUAL - bool operator==(const iterator& x) ; - bool operator!=(const iterator& x) ; -#endif -#ifdef G__HPUX - bool operator==(const iterator& x) ; -#endif - }; -#if (defined(G__GNUC) && !defined (G__KCC)) - friend bool operator==(const multiset::iterator& x ,const multiset::iterator& y) const; - friend bool operator!=(const multiset::iterator& x ,const multiset::iterator& y) const; -#endif -#ifdef G__HPUX - friend bool operator!=(const multiset::iterator& x,const multiset::iterator& y)const; -#endif - - class reverse_iterator -#if defined(G__VISUAL) - : public _Bidit<Key,difference_type> -#elif defined(G__SUNPRO_C) || defined(G__BORLANDCC5) -#elif (G__GNUC>=3 && G__GNUC_MINOR>=1) -#elif defined(G__INTEL_COMPILER) -#elif defined(G__KCC) -#elif defined(G__AIX) -#elif defined(G__ALPHA) -#else - : public bidirectional_iterator<Key,difference_type> -#endif - { - public: - reverse_iterator(const reverse_iterator& x); -#if !defined(G__BORLAND) && !defined(G__KCC) && !(defined (G__SGI)&&!defined(G__GNU)) && !defined(G__ALPHA) - reverse_iterator& operator=(const reverse_iterator& x) ; -#endif -#if defined(G__VISUAL) || (defined(G__GNUC) && !defined (G__KCC)) - value_type operator*() const; -#else - value_type& operator*() const; -#endif - reverse_iterator& operator++(); - reverse_iterator operator++(int a); - reverse_iterator& operator--(); - reverse_iterator operator--(int a); - private: - }; - friend bool operator==(const multiset::reverse_iterator& x - ,const multiset::reverse_iterator& y) const; - friend bool operator!=(const multiset::reverse_iterator& x - ,const multiset::reverse_iterator& y) const; - - typedef const iterator const_iterator; - typedef const reverse_iterator const_reverse_iterator; - - // _lib.multiset.cons_ construct/copy/destroy: - //multiset(const Compare& comp=Compare(), const Allocator&=Allocator()); - multiset(); -#if 0 - template <class InputIterator> - multiset(InputIterator first, InputIterator last, - const Compare& comp = Compare(), const Allocator& = Allocator()); -#endif - multiset(const multiset& x); - ~multiset(); - multiset& operator= (const multiset& x); - //allocator_type get_allocator() const; - // iterators: - iterator begin(); - iterator end(); - reverse_iterator rbegin(); - reverse_iterator rend(); -#ifdef G__CONSTNESSFLAG - const_iterator begin(void) const; - const_iterator end(void) const; - const_reverse_iterator rbegin(void) const; - const_reverse_iterator rend(void) const; -#endif - - // capacity: - bool empty() const; - size_type size() const; - size_type max_size() const; - // modifiers: - iterator insert(const Key& x); - iterator insert(iterator position, const Key& x); -#if 0 - template <class InputIterator> - void insert(InputIterator first, InputIterator last); -#endif - void erase(iterator position); -#if 0 - size_type erase(const key& x); -#endif - void erase(iterator first, iterator last); - void swap(multiset<Key,Compare,Allocator>&); - void clear(); - // observers: - //key_compare key_comp() const; - //value_compare value_comp() const; - // multiset operations: -#if defined(G__HPUX) || defined(G__VISUAL) - iterator find(const Key& x) ; -#elif defined(G__INTEL_COMPILER) || defined(G__AIX) - iterator find(const Key& x); - const_iterator find(const Key& x) const; -#else - iterator find(const Key& x) const; -#endif - size_type count(const Key& x) const; -#if defined(G__HPUX) || defined(G__VISUAL) - iterator lower_bound(const Key& x) ; - iterator upper_bound(const Key& x) ; -#elif defined(G__INTEL_COMPILER) || defined(G__AIX) - iterator lower_bound(const Key& x) ; - iterator upper_bound(const Key& x) ; - const_iterator lower_bound(const Key& x) const; - const_iterator upper_bound(const Key& x) const; -#else - iterator lower_bound(const Key& x) const; - iterator upper_bound(const Key& x) const; -#endif - //pair<iterator,iterator> equal_range(const Key& x) const; - - friend bool operator==(const multiset& x, const multiset& y); - friend bool operator< (const multiset& x, const multiset& y); - friend bool operator!=(const multiset& x, const multiset& y); - friend bool operator> (const multiset& x, const multiset& y); - friend bool operator>=(const multiset& x, const multiset& y); - friend bool operator<=(const multiset& x, const multiset& y); - // specialized algorithms: - //friend void swap(multiset& x, multiset& y); - -#ifndef G__NOALGORITHM - // Generic algorithm -#if (defined(G__GNUC) && !defined (G__KCC)) || defined(G__BORLAND) - - friend multiset::iterator - find(multiset::iterator first,multiset::iterator last,const Key& value); - friend multiset::iterator - search(multiset::iterator first1,multiset::iterator last1, - multiset::iterator first2,multiset::iterator last2); - -#elif defined(G__VISUAL) - - friend void reverse(multiset::iterator first,multiset::iterator last); -#if 0 - friend void sort(multiset::iterator first,multiset::iterator last); -#endif - - friend multiset::iterator - find(multiset::iterator first,multiset::iterator last,const Key& value); - friend multiset::iterator - search(multiset::iterator first1,multiset::iterator last1, - multiset::iterator first2,multiset::iterator last2); - friend multiset::iterator - copy(multiset::iterator first,multiset::iterator last, - multiset::iterator result); - friend void - fill(multiset::iterator first,multiset::iterator last,const Key& value); -#if 0 - friend multiset::iterator - remove(multiset::iterator first,multiset::iterator last,const Key& value); - friend multiset::iterator - unique(multiset::iterator first,multiset::iterator last); -#endif - -#endif // G__GNUC || G__BORLAND -#endif // G__NOALGORITHM - -}; - -#pragma endif - - - +// lib/prec_stl/multiset + +#pragma ifndef PREC_STL_MULTISET +#pragma define PREC_STL_MULTISET +#pragma link off global PREC_STL_MULTISET; +#pragma link C++ nestedtypedef; +#pragma link C++ nestedclass; +#if defined(G__HP_aCC) || defined(G__SUNPRO_C) +#pragma mask_newdelete 0x1c; +#else +#pragma mask_newdelete 0x10; +#endif + +// Imported from ANSI/ISO C++ 1997/Nov draft +// Got some ideas from Scott Snyder, Fermi-lab +// Modified by Masaharu Goto +// SGI KCC porting by Philippe Canal, Fermi-lab + +#include <_utility> +#include <_memory> +#include <_iterator> +#include <_functional> + +#if defined(G__ANSIISOLIB) || (G__GNUC>=3) +template<class Key,class Compare=std::less<Key> + ,class Allocator=std::allocator<Key> > +#elif defined(G__GNUC) && !defined(G__KCC) +#if (G__GNUC_MINOR>=95) +template<class Key,class Compare=std::less<Key> + ,class Allocator=allocator<Key> > +#else +template<class Key,class Compare=std::less<Key> + ,class Allocator=alloc> +#endif +#elif defined(G__HPUX) +template<class Key,class Compare=std::less<Key> + ,class Allocator=allocator> +#else +template<class Key,class Compare=std::less<Key> + ,class Allocator=std::allocator<Key> > +#endif +class multiset { + public: + // types: + typedef Key key_type; + typedef Key value_type; + typedef Compare key_compare; + typedef Compare value_compare; + typedef Allocator allocator_type; +#if (defined(G__GNUC) && !defined (G__KCC)) || defined(G__HPUX) + typedef Key* pointer; + typedef const Key* const_pointer; + typedef Key& reference; + typedef const Key& const_reference; + typedef size_t size_type; + typedef ptrdiff_t difference_type; +#else + typedef typename Allocator::pointer pointer; + typedef typename Allocator::const_pointer const_pointer; + typedef typename Allocator::reference reference; + typedef typename Allocator::const_reference const_reference; + typedef typename Allocator::size_type size_type; + typedef typename Allocator::difference_type difference_type; +#endif + + class iterator +#if defined(G__VISUAL) && (G__MSC_VER>=1300) + : public _Bidit<T, difference_type, const_pointer, const_reference> +#elif defined(G__VISUAL) + : public _Bidit<Key,difference_type> +#elif defined(G__SUNPRO_C) || defined(G__BORLANDCC5) +#elif (G__GNUC>=3 && G__GNUC_MINOR>=1) +#elif defined(G__INTEL_COMPILER) +#elif defined(G__KCC) +#elif defined(G__AIX) +#elif defined(G__ALPHA) +#else + : public bidirectional_iterator<Key,difference_type> +#endif + { + public: + iterator() ; + iterator(const iterator& x) ; +#if !defined(G__BORLAND) && !defined(G__KCC) && !(defined (G__SGI)&&!defined(G__GNU)) && !defined(G__ALPHA) + iterator& operator=(const iterator& x) ; +#endif +#if defined(G__VISUAL) || (defined(G__GNUC) && !defined (G__KCC)) + value_type operator*() const; +#else + value_type& operator*() const; +#endif + iterator& operator++(); + iterator operator++(int a); + iterator& operator--(); + iterator operator--(int a); +#ifdef G__VISUAL + bool operator==(const iterator& x) ; + bool operator!=(const iterator& x) ; +#endif +#ifdef G__HPUX + bool operator==(const iterator& x) ; +#endif + }; +#if (defined(G__GNUC) && !defined (G__KCC)) + friend bool operator==(const multiset::iterator& x ,const multiset::iterator& y) const; + friend bool operator!=(const multiset::iterator& x ,const multiset::iterator& y) const; +#endif +#ifdef G__HPUX + friend bool operator!=(const multiset::iterator& x,const multiset::iterator& y)const; +#endif + + class reverse_iterator +#if defined(G__VISUAL) && (G__MSC_VER>=1300) + : public _Bidit<T, difference_type, const_pointer, const_reference> +#elif defined(G__VISUAL) + : public _Bidit<Key,difference_type> +#elif defined(G__SUNPRO_C) || defined(G__BORLANDCC5) +#elif (G__GNUC>=3 && G__GNUC_MINOR>=1) +#elif defined(G__INTEL_COMPILER) +#elif defined(G__KCC) +#elif defined(G__AIX) +#elif defined(G__ALPHA) +#else + : public bidirectional_iterator<Key,difference_type> +#endif + { + public: + reverse_iterator(const reverse_iterator& x); +#if !defined(G__BORLAND) && !defined(G__KCC) && !(defined (G__SGI)&&!defined(G__GNU)) && !defined(G__ALPHA) + reverse_iterator& operator=(const reverse_iterator& x) ; +#endif +#if defined(G__VISUAL) || (defined(G__GNUC) && !defined (G__KCC)) + value_type operator*() const; +#else + value_type& operator*() const; +#endif + reverse_iterator& operator++(); + reverse_iterator operator++(int a); + reverse_iterator& operator--(); + reverse_iterator operator--(int a); + private: + }; + friend bool operator==(const multiset::reverse_iterator& x + ,const multiset::reverse_iterator& y) const; + friend bool operator!=(const multiset::reverse_iterator& x + ,const multiset::reverse_iterator& y) const; + + typedef const iterator const_iterator; + typedef const reverse_iterator const_reverse_iterator; + + // _lib.multiset.cons_ construct/copy/destroy: + //multiset(const Compare& comp=Compare(), const Allocator&=Allocator()); + multiset(); +#if 0 + template <class InputIterator> + multiset(InputIterator first, InputIterator last, + const Compare& comp = Compare(), const Allocator& = Allocator()); +#endif + multiset(const multiset& x); + ~multiset(); + multiset& operator= (const multiset& x); + //allocator_type get_allocator() const; + // iterators: + iterator begin(); + iterator end(); + reverse_iterator rbegin(); + reverse_iterator rend(); +#ifdef G__CONSTNESSFLAG + const_iterator begin(void) const; + const_iterator end(void) const; + const_reverse_iterator rbegin(void) const; + const_reverse_iterator rend(void) const; +#endif + + // capacity: + bool empty() const; + size_type size() const; + size_type max_size() const; + // modifiers: + iterator insert(const Key& x); + iterator insert(iterator position, const Key& x); +#if 0 + template <class InputIterator> + void insert(InputIterator first, InputIterator last); +#endif + void erase(iterator position); +#if 0 + size_type erase(const key& x); +#endif + void erase(iterator first, iterator last); + void swap(multiset<Key,Compare,Allocator>&); + void clear(); + // observers: + //key_compare key_comp() const; + //value_compare value_comp() const; + // multiset operations: +#if defined(G__HPUX) || defined(G__VISUAL) + iterator find(const Key& x) ; +#elif defined(G__INTEL_COMPILER) || defined(G__AIX) + iterator find(const Key& x); + const_iterator find(const Key& x) const; +#else + iterator find(const Key& x) const; +#endif + size_type count(const Key& x) const; +#if defined(G__HPUX) || defined(G__VISUAL) + iterator lower_bound(const Key& x) ; + iterator upper_bound(const Key& x) ; +#elif defined(G__INTEL_COMPILER) || defined(G__AIX) + iterator lower_bound(const Key& x) ; + iterator upper_bound(const Key& x) ; + const_iterator lower_bound(const Key& x) const; + const_iterator upper_bound(const Key& x) const; +#else + iterator lower_bound(const Key& x) const; + iterator upper_bound(const Key& x) const; +#endif + //pair<iterator,iterator> equal_range(const Key& x) const; + + friend bool operator==(const multiset& x, const multiset& y); + friend bool operator< (const multiset& x, const multiset& y); + friend bool operator!=(const multiset& x, const multiset& y); + friend bool operator> (const multiset& x, const multiset& y); + friend bool operator>=(const multiset& x, const multiset& y); + friend bool operator<=(const multiset& x, const multiset& y); + // specialized algorithms: + //friend void swap(multiset& x, multiset& y); + +#ifndef G__NOALGORITHM + // Generic algorithm +#if (defined(G__GNUC) && !defined (G__KCC)) || defined(G__BORLAND) + + friend multiset::iterator + find(multiset::iterator first,multiset::iterator last,const Key& value); + friend multiset::iterator + search(multiset::iterator first1,multiset::iterator last1, + multiset::iterator first2,multiset::iterator last2); + +#elif defined(G__VISUAL) + + friend void reverse(multiset::iterator first,multiset::iterator last); +#if 0 + friend void sort(multiset::iterator first,multiset::iterator last); +#endif + + friend multiset::iterator + find(multiset::iterator first,multiset::iterator last,const Key& value); + friend multiset::iterator + search(multiset::iterator first1,multiset::iterator last1, + multiset::iterator first2,multiset::iterator last2); + friend multiset::iterator + copy(multiset::iterator first,multiset::iterator last, + multiset::iterator result); + friend void + fill(multiset::iterator first,multiset::iterator last,const Key& value); +#if 0 + friend multiset::iterator + remove(multiset::iterator first,multiset::iterator last,const Key& value); + friend multiset::iterator + unique(multiset::iterator first,multiset::iterator last); +#endif + +#endif // G__GNUC || G__BORLAND +#endif // G__NOALGORITHM + +}; + +#pragma endif + + + diff --git a/cint/lib/prec_stl/set b/cint/lib/prec_stl/set index 4ec9ddc15e5197a635c8d3203f4726a2d0dc4bb7..18a46fa5fdceb17849c52b80ef553bf5681c5ba4 100644 --- a/cint/lib/prec_stl/set +++ b/cint/lib/prec_stl/set @@ -1,256 +1,260 @@ -// lib/prec_stl/set - -#pragma ifndef PREC_STL_SET -#pragma define PREC_STL_SET -#pragma link off global PREC_STL_SET; -#pragma link C++ nestedtypedef; -#pragma link C++ nestedclass; -#if defined(G__HP_aCC) || defined(G__SUNPRO_C) -#pragma mask_newdelete 0x1c; -#else -#pragma mask_newdelete 0x10; -#endif - -// Imported from ANSI/ISO C++ 1997/Nov draft -// Got some ideas from Scott Snyder, Fermi-lab -// Modified by Masaharu Goto -// SGI KCC porting by Philippe Canal, Fermi-lab - -#include <_utility> -#include <_memory> -#include <_iterator> -#include <_functional> - -#if defined(G__ANSIISOLIB) || (G__GNUC>=3) -template<class Key,class Compare=std::less<Key> - ,class Allocator=std::allocator<Key> > -#elif defined(G__GNUC) && !defined(G__KCC) -#if (G__GNUC_MINOR>=95) -template<class Key,class Compare=std::less<Key> - ,class Allocator=allocator<Key> > -#else -template<class Key,class Compare=std::less<Key> - ,class Allocator=alloc> -#endif -#elif defined(G__HPUX) -template<class Key,class Compare=std::less<Key> - ,class Allocator=allocator> -#else -template<class Key,class Compare=std::less<Key> - ,class Allocator=std::allocator<Key> > -#endif -class set { - public: - // types: - typedef Key key_type; - typedef Key value_type; - typedef Compare key_compare; - typedef Compare value_compare; - typedef Allocator allocator_type; -#if (defined(G__GNUC) && !defined(G__KCC)) || defined(G__HPUX) - typedef Key* pointer; - typedef const Key* const_pointer; - typedef Key& reference; - typedef const Key& const_reference; - typedef size_t size_type; - typedef ptrdiff_t difference_type; -#else - typedef typename Allocator::pointer pointer; - typedef typename Allocator::const_pointer const_pointer; - typedef typename Allocator::reference reference; - typedef typename Allocator::const_reference const_reference; - typedef typename Allocator::size_type size_type; - typedef typename Allocator::difference_type difference_type; -#endif - - class iterator -#if defined(G__VISUAL) - : public _Bidit<Key,difference_type> -#elif defined(G__SUNPRO_C) || defined(G__BORLANDCC5) -#elif (G__GNUC>=3 && G__GNUC_MINOR>=1) -#elif defined(G__INTEL_COMPILER) -#elif defined(G__KCC) -#elif defined(G__AIX) -#elif defined(G__ALPHA) -#else - : public bidirectional_iterator<Key,difference_type> -#endif - { - public: - iterator() ; - iterator(const iterator& x) ; -#if !defined(G__BORLAND) && !defined(G__KCC) && !(defined (G__SGI)&&!defined(G__GNU)) && !defined(G__ALPHA) - iterator& operator=(const iterator& x) ; -#endif -#if defined(G__VISUAL) || (defined(G__GNUC) && !defined(G__KCC)) - value_type operator*() const; -#else - value_type& operator*() const; -#endif - iterator& operator++(); - iterator operator++(int a); - iterator& operator--(); - iterator operator--(int a); -#ifdef G__VISUAL - bool operator==(const iterator& x) ; - bool operator!=(const iterator& x) ; -#endif -#ifdef G__HPUX - bool operator==(const iterator& x) ; -#endif - }; -#if defined(G__GNUC) && !defined(G__KCC) - friend bool operator==(const set::iterator& x ,const set::iterator& y) const; - friend bool operator!=(const set::iterator& x ,const set::iterator& y) const; -#endif -#ifdef G__HPUX - friend bool operator!=(const set::iterator& x,const set::iterator& y)const; -#endif - - class reverse_iterator -#if defined(G__VISUAL) - : public _Bidit<Key,difference_type> -#elif defined(G__SUNPRO_C) || defined(G__BORLANDCC5) -#elif (G__GNUC>=3 && G__GNUC_MINOR>=1) -#elif defined(G__INTEL_COMPILER) -#elif defined(G__KCC) -#elif defined(G__AIX) -#elif defined(G__ALPHA) -#else - : public bidirectional_iterator<Key,difference_type> -#endif - { - public: - reverse_iterator(const reverse_iterator& x); -#if !defined(G__BORLAND) && !defined(G__KCC) && !(defined (G__SGI)&&!defined(G__GNU)) && !defined(G__ALPHA) - reverse_iterator& operator=(const reverse_iterator& x) ; -#endif -#if defined(G__VISUAL) || (defined(G__GNUC) && !defined(G__KCC)) - value_type operator*() const; -#else - value_type& operator*() const; -#endif - reverse_iterator& operator++(); - reverse_iterator operator++(int a); - reverse_iterator& operator--(); - reverse_iterator operator--(int a); - private: - }; - friend bool operator==(const set::reverse_iterator& x - ,const set::reverse_iterator& y) const; - friend bool operator!=(const set::reverse_iterator& x - ,const set::reverse_iterator& y) const; - - typedef const iterator const_iterator; - typedef const reverse_iterator const_reverse_iterator; - - // _lib.set.cons_ construct/copy/destroy: - //set(const Compare& comp=Compare(), const Allocator&=Allocator()); - set(); -#if 0 - template <class InputIterator> - set(InputIterator first, InputIterator last, - const Compare& comp = Compare(), const Allocator& = Allocator()); -#endif - set(const set& x); - ~set(); - set& operator= (const set& x); - //allocator_type get_allocator() const; - // iterators: - iterator begin(); - iterator end(); - reverse_iterator rbegin(); - reverse_iterator rend(); -#ifdef G__CONSTNESSFLAG - const_iterator begin(void) const; - const_iterator end(void) const; - const_reverse_iterator rbegin(void) const; - const_reverse_iterator rend(void) const; -#endif - - // capacity: - bool empty() const; - size_type size() const; - size_type max_size() const; - // modifiers: - pair<set::iterator,bool> insert(const Key& x); - iterator insert(iterator position, const Key& x); -#if 0 - template <class InputIterator> - void insert(InputIterator first, InputIterator last); -#endif - void erase(iterator position); -#if 0 - size_type erase(const key& x); -#endif - void erase(iterator first, iterator last); - void swap(set<Key,Compare,Allocator>&); - void clear(); - // observers: - //key_compare key_comp() const; - //value_compare value_comp() const; - // set operations: -#if defined(G__HPUX) || defined(G__VISUAL) - iterator find(const Key& x) ; -#elif defined(G__INTEL_COMPILER) || defined(G__AIX) - iterator find(const Key& x) ; - const_iterator find(const Key& x) const; -#else - iterator find(const Key& x) const; -#endif - size_type count(const Key& x) const; -#if defined(G__HPUX) || defined(G__VISUAL) - iterator lower_bound(const Key& x) ; - iterator upper_bound(const Key& x) ; -#elif defined(G__INTEL_COMPILER) || defined(G__AIX) - iterator lower_bound(const Key& x) ; - iterator upper_bound(const Key& x) ; - const_iterator lower_bound(const Key& x) const; - const_iterator upper_bound(const Key& x) const; -#else - iterator lower_bound(const Key& x) const; - iterator upper_bound(const Key& x) const; -#endif - //pair<iterator,iterator> equal_range(const Key& x) const; - - friend bool operator==(const set& x, const set& y); - friend bool operator< (const set& x, const set& y); - friend bool operator!=(const set& x, const set& y); - friend bool operator> (const set& x, const set& y); - friend bool operator>=(const set& x, const set& y); - friend bool operator<=(const set& x, const set& y); - // specialized algorithms: - //friend void swap(set& x, set& y); - - -#ifndef G__NOALGORITHM - // Generic algorithm -#if (defined(G__GNUC) && !defined (G__KCC)) || defined(G__BORLAND) - - friend set::iterator - find(set::iterator first,set::iterator last,const Key& value); - friend set::iterator - search(set::iterator first1,set::iterator last1, - set::iterator first2,set::iterator last2); - -#elif defined(G__VISUAL) - - friend void reverse(set::iterator first,set::iterator last); - - friend set::iterator - find(set::iterator first,set::iterator last,const Key& value); - friend set::iterator - search(set::iterator first1,set::iterator last1, - set::iterator first2,set::iterator last2); - friend set::iterator - copy(set::iterator first,set::iterator last, - set::iterator result); - friend void - fill(set::iterator first,set::iterator last,const Key& value); - -#endif // G__GNUC || G__BORLAND -#endif // G__NOALGORITHM - -}; - -#pragma endif +// lib/prec_stl/set + +#pragma ifndef PREC_STL_SET +#pragma define PREC_STL_SET +#pragma link off global PREC_STL_SET; +#pragma link C++ nestedtypedef; +#pragma link C++ nestedclass; +#if defined(G__HP_aCC) || defined(G__SUNPRO_C) +#pragma mask_newdelete 0x1c; +#else +#pragma mask_newdelete 0x10; +#endif + +// Imported from ANSI/ISO C++ 1997/Nov draft +// Got some ideas from Scott Snyder, Fermi-lab +// Modified by Masaharu Goto +// SGI KCC porting by Philippe Canal, Fermi-lab + +#include <_utility> +#include <_memory> +#include <_iterator> +#include <_functional> + +#if defined(G__ANSIISOLIB) || (G__GNUC>=3) +template<class Key,class Compare=std::less<Key> + ,class Allocator=std::allocator<Key> > +#elif defined(G__GNUC) && !defined(G__KCC) +#if (G__GNUC_MINOR>=95) +template<class Key,class Compare=std::less<Key> + ,class Allocator=allocator<Key> > +#else +template<class Key,class Compare=std::less<Key> + ,class Allocator=alloc> +#endif +#elif defined(G__HPUX) +template<class Key,class Compare=std::less<Key> + ,class Allocator=allocator> +#else +template<class Key,class Compare=std::less<Key> + ,class Allocator=std::allocator<Key> > +#endif +class set { + public: + // types: + typedef Key key_type; + typedef Key value_type; + typedef Compare key_compare; + typedef Compare value_compare; + typedef Allocator allocator_type; +#if (defined(G__GNUC) && !defined(G__KCC)) || defined(G__HPUX) + typedef Key* pointer; + typedef const Key* const_pointer; + typedef Key& reference; + typedef const Key& const_reference; + typedef size_t size_type; + typedef ptrdiff_t difference_type; +#else + typedef typename Allocator::pointer pointer; + typedef typename Allocator::const_pointer const_pointer; + typedef typename Allocator::reference reference; + typedef typename Allocator::const_reference const_reference; + typedef typename Allocator::size_type size_type; + typedef typename Allocator::difference_type difference_type; +#endif + + class iterator +#if defined(G__VISUAL) && (G__MSC_VER>=1300) + : public _Bidit<T, difference_type, const_pointer, const_reference> +#elif defined(G__VISUAL) + : public _Bidit<Key,difference_type> +#elif defined(G__SUNPRO_C) || defined(G__BORLANDCC5) +#elif (G__GNUC>=3 && G__GNUC_MINOR>=1) +#elif defined(G__INTEL_COMPILER) +#elif defined(G__KCC) +#elif defined(G__AIX) +#elif defined(G__ALPHA) +#else + : public bidirectional_iterator<Key,difference_type> +#endif + { + public: + iterator() ; + iterator(const iterator& x) ; +#if !defined(G__BORLAND) && !defined(G__KCC) && !(defined (G__SGI)&&!defined(G__GNU)) && !defined(G__ALPHA) + iterator& operator=(const iterator& x) ; +#endif +#if defined(G__VISUAL) || (defined(G__GNUC) && !defined(G__KCC)) + value_type operator*() const; +#else + value_type& operator*() const; +#endif + iterator& operator++(); + iterator operator++(int a); + iterator& operator--(); + iterator operator--(int a); +#ifdef G__VISUAL + bool operator==(const iterator& x) ; + bool operator!=(const iterator& x) ; +#endif +#ifdef G__HPUX + bool operator==(const iterator& x) ; +#endif + }; +#if defined(G__GNUC) && !defined(G__KCC) + friend bool operator==(const set::iterator& x ,const set::iterator& y) const; + friend bool operator!=(const set::iterator& x ,const set::iterator& y) const; +#endif +#ifdef G__HPUX + friend bool operator!=(const set::iterator& x,const set::iterator& y)const; +#endif + + class reverse_iterator +#if defined(G__VISUAL) && (G__MSC_VER>=1300) + : public _Bidit<T, difference_type, const_pointer, const_reference> +#elif defined(G__VISUAL) + : public _Bidit<Key,difference_type> +#elif defined(G__SUNPRO_C) || defined(G__BORLANDCC5) +#elif (G__GNUC>=3 && G__GNUC_MINOR>=1) +#elif defined(G__INTEL_COMPILER) +#elif defined(G__KCC) +#elif defined(G__AIX) +#elif defined(G__ALPHA) +#else + : public bidirectional_iterator<Key,difference_type> +#endif + { + public: + reverse_iterator(const reverse_iterator& x); +#if !defined(G__BORLAND) && !defined(G__KCC) && !(defined (G__SGI)&&!defined(G__GNU)) && !defined(G__ALPHA) + reverse_iterator& operator=(const reverse_iterator& x) ; +#endif +#if defined(G__VISUAL) || (defined(G__GNUC) && !defined(G__KCC)) + value_type operator*() const; +#else + value_type& operator*() const; +#endif + reverse_iterator& operator++(); + reverse_iterator operator++(int a); + reverse_iterator& operator--(); + reverse_iterator operator--(int a); + private: + }; + friend bool operator==(const set::reverse_iterator& x + ,const set::reverse_iterator& y) const; + friend bool operator!=(const set::reverse_iterator& x + ,const set::reverse_iterator& y) const; + + typedef const iterator const_iterator; + typedef const reverse_iterator const_reverse_iterator; + + // _lib.set.cons_ construct/copy/destroy: + //set(const Compare& comp=Compare(), const Allocator&=Allocator()); + set(); +#if 0 + template <class InputIterator> + set(InputIterator first, InputIterator last, + const Compare& comp = Compare(), const Allocator& = Allocator()); +#endif + set(const set& x); + ~set(); + set& operator= (const set& x); + //allocator_type get_allocator() const; + // iterators: + iterator begin(); + iterator end(); + reverse_iterator rbegin(); + reverse_iterator rend(); +#ifdef G__CONSTNESSFLAG + const_iterator begin(void) const; + const_iterator end(void) const; + const_reverse_iterator rbegin(void) const; + const_reverse_iterator rend(void) const; +#endif + + // capacity: + bool empty() const; + size_type size() const; + size_type max_size() const; + // modifiers: + pair<set::iterator,bool> insert(const Key& x); + iterator insert(iterator position, const Key& x); +#if 0 + template <class InputIterator> + void insert(InputIterator first, InputIterator last); +#endif + void erase(iterator position); +#if 0 + size_type erase(const key& x); +#endif + void erase(iterator first, iterator last); + void swap(set<Key,Compare,Allocator>&); + void clear(); + // observers: + //key_compare key_comp() const; + //value_compare value_comp() const; + // set operations: +#if defined(G__HPUX) || defined(G__VISUAL) + iterator find(const Key& x) ; +#elif defined(G__INTEL_COMPILER) || defined(G__AIX) + iterator find(const Key& x) ; + const_iterator find(const Key& x) const; +#else + iterator find(const Key& x) const; +#endif + size_type count(const Key& x) const; +#if defined(G__HPUX) || defined(G__VISUAL) + iterator lower_bound(const Key& x) ; + iterator upper_bound(const Key& x) ; +#elif defined(G__INTEL_COMPILER) || defined(G__AIX) + iterator lower_bound(const Key& x) ; + iterator upper_bound(const Key& x) ; + const_iterator lower_bound(const Key& x) const; + const_iterator upper_bound(const Key& x) const; +#else + iterator lower_bound(const Key& x) const; + iterator upper_bound(const Key& x) const; +#endif + //pair<iterator,iterator> equal_range(const Key& x) const; + + friend bool operator==(const set& x, const set& y); + friend bool operator< (const set& x, const set& y); + friend bool operator!=(const set& x, const set& y); + friend bool operator> (const set& x, const set& y); + friend bool operator>=(const set& x, const set& y); + friend bool operator<=(const set& x, const set& y); + // specialized algorithms: + //friend void swap(set& x, set& y); + + +#ifndef G__NOALGORITHM + // Generic algorithm +#if (defined(G__GNUC) && !defined (G__KCC)) || defined(G__BORLAND) + + friend set::iterator + find(set::iterator first,set::iterator last,const Key& value); + friend set::iterator + search(set::iterator first1,set::iterator last1, + set::iterator first2,set::iterator last2); + +#elif defined(G__VISUAL) + + friend void reverse(set::iterator first,set::iterator last); + + friend set::iterator + find(set::iterator first,set::iterator last,const Key& value); + friend set::iterator + search(set::iterator first1,set::iterator last1, + set::iterator first2,set::iterator last2); + friend set::iterator + copy(set::iterator first,set::iterator last, + set::iterator result); + friend void + fill(set::iterator first,set::iterator last,const Key& value); + +#endif // G__GNUC || G__BORLAND +#endif // G__NOALGORITHM + +}; + +#pragma endif