设为首页 加入收藏

TOP

标准C++实现字符串类CString(三)
2014-11-24 03:17:21 来源: 作者: 【 】 浏览:10
Tags:标准 实现 字符串 CString
(s1.Compare(s2.GetData()) != 0);
}
bool operator!=(const CString& s1, const char* s2)
{
return (s1.Compare(s2) != 0);
}
bool operator!=(const char* s1, const CString& s2)
{
return (s2.Compare(s1) != 0);
}

bool operator>(const CString& s1, const CString& s2)
{
return (s1.Compare(s2.GetData()) > 0);
}
bool operator>(const CString& s1, const char* s2)
{
return (s1.Compare(s2) > 0);
}
bool operator>(const char* s1, const CString& s2)
{
return (s2.Compare(s1) < 0);
}

bool operator<(const CString& s1, const CString& s2)
{
return (s1.Compare(s2.GetData()) < 0);
}
bool operator<(const CString& s1, const char* s2)
{
return (s1.Compare(s2) < 0);
}
bool operator<(const char* s1, const CString& s2)
{
return (s2.Compare(s1) > 0);
}

bool operator>=(const CString& s1, const CString& s2)
{
return (s1.Compare(s2.GetData()) >= 0);
}
bool operator>=(const CString& s1, const char* s2)
{
return (s1.Compare(s2) >= 0);
}
bool operator>=(const char* s1, const CString& s2)
{
return (s2.Compare(s1) <= 0);
}

bool operator<=(const CString& s1, const CString& s2)
{
return (s1.Compare(s2.GetData()) <= 0);
}
bool operator<=(const CString& s1, const char* s2)
{
return (s1.Compare(s2) <= 0);
}
bool operator<=(const char* s1, const CString& s2)
{
return (s2.Compare(s1) >= 0);
}


首页 上一页 1 2 3 4 5 6 下一页 尾页 3/6/6
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇C++面试题-链表栈二叉树数据结构 下一篇单独编译Android源代码中的模块

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·常用meta整理 | 菜鸟 (2025-12-25 01:21:52)
·SQL HAVING 子句:深 (2025-12-25 01:21:47)
·SQL CREATE INDEX 语 (2025-12-25 01:21:45)
·Shell 传递参数 (2025-12-25 00:50:45)
·Linux echo 命令 - (2025-12-25 00:50:43)