sparse-map
Public Types | Public Member Functions | Friends | List of all members
tsl::detail_sparse_hash::sparse_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, GrowthPolicy, ExceptionSafety, Sparsity, Probing >::sparse_iterator< IsConst > Class Template Reference

#include <sparse_hash.h>

Public Types

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

Public Member Functions

 sparse_iterator () noexcept
 
 sparse_iterator (const sparse_iterator< false > &other) noexcept
 
const sparse_hash::key_typekey () const
 
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 ()
 
reference operator* () const
 
pointer operator-> () const
 
sparse_iteratoroperator++ ()
 
sparse_iterator operator++ (int)
 

Friends

class sparse_hash
 
bool operator== (const sparse_iterator &lhs, const sparse_iterator &rhs)
 
bool operator!= (const sparse_iterator &lhs, const sparse_iterator &rhs)
 

Detailed Description

template<class ValueType, class KeySelect, class ValueSelect, class Hash, class KeyEqual, class Allocator, class GrowthPolicy, tsl::sh::exception_safety ExceptionSafety, tsl::sh::sparsity Sparsity, tsl::sh::probing Probing>
template<bool IsConst>
class tsl::detail_sparse_hash::sparse_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, GrowthPolicy, ExceptionSafety, Sparsity, Probing >::sparse_iterator< IsConst >

The operator*() and operator->() methods return a const reference and const pointer respectively to the stored value type (Key for a set, std::pair<Key, T> for a map).

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

Member Typedef Documentation

◆ difference_type

template<class ValueType, class KeySelect, class ValueSelect, class Hash, class KeyEqual, class Allocator, class GrowthPolicy, tsl::sh::exception_safety ExceptionSafety, tsl::sh::sparsity Sparsity, tsl::sh::probing Probing>
template<bool IsConst>
using tsl::detail_sparse_hash::sparse_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, GrowthPolicy, ExceptionSafety, Sparsity, Probing >::sparse_iterator< IsConst >::difference_type = std::ptrdiff_t

◆ iterator_category

template<class ValueType, class KeySelect, class ValueSelect, class Hash, class KeyEqual, class Allocator, class GrowthPolicy, tsl::sh::exception_safety ExceptionSafety, tsl::sh::sparsity Sparsity, tsl::sh::probing Probing>
template<bool IsConst>
using tsl::detail_sparse_hash::sparse_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, GrowthPolicy, ExceptionSafety, Sparsity, Probing >::sparse_iterator< IsConst >::iterator_category = std::forward_iterator_tag

◆ pointer

template<class ValueType, class KeySelect, class ValueSelect, class Hash, class KeyEqual, class Allocator, class GrowthPolicy, tsl::sh::exception_safety ExceptionSafety, tsl::sh::sparsity Sparsity, tsl::sh::probing Probing>
template<bool IsConst>
using tsl::detail_sparse_hash::sparse_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, GrowthPolicy, ExceptionSafety, Sparsity, Probing >::sparse_iterator< IsConst >::pointer = value_type*

◆ reference

template<class ValueType, class KeySelect, class ValueSelect, class Hash, class KeyEqual, class Allocator, class GrowthPolicy, tsl::sh::exception_safety ExceptionSafety, tsl::sh::sparsity Sparsity, tsl::sh::probing Probing>
template<bool IsConst>
using tsl::detail_sparse_hash::sparse_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, GrowthPolicy, ExceptionSafety, Sparsity, Probing >::sparse_iterator< IsConst >::reference = value_type&

◆ value_type

template<class ValueType, class KeySelect, class ValueSelect, class Hash, class KeyEqual, class Allocator, class GrowthPolicy, tsl::sh::exception_safety ExceptionSafety, tsl::sh::sparsity Sparsity, tsl::sh::probing Probing>
template<bool IsConst>
using tsl::detail_sparse_hash::sparse_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, GrowthPolicy, ExceptionSafety, Sparsity, Probing >::sparse_iterator< IsConst >::value_type = const typename sparse_hash::value_type

Constructor & Destructor Documentation

◆ sparse_iterator() [1/2]

template<class ValueType, class KeySelect, class ValueSelect, class Hash, class KeyEqual, class Allocator, class GrowthPolicy, tsl::sh::exception_safety ExceptionSafety, tsl::sh::sparsity Sparsity, tsl::sh::probing Probing>
template<bool IsConst>
tsl::detail_sparse_hash::sparse_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, GrowthPolicy, ExceptionSafety, Sparsity, Probing >::sparse_iterator< IsConst >::sparse_iterator ( )
inlinenoexcept

◆ sparse_iterator() [2/2]

template<class ValueType, class KeySelect, class ValueSelect, class Hash, class KeyEqual, class Allocator, class GrowthPolicy, tsl::sh::exception_safety ExceptionSafety, tsl::sh::sparsity Sparsity, tsl::sh::probing Probing>
template<bool IsConst>
tsl::detail_sparse_hash::sparse_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, GrowthPolicy, ExceptionSafety, Sparsity, Probing >::sparse_iterator< IsConst >::sparse_iterator ( const sparse_iterator< false > &  other)
inlinenoexcept

Member Function Documentation

◆ key()

template<class ValueType, class KeySelect, class ValueSelect, class Hash, class KeyEqual, class Allocator, class GrowthPolicy, tsl::sh::exception_safety ExceptionSafety, tsl::sh::sparsity Sparsity, tsl::sh::probing Probing>
template<bool IsConst>
const sparse_hash::key_type& tsl::detail_sparse_hash::sparse_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, GrowthPolicy, ExceptionSafety, Sparsity, Probing >::sparse_iterator< IsConst >::key ( ) const
inline

◆ operator*()

template<class ValueType, class KeySelect, class ValueSelect, class Hash, class KeyEqual, class Allocator, class GrowthPolicy, tsl::sh::exception_safety ExceptionSafety, tsl::sh::sparsity Sparsity, tsl::sh::probing Probing>
template<bool IsConst>
reference tsl::detail_sparse_hash::sparse_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, GrowthPolicy, ExceptionSafety, Sparsity, Probing >::sparse_iterator< IsConst >::operator* ( ) const
inline

◆ operator++() [1/2]

template<class ValueType, class KeySelect, class ValueSelect, class Hash, class KeyEqual, class Allocator, class GrowthPolicy, tsl::sh::exception_safety ExceptionSafety, tsl::sh::sparsity Sparsity, tsl::sh::probing Probing>
template<bool IsConst>
sparse_iterator& tsl::detail_sparse_hash::sparse_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, GrowthPolicy, ExceptionSafety, Sparsity, Probing >::sparse_iterator< IsConst >::operator++ ( )
inline

◆ operator++() [2/2]

template<class ValueType, class KeySelect, class ValueSelect, class Hash, class KeyEqual, class Allocator, class GrowthPolicy, tsl::sh::exception_safety ExceptionSafety, tsl::sh::sparsity Sparsity, tsl::sh::probing Probing>
template<bool IsConst>
sparse_iterator tsl::detail_sparse_hash::sparse_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, GrowthPolicy, ExceptionSafety, Sparsity, Probing >::sparse_iterator< IsConst >::operator++ ( int  )
inline

◆ operator->()

template<class ValueType, class KeySelect, class ValueSelect, class Hash, class KeyEqual, class Allocator, class GrowthPolicy, tsl::sh::exception_safety ExceptionSafety, tsl::sh::sparsity Sparsity, tsl::sh::probing Probing>
template<bool IsConst>
pointer tsl::detail_sparse_hash::sparse_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, GrowthPolicy, ExceptionSafety, Sparsity, Probing >::sparse_iterator< IsConst >::operator-> ( ) const
inline

◆ value() [1/2]

template<class ValueType, class KeySelect, class ValueSelect, class Hash, class KeyEqual, class Allocator, class GrowthPolicy, tsl::sh::exception_safety ExceptionSafety, tsl::sh::sparsity Sparsity, tsl::sh::probing Probing>
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_sparse_hash::sparse_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, GrowthPolicy, ExceptionSafety, Sparsity, Probing >::sparse_iterator< IsConst >::value ( ) const
inline

◆ value() [2/2]

template<class ValueType, class KeySelect, class ValueSelect, class Hash, class KeyEqual, class Allocator, class GrowthPolicy, tsl::sh::exception_safety ExceptionSafety, tsl::sh::sparsity Sparsity, tsl::sh::probing Probing>
template<bool IsConst>
template<class U = ValueSelect, typename std::enable_if< has_mapped_type< U >::value &&!IsConst >::type * = nullptr>
U::value_type& tsl::detail_sparse_hash::sparse_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, GrowthPolicy, ExceptionSafety, Sparsity, Probing >::sparse_iterator< IsConst >::value ( )
inline

Friends And Related Function Documentation

◆ operator!=

template<class ValueType, class KeySelect, class ValueSelect, class Hash, class KeyEqual, class Allocator, class GrowthPolicy, tsl::sh::exception_safety ExceptionSafety, tsl::sh::sparsity Sparsity, tsl::sh::probing Probing>
template<bool IsConst>
bool operator!= ( const sparse_iterator< IsConst > &  lhs,
const sparse_iterator< IsConst > &  rhs 
)
friend

◆ operator==

template<class ValueType, class KeySelect, class ValueSelect, class Hash, class KeyEqual, class Allocator, class GrowthPolicy, tsl::sh::exception_safety ExceptionSafety, tsl::sh::sparsity Sparsity, tsl::sh::probing Probing>
template<bool IsConst>
bool operator== ( const sparse_iterator< IsConst > &  lhs,
const sparse_iterator< IsConst > &  rhs 
)
friend

◆ sparse_hash

template<class ValueType, class KeySelect, class ValueSelect, class Hash, class KeyEqual, class Allocator, class GrowthPolicy, tsl::sh::exception_safety ExceptionSafety, tsl::sh::sparsity Sparsity, tsl::sh::probing Probing>
template<bool IsConst>
friend class sparse_hash
friend

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