标题:迭代器问题
取消只看楼主
q1826050194
Rank: 2
等 级:论坛游民
帖 子:67
专家分:19
注 册:2011-3-7
结帖率:77.78%
已结贴  问题点数:20 回复次数:0 
迭代器问题
#include<algorithm>
#include<iostream>
#include<iterator>

template<typename Iter>
void print(Iter first,Iter last,const char* nm="", const char* seq="\n",std::ostream& os=std::cout){
    if(nm!=0&&nm!='\0')
    os<<nm<<":"<<seq;
    typedef typename iterator_traits<Iter>::value_type T;
    copy(first,last,ostream_iterator<T>(cout,seq));
    os<<std::endl;
}

--------------------配置: mingw5 - LIB Release, 编译器类型: MinGW--------------------

检查文件依赖性...
正在编译 C:\Users\zjy\Documents\C-Free\Temp\未命名15.cpp...
[Error] C:\Users\zjy\Documents\C-Free\Temp\未命名15.cpp:9: error: expected nested-name-specifier before "iterator_traits"
[Error] C:\Users\zjy\Documents\C-Free\Temp\未命名15.cpp:9: error: expected initializer before '<' token
[Error] C:\Users\zjy\Documents\C-Free\Temp\未命名15.cpp:10: error: `ostream_iterator' was not declared in this scope
[Error] C:\Users\zjy\Documents\C-Free\Temp\未命名15.cpp:10: error: `T' was not declared in this scope
[Error] C:\Users\zjy\Documents\C-Free\Temp\未命名15.cpp:10: error: `cout' was not declared in this scope
构建中止 未命名15: 5 个错误

求帮助...
搜索更多相关主题的帖子: void 检查 Documents include 编译器 
2012-07-10 20:09



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-373119-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.074666 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved