语法错误
c++吧
全部回复
仅看楼主
level 11
whatofor 楼主
const class
{
public:
template<typename T>
operator T*()const
{
return 0;
} template<typename T,class C>
operator T C::*()const
{
return 0;
}
private:
void operator&()const;
}nullptr;
错误:template.cpp|24|error: uninitialized const 'nullptr'|
||=== Build finished: 1 errors, 0 warnings ===|
这是符合标准的用法吗? 我想知道是编译器的问题还是用法的问题

2012年03月04日 02点03分 1
level 11
whatofor 楼主
重新安装了mingw4.6.1(32bit),还是不行。
还是玩玩vs2008算了
2012年03月04日 03点03分 3
level 12
SP1好像有?
2012年03月04日 03点03分 5
level 12
g++ 4.6已经支持nullptr了
加开关 -std=c++0x
2012年03月04日 03点03分 6
level 11
whatofor 楼主
主要是下面的语法
const class
{
///...
}classname;
是否符合标准还是只是 vc的扩展
2012年03月04日 03点03分 7
level 12
本以为xcode4.3已经支持lambda, 结果却总是编译错误。。。
2012年03月04日 04点03分 8
level 11
whatofor 楼主
你没加c++0x支持?
2012年03月04日 04点03分 9
level 12
不支持
clang+
+3
.1(svn)才会支持lambda,xcode自带g++好像支持4.2.?而已
开源协议神马的
2012年03月04日 04点03分 10
level 12
支持4.2.? -> 只是4.2.?
2012年03月04日 04点03分 11
level 12
我会告诉你在项目配置里面写了个很霸气的LLVM3.1所以我才试试的吗。。。
话说我用port安装3.1说装ld64有啥bug。。。
自己cmake又有天书般的错误代码。。。
2012年03月04日 11点03分 12
level 12
clang++最近没多久才支持了lambda
你命令行试一下,看是编译器直接崩溃,还是提示lambda表达式不支持(-std=c++11)
2012年03月04日 12点03分 13
level 12
饿。。。我cmake clang 3.1为啥爆了。。。
Xcode似乎未能解析这个错误。。。
编译器出错信息似乎是Lambda里传入的变量调用后提示未定义。。。不会又是我2B了吧。。。
for_each(dat.begin(); dat.end(); [](int a) { cout << a << endl; });
类似这样的代码。。。提示a未定义。。。
2012年03月04日 12点03分 14
level 11
whatofor 楼主
for_each(dat.begin(); dat.end(); [](int a) { cout << a << endl; });
//参数之间不是用逗号吗?
2012年03月04日 12点03分 15
level 12
参数间用“,”分隔[瀑布汗~]
2012年03月04日 12点03分 16
level 12
木见过const class{}classname;的彩笔路过,,,,,,,,[墙角]
2012年03月04日 12点03分 17
level 11
whatofor 楼主
那咱们都是今天才见到
2012年03月04日 12点03分 18
level 12
那你也算是前辈
2012年03月04日 12点03分 19
level 11
whatofor 楼主
新版是指哪个版本?4.7.0?
2012年03月04日 13点03分 21
level 12

也许标准有新规定@幻の上帝
clang++是必须加的
2012年03月04日 13点03分 22
1 2 尾页