Ai
9 Star 32 Fork 21

10km/common_source_cpp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
memory_ext.h 1.91 KB
一键复制 编辑 原始数据 按行查看 历史
10km 提交于 2018-04-11 09:37 +08:00 . 导入代码
/*
* memory_ext.h
*
* Created on: 2016年8月21日
* Author: guyadong
*/
#ifndef COMMON_SOURCE_CPP_MEMORY_EXT_H_
#define COMMON_SOURCE_CPP_MEMORY_EXT_H_
#include <memory>
namespace std{
template<typename _T>
inline bool operator==(const std::shared_ptr<_T>& __a, const _T &__b) noexcept{ return nullptr==__a?false:*__a== __b; }
template<typename _T>
inline bool operator==(const _T &__a, const std::shared_ptr<_T>& __b) noexcept{ return nullptr==__b?false:*__b== __a; }
template<typename _T>
inline bool operator!=(const std::shared_ptr<_T>& __a, const _T &__b) noexcept{ return nullptr==__a?false:*__a!= __b; }
template<typename _T>
inline bool operator!=(const _T &__a, const std::shared_ptr<_T>& __b) noexcept{ return nullptr==__b?false:*__b!= __a; }
template<typename _T>
inline bool operator>(const std::shared_ptr<_T>& __a, const _T &__b) noexcept{ return nullptr==__a?false:*__a> __b; }
template<typename _T>
inline bool operator>(const _T &__a, const std::shared_ptr<_T>& __b) noexcept{ return nullptr==__b?false:*__b> __a; }
template<typename _T>
inline bool operator>=(const std::shared_ptr<_T>& __a, const _T &__b) noexcept{ return nullptr==__a?false:*__a>= __b; }
template<typename _T>
inline bool operator>=(const _T &__a, const std::shared_ptr<_T>& __b) noexcept{ return nullptr==__b?false:*__b>= __a; }
template<typename _T>
inline bool operator<(const std::shared_ptr<_T>& __a, const _T &__b) noexcept{ return nullptr==__a?false:*__a< __b; }
template<typename _T>
inline bool operator<(const _T &__a, const std::shared_ptr<_T>& __b) noexcept{ return nullptr==__b?false:*__b< __a; }
template<typename _T>
inline bool operator<=(const std::shared_ptr<_T>& __a, const _T &__b) noexcept{ return nullptr==__a?false:*__a<= __b; }
template<typename _T>
inline bool operator<=(const _T &__a, const std::shared_ptr<_T>& __b) noexcept{ return nullptr==__b?false:*__b<= __a; }
} /*namespace std*/
#endif /* COMMON_SOURCE_CPP_MEMORY_EXT_H_ */
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/l0km/common_source_cpp.git
git@gitee.com:l0km/common_source_cpp.git
l0km
common_source_cpp
common_source_cpp
master

搜索帮助