25#define VERSION_SORTED_VECTOR_ 0x00010010
34#pragma warning(push,3)
40 template<
class K,
bool bNoDuplicates= false,
class Pr = std::less<K>,
class A = std::allocator<K> >
44 typedef std::vector<K,A>
Cont;
57 typedef Cont::const_reverse_iterator
61 typedef std::pair<iterator, iterator>
Pairii_;
62 typedef std::pair<const_iterator, const_iterator>
Paircc_;
63 typedef std::pair<iterator, bool>
Pairib_;
69 const Pr& pred = Pr(),
const A& al = A())
74 const Pr& pred = Pr(),
const A& al = A())
95 {
return vec_.rbegin();}
109 {
return vec_.operator[](p);}
119 {
vec_.assign(first,beyond);}
157#if (_MSC_VER >= 1300)
159 void insert(It first, It beyond)
161 size_type n= std::distance(first,beyond);
163 for( ;first!=beyond;++first){
170 size_type n= std::distance(first,beyond);
172 for( ;first!=beyond;++first){
179 {
return vec_.erase(first,beyond);}
183 size_type n= std::distance(begEnd.first,begEnd.second);
184 erase(begEnd.first,begEnd.second);
193 {
return (std::lexicographical_compare(
begin(),
end(),
212 size_type n = std::distance(Ans_.first, Ans_.second);
246 for(
iterator prev_; (prev_=front_)!=end_ && ++front_!=end_; ){
253 if(!bCopy_){out_=front_;bCopy_=
true;}
259 {
return vec_.insert(p,x);}
272template<
class K,
bool bNoDuplicates,
class Pr,
class A>
inline
276template<
class K,
bool bNoDuplicates,
class Pr,
class A>
inline
279 {
return !(x == Y_); }
280template<
class K,
bool bNoDuplicates,
class Pr,
class A>
inline
284template<
class K,
bool bNoDuplicates,
class Pr,
class A>
inline
288template<
class K,
bool bNoDuplicates,
class Pr,
class A>
inline
292template<
class K,
bool bNoDuplicates,
class Pr,
class A>
inline
295 {
return (!(x < Y_)); }
299#elif VERSION_SORTED_VECTOR_ != 0x00010010
300#error You have included two sorted_vector.h with different version numbers
sorted_vector(const Myt_ &x)
const_reference operator[](size_type p) const
const_reverse_iterator rbegin() const
bool KeyCompare_Geq_(const K &ty0, const K &ty1)
Cont::reference reference
iterator erase(iterator first, iterator beyond)
void insert(const_iterator first, const_iterator beyond)
Cont::const_iterator const_iterator
void assign(size_type n, const K &x=K())
Cont::difference_type difference_type
const_reference back() const
const_reference at(size_type p) const
Cont::reverse_iterator reverse_iterator
bool KeyCompare_Gt_(const K &ty0, const K &ty1)
std::pair< iterator, bool > Pairib_
std::pair< iterator, iterator > Pairii_
Pairib_ insert(const value_type &x)
void assign(const_iterator first, const_iterator beyond)
Pairii_ equal_range(const K &k)
sorted_vector(const Pr &pred=Pr(), const A &al=A())
reverse_iterator rbegin()
const_iterator find(const K &k) const
Myt_ & operator=(const Myt_ &x)
const_iterator begin() const
const_iterator upper_bound(const K &k) const
friend void swap(Myt_ &x, Myt_ &Y_)
bool Lt_(const Myt_ &x) const
iterator upper_bound(const K &k)
iterator insert(iterator it, const value_type &x)
bool Eq_(const Myt_ &x) const
Cont::allocator_type allocator_type
std::pair< const_iterator, const_iterator > Paircc_
const_reference front() const
iterator lower_bound(const K &k)
size_type count(const K &k) const
reference at(size_type p)
Cont::size_type size_type
key_compare key_comp() const
reference operator[](size_type p)
sorted_vector< K, bNoDuplicates, Pr, A > Myt_
size_type max_size() const
const_iterator lower_bound(const K &k) const
Paircc_ equal_range(const K &k) const
iterator InsertImpl_(iterator p, const value_type &x)
const_reverse_iterator rend() const
void reserve(size_type n)
Myt_ & operator=(const Cont &x)
value_compare value_comp() const
Cont::const_reference const_reference
iterator erase(iterator p)
Cont::const_reverse_iterator const_reverse_iterator
Cont::value_type value_type
sorted_vector(const_iterator first, const_iterator beyond, const Pr &pred=Pr(), const A &al=A())
const_iterator end() const
bool KeyCompare_Leq_(const K &ty0, const K &ty1)
size_type erase(const K &key)
iterator find(const K &k)
bool operator==(const sorted_vector< K, bNoDuplicates, Pr, A > &x, const sorted_vector< K, bNoDuplicates, Pr, A > &Y_)
bool operator!=(const sorted_vector< K, bNoDuplicates, Pr, A > &x, const sorted_vector< K, bNoDuplicates, Pr, A > &Y_)
bool operator<=(const sorted_vector< K, bNoDuplicates, Pr, A > &x, const sorted_vector< K, bNoDuplicates, Pr, A > &Y_)
bool operator>=(const sorted_vector< K, bNoDuplicates, Pr, A > &x, const sorted_vector< K, bNoDuplicates, Pr, A > &Y_)
bool operator<(const sorted_vector< K, bNoDuplicates, Pr, A > &x, const sorted_vector< K, bNoDuplicates, Pr, A > &Y_)
bool operator>(const sorted_vector< K, bNoDuplicates, Pr, A > &x, const sorted_vector< K, bNoDuplicates, Pr, A > &Y_)