c++比较运算符重载函数_compare
来源:互联网 发布:怎样去开淘宝店 编辑:程序博客网 时间:2024/06/03 22:44
1. 函数参数可以任意类型的
2. 返回值是bool类型
3. 编译器没有提供默认实现,不能直接使用?
#define COMPARE(_op_) /
inline bool operator _op_ (const sp<T>& o) const { /
return m_ptr _op_ o.m_ptr; /
} /
inline bool operator _op_ (const wp<T>& o) const { /
return m_ptr _op_ o.m_ptr; /
} /
inline bool operator _op_ (const T* o) const { /
return m_ptr _op_ o; /
} /
template<typename U> /
inline bool operator _op_ (const sp<U>& o) const { /
return m_ptr _op_ o.m_ptr; /
} /
template<typename U> /
inline bool operator _op_ (const wp<U>& o) const { /
return m_ptr _op_ o.m_ptr; /
} /
template<typename U> /
inline bool operator _op_ (const U* o) const { /
return m_ptr _op_ o; /
}
- c++比较运算符重载函数_compare
- C++:重载函数运算符
- 【C++】重载运算符和重载函数
- 【C++】之【运算符重载函数】
- 成员函数重载运算符和友元函数重载运算符的比较
- 成员函数重载运算符和友元函数重载运算符的比较
- 成员函数重载运算符和友元函数重载运算符的比较
- 成员函数重载运算符和友元函数重载运算符的比较
- 成员函数重载运算符和友元函数重载运算符的比较
- 《C++》12 C++ 重载运算符和重载函数
- 赋值运算符重载函数[C/C++/C#]
- 比较运算符的重载
- 函数 运算符 重载
- 函数 运算符 重载
- 运算符重载函数
- C++-运算符重载
- [C++]重载运算符
- C#:运算符重载
- Windows下搭建MinGW+GTK开发环境
- Cygwin下 NS2安装
- Java网络编程--Socket
- 学习Preference使用
- fedora 13 x图形界面进入/root文件夹
- c++比较运算符重载函数_compare
- [音乐下载] [115永久续期] 最终心跳回忆。。。(11G)
- 3.29
- 关于setContentPane()和getContentPane()的应用.
- android 歌词同步实现
- [OPENGL]纹理,材质,光照
- 完成端口模型
- install ns2
- 计算机的点点滴滴