Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
tsl::detail_robin_hash::robin_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, StoreHash, GrowthPolicy >::robin_iterator< IsConst > Class Template Reference

#include <robin_hash.h>

Public Types

using difference_type = std::ptrdiff_t
 
using iterator_category = std::forward_iterator_tag
 
using pointer = value_type *
 
using reference = value_type &
 
using value_type = const typename robin_hash::value_type
 

Public Member Functions

const robin_hash::key_typekey () const
 
reference operator* () const
 
robin_iteratoroperator++ ()
 
robin_iterator operator++ (int)
 
pointer operator-> () const
 
robin_iteratoroperator= (const robin_iterator &other)=default
 
robin_iteratoroperator= (robin_iterator &&other)=default
 
 robin_iterator () noexcept
 
 robin_iterator (const robin_iterator &other)=default
 
template<bool TIsConst = IsConst, typename std::enable_if< TIsConst >::type * = nullptr>
 robin_iterator (const robin_iterator<!TIsConst > &other) noexcept
 
 robin_iterator (robin_iterator &&other)=default
 
template<class U = ValueSelect, typename std::enable_if< has_mapped_type< U >::value &&IsConst >::type * = nullptr>
const U::value_type & value () const
 
template<class U = ValueSelect, typename std::enable_if< has_mapped_type< U >::value &&!IsConst >::type * = nullptr>
U::value_type & value () const
 

Private Types

using bucket_entry_ptr = typename std::conditional< IsConst, const bucket_entry *, bucket_entry * >::type
 

Private Member Functions

 robin_iterator (bucket_entry_ptr bucket) noexcept
 

Private Attributes

bucket_entry_ptr m_bucket
 

Friends

bool operator!= (const robin_iterator &lhs, const robin_iterator &rhs)
 
bool operator== (const robin_iterator &lhs, const robin_iterator &rhs)
 
class robin_hash
 

Detailed Description

template<class ValueType, class KeySelect, class ValueSelect, class Hash, class KeyEqual, class Allocator, bool StoreHash, class GrowthPolicy>
template<bool IsConst>
class tsl::detail_robin_hash::robin_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, StoreHash, GrowthPolicy >::robin_iterator< IsConst >

The 'operator*()' and 'operator->()' methods return a const reference and const pointer respectively to the stored value type.

In case of a map, to get a mutable reference to the value associated to a key (the '.second' in the stored pair), you have to call 'value()'.

The main reason for this is that if we returned a std::pair<Key, T>& instead of a const std::pair<Key, T>&, the user may modify the key which will put the map in a undefined state.

Definition at line 376 of file robin_hash.h.

Member Typedef Documentation

◆ bucket_entry_ptr

template<class ValueType , class KeySelect , class ValueSelect , class Hash , class KeyEqual , class Allocator , bool StoreHash, class GrowthPolicy >
template<bool IsConst>
using tsl::detail_robin_hash::robin_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, StoreHash, GrowthPolicy >::robin_iterator< IsConst >::bucket_entry_ptr = typename std::conditional<IsConst, const bucket_entry*, bucket_entry*>::type
private

Definition at line 462 of file robin_hash.h.

◆ difference_type

template<class ValueType , class KeySelect , class ValueSelect , class Hash , class KeyEqual , class Allocator , bool StoreHash, class GrowthPolicy >
template<bool IsConst>
using tsl::detail_robin_hash::robin_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, StoreHash, GrowthPolicy >::robin_iterator< IsConst >::difference_type = std::ptrdiff_t

Definition at line 469 of file robin_hash.h.

◆ iterator_category

template<class ValueType , class KeySelect , class ValueSelect , class Hash , class KeyEqual , class Allocator , bool StoreHash, class GrowthPolicy >
template<bool IsConst>
using tsl::detail_robin_hash::robin_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, StoreHash, GrowthPolicy >::robin_iterator< IsConst >::iterator_category = std::forward_iterator_tag

Definition at line 467 of file robin_hash.h.

◆ pointer

template<class ValueType , class KeySelect , class ValueSelect , class Hash , class KeyEqual , class Allocator , bool StoreHash, class GrowthPolicy >
template<bool IsConst>
using tsl::detail_robin_hash::robin_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, StoreHash, GrowthPolicy >::robin_iterator< IsConst >::pointer = value_type*

Definition at line 471 of file robin_hash.h.

◆ reference

template<class ValueType , class KeySelect , class ValueSelect , class Hash , class KeyEqual , class Allocator , bool StoreHash, class GrowthPolicy >
template<bool IsConst>
using tsl::detail_robin_hash::robin_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, StoreHash, GrowthPolicy >::robin_iterator< IsConst >::reference = value_type&

Definition at line 470 of file robin_hash.h.

◆ value_type

template<class ValueType , class KeySelect , class ValueSelect , class Hash , class KeyEqual , class Allocator , bool StoreHash, class GrowthPolicy >
template<bool IsConst>
using tsl::detail_robin_hash::robin_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, StoreHash, GrowthPolicy >::robin_iterator< IsConst >::value_type = const typename robin_hash::value_type

Definition at line 468 of file robin_hash.h.

Constructor & Destructor Documentation

◆ robin_iterator() [1/5]

template<class ValueType , class KeySelect , class ValueSelect , class Hash , class KeyEqual , class Allocator , bool StoreHash, class GrowthPolicy >
template<bool IsConst>
tsl::detail_robin_hash::robin_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, StoreHash, GrowthPolicy >::robin_iterator< IsConst >::robin_iterator ( bucket_entry_ptr  bucket)
inlineprivatenoexcept

Definition at line 464 of file robin_hash.h.

◆ robin_iterator() [2/5]

template<class ValueType , class KeySelect , class ValueSelect , class Hash , class KeyEqual , class Allocator , bool StoreHash, class GrowthPolicy >
template<bool IsConst>
tsl::detail_robin_hash::robin_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, StoreHash, GrowthPolicy >::robin_iterator< IsConst >::robin_iterator ( )
inlinenoexcept

Definition at line 473 of file robin_hash.h.

◆ robin_iterator() [3/5]

template<class ValueType , class KeySelect , class ValueSelect , class Hash , class KeyEqual , class Allocator , bool StoreHash, class GrowthPolicy >
template<bool IsConst>
template<bool TIsConst = IsConst, typename std::enable_if< TIsConst >::type * = nullptr>
tsl::detail_robin_hash::robin_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, StoreHash, GrowthPolicy >::robin_iterator< IsConst >::robin_iterator ( const robin_iterator<!TIsConst > &  other)
inlinenoexcept

Definition at line 478 of file robin_hash.h.

◆ robin_iterator() [4/5]

template<class ValueType , class KeySelect , class ValueSelect , class Hash , class KeyEqual , class Allocator , bool StoreHash, class GrowthPolicy >
template<bool IsConst>
tsl::detail_robin_hash::robin_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, StoreHash, GrowthPolicy >::robin_iterator< IsConst >::robin_iterator ( const robin_iterator< IsConst > &  other)
default

◆ robin_iterator() [5/5]

template<class ValueType , class KeySelect , class ValueSelect , class Hash , class KeyEqual , class Allocator , bool StoreHash, class GrowthPolicy >
template<bool IsConst>
tsl::detail_robin_hash::robin_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, StoreHash, GrowthPolicy >::robin_iterator< IsConst >::robin_iterator ( robin_iterator< IsConst > &&  other)
default

Member Function Documentation

◆ key()

template<class ValueType , class KeySelect , class ValueSelect , class Hash , class KeyEqual , class Allocator , bool StoreHash, class GrowthPolicy >
template<bool IsConst>
const robin_hash::key_type& tsl::detail_robin_hash::robin_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, StoreHash, GrowthPolicy >::robin_iterator< IsConst >::key ( ) const
inline

Definition at line 486 of file robin_hash.h.

◆ operator*()

template<class ValueType , class KeySelect , class ValueSelect , class Hash , class KeyEqual , class Allocator , bool StoreHash, class GrowthPolicy >
template<bool IsConst>
reference tsl::detail_robin_hash::robin_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, StoreHash, GrowthPolicy >::robin_iterator< IsConst >::operator* ( ) const
inline

Definition at line 504 of file robin_hash.h.

◆ operator++() [1/2]

template<class ValueType , class KeySelect , class ValueSelect , class Hash , class KeyEqual , class Allocator , bool StoreHash, class GrowthPolicy >
template<bool IsConst>
robin_iterator& tsl::detail_robin_hash::robin_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, StoreHash, GrowthPolicy >::robin_iterator< IsConst >::operator++ ( )
inline

Definition at line 508 of file robin_hash.h.

◆ operator++() [2/2]

template<class ValueType , class KeySelect , class ValueSelect , class Hash , class KeyEqual , class Allocator , bool StoreHash, class GrowthPolicy >
template<bool IsConst>
robin_iterator tsl::detail_robin_hash::robin_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, StoreHash, GrowthPolicy >::robin_iterator< IsConst >::operator++ ( int  )
inline

Definition at line 522 of file robin_hash.h.

◆ operator->()

template<class ValueType , class KeySelect , class ValueSelect , class Hash , class KeyEqual , class Allocator , bool StoreHash, class GrowthPolicy >
template<bool IsConst>
pointer tsl::detail_robin_hash::robin_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, StoreHash, GrowthPolicy >::robin_iterator< IsConst >::operator-> ( ) const
inline

Definition at line 506 of file robin_hash.h.

◆ operator=() [1/2]

template<class ValueType , class KeySelect , class ValueSelect , class Hash , class KeyEqual , class Allocator , bool StoreHash, class GrowthPolicy >
template<bool IsConst>
robin_iterator& tsl::detail_robin_hash::robin_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, StoreHash, GrowthPolicy >::robin_iterator< IsConst >::operator= ( const robin_iterator< IsConst > &  other)
default

◆ operator=() [2/2]

template<class ValueType , class KeySelect , class ValueSelect , class Hash , class KeyEqual , class Allocator , bool StoreHash, class GrowthPolicy >
template<bool IsConst>
robin_iterator& tsl::detail_robin_hash::robin_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, StoreHash, GrowthPolicy >::robin_iterator< IsConst >::operator= ( robin_iterator< IsConst > &&  other)
default

◆ value() [1/2]

template<class ValueType , class KeySelect , class ValueSelect , class Hash , class KeyEqual , class Allocator , bool StoreHash, class GrowthPolicy >
template<bool IsConst>
template<class U = ValueSelect, typename std::enable_if< has_mapped_type< U >::value &&IsConst >::type * = nullptr>
const U::value_type& tsl::detail_robin_hash::robin_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, StoreHash, GrowthPolicy >::robin_iterator< IsConst >::value ( ) const
inline

Definition at line 493 of file robin_hash.h.

◆ value() [2/2]

template<class ValueType , class KeySelect , class ValueSelect , class Hash , class KeyEqual , class Allocator , bool StoreHash, class GrowthPolicy >
template<bool IsConst>
template<class U = ValueSelect, typename std::enable_if< has_mapped_type< U >::value &&!IsConst >::type * = nullptr>
U::value_type& tsl::detail_robin_hash::robin_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, StoreHash, GrowthPolicy >::robin_iterator< IsConst >::value ( ) const
inline

Definition at line 500 of file robin_hash.h.

Friends And Related Function Documentation

◆ operator!=

template<class ValueType , class KeySelect , class ValueSelect , class Hash , class KeyEqual , class Allocator , bool StoreHash, class GrowthPolicy >
template<bool IsConst>
bool operator!= ( const robin_iterator< IsConst > &  lhs,
const robin_iterator< IsConst > &  rhs 
)
friend

Definition at line 534 of file robin_hash.h.

◆ operator==

template<class ValueType , class KeySelect , class ValueSelect , class Hash , class KeyEqual , class Allocator , bool StoreHash, class GrowthPolicy >
template<bool IsConst>
bool operator== ( const robin_iterator< IsConst > &  lhs,
const robin_iterator< IsConst > &  rhs 
)
friend

Definition at line 529 of file robin_hash.h.

◆ robin_hash

template<class ValueType , class KeySelect , class ValueSelect , class Hash , class KeyEqual , class Allocator , bool StoreHash, class GrowthPolicy >
template<bool IsConst>
friend class robin_hash
friend

Definition at line 457 of file robin_hash.h.

Member Data Documentation

◆ m_bucket

template<class ValueType , class KeySelect , class ValueSelect , class Hash , class KeyEqual , class Allocator , bool StoreHash, class GrowthPolicy >
template<bool IsConst>
bucket_entry_ptr tsl::detail_robin_hash::robin_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, StoreHash, GrowthPolicy >::robin_iterator< IsConst >::m_bucket
private

Definition at line 540 of file robin_hash.h.


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


mp2p_icp
Author(s): Jose-Luis Blanco-Claraco
autogenerated on Wed Jun 26 2024 02:47:11