ELC in dev
ELC-lang
载入中...
搜索中...
未找到
elc::defs::base::null_ptr_n 命名空间参考

class  can_t_use_default_null_ptr
 
class  force_use_default_null_ptr
 
struct  null_ptr_t
 

函数

void the_get_null_ptr () noexcept=delete
 
template<typename T >
constexpr auto get_null_ptr () noexcept
 
template<typename T , typename U = decltype(*null_ptr.base_get<T>())>
auto operator== (T *a, null_ptr_t) noexcept
 

变量

constexpr struct elc::defs::base::null_ptr_n::null_ptr_t null_ptr
 

函数说明

◆ get_null_ptr()

template<typename T >
constexpr auto elc::defs::base::null_ptr_n::get_null_ptr ( )
constexprnoexcept

在文件 all_defs.cpp8809 行定义.

8809 {
8810 push_and_disable_msvc_warning(26462);//貌似msvc在这里有bug
8811 constexpr auto null_as_T = static_cast<T*>(nullptr);
8812 if constexpr(was_not_an_ill_form(the_get_null_ptr(null_as_T)))
8813 return the_get_null_ptr(null_as_T);
8814 elseif constexpr(type_info<T>.has_attribute(can_t_use_default_null_ptr)&&type_info<T>.not_has_attribute(force_use_default_null_ptr)){
8815 template_error("please overload the function the_get_null_ptr in the namespace where this type is defined.");
8816 return null_as_T;
8817 }
8818 else
8819 return null_as_T;
8821 }
#define was_not_an_ill_form(...)
Definition all_defs.cpp:611
#define elseif
Definition all_defs.cpp:650
#define template_error(reason)
Definition all_defs.cpp:559
#define pop_msvc_warning()
Definition all_defs.cpp:478
#define push_and_disable_msvc_warning(...)
Definition all_defs.cpp:479
void the_get_null_ptr() noexcept=delete
函数调用图:
这是这个函数的调用关系图:

◆ operator==()

template<typename T , typename U = decltype(*null_ptr.base_get<T>())>
auto elc::defs::base::null_ptr_n::operator== ( T *  a,
null_ptr_t   
)
noexcept

在文件 all_defs.cpp8836 行定义.

8836 {
8837 return null_ptr.base_get<T>()==static_cast<const remove_ref<U>*>(add_const(a));
8838 }
constexpr struct elc::defs::base::null_ptr_n::null_ptr_t null_ptr
::std::remove_reference_t< T > remove_ref
Definition all_defs.cpp:839
constexpr const T add_const(T a) noexcept
对值追加const
constexprauto base_get() const noexcept
函数调用图:

◆ the_get_null_ptr()

void elc::defs::base::null_ptr_n::the_get_null_ptr ( )
deletenoexcept
这是这个函数的调用关系图:

变量说明

◆ null_ptr

constexpr struct elc::defs::base::null_ptr_n::null_ptr_t elc::defs::base::null_ptr_n::null_ptr