为什么这段代码在unix下编译会出问题??急~~~~~~

castaway 2005-10-13 09:47:36
现有一段代码,在vc6下编译通过,但是在sco unix下用CC -c编译却要报错:
template<typename IterT>
class sub_expr_base<IterT>
{...};

template<typename IterT>
class sub_expr<IterT> : public sub_expr_base<IterT>
{
typedef typename std::iterator_traits<IterT>::value_type char_type;
};

template<typename IterT>
class assertion : public sub_expr<IterT>
{
public:
char_type cc;
};
...

在sco unix下执行CC -c *.cpp编译时会报错:
error: nontype "sub_expr<IterT>::char_type[with IterT=IterT] is not a type name
char_type cc;

请问各位高手这是什么原因啊?是不是sco unix下的名字空间std中没有iterator_traits?
...全文
128 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
yyy790601 2005-10-13
  • 打赏
  • 举报
回复
根据提示是没有sub_expr这个类型
mefit 2005-10-13
  • 打赏
  • 举报
回复
用下g++或者cxx编译看看

23,121

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧