ELC in dev
ELC-lang
载入中...
搜索中...
未找到
elc::defs::base::bitset< bit_num > 模板结构体 参考
类 elc::defs::base::bitset< bit_num > 继承关系图:
[图例]
elc::defs::base::bitset< bit_num > 的协作图:
[图例]

class  arec_t
 

Public 类型

typedef byteset< data_sizebase_t
 
typedef bitset< bit_numthis_t
 
typedef iterator_t< bool, iterator_base_t > iterator
 
typedef const_iterator_t< bool, const iterator_base_t > const_iterator
 

Public 成员函数

constexpr iterator begin () noexcept
 
constexpr iterator end () noexcept
 
constexpr const_iterator begin () const noexcept
 
constexpr const_iterator end () const noexcept
 
constexpr const_iterator cbegin () const noexcept
 
constexpr const_iterator cend () const noexcept
 
constexpr arec_t operator[] (size_t index) noexcept
 
constexpr const arec_t operator[] (size_t index) const noexcept
 
constexpr auto operator~ () const noexcept
 
constexpr autooperator&= (const this_t &b) noexcept
 
constexpr autooperator|= (const this_t &b) noexcept
 
constexpr autooperator^= (const this_t &b) noexcept
 
template<unsigned_integer_type T>
constexpr autooperator= (T n) noexcept
 
template<unsigned_integer_type T>
constexpr bitset (T n) noexcept
 
template<unsigned_integer_type T>
constexpr operator T () const noexcept
 
constexpr autooperator<<= (size_t n) noexcept
 
constexpr autooperator>>= (size_t n) noexcept
 
constexpr auto operator<< (size_t n) const noexcept
 
constexpr auto operator>> (size_t n) const noexcept
 
constexpr auto operator& (const this_t &b) const noexcept
 
constexpr auto operator| (const this_t &b) const noexcept
 
constexpr auto operator^ (const this_t &b) const noexcept
 
constexpr auto operator== (const this_t &b) const noexcept
 
- Public 成员函数 继承自 elc::defs::base::byteset< ceil_div(bit_num,(sizeof(byte) *CHAR_BIT))>
constexpr byteset () noexcept
 
constexpr byteset (T &&t) noexcept
 
constexpr operator byte * () noexcept
 
constexpr operator const byte * () const noexcept
 
constexpr auto & operator= (T &&t) noexcept
 
constexpr byte * begin () noexcept
 
constexpr const byte * begin () const noexcept
 
constexpr byte * end () noexcept
 
constexpr const byte * end () const noexcept
 
- Public 成员函数 继承自 elc::defs::base::non_copy_construct_able
constexpr non_copy_construct_able ()=default
 
constexpr non_copy_construct_able (const non_copy_construct_able &)=delete
 
constexpr non_copy_construct_able (non_copy_construct_able &&)=default
 
constexpr non_copy_construct_ableoperator= (const non_copy_construct_able &) &noexcept=default
 
constexpr non_copy_construct_ableoperator= (non_copy_construct_able &&) &noexcept=default
 
- Public 成员函数 继承自 elc::defs::base::non_move_construct_able
constexpr non_move_construct_able ()=default
 
constexpr non_move_construct_able (const non_move_construct_able &)=default
 
constexpr non_move_construct_able (non_move_construct_able &&)=delete
 
constexpr non_move_construct_ableoperator= (const non_move_construct_able &) &noexcept=default
 
constexpr non_move_construct_ableoperator= (non_move_construct_able &&) &noexcept=default
 

Public 属性

byte _data [data_size]
 
- Public 属性 继承自 elc::defs::base::byteset< ceil_div(bit_num,(sizeof(byte) *CHAR_BIT))>
byte _data [byte_num]
 

静态 Public 属性

static constexpr size_t data_size =ceil_div(bit_num,(sizeof( byte )*CHAR_BIT))
 

详细描述

template<size_t bit_num>
struct elc::defs::base::bitset< bit_num >

在文件 all_defs.cpp10664 行定义.

成员类型定义说明

◆ base_t

template<size_t bit_num>
typedef byteset<data_size> elc::defs::base::bitset< bit_num >::base_t

在文件 all_defs.cpp10666 行定义.

◆ const_iterator

template<size_t bit_num>
typedef const_iterator_t<bool,const iterator_base_t> elc::defs::base::bitset< bit_num >::const_iterator

在文件 all_defs.cpp10722 行定义.

◆ iterator

template<size_t bit_num>
typedef iterator_t<bool,iterator_base_t> elc::defs::base::bitset< bit_num >::iterator

在文件 all_defs.cpp10721 行定义.

◆ this_t

template<size_t bit_num>
typedef bitset<bit_num> elc::defs::base::bitset< bit_num >::this_t

在文件 all_defs.cpp10667 行定义.

构造及析构函数说明

◆ bitset()

template<size_t bit_num>
template<unsigned_integer_type T>
constexpr elc::defs::base::bitset< bit_num >::bitset ( n)
inlineconstexprnoexcept

在文件 all_defs.cpp10764 行定义.

10764{*this=n;}
constexpr T down_cast(U a) noexcept
向下转型至

成员函数说明

◆ begin() [1/2]

template<size_t bit_num>
constexpr const_iterator elc::defs::base::bitset< bit_num >::begin ( ) const
inlineconstexprnoexcept

在文件 all_defs.cpp10725 行定义.

10725{ return get_iterator_data_at(0); }

◆ begin() [2/2]

template<size_t bit_num>
constexpr iterator elc::defs::base::bitset< bit_num >::begin ( )
inlineconstexprnoexcept

在文件 all_defs.cpp10723 行定义.

10723{ return get_iterator_data_at(0); }

◆ cbegin()

template<size_t bit_num>
constexpr const_iterator elc::defs::base::bitset< bit_num >::cbegin ( ) const
inlineconstexprnoexcept

在文件 all_defs.cpp10727 行定义.

10727{ return get_iterator_data_at(0); }

◆ cend()

template<size_t bit_num>
constexpr const_iterator elc::defs::base::bitset< bit_num >::cend ( ) const
inlineconstexprnoexcept

在文件 all_defs.cpp10728 行定义.

10728{ return get_iterator_data_at(-1); }

◆ end() [1/2]

template<size_t bit_num>
constexpr const_iterator elc::defs::base::bitset< bit_num >::end ( ) const
inlineconstexprnoexcept

在文件 all_defs.cpp10726 行定义.

10726{ return get_iterator_data_at(-1); }

◆ end() [2/2]

template<size_t bit_num>
constexpr iterator elc::defs::base::bitset< bit_num >::end ( )
inlineconstexprnoexcept

在文件 all_defs.cpp10724 行定义.

10724{ return get_iterator_data_at(-1); }

◆ operator T()

template<size_t bit_num>
template<unsigned_integer_type T>
constexpr elc::defs::base::bitset< bit_num >::operator T ( ) const
inlineexplicitconstexprnoexcept

在文件 all_defs.cpp10766 行定义.

10766 {
10769 T result{};
10770 for(size_t i=data_size-1;i!=npos;--i){
10771 result*=mod_base;
10772 result+=arithmetic_byte_t(_data[i]);
10773 }
10774 return result;
10775 }
constexpr auto npos
decltype(λ{ if constexpr(size==sizeof(uint8_t)) return(uint8_t) 0 unsigned_specific_size_t
byte _data[data_size]
static constexpr size_t data_size

◆ operator&()

template<size_t bit_num>
constexpr auto elc::defs::base::bitset< bit_num >::operator& ( const this_t b) const
inlineconstexprnoexcept

在文件 all_defs.cpp10796 行定义.

10796{return this_t(*this)&=b;}
bitset< bit_num > this_t

◆ operator&=()

template<size_t bit_num>
constexpr auto & elc::defs::base::bitset< bit_num >::operator&= ( const this_t b)
inlineconstexprnoexcept

在文件 all_defs.cpp10737 行定义.

10737 {
10738 for(size_t i=0;i<data_size;++i)
10739 _data[i]&=b._data[i];
10740 return*this;
10741 }

◆ operator<<()

template<size_t bit_num>
constexpr auto elc::defs::base::bitset< bit_num >::operator<< ( size_t  n) const
inlineconstexprnoexcept

在文件 all_defs.cpp10794 行定义.

10794{return this_t(*this)<<=n;}

◆ operator<<=()

template<size_t bit_num>
constexpr auto & elc::defs::base::bitset< bit_num >::operator<<= ( size_t  n)
inlineconstexprnoexcept

在文件 all_defs.cpp10776 行定义.

10776 {
10777 const auto [move_step,offset]=divmod(n,bitnum_of(byte));
10778 byte carry{};
10779 for(size_t i=data_size-move_step-1;i!=npos;--i)
10780 carry=swap(_data[i],byte((_data[i]<<offset)|carry))>>(bitnum_of(byte)-offset);
10781 for(size_t i=0;i<move_step;++i)
10782 _data[i]=byte{};
10783 return*this;
10784 }
#define bitnum_of(...)
Definition all_defs.cpp:578
constexpr auto divmod(const T1 &a, const T2 &b)
constexpr void swap(T1 &a, T2 &b)
函数调用图:

◆ operator=()

template<size_t bit_num>
template<unsigned_integer_type T>
constexpr auto & elc::defs::base::bitset< bit_num >::operator= ( n)
inlineconstexprnoexcept

在文件 all_defs.cpp10753 行定义.

10753 {
10756 for(size_t i=0;i<data_size;++i){
10757 auto result=divmod(n,mod_base);
10758 _data[i]=byte(arithmetic_byte_t(move(result.mod)));
10759 n=T(move(result.quot));
10760 }
10761 return*this;
10762 }
constexpr struct elc::defs::memory::lifetime_n::move_t move

◆ operator==()

template<size_t bit_num>
constexpr auto elc::defs::base::bitset< bit_num >::operator== ( const this_t b) const
inlineconstexprnoexcept

在文件 all_defs.cpp10799 行定义.

10799 {
10800 for(size_t i=0;i<data_size-1;++i)
10801 if(_data[i]!=b._data[i])
10802 return false;
10803 const auto mod=bit_num%bitnum_of(byte);
10804 return (_data[data_size-1]>>mod)==(b._data[data_size-1]>>mod);
10805 }
constexpr auto mod(const T1 &a, const T2 &b)

◆ operator>>()

template<size_t bit_num>
constexpr auto elc::defs::base::bitset< bit_num >::operator>> ( size_t  n) const
inlineconstexprnoexcept

在文件 all_defs.cpp10795 行定义.

10795{return this_t(*this)>>=n;}

◆ operator>>=()

template<size_t bit_num>
constexpr auto & elc::defs::base::bitset< bit_num >::operator>>= ( size_t  n)
inlineconstexprnoexcept

在文件 all_defs.cpp10785 行定义.

10785 {
10786 const auto [move_step,offset]=divmod(n,bitnum_of(byte));
10787 byte carry{};
10788 for(size_t i=move_step;i!=data_size;++i)
10789 carry=swap(_data[i],byte((_data[i]>>offset)|carry))<<(bitnum_of(byte)-offset);
10790 for(size_t i=data_size-move_step;i!=data_size;++i)
10791 _data[i]=byte{};
10792 return*this;
10793 }
函数调用图:

◆ operator[]() [1/2]

template<size_t bit_num>
constexpr const arec_t elc::defs::base::bitset< bit_num >::operator[] ( size_t  index) const
inlineconstexprnoexcept

在文件 all_defs.cpp10730 行定义.

10730{return {remove_const(this),index};}
constexpr T & remove_const(const T &a) noexcept
对引用移除const
函数调用图:

◆ operator[]() [2/2]

template<size_t bit_num>
constexpr arec_t elc::defs::base::bitset< bit_num >::operator[] ( size_t  index)
inlineconstexprnoexcept

在文件 all_defs.cpp10729 行定义.

10729{return {this,index};}

◆ operator^()

template<size_t bit_num>
constexpr auto elc::defs::base::bitset< bit_num >::operator^ ( const this_t b) const
inlineconstexprnoexcept

在文件 all_defs.cpp10798 行定义.

10798{return this_t(*this)^=b;}

◆ operator^=()

template<size_t bit_num>
constexpr auto & elc::defs::base::bitset< bit_num >::operator^= ( const this_t b)
inlineconstexprnoexcept

在文件 all_defs.cpp10747 行定义.

10747 {
10748 for(size_t i=0;i<data_size;++i)
10749 _data[i]^=b._data[i];
10750 return*this;
10751 }

◆ operator|()

template<size_t bit_num>
constexpr auto elc::defs::base::bitset< bit_num >::operator| ( const this_t b) const
inlineconstexprnoexcept

在文件 all_defs.cpp10797 行定义.

10797{return this_t(*this)|=b;}

◆ operator|=()

template<size_t bit_num>
constexpr auto & elc::defs::base::bitset< bit_num >::operator|= ( const this_t b)
inlineconstexprnoexcept

在文件 all_defs.cpp10742 行定义.

10742 {
10743 for(size_t i=0;i<data_size;++i)
10744 _data[i]|=b._data[i];
10745 return*this;
10746 }

◆ operator~()

template<size_t bit_num>
constexpr auto elc::defs::base::bitset< bit_num >::operator~ ( ) const
inlineconstexprnoexcept

在文件 all_defs.cpp10731 行定义.

10731 {
10732 this_t tmp;
10733 for(size_t i=0;i<data_size;++i)
10734 tmp._data[i]=~_data[i];
10735 return tmp;
10736 }

类成员变量说明

◆ _data

template<size_t bit_num>
byte elc::defs::base::bitset< bit_num >::_data[data_size]

在文件 all_defs.cpp10670 行定义.

◆ data_size

template<size_t bit_num>
constexpr size_t elc::defs::base::bitset< bit_num >::data_size =ceil_div(bit_num,(sizeof( byte )*CHAR_BIT))
staticconstexpr

在文件 all_defs.cpp10665 行定义.


该结构体的文档由以下文件生成: