38 #ifndef BLOCXX_SORTED_VECTOR_SET_HPP_ 39 #define BLOCXX_SORTED_VECTOR_SET_HPP_ 40 #include "blocxx/BLOCXX_config.h" 50 template<
class T,
class Compare >
53 template<
class T,
class Compare>
57 template<
class T,
class Compare>
61 template<
class T,
class Compare = std::less<T> >
66 #pragma warning (push) 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));
237 template<
class T,
class Compare>
243 template<
class T,
class Compare>
249 template <
class T,
class Compare>
iterator lower_bound(const key_type &x)
const_iterator lower_bound(const key_type &x) const
void swap(SortedVectorSet< T, Compare > &x)
container_t::size_type size_type
const_reverse_iterator rend() const
std::vector< T > container_t
container_t::const_iterator const_iterator
iterator upper_bound(const key_type &x)
container_t::iterator iterator
size_type count(const key_type &x) const
void swap(Array< T > &x, Array< T > &y)
This String class is an abstract data type that represents as NULL terminated string of characters.
iterator erase(iterator first, iterator last)
void swap(COWReference< T > &arg)
const_iterator upper_bound(const key_type &x) const
container_t::const_reverse_iterator const_reverse_iterator
iterator erase(iterator position)
SortedVectorSet(container_t *toWrap)
const_iterator find(const key_type &x) const
static bool equivalent(const key_type &x, const key_type &y)
container_t::reverse_iterator reverse_iterator
bool operator==(const Array< T > &x, const Array< T > &y)
std::pair< const_iterator, const_iterator > equal_range(const key_type &x) const
container_t::reference reference
void insert(InputIterator first, InputIterator last)
size_type max_size() const
const_iterator end() const
std::pair< iterator, bool > insert(const value_type &x)
COWReference< container_t > m_impl
const_iterator begin() const
container_t::const_pointer const_pointer
std::pair< iterator, iterator > equal_range(const key_type &x)
container_t::const_reference const_reference
bool operator<(const Array< T > &x, const Array< T > &y)
container_t::pointer pointer
const_reverse_iterator rbegin() const
iterator insert(iterator, const value_type &x)
size_type erase(const key_type &x)
SortedVectorSet(InputIterator first, InputIterator last)
iterator find(const key_type &x)
container_t::difference_type difference_type