ELC in dev
ELC-lang
载入中...
搜索中...
未找到
elc::defs::base::equal_t结构体 参考

Public 成员函数

template<typename T , typename U >
constexpr auto operator() (T &&a, U &&b) const noexcept(nothrow< T, U >)
 
template<typename T , typename U >
constexpr bool operator() (T *a, U *b, size_t size) const noexcept(nothrow< T, U >)
 
template<typename T , typename U , size_t N1, size_t N2>
constexpr bool operator() (T(&a)[N1], U(&b)[N2]) const noexcept(nothrow< T, U >)
 
template<typename T , typename U >
constexpr bool operator() (T *a, size_t size1, U *b, size_t size2) const noexcept(nothrow< T, U >)
 
template<typename T , typename U >
constexpr bool operator() (T *a, size_t size1, U *b, end_by_zero_t) const noexcept(nothrow< T, U >)
 
template<typename T , typename U >
constexpr bool operator() (T *a, end_by_zero_t, U *b, size_t size2) const noexcept(nothrow< T, U >)
 
template<typename T , typename U >
constexpr bool operator() (T *a, end_by_zero_t, U *b, end_by_zero_t) const noexcept(nothrow< T, U >)
 
template<typename T , typename U >
constexpr bool operator() (T *a, size_t size1, just_an_part_t, U *b, end_by_zero_t) const noexcept(nothrow< T, U >)
 

静态 Public 属性

template<class T , class U = T>
static constexpr bool able = (bool(requires{ (::std::declval< T >())==(::std::declval< U >()) ;}))
 
template<class T , class U = T>
static constexpr bool nothrow = (bool(requires{ (::std::declval< T >())==(::std::declval< U >()) ;{ (::std::declval< T >())==(::std::declval< U >()) }noexcept;}))
 

详细描述

相等比较任意支持比较的类型或其数组——简易封装. 用法: 判断两值是否可比较。 equal.able<类型1,类型2(可选,默认为类型1)> -> bool 判断将两者进行比较时是否会抛出异常。 equal.nothrow<类型,类型2(可选,默认为类型1)> -> bool

equal(T1,T2) -> auto

equal(T1[N1],T2[N2]) -> bool equal(T1*,size1,T2*,size2) -> bool equal(T1*,T2*,size) -> bool equal(T1*,size1,T2*,end_by_zero) -> bool equal(T1*,end_by_zero,T2*,size) -> bool equal(T1*,end_by_zero,T2*,end_by_zero) -> bool

在文件 all_defs.cpp1851 行定义.

成员函数说明

◆ operator()() [1/8]

template<typename T , typename U >
constexpr auto elc::defs::base::equal_t::operator() ( T &&  a,
U &&  b 
) const
inlineconstexprnoexcept

在文件 all_defs.cpp1858 行定义.

1858 {
1859 return a==b;
1860 }
constexpr T down_cast(U a) noexcept
向下转型至

◆ operator()() [2/8]

template<typename T , typename U >
constexpr bool elc::defs::base::equal_t::operator() ( T *  a,
end_by_zero_t  ,
U b,
end_by_zero_t   
) const
inlineconstexprnoexcept

在文件 all_defs.cpp1900 行定义.

1900 {
1901 floop{
1902 if(*a!=*b)
1903 return false;
1904 if(*a==T{0})
1905 return true;
1906 a++;
1907 b++;
1908 }
1909 }
#define floop
Definition all_defs.cpp:543

◆ operator()() [3/8]

template<typename T , typename U >
constexpr bool elc::defs::base::equal_t::operator() ( T *  a,
end_by_zero_t  ,
U b,
size_t  size2 
) const
inlineconstexprnoexcept

在文件 all_defs.cpp1896 行定义.

1896 {
1897 return operator()(b,size2,a,end_by_zero);
1898 }
constexpr struct elc::defs::base::end_by_zero_t end_by_zero
constexpr auto operator()(T &&a, U &&b) const noexcept(nothrow< T, U >)

◆ operator()() [4/8]

template<typename T , typename U >
constexpr bool elc::defs::base::equal_t::operator() ( T *  a,
size_t  size1,
just_an_part_t  ,
U b,
end_by_zero_t   
) const
inlineconstexprnoexcept

在文件 all_defs.cpp1911 行定义.

1911 {
1912 while(size1--){
1913 if(*a!=*b || *b==U{0})
1914 return false;
1915 a++;
1916 b++;
1917 }
1918 return true;
1919 }

◆ operator()() [5/8]

template<typename T , typename U >
constexpr bool elc::defs::base::equal_t::operator() ( T *  a,
size_t  size1,
U b,
end_by_zero_t   
) const
inlineconstexprnoexcept

在文件 all_defs.cpp1886 行定义.

1886 {
1887 while(size1--){
1888 if(*a!=*b || *b==U{0})
1889 return false;
1890 a++;
1891 b++;
1892 }
1893 return *b==U{0};
1894 }

◆ operator()() [6/8]

template<typename T , typename U >
constexpr bool elc::defs::base::equal_t::operator() ( T *  a,
size_t  size1,
U b,
size_t  size2 
) const
inlineconstexprnoexcept

在文件 all_defs.cpp1879 行定义.

1879 {
1880 if(size1==size2)
1881 return operator()(a,b,size1);
1882 else
1883 return false;
1884 }

◆ operator()() [7/8]

template<typename T , typename U >
constexpr bool elc::defs::base::equal_t::operator() ( T *  a,
U b,
size_t  size 
) const
inlineconstexprnoexcept

在文件 all_defs.cpp1862 行定义.

1862 {
1863 while(size--){
1864 if(*(a++)!=*(b++))
1865 return false;
1866 }
1867 return true;
1868 }

◆ operator()() [8/8]

template<typename T , typename U , size_t N1, size_t N2>
constexpr bool elc::defs::base::equal_t::operator() ( T(&)  a[N1],
U(&)  b[N2] 
) const
inlineconstexprnoexcept

在文件 all_defs.cpp1870 行定义.

1870 {
1871 if constexpr(N1==N2)
1872 return operator()(a,b,N1);
1873 else{
1874 template_warning("N1!=N2");
1875 return false;
1876 }
1877 }
#define template_warning(reason)
Definition all_defs.cpp:563

类成员变量说明

◆ able

template<class T , class U = T>
constexpr bool elc::defs::base::equal_t::able = (bool(requires{ (::std::declval< T >())==(::std::declval< U >()) ;}))
staticconstexpr

在文件 all_defs.cpp1853 行定义.

◆ nothrow

template<class T , class U = T>
constexpr bool elc::defs::base::equal_t::nothrow = (bool(requires{ (::std::declval< T >())==(::std::declval< U >()) ;{ (::std::declval< T >())==(::std::declval< U >()) }noexcept;}))
staticconstexpr

在文件 all_defs.cpp1855 行定义.


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