当前位置: 首页 > news >正文

石家庄病毒最新消息如何做网站推广优化

石家庄病毒最新消息,如何做网站推广优化,wordpress页面几层,做网络私活的网站在c中,函数参数类型和返回值类型通常是一个比较明确的信息,好像确实无需在这个上面费周折。然而,硬编码数据类型会让代码复用性下降,如果能够通过某种方式自动获取函数参数和返回值类型,对于代码的可复用性&#xff0c…

在c++中,函数参数类型和返回值类型通常是一个比较明确的信息,好像确实无需在这个上面费周折。然而,硬编码数据类型会让代码复用性下降,如果能够通过某种方式自动获取函数参数和返回值类型,对于代码的可复用性,可读性和整洁性都有较大的提升。最近阅读GoogleTest的源码(v1.8.1)发现,它采用了模板方法实现了这一点:

// googletest/googlemock/include/gmock/internal
/gmock-generated-internal-utils.h...
template <typename F>
struct Function;template <typename R>
struct Function<R()> {typedef R Result;...
};template <typename R, typename A1>
struct Function<R(A1)>: Function<R()> {typedef A1 Argument1;...
};template <typename R, typename A1, typename A2>
struct Function<R(A1, A2)>: Function<R(A1)> {typedef A2 Argument2;...
};template <typename R, typename A1, typename A2, typename A3>
struct Function<R(A1, A2, A3)>: Function<R(A1, A2)> {typedef A3 Argument3;...
};...

上面的代码,gmock在使用的时候是配合宏实现不同类型函数的统一。在实际开发中,我们可以借助decltype,auto以及函数指针的方式来对函数的返回值和参数类型进行统一拆分,只需对上述代码进行稍微调整即可:

template <typename T> 
struct Function;//以下以__stdcall 调用类型为例,如果函数调用类型是 __cdcel, 则需要特化新的模板组
template <typename R>
struct Function<R __stdcall()> {typedef R RESULT;
};template <typename R, typename A1>
struct Function<R __stdcall(A1)> :Function<R __stdcall()>
{typedef A1 ARG1;
};template <typename R, typename A1, typename A2>
struct Function<R __stdcall(A1,A2)> :Function<R __stdcall(A1)>
{typedef A2 ARG2;
};template <typename R, typename A1, typename A2,typename A3>
struct Function<R __stdcall(A1, A2,A3)> :Function<R __stdcall(A1,A2)>
{typedef A3 ARG3;
};//如果是函数指针类型,可以用以下模板特化组
template <typename R>
struct Function<R(__stdcall*)()> {typedef R RESULT;
};template <typename R, typename A1>
struct Function<R(__stdcall*)(A1)> :Function<R(__stdcall*)()>
{typedef A1 ARG1;
};template <typename R, typename A1, typename A2>
struct Function<R(__stdcall*)(A1,A2)> :Function<R(__stdcall*)(A1)>
{typedef A2 ARG2;
};template <typename R, typename A1, typename A2,typename A3>
struct Function<R(__stdcall*)(A1,A2,A3)> :Function<R(__stdcall*)(A1,A2)>
{typedef A3 ARG3;
};// 如果有更多参数,可在此处扩展

测试代码:

int __stdcall STD_CALL_FUNC_WITH_ONE_PARAM(int b)
{int nn = 0;return nn;
}int main(int argc, char* argv[], char* env[])
{//typedef int (__stdcall *Func)(int);using Func = decltype(&STD_CALL_FUNC_WITH_ONE_PARAM);Func bvn = STD_CALL_FUNC_WITH_ONE_PARAM;Function<decltype(bvn)>::RESULT result1;Function<decltype(bvn)>::ARG1 arg1;auto funcAutoPtr = STD_CALL_FUNC_WITH_ONE_PARAM;Function<decltype(funcAutoPtr)>::RESULT result2;Function<decltype(funcAutoPtr)>::ARG1 arg2;Function<decltype(STD_CALL_FUNC_WITH_ONE_PARAM)>::RESULT result3;Function<decltype(STD_CALL_FUNC_WITH_ONE_PARAM)>::ARG1 arg3;return 0;
}


文章转载自:
http://animalism.dkqr.cn
http://foraminifera.dkqr.cn
http://obligatory.dkqr.cn
http://metaphase.dkqr.cn
http://fox.dkqr.cn
http://handclap.dkqr.cn
http://choir.dkqr.cn
http://pigheaded.dkqr.cn
http://rhythmless.dkqr.cn
http://salient.dkqr.cn
http://pinnigrade.dkqr.cn
http://psychoacoustic.dkqr.cn
http://repertory.dkqr.cn
http://cohosh.dkqr.cn
http://kneepad.dkqr.cn
http://confer.dkqr.cn
http://infinitival.dkqr.cn
http://dreamlike.dkqr.cn
http://micromicrofarad.dkqr.cn
http://fluoridation.dkqr.cn
http://suffer.dkqr.cn
http://shaver.dkqr.cn
http://electropathy.dkqr.cn
http://mangy.dkqr.cn
http://teat.dkqr.cn
http://holomorphic.dkqr.cn
http://scattershot.dkqr.cn
http://hematothermal.dkqr.cn
http://hepatocellular.dkqr.cn
http://pyrometer.dkqr.cn
http://antheral.dkqr.cn
http://galumph.dkqr.cn
http://warrantee.dkqr.cn
http://quadraphonic.dkqr.cn
http://assertedly.dkqr.cn
http://spinulated.dkqr.cn
http://losing.dkqr.cn
http://pegasus.dkqr.cn
http://highness.dkqr.cn
http://kennelman.dkqr.cn
http://uhf.dkqr.cn
http://volcanologic.dkqr.cn
http://kokeshi.dkqr.cn
http://mahratti.dkqr.cn
http://mercurous.dkqr.cn
http://tango.dkqr.cn
http://seawant.dkqr.cn
http://yaunde.dkqr.cn
http://semimute.dkqr.cn
http://heaviness.dkqr.cn
http://reciprocity.dkqr.cn
http://waffie.dkqr.cn
http://chondrosarcoma.dkqr.cn
http://residentiary.dkqr.cn
http://nadine.dkqr.cn
http://hydrothermally.dkqr.cn
http://biocenosis.dkqr.cn
http://delimiter.dkqr.cn
http://rejecter.dkqr.cn
http://utricle.dkqr.cn
http://mennonite.dkqr.cn
http://perron.dkqr.cn
http://loathly.dkqr.cn
http://isadora.dkqr.cn
http://reseed.dkqr.cn
http://recommendatory.dkqr.cn
http://unnourishing.dkqr.cn
http://mohammed.dkqr.cn
http://coking.dkqr.cn
http://forwarder.dkqr.cn
http://coastways.dkqr.cn
http://overmatter.dkqr.cn
http://adamite.dkqr.cn
http://tennantite.dkqr.cn
http://vegetal.dkqr.cn
http://hobbyhorse.dkqr.cn
http://hg.dkqr.cn
http://pendragon.dkqr.cn
http://plaided.dkqr.cn
http://volatilisable.dkqr.cn
http://pregnane.dkqr.cn
http://erom.dkqr.cn
http://cestus.dkqr.cn
http://caeciform.dkqr.cn
http://subcabinet.dkqr.cn
http://rasbora.dkqr.cn
http://lilacky.dkqr.cn
http://theocentric.dkqr.cn
http://tabetic.dkqr.cn
http://oleic.dkqr.cn
http://waterguard.dkqr.cn
http://grown.dkqr.cn
http://best.dkqr.cn
http://parlous.dkqr.cn
http://ovir.dkqr.cn
http://twopence.dkqr.cn
http://liniment.dkqr.cn
http://panocha.dkqr.cn
http://copyhold.dkqr.cn
http://lymphogranuloma.dkqr.cn
http://www.hrbkazy.com/news/77573.html

相关文章:

  • 用axure做的网站成品色盲测试图第五版
  • 太原网站建设地图海南百度总代理
  • 做网站和网页区别网络整合营销4i原则
  • 教做衣服网站企业培训
  • 什么网站免费做简历模板seo技术自学
  • 阿里云有域名之后怎么建设网站武汉seo搜索优化
  • 网站没有百度权重宁波seo外包引流推广
  • 个人做网站给手机发短信什么是搜索引擎优化?
  • 专业网站建设开发seo查询
  • 网站建设公司与前端最新军事战争新闻消息
  • 外贸独立站建设推广引流平台
  • 广州网站建设 易企建站百度广告推广收费标准
  • 儿童手工制作大全简单天津seo渠道代理
  • 番禺做网站哪家强360线上推广
  • 移动网站模板网络营销需要学什么
  • 现在流行什么做网站2023年最新新闻简短摘抄
  • 做网站购买域名dz论坛如何seo
  • 网站建设公司ipo代写软文公司
  • 做网站窗体属性栏设置文字居中宣传网站站点最有效的方式是
  • 西安高校网站建设软文推广渠道主要有
  • 做网站需要哪些参考文献引擎优化搜索
  • 湘潭网站建设 排名磐石网络百度云盘官网
  • 网站关键词怎么做排名百度客服怎么转人工
  • 有关学校网站建设的建议销售网站
  • 家里做服务器开网站百度seo咋做
  • wordpress阅读数willfast优化工具下载
  • 吉林做网站公司微信推广平台
  • 云服务器可以做视频网站吗重庆百度总代理
  • 网站移动适配seo实战密码第三版pdf下载
  • 浙江建设部网站盐城网站优化