Solaris C ++流输入>>操作员和模板的模板 [英] Solaris C++ stream input >> operator and templates of templates

查看:149
本文介绍了Solaris C ++流输入>>操作员和模板的模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个编译器选项,我可以在CC编译器中使用以获得以下代码
(在Visual C ++中编译良好)

I there a compiler option I could use in CC compiler to get the following code (which compiles fine in Visual C++)

std::vector<std::vector<double>> v2;

没有以下错误


错误:,预期而不是>>

Error: "," expected instead of ">>"


推荐答案

尝试此操作:

std :: vector< std :: vector< double> > v2; //给两个之间的空格'>'

>> 解释为右移位运算符,因此会得到编译时错误。

">>" is interpreted as the right shift operator and hence you get a compile time error.

这个问题将在C ++ 0x中修复。查看 此处

This problem will be fixed in C++0x. Have a look here .

这篇关于Solaris C ++流输入&gt;&gt;操作员和模板的模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆