namespace fd
{
// ----------------------------------------------------------------------
class bad_function_call;
class bad_member_function_call;
// ======================================================================
//
// class delegateN (Portable Syntax)
//
// ======================================================================
template<typename R,typename T1,typename T2,...,typename TN,
typename Alloocator = std::allocator<void>,size_t t_countof_pvoid = 2>
class delegateN;
// ----------------------------------------------------------------------
// default c'tor
delegateN<R, T1, T2, ..., TN>::delegateN();
// ----------------------------------------------------------------------
// copy c'tor for 0
delegateN<R, T1, T2, ..., TN>::delegateN(implClass::clear_type const *);
// ----------------------------------------------------------------------
// copy c'tor
delegateN<R, T1, T2, ..., TN>::delegateN(delegateN<R, T1, T2, ..., TN> const & other);
// ----------------------------------------------------------------------
// function copy c'tor
delegateN<R, T1, T2, ..., TN>::delegateN(R (*fn)(T1, T2, ..., TN);
// ----------------------------------------------------------------------
// member function adapter copy c'tors
// ,where T1 can be trivially converted to either U * or U &
delegateN<R, T1, T2, ..., TN>::delegateN(R (U::*mfn)(T2, T3, ..., TN));
// ,where T1 can be trivially converted to one of U * or U const * or U & or U const &
delegateN<R, T1, T2, ..., TN>::delegateN(R (U::*mfn)(T2, T3, ..., TN) const);
// ----------------------------------------------------------------------
// member function argument binding copy c'tors
delegateN<R, T1, T2, ..., TN>::delegateN(R (U::*mfn)(T1, T2, ..., TN), T & obj);
delegateN<R, T1, T2, ..., TN>::delegateN(R (U::*mfn)(T1, T2, ..., TN) const, T & obj);
delegateN<R, T1, T2, ..., TN>::delegateN(R (U::*mfn)(T1, T2, ..., TN), T * obj);
delegateN<R, T1, T2, ..., TN>::delegateN(R (U::*mfn)(T1, T2, ..., TN) const, T * obj);
// ----------------------------------------------------------------------
// functor copy c'tors
template<typename Functor>
delegateN<R, T1, T2, ..., TN>::delegateN(Functor & ftor, bool/* dummy*/);
template<typename Functor>
delegateN<R, T1, T2, ..., TN>::delegateN(Functor * ftor, bool/* dummy*/);
// ----------------------------------------------------------------------
// assignment from 0
delegateN<R, T1, T2, ..., TN> &
delegateN<R, T1, T2, ..., TN>::operator = (implClass::clear_type const *);
// ----------------------------------------------------------------------
// assignment operator
delegateN<R, T1, T2, ..., TN> &
delegateN<R, T1, T2, ..., TN>::operator = (delegateN<R, T1, T2, ..., TN> const & other);
// ----------------------------------------------------------------------
// function assignment operator
delegateN<R, T1, T2, ..., TN> &
delegateN<R, T1, T2, ..., TN>::operator = (R (*fn)(T1, T2, ..., TN);
// ----------------------------------------------------------------------
// member function adapter assignment operators
// ,where T1 can be trivially converted to either U * or U &
delegateN<R, T1, T2, ..., TN> &
delegateN<R, T1, T2, ..., TN>::operator = (R (U::*mfn)(T2, ..., TN));
// ,where T1 can be trivially converted to one of U * or U const * or U & or U const &
delegateN<R, T1, T2, ..., TN> &
delegateN<R, T1, T2, ..., TN>::operator = (R (U::*mfn)(T2, ..., TN) const);
// ----------------------------------------------------------------------
// member function argument binding assignment operators
delegateN<R, T1, T2, ..., TN> &
delegateN<R, T1, T2, ..., TN>::operator = (R (U::*mfn)(T1, T2, ..., TN), T & obj);
delegateN<R, T1, T2, ..., TN> &
delegateN<R, T1, T2, ..., TN>::operator = (R (U::*mfn)(T1, T2, ..., TN) const, T & obj);
delegateN<R, T1, T2, ..., TN> &
delegateN<R, T1, T2, ..., TN>::operator = (R (U::*mfn)(T1, T2, ..., TN), T * obj);
delegateN<R, T1, T2, ..., TN> &
delegateN<R, T1, T2, ..., TN>::operator = (R (U::*mfn)(T1, T2, ..., TN) const, T * obj);
// ----------------------------------------------------------------------
// functor assignment operators
template<typename Functor>
delegateN<R, T1, T2, ..., TN> &
delegateN<R, T1, T2, ..., TN>::operator <<= (Functor & ftor);
template<typename Functor>
delegateN<R, T1, T2, ..., TN> &
delegateN<R, T1, T2, ..., TN>::operator <<= (Functor * ftor);
// ----------------------------------------------------------------------
// invocation operator
result_type operator ()(T1 p1, T2 p2, ..., TN pN) const;
// ----------------------------------------------------------------------
// swap
void delegateN<R, T1, T2, ..., TN>::swap(delegateN & other);
// ----------------------------------------------------------------------
// clear
void delegateN<R, T1, T2, ..., TN>::clear();
// ----------------------------------------------------------------------
// empty
bool delegateN<R, T1, T2, ..., TN>::empty() const;
// ----------------------------------------------------------------------
// comparison for 0
bool operator == (implClass::clear_type const *) const;
bool operator != (implClass::clear_type const *) const;
// ----------------------------------------------------------------------
// compare
int compare(delegateN const & other, bool check_bound_object = false) const;
// comparison operators
bool operator == (delegateN<R, T1, T2, ..., TN> const & other) const;
bool operator != (delegateN<R, T1, T2, ..., TN> const & other) const;
bool operator <= (delegateN<R, T1, T2, ..., TN> const & other) const;
bool operator < (delegateN<R, T1, T2, ..., TN> const & other) const;
bool operator >= (delegateN<R, T1, T2, ..., TN> const & other) const;
bool operator > (delegateN<R, T1, T2, ..., TN> const & other) const;
// ======================================================================
//
// class delegate (Preferred Syntax)
//
// ======================================================================
template<typename R,typename T1,typename T2,...,typename TN,
typename Allocator = std::allocator<void>,size_t t_countof_pvoid = 2>
class delegate<R (T1, T2, ..., TN), Allocator, t_countof_pvoid>;
//
// the same set of member functions as fd::delegateN of Portable Syntax
//
// ======================================================================
//
// fd::make_delegate()
//
// ======================================================================
// make_delegate for function
template<typename R,typename T1,typename T2,...,typename TN,typename U,typename T>
delegateN<R, T1, T2, ..., TN>
make_delegate(R (*fn)(T1, T2, ..., TN));
// ----------------------------------------------------------------------
// make_delegate for member function adapter
template<typename R,typename T2,...,typename TN,typename U,typename T>
delegateN<R, T *, T2, ..., TN>
make_delegate(T *, R (U::*mfn)(T2, ..., TN));
template<typename R,typename T2,...,typename TN,typename U,typename T>
delegateN<R, T *, T2, ..., TN>
make_delegate(T *, R (U::*mfn)(T2, ..., TN) const);
// ----------------------------------------------------------------------
// make_delegate for member function argument binding
template<typename R,typename T1,typename T2,...,typename TN,typename U,typename T>
delegateN<R, T1, T2, ..., TN>
make_delegate(R (U::*mfn)(T1, T2, ..., TN), T & obj);
template<typename R,typename T1,typename T2,...,typename
fd_src.zip_模板类
版权申诉
70 浏览量
2022-09-24
13:45:22
上传
评论
收藏 33KB ZIP 举报
我虽横行却不霸道
- 粉丝: 75
- 资源: 1万+
最新资源
- tensorflow-gpu-2.5.0-cp39-cp39-manylinux2010-x86-64.whl
- tensorflow-gpu-2.5.2-cp39-cp39-manylinux2010-x86-64.whl
- 内含方正小标宋简体、仿宋-Gb2312、黑体、楷体、宋体,五个公文常用字体
- 记忆卡牌游戏源码及可运行文件
- 利用wps的js宏编写的一键格式修改辅助工具
- 基于matlab实现训练RBF网络的,但用的算法是梯度下降法,算法仍然是自己写的.rar
- 基于matlab实现小波分析改造后,可以分析脑电数据的程序,出现32个导联每个通道的功率谱.rar
- 基于matlab实现物体的应力和应变DIC-通过识别一系列图像的变形得到物体的应力和应变
- 基于matlab实现文档+程序NSGA-II多目标优化的matlab代码.rar
- 基于matlab实现文档+程序 多目标优化,NSGA2算法实现.rar
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
评论0