ELC in dev
ELC-lang
载入中...
搜索中...
未找到
elc::defs::container::map_n::map_t< T, key_t, stack_t, bucket_max_size > 模板类 参考

Public 成员函数

 map_t () noexcept=default
 
 ~map_t () noexcept(destruct.nothrow< base_t_w >)=default
 
 map_t (const this_t &a) noexcept=default
 
 map_t (this_t &&a) noexcept=default
 
this_toperator= (this_t &&a) noexcept
 
this_toperator= (const this_t &a) noexcept
 
template<size_t _>
void swap (map_t< T, key_t, stack_t, _ > &a) noexcept
 
T & operator[] (const key_t &a) noexcept(noexcept((_m.add({a, T()}))))
 
const T & operator[] (const key_t &a) const noexcept
 
void clear () noexcept(re_construct.nothrow< this_t >)
 
template<typename func_t >
requires (bool(requires{ (::std::declval< func_t >())((::std::declval< T& >())) ;}))
void for_each (func_t &&func) noexcept(noexcept(((::std::declval< func_t >())((::std::declval< T & >())))))
 
template<typename func_t >
requires (bool(requires{ (::std::declval< func_t >())((::std::declval< const T& >())) ;}))
void for_each (func_t &&func) const noexcept(noexcept(((::std::declval< func_t >())((::std::declval< const T & >())))))
 
void shrink () const noexcept(shrink_nothow)
 
template<class... Args>
requires (bool(requires{ ((::std::declval< decltype( _m ) >())). size ((::std::declval< Args >())...) ;}))
auto size (Args &&...rest) const noexcept(noexcept((((::std::declval< decltype(_m) >())). size((::std::declval< Args >())...))))
 
bool operator== (const this_t &a) const noexcept(shrink_nothow &&equal.nothrow< T >)
 

静态 Public 属性

static constexpr bool shrink_nothow =stack_t<data_t>::remove_nothrow
 

详细描述

template<typename T, typename key_t, template< typename >class stack_t = auto_stack_t, size_t bucket_max_size = 256>
class elc::defs::container::map_n::map_t< T, key_t, stack_t, bucket_max_size >

在文件 all_defs.cpp25710 行定义.

构造及析构函数说明

◆ map_t() [1/3]

template<typename T , typename key_t , template< typename >class stack_t = auto_stack_t, size_t bucket_max_size = 256>
elc::defs::container::map_n::map_t< T, key_t, stack_t, bucket_max_size >::map_t ( )
defaultnoexcept

◆ ~map_t()

template<typename T , typename key_t , template< typename >class stack_t = auto_stack_t, size_t bucket_max_size = 256>
elc::defs::container::map_n::map_t< T, key_t, stack_t, bucket_max_size >::~map_t ( )
defaultnoexcept

◆ map_t() [2/3]

template<typename T , typename key_t , template< typename >class stack_t = auto_stack_t, size_t bucket_max_size = 256>
elc::defs::container::map_n::map_t< T, key_t, stack_t, bucket_max_size >::map_t ( const this_t a)
defaultnoexcept

◆ map_t() [3/3]

template<typename T , typename key_t , template< typename >class stack_t = auto_stack_t, size_t bucket_max_size = 256>
elc::defs::container::map_n::map_t< T, key_t, stack_t, bucket_max_size >::map_t ( this_t &&  a)
defaultnoexcept

成员函数说明

◆ clear()

template<typename T , typename key_t , template< typename >class stack_t = auto_stack_t, size_t bucket_max_size = 256>
void elc::defs::container::map_n::map_t< T, key_t, stack_t, bucket_max_size >::clear ( )
inlinenoexcept

在文件 all_defs.cpp25778 行定义.

25778 {
25779 re_construct(this);
25780 }
constexpr struct elc::defs::memory::lifetime_n::re_construct_t re_construct

◆ for_each() [1/2]

template<typename T , typename key_t , template< typename >class stack_t = auto_stack_t, size_t bucket_max_size = 256>
template<typename func_t >
requires (bool(requires{ (::std::declval< func_t >())((::std::declval< const T& >())) ;}))
void elc::defs::container::map_n::map_t< T, key_t, stack_t, bucket_max_size >::for_each ( func_t &&  func) const
inlinenoexcept

在文件 all_defs.cpp25793 行定义.

25793 {
25794 _m.for_each(λ(data_t&a)noexcept_as(expr){
25795 func(add_const<T&>(a._value));
25796 });
25797 }
#define λ
Definition all_defs.cpp:623
#define expr
#define noexcept_as(...)
Definition all_defs.cpp:524
constexpr T down_cast(U a) noexcept
向下转型至

◆ for_each() [2/2]

template<typename T , typename key_t , template< typename >class stack_t = auto_stack_t, size_t bucket_max_size = 256>
template<typename func_t >
requires (bool(requires{ (::std::declval< func_t >())((::std::declval< T& >())) ;}))
void elc::defs::container::map_n::map_t< T, key_t, stack_t, bucket_max_size >::for_each ( func_t &&  func)
inlinenoexcept

在文件 all_defs.cpp25784 行定义.

25784 {
25785 _m.for_each(λ(data_t&a)noexcept_as(expr){
25786 func(a._value);
25787 });
25788 }

◆ operator=() [1/2]

template<typename T , typename key_t , template< typename >class stack_t = auto_stack_t, size_t bucket_max_size = 256>
this_t & elc::defs::container::map_n::map_t< T, key_t, stack_t, bucket_max_size >::operator= ( const this_t a)
inlinenoexcept

在文件 all_defs.cpp25759 行定义.

25759 {
25760 return operator=(a.copy());
25761 }
this_t & operator=(this_t &&a) noexcept

◆ operator=() [2/2]

template<typename T , typename key_t , template< typename >class stack_t = auto_stack_t, size_t bucket_max_size = 256>
this_t & elc::defs::container::map_n::map_t< T, key_t, stack_t, bucket_max_size >::operator= ( this_t &&  a)
inlinenoexcept

在文件 all_defs.cpp25755 行定义.

25755 {
25756 swap(_m,a._m);
25757 return*this;
25758 }
void swap(map_t< T, key_t, stack_t, _ > &a) noexcept
函数调用图:

◆ operator==()

template<typename T , typename key_t , template< typename >class stack_t = auto_stack_t, size_t bucket_max_size = 256>
bool elc::defs::container::map_n::map_t< T, key_t, stack_t, bucket_max_size >::operator== ( const this_t a) const
inlinenoexcept

在文件 all_defs.cpp25809 行定义.

25809 {
25810 shrink();
25811 a.shrink();
25812 if(size()!=a.size())
25813 return 0;
25814 try{
25815 _m.for_each(λ_with_catch(&a)(data_t&b){
25816 if(a[b._key]!=b._value)
25817 throw (this_t*)(nullptr);
25818 });
25819 }
25820 catch(this_t*){
25821 return 0;
25822 }
25823 return 1;
25824 }
#define λ_with_catch(...)
Definition all_defs.cpp:627
auto size(Args &&...rest) const noexcept(noexcept((((::std::declval< decltype(_m) >())). size((::std::declval< Args >())...))))
void shrink() const noexcept(shrink_nothow)

◆ operator[]() [1/2]

template<typename T , typename key_t , template< typename >class stack_t = auto_stack_t, size_t bucket_max_size = 256>
const T & elc::defs::container::map_n::map_t< T, key_t, stack_t, bucket_max_size >::operator[] ( const key_t a) const
inlinenoexcept

在文件 all_defs.cpp25774 行定义.

25774 {
25775 auto tmp=_m.find(a);
25776 return tmp.fail()?const_default_value_of<T>:tmp.get_ref()._value;
25777 }

◆ operator[]() [2/2]

template<typename T , typename key_t , template< typename >class stack_t = auto_stack_t, size_t bucket_max_size = 256>
T & elc::defs::container::map_n::map_t< T, key_t, stack_t, bucket_max_size >::operator[] ( const key_t a)
inlinenoexcept

在文件 all_defs.cpp25766 行定义.

25766 {a,T()})){
25767 auto tmp=_m.find(a);
25768 if(tmp.fail()){
25769 _m.add({a,T()});
25770 tmp=_m.find(a);
25771 }
25772 return tmp.get_ref()._value;
25773 }

◆ shrink()

template<typename T , typename key_t , template< typename >class stack_t = auto_stack_t, size_t bucket_max_size = 256>
void elc::defs::container::map_n::map_t< T, key_t, stack_t, bucket_max_size >::shrink ( ) const
inlinenoexcept

在文件 all_defs.cpp25801 行定义.

25801 {
25802 _m.for_each_bucket(λ(stack_t<data_t>&a)noexcept(shrink_nothow && equal.nothrow<T>){
25803 while(a.remove(data_t::seek_value_t(const_default_value_of<T>)));
25804 });
25805 }
static constexpr bool shrink_nothow
constexpr struct elc::defs::base::equal_t equal
static constexpr bool nothrow

◆ size()

template<typename T , typename key_t , template< typename >class stack_t = auto_stack_t, size_t bucket_max_size = 256>
template<class... Args>
requires (bool(requires{ ((::std::declval< decltype( _m ) >())). size ((::std::declval< Args >())...) ;}))
auto elc::defs::container::map_n::map_t< T, key_t, stack_t, bucket_max_size >::size ( Args &&...  rest) const
inlinenoexcept

在文件 all_defs.cpp25807 行定义.

◆ swap()

template<typename T , typename key_t , template< typename >class stack_t = auto_stack_t, size_t bucket_max_size = 256>
template<size_t _>
void elc::defs::container::map_n::map_t< T, key_t, stack_t, bucket_max_size >::swap ( map_t< T, key_t, stack_t, _ > &  a)
inlinenoexcept

在文件 all_defs.cpp25764 行定义.

25764{swap(_m,a._m);}
函数调用图:
这是这个函数的调用关系图:

类成员变量说明

◆ shrink_nothow

template<typename T , typename key_t , template< typename >class stack_t = auto_stack_t, size_t bucket_max_size = 256>
constexpr bool elc::defs::container::map_n::map_t< T, key_t, stack_t, bucket_max_size >::shrink_nothow =stack_t<data_t>::remove_nothrow
staticconstexpr

在文件 all_defs.cpp25800 行定义.


该类的文档由以下文件生成: