proxygen
folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container > Class Template Reference

#include <sorted_vector_types.h>

Inheritance diagram for folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >:
folly::detail::growth_policy_wrapper< GrowthPolicy >

Classes

struct  EBO
 

Public Types

typedef T value_type
 
typedef T key_type
 
typedef Compare key_compare
 
typedef Compare value_compare
 
typedef Container::pointer pointer
 
typedef Container::reference reference
 
typedef Container::const_reference const_reference
 
typedef Container::iterator iterator
 
typedef Container::const_iterator const_iterator
 
typedef Container::difference_type difference_type
 
typedef Container::size_type size_type
 
typedef Container::reverse_iterator reverse_iterator
 
typedef Container::const_reverse_iterator const_reverse_iterator
 

Public Member Functions

 sorted_vector_set (const Compare &comp=Compare(), const Allocator &alloc=Allocator())
 
template<class InputIterator >
 sorted_vector_set (InputIterator first, InputIterator last, const Compare &comp=Compare(), const Allocator &alloc=Allocator())
 
 sorted_vector_set (std::initializer_list< value_type > list, const Compare &comp=Compare(), const Allocator &alloc=Allocator())
 
 sorted_vector_set (Container &&container, const Compare &comp=Compare())
 
 sorted_vector_set (presorted_t, Container &&container, const Compare &comp=Compare())
 
sorted_vector_setoperator= (std::initializer_list< value_type > ilist)
 
key_compare key_comp () const
 
value_compare value_comp () const
 
iterator begin ()
 
iterator end ()
 
const_iterator cbegin () const
 
const_iterator begin () const
 
const_iterator cend () const
 
const_iterator end () const
 
reverse_iterator rbegin ()
 
reverse_iterator rend ()
 
const_reverse_iterator rbegin () const
 
const_reverse_iterator rend () const
 
void clear ()
 
size_type size () const
 
size_type max_size () const
 
bool empty () const
 
void reserve (size_type s)
 
void shrink_to_fit ()
 
size_type capacity () const
 
std::pair< iterator, bool > insert (const value_type &value)
 
std::pair< iterator, bool > insert (value_type &&value)
 
iterator insert (iterator hint, const value_type &value)
 
iterator insert (iterator hint, value_type &&value)
 
template<class InputIterator >
void insert (InputIterator first, InputIterator last)
 
size_type erase (const key_type &key)
 
iterator erase (iterator it)
 
iterator erase (iterator first, iterator last)
 
iterator find (const key_type &key)
 
const_iterator find (const key_type &key) const
 
template<typename K >
if_is_transparent< K, iteratorfind (const K &key)
 
template<typename K >
if_is_transparent< K, const_iteratorfind (const K &key) const
 
size_type count (const key_type &key) const
 
template<typename K >
if_is_transparent< K, size_typecount (const K &key) const
 
iterator lower_bound (const key_type &key)
 
const_iterator lower_bound (const key_type &key) const
 
template<typename K >
if_is_transparent< K, iteratorlower_bound (const K &key)
 
template<typename K >
if_is_transparent< K, const_iteratorlower_bound (const K &key) const
 
iterator upper_bound (const key_type &key)
 
const_iterator upper_bound (const key_type &key) const
 
template<typename K >
if_is_transparent< K, iteratorupper_bound (const K &key)
 
template<typename K >
if_is_transparent< K, const_iteratorupper_bound (const K &key) const
 
std::pair< iterator, iteratorequal_range (const key_type &key)
 
std::pair< const_iterator, const_iteratorequal_range (const key_type &key) const
 
template<typename K >
if_is_transparent< K, std::pair< iterator, iterator > > equal_range (const K &key)
 
template<typename K >
if_is_transparent< K, std::pair< const_iterator, const_iterator > > equal_range (const K &key) const
 
void swap (sorted_vector_set &o)
 
bool operator== (const sorted_vector_set &other) const
 
bool operator!= (const sorted_vector_set &other) const
 
bool operator< (const sorted_vector_set &other) const
 
bool operator> (const sorted_vector_set &other) const
 
bool operator<= (const sorted_vector_set &other) const
 
bool operator>= (const sorted_vector_set &other) const
 
const value_typedata () const noexcept
 

Private Types

template<typename K , typename V , typename C = Compare>
using if_is_transparent = _t< detail::sorted_vector_enable_if_is_transparent< void, C, K, V >>
 
template<typename Self >
using self_iterator_t = _t< std::conditional< std::is_const< Self >::value, const_iterator, iterator >>
 

Private Member Functions

detail::growth_policy_wrapper< GrowthPolicy > & get_growth_policy ()
 
- Private Member Functions inherited from folly::detail::growth_policy_wrapper< GrowthPolicy >
Iterator increase_capacity (Container &c, Iterator desired_insertion)
 

Static Private Member Functions

template<typename Self , typename K >
static self_iterator_t< Self > find (Self &self, K const &key)
 

Private Attributes

folly::sorted_vector_set::EBO m_
 

Detailed Description

template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
class folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >

A sorted_vector_set is a container similar to std::set<>, but implemented as a sorted array with std::vector<>.

Parameters
classT Data type to store
classCompare Comparison function that imposes a strict weak ordering over instances of T
classAllocator allocation policy
classGrowthPolicy policy object to control growth
Author
Aditya Agarwal adity.nosp@m.a@fb.nosp@m..com
Akhil Wable akhil.nosp@m.@fb..nosp@m.com
Jordan DeLong delon.nosp@m.g.j@.nosp@m.fb.co.nosp@m.m

Definition at line 228 of file sorted_vector_types.h.

Member Typedef Documentation

template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
typedef Container::const_iterator folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::const_iterator

Definition at line 252 of file sorted_vector_types.h.

template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
typedef Container::const_reference folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::const_reference

Definition at line 245 of file sorted_vector_types.h.

template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
typedef Container::const_reverse_iterator folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::const_reverse_iterator

Definition at line 256 of file sorted_vector_types.h.

template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
typedef Container::difference_type folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::difference_type

Definition at line 253 of file sorted_vector_types.h.

template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
template<typename K , typename V , typename C = Compare>
using folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::if_is_transparent = _t<detail::sorted_vector_enable_if_is_transparent<void, C, K, V>>
private

Definition at line 235 of file sorted_vector_types.h.

template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
typedef Container::iterator folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::iterator

Definition at line 251 of file sorted_vector_types.h.

template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
typedef Compare folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::key_compare

Definition at line 240 of file sorted_vector_types.h.

template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
typedef T folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::key_type

Definition at line 239 of file sorted_vector_types.h.

template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
typedef Container::pointer folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::pointer

Definition at line 243 of file sorted_vector_types.h.

template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
typedef Container::reference folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::reference

Definition at line 244 of file sorted_vector_types.h.

template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
typedef Container::reverse_iterator folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::reverse_iterator

Definition at line 255 of file sorted_vector_types.h.

template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
template<typename Self >
using folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::self_iterator_t = _t< std::conditional<std::is_const<Self>::value, const_iterator, iterator>>
private

Definition at line 564 of file sorted_vector_types.h.

template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
typedef Container::size_type folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::size_type

Definition at line 254 of file sorted_vector_types.h.

template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
typedef Compare folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::value_compare

Definition at line 241 of file sorted_vector_types.h.

template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
typedef T folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::value_type

Definition at line 238 of file sorted_vector_types.h.

Constructor & Destructor Documentation

template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::sorted_vector_set ( const Compare &  comp = Compare(),
const Allocator &  alloc = Allocator() 
)
inlineexplicit

Definition at line 258 of file sorted_vector_types.h.

261  : m_(comp, alloc) {}
folly::sorted_vector_set::EBO m_
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
template<class InputIterator >
folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::sorted_vector_set ( InputIterator  first,
InputIterator  last,
const Compare &  comp = Compare(),
const Allocator &  alloc = Allocator() 
)
inlineexplicit

Definition at line 264 of file sorted_vector_types.h.

269  : m_(comp, alloc) {
270  // This is linear if [first, last) is already sorted (and if we
271  // can figure out the distance between the two iterators).
272  insert(first, last);
273  }
std::pair< iterator, bool > insert(const value_type &value)
folly::sorted_vector_set::EBO m_
constexpr detail::First first
Definition: Base-inl.h:2553
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::sorted_vector_set ( std::initializer_list< value_type list,
const Compare &  comp = Compare(),
const Allocator &  alloc = Allocator() 
)
inline

Definition at line 275 of file sorted_vector_types.h.

279  : m_(comp, alloc) {
280  insert(list.begin(), list.end());
281  }
std::pair< iterator, bool > insert(const value_type &value)
folly::sorted_vector_set::EBO m_
Encoder::MutableCompressedList list
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::sorted_vector_set ( Container &&  container,
const Compare &  comp = Compare() 
)
inlineexplicit

Definition at line 291 of file sorted_vector_types.h.

295  presorted,
296  detail::as_sorted(std::move(container), comp),
297  comp) {}
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
sorted_vector_set(const Compare &comp=Compare(), const Allocator &alloc=Allocator())
constexpr presorted_t presorted
Definition: Utility.h:311
Container && as_sorted(Container &&container, Compare const &comp)
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::sorted_vector_set ( presorted_t  ,
Container &&  container,
const Compare &  comp = Compare() 
)
inline

Definition at line 308 of file sorted_vector_types.h.

312  : m_(comp, container.get_allocator()) {
313  assert(std::is_sorted(container.begin(), container.end(), value_comp()));
314  m_.cont_.swap(container);
315  }
value_compare value_comp() const
folly::sorted_vector_set::EBO m_

Member Function Documentation

template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
iterator folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::begin ( )
inline

Definition at line 330 of file sorted_vector_types.h.

Referenced by extractValues(), and TEST().

330  {
331  return m_.cont_.begin();
332  }
folly::sorted_vector_set::EBO m_
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
const_iterator folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::begin ( ) const
inline

Definition at line 339 of file sorted_vector_types.h.

339  {
340  return m_.cont_.begin();
341  }
folly::sorted_vector_set::EBO m_
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
size_type folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::capacity ( ) const
inline

Definition at line 379 of file sorted_vector_types.h.

Referenced by TEST().

379  {
380  return m_.cont_.capacity();
381  }
folly::sorted_vector_set::EBO m_
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
const_iterator folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::cbegin ( ) const
inline

Definition at line 336 of file sorted_vector_types.h.

336  {
337  return m_.cont_.cbegin();
338  }
folly::sorted_vector_set::EBO m_
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
const_iterator folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::cend ( ) const
inline

Definition at line 342 of file sorted_vector_types.h.

342  {
343  return m_.cont_.cend();
344  }
folly::sorted_vector_set::EBO m_
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
void folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::clear ( )
inline

Definition at line 361 of file sorted_vector_types.h.

361  {
362  return m_.cont_.clear();
363  }
folly::sorted_vector_set::EBO m_
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
size_type folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::count ( const key_type key) const
inline

Definition at line 445 of file sorted_vector_types.h.

Referenced by TEST().

445  {
446  return find(key) == end() ? 0 : 1;
447  }
iterator find(const key_type &key)
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
template<typename K >
if_is_transparent<K, size_type> folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::count ( const K &  key) const
inline

Definition at line 450 of file sorted_vector_types.h.

450  {
451  return find(key) == end() ? 0 : 1;
452  }
iterator find(const key_type &key)
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
const value_type* folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::data ( ) const
inlinenoexcept

Definition at line 540 of file sorted_vector_types.h.

540  {
541  return m_.cont_.data();
542  }
folly::sorted_vector_set::EBO m_
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
bool folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::empty ( ) const
inline

Definition at line 370 of file sorted_vector_types.h.

Referenced by TEST().

370  {
371  return m_.cont_.empty();
372  }
folly::sorted_vector_set::EBO m_
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
iterator folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::end ( )
inline

Definition at line 333 of file sorted_vector_types.h.

Referenced by extractValues(), and TEST().

333  {
334  return m_.cont_.end();
335  }
folly::sorted_vector_set::EBO m_
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
const_iterator folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::end ( ) const
inline

Definition at line 345 of file sorted_vector_types.h.

345  {
346  return m_.cont_.end();
347  }
folly::sorted_vector_set::EBO m_
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
std::pair<iterator, iterator> folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::equal_range ( const key_type key)
inline

Definition at line 490 of file sorted_vector_types.h.

Referenced by TEST().

490  {
491  return std::equal_range(begin(), end(), key, key_comp());
492  }
key_compare key_comp() const
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
std::pair<const_iterator, const_iterator> folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::equal_range ( const key_type key) const
inline

Definition at line 494 of file sorted_vector_types.h.

495  {
496  return std::equal_range(begin(), end(), key, key_comp());
497  }
key_compare key_comp() const
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
template<typename K >
if_is_transparent<K, std::pair<iterator, iterator> > folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::equal_range ( const K &  key)
inline

Definition at line 500 of file sorted_vector_types.h.

501  {
502  return std::equal_range(begin(), end(), key, key_comp());
503  }
key_compare key_comp() const
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
template<typename K >
if_is_transparent<K, std::pair<const_iterator, const_iterator> > folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::equal_range ( const K &  key) const
inline

Definition at line 506 of file sorted_vector_types.h.

507  {
508  return std::equal_range(begin(), end(), key, key_comp());
509  }
key_compare key_comp() const
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
size_type folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::erase ( const key_type key)
inline

Definition at line 410 of file sorted_vector_types.h.

Referenced by TEST().

410  {
411  iterator it = find(key);
412  if (it == end()) {
413  return 0;
414  }
415  m_.cont_.erase(it);
416  return 1;
417  }
Container::iterator iterator
iterator find(const key_type &key)
folly::sorted_vector_set::EBO m_
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
iterator folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::erase ( iterator  it)
inline

Definition at line 419 of file sorted_vector_types.h.

419  {
420  return m_.cont_.erase(it);
421  }
folly::sorted_vector_set::EBO m_
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
iterator folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::erase ( iterator  first,
iterator  last 
)
inline

Definition at line 423 of file sorted_vector_types.h.

423  {
424  return m_.cont_.erase(first, last);
425  }
folly::sorted_vector_set::EBO m_
constexpr detail::First first
Definition: Base-inl.h:2553
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
iterator folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::find ( const key_type key)
inline

Definition at line 427 of file sorted_vector_types.h.

Referenced by TEST().

427  {
428  return find(*this, key);
429  }
iterator find(const key_type &key)
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
const_iterator folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::find ( const key_type key) const
inline

Definition at line 431 of file sorted_vector_types.h.

431  {
432  return find(*this, key);
433  }
iterator find(const key_type &key)
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
template<typename K >
if_is_transparent<K, iterator> folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::find ( const K &  key)
inline

Definition at line 436 of file sorted_vector_types.h.

436  {
437  return find(*this, key);
438  }
iterator find(const key_type &key)
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
template<typename K >
if_is_transparent<K, const_iterator> folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::find ( const K &  key) const
inline

Definition at line 441 of file sorted_vector_types.h.

441  {
442  return find(*this, key);
443  }
iterator find(const key_type &key)
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
template<typename Self , typename K >
static self_iterator_t<Self> folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::find ( Self &  self,
K const &  key 
)
inlinestaticprivate

Definition at line 567 of file sorted_vector_types.h.

567  {
568  auto end = self.end();
569  auto it = self.lower_bound(key);
570  if (it == end || !self.key_comp()(key, *it)) {
571  return it;
572  }
573  return end;
574  }
key_compare key_comp() const
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
detail::growth_policy_wrapper<GrowthPolicy>& folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::get_growth_policy ( )
inlineprivate

Definition at line 229 of file sorted_vector_types.h.

229  {
230  return *this;
231  }
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
std::pair<iterator, bool> folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::insert ( const value_type value)
inline

Definition at line 383 of file sorted_vector_types.h.

Referenced by TEST().

383  {
384  return insert(std::move(value_type(value)));
385  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
std::pair< iterator, bool > insert(const value_type &value)
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
std::pair<iterator, bool> folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::insert ( value_type &&  value)
inline

Definition at line 387 of file sorted_vector_types.h.

387  {
388  iterator it = lower_bound(value);
389  if (it == end() || value_comp()(value, *it)) {
391  return std::make_pair(m_.cont_.insert(it, std::move(value)), true);
392  }
393  return std::make_pair(it, false);
394  }
Container::iterator iterator
detail::growth_policy_wrapper< GrowthPolicy > & get_growth_policy()
value_compare value_comp() const
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
Iterator increase_capacity(Container &c, Iterator desired_insertion)
folly::sorted_vector_set::EBO m_
iterator lower_bound(const key_type &key)
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
iterator folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::insert ( iterator  hint,
const value_type value 
)
inline

Definition at line 396 of file sorted_vector_types.h.

396  {
397  return insert(hint, std::move(value_type(value)));
398  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
std::pair< iterator, bool > insert(const value_type &value)
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
iterator folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::insert ( iterator  hint,
value_type &&  value 
)
inline

Definition at line 400 of file sorted_vector_types.h.

400  {
402  *this, m_.cont_, hint, std::move(value), get_growth_policy());
403  }
detail::growth_policy_wrapper< GrowthPolicy > & get_growth_policy()
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
OurContainer::iterator insert_with_hint(OurContainer &sorted, Vector &cont, typename OurContainer::iterator hint, typename OurContainer::value_type &&value, GrowthPolicy &po)
folly::sorted_vector_set::EBO m_
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
template<class InputIterator >
void folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::insert ( InputIterator  first,
InputIterator  last 
)
inline

Definition at line 406 of file sorted_vector_types.h.

406  {
407  detail::bulk_insert(*this, m_.cont_, first, last);
408  }
folly::sorted_vector_set::EBO m_
void bulk_insert(OurContainer &sorted, Vector &cont, InputIterator first, InputIterator last)
constexpr detail::First first
Definition: Base-inl.h:2553
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
key_compare folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::key_comp ( ) const
inline

Definition at line 323 of file sorted_vector_types.h.

323  {
324  return m_;
325  }
folly::sorted_vector_set::EBO m_
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
iterator folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::lower_bound ( const key_type key)
inline

Definition at line 454 of file sorted_vector_types.h.

Referenced by TEST().

454  {
455  return std::lower_bound(begin(), end(), key, key_comp());
456  }
key_compare key_comp() const
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
const_iterator folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::lower_bound ( const key_type key) const
inline

Definition at line 458 of file sorted_vector_types.h.

458  {
459  return std::lower_bound(begin(), end(), key, key_comp());
460  }
key_compare key_comp() const
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
template<typename K >
if_is_transparent<K, iterator> folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::lower_bound ( const K &  key)
inline

Definition at line 463 of file sorted_vector_types.h.

463  {
464  return std::lower_bound(begin(), end(), key, key_comp());
465  }
key_compare key_comp() const
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
template<typename K >
if_is_transparent<K, const_iterator> folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::lower_bound ( const K &  key) const
inline

Definition at line 468 of file sorted_vector_types.h.

468  {
469  return std::lower_bound(begin(), end(), key, key_comp());
470  }
key_compare key_comp() const
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
size_type folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::max_size ( ) const
inline

Definition at line 367 of file sorted_vector_types.h.

367  {
368  return m_.cont_.max_size();
369  }
folly::sorted_vector_set::EBO m_
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
bool folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::operator!= ( const sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container > &  other) const
inline

Definition at line 523 of file sorted_vector_types.h.

523  {
524  return !operator==(other);
525  }
bool operator==(const sorted_vector_set &other) const
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
bool folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::operator< ( const sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container > &  other) const
inline

Definition at line 527 of file sorted_vector_types.h.

527  {
528  return m_.cont_ < other.m_.cont_;
529  }
folly::sorted_vector_set::EBO m_
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
bool folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::operator<= ( const sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container > &  other) const
inline

Definition at line 533 of file sorted_vector_types.h.

533  {
534  return !operator>(other);
535  }
bool operator>(const sorted_vector_set &other) const
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
sorted_vector_set& folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::operator= ( std::initializer_list< value_type ilist)
inline

Definition at line 317 of file sorted_vector_types.h.

317  {
318  clear();
319  insert(ilist.begin(), ilist.end());
320  return *this;
321  }
std::pair< iterator, bool > insert(const value_type &value)
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
bool folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::operator== ( const sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container > &  other) const
inline

Definition at line 520 of file sorted_vector_types.h.

520  {
521  return other.m_.cont_ == m_.cont_;
522  }
folly::sorted_vector_set::EBO m_
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
bool folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::operator> ( const sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container > &  other) const
inline

Definition at line 530 of file sorted_vector_types.h.

530  {
531  return other < *this;
532  }
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
bool folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::operator>= ( const sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container > &  other) const
inline

Definition at line 536 of file sorted_vector_types.h.

536  {
537  return !operator<(other);
538  }
bool operator<(const sorted_vector_set &other) const
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
reverse_iterator folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::rbegin ( )
inline

Definition at line 348 of file sorted_vector_types.h.

348  {
349  return m_.cont_.rbegin();
350  }
folly::sorted_vector_set::EBO m_
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
const_reverse_iterator folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::rbegin ( ) const
inline

Definition at line 354 of file sorted_vector_types.h.

354  {
355  return m_.cont_.rbegin();
356  }
folly::sorted_vector_set::EBO m_
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
reverse_iterator folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::rend ( )
inline

Definition at line 351 of file sorted_vector_types.h.

351  {
352  return m_.cont_.rend();
353  }
folly::sorted_vector_set::EBO m_
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
const_reverse_iterator folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::rend ( ) const
inline

Definition at line 357 of file sorted_vector_types.h.

357  {
358  return m_.cont_.rend();
359  }
folly::sorted_vector_set::EBO m_
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
void folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::reserve ( size_type  s)
inline

Definition at line 373 of file sorted_vector_types.h.

373  {
374  return m_.cont_.reserve(s);
375  }
folly::sorted_vector_set::EBO m_
static set< string > s
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
void folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::shrink_to_fit ( )
inline

Definition at line 376 of file sorted_vector_types.h.

Referenced by TEST().

376  {
377  m_.cont_.shrink_to_fit();
378  }
folly::sorted_vector_set::EBO m_
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
size_type folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::size ( ) const
inline

Definition at line 364 of file sorted_vector_types.h.

Referenced by TEST().

364  {
365  return m_.cont_.size();
366  }
folly::sorted_vector_set::EBO m_
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
void folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::swap ( sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container > &  o)
inline

Definition at line 512 of file sorted_vector_types.h.

Referenced by folly::swap(), and TEST().

512  {
513  using std::swap; // Allow ADL for swap(); fall back to std::swap().
514  Compare& a = m_;
515  Compare& b = o.m_;
516  swap(a, b);
517  m_.cont_.swap(o.m_.cont_);
518  }
char b
void swap(sorted_vector_map< K, V, C, A, G > &a, sorted_vector_map< K, V, C, A, G > &b)
folly::sorted_vector_set::EBO m_
char a
void swap(sorted_vector_set &o)
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
iterator folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::upper_bound ( const key_type key)
inline

Definition at line 472 of file sorted_vector_types.h.

Referenced by TEST().

472  {
473  return std::upper_bound(begin(), end(), key, key_comp());
474  }
key_compare key_comp() const
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
const_iterator folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::upper_bound ( const key_type key) const
inline

Definition at line 476 of file sorted_vector_types.h.

476  {
477  return std::upper_bound(begin(), end(), key, key_comp());
478  }
key_compare key_comp() const
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
template<typename K >
if_is_transparent<K, iterator> folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::upper_bound ( const K &  key)
inline

Definition at line 481 of file sorted_vector_types.h.

481  {
482  return std::upper_bound(begin(), end(), key, key_comp());
483  }
key_compare key_comp() const
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
template<typename K >
if_is_transparent<K, const_iterator> folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::upper_bound ( const K &  key) const
inline

Definition at line 486 of file sorted_vector_types.h.

486  {
487  return std::upper_bound(begin(), end(), key, key_comp());
488  }
key_compare key_comp() const
template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
value_compare folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::value_comp ( ) const
inline

Definition at line 326 of file sorted_vector_types.h.

326  {
327  return m_;
328  }
folly::sorted_vector_set::EBO m_

Member Data Documentation

template<class T, class Compare = std::less<T>, class Allocator = std::allocator<T>, class GrowthPolicy = void, class Container = std::vector<T, Allocator>>
folly::sorted_vector_set::EBO folly::sorted_vector_set< T, Compare, Allocator, GrowthPolicy, Container >::m_
private

The documentation for this class was generated from the following file: