Thoth
A functional, expressive, asynchronous C++26 webdev library
Loading...
Searching...
No Matches
Thoth::Dsa::LinearMap< KeyT, ValT, Pred > Struct Template Reference

#include <LinearMap.hpp>

Public Types

using key_type = KeyT
 
using mapped_type = ValT
 
using value_type = std::pair< KeyT, ValT >
 
using key_compare = Pred
 
using container_type = std::vector< value_type >
 
using iterator = container_type::iterator
 
using const_iterator = container_type::const_iterator
 
using size_type = container_type::size_type
 

Public Member Functions

constexpr LinearMap ()=default
 
constexpr LinearMap (const LinearMap &)=default
 
constexpr LinearMap (LinearMap &&)=default
 
constexpr LinearMap (const key_compare &comp)
 
constexpr LinearMap (std::initializer_list< value_type > init, const key_compare &comp=key_compare{})
 
constexpr LinearMapoperator= (const LinearMap &)
 
constexpr LinearMapoperator= (LinearMap &&) noexcept
 
constexpr bool operator== (const LinearMap &other) const
 
constexpr void clear ()
 
constexpr iterator begin ()
 
constexpr iterator end ()
 
constexpr const_iterator begin () const
 
constexpr const_iterator end () const
 
constexpr const_iterator cbegin () const
 
constexpr const_iterator cend () const
 
constexpr bool empty () const
 
constexpr size_type size () const
 
template<class LookupKeyT , class MappedT >
constexpr std::pair< iterator, bool > try_emplace (LookupKeyT &&key, MappedT &&val)
 
template<class LookupKeyT , class MappedT >
constexpr std::pair< iterator, bool > insert_or_assign (LookupKeyT &&key, MappedT &&val)
 
template<class LookupKeyT >
constexpr bool erase (const LookupKeyT &key)
 
constexpr iterator erase (iterator pos)
 
constexpr iterator erase (const_iterator pos)
 
template<class LookupKeyT >
constexpr iterator find (const LookupKeyT &key)
 
template<class LookupKeyT >
constexpr const_iterator find (const LookupKeyT &key) const
 
template<class LookupKeyT >
constexpr bool exists (const LookupKeyT &key) const
 
template<class LookupKeyT >
constexpr bool contains (const LookupKeyT &key) const
 
template<class LookupKeyT >
ValT & operator[] (LookupKeyT &&key)
 

Member Typedef Documentation

◆ const_iterator

template<class KeyT , class ValT , class Pred = std::less<>>
using Thoth::Dsa::LinearMap< KeyT, ValT, Pred >::const_iterator = container_type::const_iterator

◆ container_type

template<class KeyT , class ValT , class Pred = std::less<>>
using Thoth::Dsa::LinearMap< KeyT, ValT, Pred >::container_type = std::vector<value_type>

◆ iterator

template<class KeyT , class ValT , class Pred = std::less<>>
using Thoth::Dsa::LinearMap< KeyT, ValT, Pred >::iterator = container_type::iterator

◆ key_compare

template<class KeyT , class ValT , class Pred = std::less<>>
using Thoth::Dsa::LinearMap< KeyT, ValT, Pred >::key_compare = Pred

◆ key_type

template<class KeyT , class ValT , class Pred = std::less<>>
using Thoth::Dsa::LinearMap< KeyT, ValT, Pred >::key_type = KeyT

◆ mapped_type

template<class KeyT , class ValT , class Pred = std::less<>>
using Thoth::Dsa::LinearMap< KeyT, ValT, Pred >::mapped_type = ValT

◆ size_type

template<class KeyT , class ValT , class Pred = std::less<>>
using Thoth::Dsa::LinearMap< KeyT, ValT, Pred >::size_type = container_type::size_type

◆ value_type

template<class KeyT , class ValT , class Pred = std::less<>>
using Thoth::Dsa::LinearMap< KeyT, ValT, Pred >::value_type = std::pair<KeyT, ValT>

Constructor & Destructor Documentation

◆ LinearMap() [1/5]

template<class KeyT , class ValT , class Pred = std::less<>>
constexpr Thoth::Dsa::LinearMap< KeyT, ValT, Pred >::LinearMap ( )
constexprdefault

◆ LinearMap() [2/5]

template<class KeyT , class ValT , class Pred = std::less<>>
constexpr Thoth::Dsa::LinearMap< KeyT, ValT, Pred >::LinearMap ( const LinearMap< KeyT, ValT, Pred > &  )
constexprdefault

◆ LinearMap() [3/5]

template<class KeyT , class ValT , class Pred = std::less<>>
constexpr Thoth::Dsa::LinearMap< KeyT, ValT, Pred >::LinearMap ( LinearMap< KeyT, ValT, Pred > &&  )
constexprdefault

◆ LinearMap() [4/5]

template<class KeyT , class ValT , class Pred = std::less<>>
constexpr Thoth::Dsa::LinearMap< KeyT, ValT, Pred >::LinearMap ( const key_compare comp)
explicitconstexpr

◆ LinearMap() [5/5]

template<class KeyT , class ValT , class Pred = std::less<>>
constexpr Thoth::Dsa::LinearMap< KeyT, ValT, Pred >::LinearMap ( std::initializer_list< value_type init,
const key_compare comp = key_compare{} 
)
constexpr

Member Function Documentation

◆ begin() [1/2]

template<class KeyT , class ValT , class Pred = std::less<>>
constexpr iterator Thoth::Dsa::LinearMap< KeyT, ValT, Pred >::begin ( )
constexpr

◆ begin() [2/2]

template<class KeyT , class ValT , class Pred = std::less<>>
constexpr const_iterator Thoth::Dsa::LinearMap< KeyT, ValT, Pred >::begin ( ) const
constexpr

◆ cbegin()

template<class KeyT , class ValT , class Pred = std::less<>>
constexpr const_iterator Thoth::Dsa::LinearMap< KeyT, ValT, Pred >::cbegin ( ) const
constexpr

◆ cend()

template<class KeyT , class ValT , class Pred = std::less<>>
constexpr const_iterator Thoth::Dsa::LinearMap< KeyT, ValT, Pred >::cend ( ) const
constexpr

◆ clear()

template<class KeyT , class ValT , class Pred = std::less<>>
constexpr void Thoth::Dsa::LinearMap< KeyT, ValT, Pred >::clear ( )
constexpr

◆ contains()

template<class KeyT , class ValT , class Pred = std::less<>>
template<class LookupKeyT >
constexpr bool Thoth::Dsa::LinearMap< KeyT, ValT, Pred >::contains ( const LookupKeyT &  key) const
constexpr

◆ empty()

template<class KeyT , class ValT , class Pred = std::less<>>
constexpr bool Thoth::Dsa::LinearMap< KeyT, ValT, Pred >::empty ( ) const
constexpr

◆ end() [1/2]

template<class KeyT , class ValT , class Pred = std::less<>>
constexpr iterator Thoth::Dsa::LinearMap< KeyT, ValT, Pred >::end ( )
constexpr

◆ end() [2/2]

template<class KeyT , class ValT , class Pred = std::less<>>
constexpr const_iterator Thoth::Dsa::LinearMap< KeyT, ValT, Pred >::end ( ) const
constexpr

◆ erase() [1/3]

template<class KeyT , class ValT , class Pred = std::less<>>
template<class LookupKeyT >
constexpr bool Thoth::Dsa::LinearMap< KeyT, ValT, Pred >::erase ( const LookupKeyT &  key)
constexpr

◆ erase() [2/3]

template<class KeyT , class ValT , class Pred = std::less<>>
constexpr iterator Thoth::Dsa::LinearMap< KeyT, ValT, Pred >::erase ( const_iterator  pos)
constexpr

◆ erase() [3/3]

template<class KeyT , class ValT , class Pred = std::less<>>
constexpr iterator Thoth::Dsa::LinearMap< KeyT, ValT, Pred >::erase ( iterator  pos)
constexpr

◆ exists()

template<class KeyT , class ValT , class Pred = std::less<>>
template<class LookupKeyT >
constexpr bool Thoth::Dsa::LinearMap< KeyT, ValT, Pred >::exists ( const LookupKeyT &  key) const
constexpr

◆ find() [1/2]

template<class KeyT , class ValT , class Pred = std::less<>>
template<class LookupKeyT >
constexpr iterator Thoth::Dsa::LinearMap< KeyT, ValT, Pred >::find ( const LookupKeyT &  key)
constexpr

◆ find() [2/2]

template<class KeyT , class ValT , class Pred = std::less<>>
template<class LookupKeyT >
constexpr const_iterator Thoth::Dsa::LinearMap< KeyT, ValT, Pred >::find ( const LookupKeyT &  key) const
constexpr

◆ insert_or_assign()

template<class KeyT , class ValT , class Pred = std::less<>>
template<class LookupKeyT , class MappedT >
constexpr std::pair< iterator, bool > Thoth::Dsa::LinearMap< KeyT, ValT, Pred >::insert_or_assign ( LookupKeyT &&  key,
MappedT &&  val 
)
constexpr

◆ operator=() [1/2]

template<class KeyT , class ValT , class Pred = std::less<>>
constexpr LinearMap & Thoth::Dsa::LinearMap< KeyT, ValT, Pred >::operator= ( const LinearMap< KeyT, ValT, Pred > &  )
constexpr

◆ operator=() [2/2]

template<class KeyT , class ValT , class Pred = std::less<>>
constexpr LinearMap & Thoth::Dsa::LinearMap< KeyT, ValT, Pred >::operator= ( LinearMap< KeyT, ValT, Pred > &&  )
constexprnoexcept

◆ operator==()

template<class KeyT , class ValT , class Pred = std::less<>>
constexpr bool Thoth::Dsa::LinearMap< KeyT, ValT, Pred >::operator== ( const LinearMap< KeyT, ValT, Pred > &  other) const
constexpr

◆ operator[]()

template<class KeyT , class ValT , class Pred = std::less<>>
template<class LookupKeyT >
ValT & Thoth::Dsa::LinearMap< KeyT, ValT, Pred >::operator[] ( LookupKeyT &&  key)

◆ size()

template<class KeyT , class ValT , class Pred = std::less<>>
constexpr size_type Thoth::Dsa::LinearMap< KeyT, ValT, Pred >::size ( ) const
constexpr

◆ try_emplace()

template<class KeyT , class ValT , class Pred = std::less<>>
template<class LookupKeyT , class MappedT >
constexpr std::pair< iterator, bool > Thoth::Dsa::LinearMap< KeyT, ValT, Pred >::try_emplace ( LookupKeyT &&  key,
MappedT &&  val 
)
constexpr

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