STL源码剖析——stl_relops.h学习
来源:互联网 发布:淘宝分享有礼qq群 编辑:程序博客网 时间:2024/06/05 07:36
前言
这个文件提供了操作符的重载,但是没有提供operator==和operator<的重载,用户要使用这些操作符时,必须自己重载operator==和operator<操作符,因为该文件的重载操作符都是基于这两种操作符。本文件出自SGI STL中的<stl_relops.h>。
relops源码
// 这里提供比较运算符的重载, 任何全局的比较运算符如果需要重载 // 只需要自己提供operator <和==即可 #ifndef __SGI_STL_INTERNAL_RELOPS#define __SGI_STL_INTERNAL_RELOPS__STL_BEGIN_RELOPS_NAMESPACEtemplate <class _Tp>inline bool operator!=(const _Tp& __x, const _Tp& __y) { return !(__x == __y);}template <class _Tp>inline bool operator>(const _Tp& __x, const _Tp& __y) { return __y < __x;}template <class _Tp>inline bool operator<=(const _Tp& __x, const _Tp& __y) { return !(__y < __x);}template <class _Tp>inline bool operator>=(const _Tp& __x, const _Tp& __y) { return !(__x < __y);}__STL_END_RELOPS_NAMESPACE#endif /* __SGI_STL_INTERNAL_RELOPS */// Local Variables:// mode:C++// End:
0 0
- STL源码剖析——stl_relops.h学习
- 《STL源码剖析》-- stl_relops.h
- STL源码剖析——stl_pair.h学习
- STL源码剖析——stl_hash_fun.h学习
- 《STL源码剖析》—— stl_config.h
- STL源码剖析——stl_tree.h
- STL源码剖析——stl_numeric.h
- STL源码剖析——stl_algobase.h
- STL源码剖析——STL算法stl_algo.h
- STL源码剖析——数值算法stl_numeric.h
- STL源码剖析——基本算法stl_algobase.h
- C++ STL源码剖析——stl_config.h
- C++ STL源码剖析——defalloc.h
- C++ STL源码剖析——stl_alloc.h
- stl_relops.h
- 《STL源码剖析》-- stl_config.h
- 《STL源码剖析》-- defalloc.h
- 《STL源码剖析》-- stl_alloc.h
- Big Data: 20 Free Big Data Sources Everyone Should Know
- POJ 2777--Count Color(线段树)
- 用WebCollector制作一个爬取《知乎》并进行问题精准抽取的爬虫(JAVA)
- 使用ViewPage实现无缝左右循环滑动
- spring开发包详解
- STL源码剖析——stl_relops.h学习
- 中国计算机学会推荐国际学术刊物
- poj1753
- 浅析android线程模型【Android】
- 39个让你受益的HTML5教程
- 编译android vbox_x86-eng 报错
- 浅入浅出SQL注入
- linux VFS
- 2014年9月27 网新恒天面试总结