operators库
头文件
''boost/operators.hpp"
operators库由多个基类组成。派生operators的基类,在派生类中实现必须要实现的重载运算符函数,可以得到基类中其他的重载函数
less_than_comparable内含:
bool operator<(const T&,const T&);
bool operator>(const T&,const T&);
bool operator<=(const T&,const T&);
bool operator>=(const T&,const T&);当派生自boost::less_than_comparable时,派生类必须提供如下代码:
bool operator<(const T&,const T&);
equality_comparable内含:
bool operator==(const T&,const T&);
bool operator!=(const T&,const T&);必须实现:
bool operator==(const T&,const T&);
addable内含:
T operator+(const T&,const T&);
T operator+=(const T&,const T&);必须含有:
T operator+=(const T&,const T&);
subtractableT operator-(const T&,const T&);
T operator-=(const T&,const T&);必须含有:
T operator-=(const T&,const T&);
orableT operator|(const T&,const T&);
T operator|=(const T&,const T&);必须含有:
T operator|=(const T&,const T&);
andableT operator&(const T&,const T&);
T operator&=(const T&,const T&);必须含有:
T operator&=(const T&,const T&);
incrementableT& opeartor++(T&);
T opperator++(T&,int);必须含有:
T& operator++(T&);
decrementable
T& opeartor--(T&);
T opperator--(T&,int);必须含有:
T& operator--(T&);
equivalentbool operator<(const T&,const T&);
bool operator==(const T&,const T&);必须含有:
bool operator<(const T&,const T&);
dereferenceableR* operator->() const;
R& operator*() const;必须含有:
R operator*() const;
避免对象膨胀,采用的写法
operators库相关推荐
- c++学习书籍推荐《超越C++标准库:Boost库导论》下载
<超越C++标准库Boost库导论>不仅介绍了Boost库的功能.使用方法及注意事项,而且还深入讨论了Boost库的设计理念.解决问题的思想和技巧以及待处理的问题.因此,本书是一本了解Bo ...
- 最新超详细C++经典Boost库介绍
Boost库 Boost库是为C++语言标准库提供扩展的一些C++程序库的总称,由Boost社区组织开发.维护.Boost库可以与C++标准库完美共同工作,并且为其提供扩展功能. 目录 Boost库 ...
- 读《Boost程序库完全开发指南》
读<Boost程序库完全开发指南> 2011-05-18 20:47:19| 分类: 读书|举报|字号 订阅 C++确实很复杂,神一样的0x不知道能否使C++变得纯粹和干爽? boost ...
- 《Boost程序完全开发指南》
1.3开发环境 由于Boost大量使用了C++高级特性(如模板偏特化.ADL),因此不是所有的编译器都 能够很好地支持Boost. 在VC集成环境中使用嵌入工程编译的方式需要定义宏BOOST_ALL_ ...
- [C++] boost::less_than_comparable
boost::less_than_comparable 前言 很多操作符都是可以从其他操作符自动推导出来,例如a != b可以从!(a == b)推导出来,因此原则上只需要定义少量的基本操作符,其他的 ...
- Windows API参考大全
第一章 Win32 API概论 1.1为什么使用 Wu32 API 在Windows程序设计领域处于发展初期时,Windows程序员可使用的编程工具唯有API 函数.这些函数在程序员手中犹如" ...
- 基于C++模板的线性代数库---Eigen
Eigen 是一个基于C++模板的线性代数库,直接将库下载后放在项目目录下,然后包含头文件就能使用,非常方便.此外,Eigen的接口清晰,稳定高效. 在解决方案"属性"中的&quo ...
- C++中标准模板库std::pair的实现
以下用C++实现了标准模板库中的std::pair实现,参考了 cplusplus 和 vs2013中的utility文件. 关于std::pair的介绍和用法可以参考: https://blog.c ...
- JavaScript库和API
by Adam Recvlohe 通过亚当·雷夫洛厄(Adam Recvlohe) API就像一盒巧克力 (APIs are like a box of chocolates) If you have ...
- Eigen 矩阵运算库在实际项目中的使用
Eigen 矩阵运算库在实际项目中的使用情况如何? 心血来潮,试了试纯模板技术写的 Eigen 并作了简单的性能测试,三个 1000 阶的方阵连乘运算 Eigen 比 MATLAB 快了一倍,比 Op ...
最新文章
- keil2c语言使用教程,Keil教程(2)
- ITK:在没有写访问权的情况下迭代图像中的区域
- 深入理解Spark 2.1 Core (二):DAG调度器的原理与源码分析
- 如何处理班级过多的问题
- Android驱动(1)---Ubuntu中为Android系统上编写Linux内核驱动程序实现方法
- 03-07 APP 控件交互
- 快手短视频领域为例的领域数据建设探索
- 怎么看准确率_做题粗心马虎怎么训练?采取这三项措施,有效提高做题的准确率...
- Ubuntu,QT5连接MySQL
- jdk8 32位_HashMap源码分析 jdk8
- 工作六年后,对软件开发的一些新观点
- 使用yum更新补丁包
- 点云的无序性_三维点云分类与分割-PointNet
- 如何使用html制作网页
- JavaWeb笔记02(数据库)
- LinuxAndroid网络前缀和子网掩码的关系
- win10安装Tomcat10详细教程
- 计算机硬件与软件教学反思,计算机硬件教学反思.doc
- BBS(仿博客园系统)项目03(主页搭建、个人站点搭建(侧边栏分类展示、标签展示、日期归档)、文章详情页相关功能实现)...
- 网络(思科)——静态路由
热门文章
- 58.3万笔/秒!看阿里的黑科技
- 如何理解软件测试质量,我对测试总结报告和质量分析报告的理解
- python逆时针旋转矩阵_由外向内顺时针逆时针旋转矩阵
- 《数据库原理与应用》复习总结
- python乒乓球比赛规则介绍_乒乓球比赛规则简介
- EF多表关联数据更新
- 计算机专业选锐龙还是英特尔,如何选择cad制图用英特尔还是锐龙?
- 创建企业邮箱后如何登录邮箱?企业邮箱登陆入口在哪里?
- VS C++控制台程序 错误 fatal error C1083: 无法打开包括文件 解决办法
- Linux 设备树 status 详解