侯捷stl源码剖析注释之17sgi-stl-33-function

侯捷stl源码剖析注释之17sgi-stl-33-function

ID:42434481

大小:241.58 KB

页数:14页

时间:2019-09-15

侯捷stl源码剖析注释之17sgi-stl-33-function_第1页
侯捷stl源码剖析注释之17sgi-stl-33-function_第2页
侯捷stl源码剖析注释之17sgi-stl-33-function_第3页
侯捷stl源码剖析注释之17sgi-stl-33-function_第4页
侯捷stl源码剖析注释之17sgi-stl-33-function_第5页
资源描述:

《侯捷stl源码剖析注释之17sgi-stl-33-function》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库

1、SGISTL3.3stl_function.h完整列表/**Copyright(c)1994*Hewlett-PackardCompany**Permissiontouse,copy,modify,distributeandsellthissoftware*anditsdocumentationforanypurposeisherebygrantedwithoutfee,*providedthattheabovecopyrightnoticeappearinallcopiesand*thatbotht

2、hatcopyrightnoticeandthispermissionnoticeappear*insupportingdocumentation.Hewlett-PackardCompanymakesno*representationsaboutthesuitabilityofthissoftwareforany*purpose.Itisprovidednasis"withoutexpressorimpliedwarranty.*Copyright(c)1996-1998*SiliconGraphi

3、csComputerSystems,Inc.**Permissiontouse,copy,modify,distributeandsellthissoftware*anditsdocumentationforanypurposeisherebygrantedwithoutfee,*providedthattheabovecopyrightnoticeappearinallcopiesand*thatboththatcopyrightnoticeandthispermissionnoticeappear

4、*insupportingdocumentation.SiliconGraphicsmakesno*representationsaboutthesuitabilityofthissoftwareforany*purpose.Itisprovidednasis"withoutexpressorimpliedwarranty・/*NOTE:Thisisaninternalheaderfile,includedbyotherSTLheaders.*Youshouldnotattempttouseitdir

5、ectly.#ifndef—SGI_STL_INTERNAL_FUNCTION_H#defineSGISTLINTERNALFUNCTIONH_STL_BEGIN_NAMESPACEtemplatestructunary_function{typedef_Argargument_type;typedef_Resultresult_type;};templatestructbinary

6、_function{typedef_Arglfirst_argument_type;typedef_Arg2second_argument_type;typedef_Resultresult_type;};templatestructplus:publicbinary_function<_Tp,_Tpz_Tp>{_Tpoperator()(const_Tp&_xrconst_Tp&_y)const{return—x+—y;}};templatestructmin

7、us:publicbinary_functione_Tp,_Tp,_Tp>{_Tpoperator()(const_Tp&—xzconst_Tp&_y)const{return—x-—y;}};templatestructmultiplies:publicbinary_function<_Tpr_Tp,_Tp>{_Tpoperator()(const_Tp&x,const_Tp&y)const{returnx*y;}};templatestructdivides

8、:publicbiri3ry_function<_Tp,_Tp,_Tp>{_Tpoperator()(const_Tp&_xzconst_Tp&—y)const{return_x/_y;}};//identity_eleinent(notpartoftheC++standard)•templateinline_Tpidentity_element(plus<_Tp>)(return_Tp(0);}templatei

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。