📄 wy_atdestroy.3wy
字号:
.\".\" Edited by I.J.Wang, 2005.\".TH Wy_AtDestroy 3wy "libwy v0.31".SH NAMEWy_AtDestroy \- class template for function call at destruction.SH SYNOPSIS.B #include <wy_atdestroy.h>.PPWy_AtDestroy is a class template to call the given function at objectdestruction.Note: Stack unwind initiated from the destructor increases the chance of unexpected termination.Example: char* buf= new char[100]; T* tp= new T(); Wy_AtDestroy<void,char*> rrad_buf(Wy::_delete_array,buf); Wy_AtDestroy<void,T*> rrad_tp (Wy::_delete_one,tp);.SH "template<typename R, typename A>" \fBWy_AtDestroy\fP(R,A) \fB~Wy_AtDestroy\fP() void \fBrelease\fP(void) thow().SH "template<typename R,typename A1,typename A2>" \fBWy_AtDestroy2\fP(R,A1,A2) \fB~Wy_AtDestroy2\fP() void \fBrelease\fP(void) thow().SH "DESCRIPTION".\"--------------------------------------------.PP.BI "Wy_AtDestroy( R(*" "f" ")(A), A " "arg" ")".PP.BI "Wy_AtDestroy2( R(*" "f" ")(A1,A2), A1 " "arg1" ", A2 " "arg2" ")".PP Construct object to call \fIf\fP(\fIarg\fP) or \fIf\fP(\fIarg1\fP,\fIarg2\fP) when object is in destruction. Note: Function argument types \fBA\fP/\fBA1\fP/\fBA2\fP are better pointer or reference types. The expanded code may construct(copy) the argument object(s) and destruct, and call \fIf\fP with the copy constructed object, the result might not be what is desired..\"--------------------------------------------.PP.BI "~Wy_AtDestroy().PP.BI "~Wy_AtDestroy2().PP Destruct *this by calling \fIf\fP(\fIarg\fP) or \fIf\fP(\fIarg1\fP,\fIarg2\fP), of which the return value is ignored..\"--------------------------------------------.PP.BI "void release(void) thow()".PP Release *this from calling the constructor given function at object destruction..\"--------------------------------------------.SH "SEE ALSO".BR wy.BR wyret.BR wymutex.BR wyfifofile.BR wyregfile.BR wysockfile.BR wy_thread.SH NOTEProject is in development, http://sourceforge.net/projects/libwx
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -