38#ifndef BLOCXX_SORTED_VECTOR_SET_HPP_
39#define BLOCXX_SORTED_VECTOR_SET_HPP_
40#include "blocxx/BLOCXX_config.h"
50template<
class T,
class Compare >
53template<
class T,
class Compare>
54inline bool operator==(
const SortedVectorSet<T, Compare>& x,
55 const SortedVectorSet<T, Compare>& y);
57template<
class T,
class Compare>
58inline bool operator<(
const SortedVectorSet<T, Compare>& x,
59 const SortedVectorSet<T, Compare>& y);
61template<
class T,
class Compare = std::less<T> >
67#pragma warning (disable: 4251)
79 typedef typename container_t::pointer
pointer;
83 typedef typename container_t::iterator
iterator;
95 template <
class InputIterator>
118 return std::pair<iterator, bool>(
i,
false);
122 return std::pair<iterator, bool>(
m_impl->insert(
i, x),
true);
129 template <
class InputIterator>
130 void insert(InputIterator first, InputIterator last)
138 return m_impl->erase(position);
155 return m_impl->erase(first, last);
187 if (std::binary_search(
m_impl->begin(),
m_impl->end(), x, Compare()))
198 return std::lower_bound(
m_impl->begin(),
m_impl->end(), x, Compare());
202 return std::lower_bound(
m_impl->begin(),
m_impl->end(), x, Compare());
206 return std::upper_bound(
m_impl->begin(),
m_impl->end(), x, Compare());
210 return std::upper_bound(
m_impl->begin(),
m_impl->end(), x, Compare());
213 std::pair<iterator, iterator>
216 return std::equal_range(
m_impl->begin(),
m_impl->end(), x, Compare());
219 std::pair<const_iterator, const_iterator>
222 return std::equal_range(
m_impl->begin(),
m_impl->end(), x, Compare());
234 return (!Compare()(x, y) && !Compare()(y, x));
237template<
class T,
class Compare>
243template<
class T,
class Compare>
249template <
class T,
class Compare>
COWReference A smart pointer that uses non-intrusive reference counting.
void swap(COWReference< T > &arg)
iterator erase(iterator first, iterator last)
container_t::reference reference
const_iterator end() const
iterator find(const key_type &x)
iterator upper_bound(const key_type &x)
const_reverse_iterator rend() const
size_type max_size() const
size_type erase(const key_type &x)
COWReference< container_t > m_impl
const_iterator find(const key_type &x) const
static bool equivalent(const key_type &x, const key_type &y)
size_type count(const key_type &x) const
const_iterator upper_bound(const key_type &x) const
friend bool operator==(const SortedVectorSet< T, Compare > &x, const SortedVectorSet< T, Compare > &y)
SortedVectorSet(container_t *toWrap)
std::pair< iterator, iterator > equal_range(const key_type &x)
container_t::const_pointer const_pointer
iterator erase(iterator position)
container_t::iterator iterator
const_reverse_iterator rbegin() const
iterator lower_bound(const key_type &x)
SortedVectorSet(InputIterator first, InputIterator last)
std::pair< iterator, bool > insert(const value_type &x)
container_t::difference_type difference_type
iterator insert(iterator, const value_type &x)
const_iterator lower_bound(const key_type &x) const
container_t::size_type size_type
container_t::reverse_iterator reverse_iterator
container_t::pointer pointer
container_t::const_reference const_reference
container_t::const_reverse_iterator const_reverse_iterator
void swap(SortedVectorSet< T, Compare > &x)
container_t::const_iterator const_iterator
std::pair< const_iterator, const_iterator > equal_range(const key_type &x) const
std::vector< T > container_t
void insert(InputIterator first, InputIterator last)
const_iterator begin() const
bool operator<(const Array< T > &x, const Array< T > &y)
bool operator==(const Array< T > &x, const Array< T > &y)
void swap(Array< T > &x, Array< T > &y)