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

Public 成员函数

template<typename T >
requires able<T>
void operator() (T *a) const noexcept(nothrow< T >)
 
template<typename T >
requires able<T>
void operator() (T *a, decltype(destruct)::not_t) const noexcept(nothrow< T >)
 

静态 Public 属性

template<typename T >
static constexpr bool able =destruct.able<T>
 
template<typename T >
static constexpr bool nothrow =destruct.nothrow<T>
 

详细描述

在文件 all_defs.cpp21766 行定义.

成员函数说明

◆ operator()() [1/2]

template<typename T >
requires able<T>
void elc::defs::memory::get_n::unget_t::operator() ( T *  a) const
inlinenoexcept

在文件 all_defs.cpp21773 行定义.

21773 {
21774 const APIs::alloc::source_location_guard slg;
21775 if(a!=null_ptr){
21776 if constexpr(::std::is_polymorphic_v<T> && !::std::is_final_v<T>)
21777 if constexpr(type_info<T>.has_attribute(abstract_base)){
21778 #if defined(_MSC_VER)
21779 [[gsl::suppress(f.6)]]
21780 #endif
21781 attribute_ptr_cast<abstract_base>(a)->abstract_method_unget_this();
21782 return;
21783 }
21784 elseif constexpr(type_info<T>.not_has_attribute(instance_struct))
21785 template_warning("T is polymorphic, but there is no elc::abstract_base attribute to provide information to elc's memory system, which could lead to incorrect unget handling.");
21786 if constexpr(!destruct.nothrow<T>)
21787 template_warning("the destructer of T was not noexcept,this may cause memory lack.");
21788 if constexpr(type_info<T>.has_attribute(never_in_array))
21789 destruct(a);
21790 else
21792 free(a);
21793 }
21794 }
#define elseif
Definition all_defs.cpp:650
#define has_attribute(...)
Definition all_defs.cpp:572
#define template_warning(reason)
Definition all_defs.cpp:563
constexpr T down_cast(U a) noexcept
向下转型至
constexpr struct elc::defs::memory::alloc_n::get_size_of_alloc_t get_size_of_alloc
constexpr struct elc::defs::memory::alloc_n::free_t free
constexpr struct elc::defs::memory::lifetime_n::destruct_t destruct

◆ operator()() [2/2]

template<typename T >
requires able<T>
void elc::defs::memory::get_n::unget_t::operator() ( T *  a,
decltype(destruct)::not_t   
) const
inlinenoexcept

在文件 all_defs.cpp21797 行定义.

21797 {
21798 const APIs::alloc::source_location_guard slg;
21799 free(a);
21800 }

类成员变量说明

◆ able

template<typename T >
constexpr bool elc::defs::memory::get_n::unget_t::able =destruct.able<T>
staticconstexpr

在文件 all_defs.cpp21768 行定义.

◆ nothrow

template<typename T >
constexpr bool elc::defs::memory::get_n::unget_t::nothrow =destruct.nothrow<T>
staticconstexpr

在文件 all_defs.cpp21770 行定义.


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