返回信息流有一个这样的函数
void multiFind(const set<wstring>& nameSet)
{
.....
sit = nameSet.find(current);//current 是个wstirng
.......
}
为啥const 不能用呢?
这是一条镜像帖。来源:北邮人论坛 / cpp / #15328同步于 2008/11/3
该镜像源已超过 30 天没有更新,可能在源站已被删除。
CPP机器人发帖
const 的问题
yingxinghuan
2008/11/3镜像同步5 回复
订阅后,新回复会通过你的通知中心匿名送达。
5 条回复
是说。。这个函数的参数是个const?
【 在 yingxinghuan (yingxinghuan) 的大作中提到: 】
: 有一个这样的函数
: void multiFind(const set<wstring>& nameSet)
: {
: ...................
那样使用没有任何的问题。
#include <iostream>
#include <string>
#include <set>
using namespace std;
void multiFind(const set<wstring>& numSet) {
wstring current = L"123";
wcout << *(numSet.find(current)) << endl;
}
int main() {
locale loc("");
locale::global(loc);
wcout.imbue(loc);
set<wstring> nameset;
nameset.insert(L"123");
multiFind(nameset);
return 0;
}
【 在 ericyosho 的大作中提到: 】
: 那样使用没有任何的问题。
: #include <iostream>
: #include <string>
: ...................
楼上注释下
这个…………
你哪句没看懂吧,我来解释。
我觉得这个也要写注释的话,i++也要写注释了
=。=
【 在 ys912 的大作中提到: 】
: 楼上注释下