我用VC加了BOOST库,可是在用regex_replace时编译老不通过,用regex_match就正常。像网上只用三个参数时一直有错误
如下
D:\程序\MSDev98\MyProjects\TxtEdit\FileInfo.cpp(116) : error C2780: 'OutputIterator __cdecl boost::regex_replace(OutputIterator,Iterator,Iterator,const class boost::reg_expression<charT,traits,Allocator> &,const class std::basic_string<charT,struct
std::char_traits<charT>,class std::allocator<charT> > &,unsigned long)' : expects 6 arguments - 3 provided
c:\program files\boost_1_32_0\boost\regex\v4\regex_replace.hpp(46) : see declaration of 'regex_replace'
D:\程序\MSDev98\MyProjects\TxtEdit\FileInfo.cpp(116) : error C2780: 'OutputIterator __cdecl boost::regex_replace(OutputIterator,Iterator,Iterator,const class boost::reg_expression<charT,traits,Allocator> &,const charT *,unsigned long)' : expects 6 a
rguments - 3 provided
c:\program files\boost_1_32_0\boost\regex\v4\regex_replace.hpp(32) : see declaration of 'regex_replace'多个参数的看不懂,也不好弄
求高手帮忙看看,是哪里出问题了。
顺便请教下关于迭代器的问题,就是其中的Iterator要怎么用?有文章推荐下吗?看boost的文档不是很懂
求指教
如下
D:\程序\MSDev98\MyProjects\TxtEdit\FileInfo.cpp(116) : error C2780: 'OutputIterator __cdecl boost::regex_replace(OutputIterator,Iterator,Iterator,const class boost::reg_expression<charT,traits,Allocator> &,const class std::basic_string<charT,struct
std::char_traits<charT>,class std::allocator<charT> > &,unsigned long)' : expects 6 arguments - 3 provided
c:\program files\boost_1_32_0\boost\regex\v4\regex_replace.hpp(46) : see declaration of 'regex_replace'
D:\程序\MSDev98\MyProjects\TxtEdit\FileInfo.cpp(116) : error C2780: 'OutputIterator __cdecl boost::regex_replace(OutputIterator,Iterator,Iterator,const class boost::reg_expression<charT,traits,Allocator> &,const charT *,unsigned long)' : expects 6 a
rguments - 3 provided
c:\program files\boost_1_32_0\boost\regex\v4\regex_replace.hpp(32) : see declaration of 'regex_replace'多个参数的看不懂,也不好弄
求高手帮忙看看,是哪里出问题了。
顺便请教下关于迭代器的问题,就是其中的Iterator要怎么用?有文章推荐下吗?看boost的文档不是很懂
求指教
解决方案 »
- 不理解MSDN上对data_seg()的解释,把变量保存在.obj文件里面?
- 对话框中有n个按钮(id为1到n),点击其中一个(设id为3),该按钮消失,3后面的按钮依次排列到前一个按钮的位置,如何群处理
- 超级想不通:关于简单的消息问题!!急急,盼望高手解释
- 关于CPropertySheet的问题
- 这个参数什么意思?
- 请问:这句话怎么用呀
- jpeg压缩
- MFC程序写日志怎样更快
- 如何在两个cpp文件中使用同一全局变量
- 多线程DC问题
- 如何查看以下pcap_sendpacket发送数据包的结果
- 我现在要用vc++将一个文件夹里格式相同的文本文件导入access数据库,文件名当做表名(一个文本文件创建一个表)该如何操作? QQ136289121 谢谢
std::string s = "Colour, colour, color, colOurize";
s = regex_replace(s, reg, "$1$3");运行正常;
你的库添加对了没?好像有好几个这个库,我也是今天才用这个的,还不很懂。
包含了#include <boost/regex/mfc.hpp>
使用boost::tregex和boost::tmatch,用boost::regex_match可以顺利编译并且正确输出但boost::regex_replace的时候却提示错误 3 error C2784: “ATL::CSimpleStringT<B,b> boost::regex_replace(const ATL::CSimpleStringT<B,b> &,const boost::basic_regex<charT,traits> &,const ATL::CSimpleStringT<B,b> &,boost::regex_constants::match_flag_type)”: 无法从“CString”为“const ATL::CSimpleStringT<B,b> &”推导 模板 参数 d:\360data\Documents\Visual Studio 2008\Projects\TEST\TEST\TESTDlg.cpp 466 TEST
错误 4 error C2784: “ATL::CSimpleStringT<B,b> boost::regex_replace(const ATL::CSimpleStringT<B,b> &,const boost::basic_regex<charT,traits> &,const ATL::CSimpleStringT<B,b> &,boost::regex_constants::match_flag_type)”: 无法从“const wchar_t [1]”为“const ATL::CSimpleStringT<B,b> &”推导 模板 参数 d:\360data\Documents\Visual Studio 2008\Projects\TEST\TEST\TESTDlg.cpp 466 TEST
错误 5 error C2780: “OutputIterator boost::regex_replace(OutputIterator,BidirectionalIterator,BidirectionalIterator,const boost::basic_regex<charT,traits> &,const ATL::CSimpleStringT<B,b> &,boost::regex_constants::match_flag_type)”: 应输入 6 个参数,却提供了 3 个 d:\360data\Documents\Visual Studio 2008\Projects\TEST\TEST\TESTDlg.cpp 466 TEST
错误 6 error C2784: “std::basic_string<charT> boost::regex_replace(const std::basic_string<charT> &,const boost::basic_regex<charT,traits> &,Formatter,boost::regex_constants::match_flag_type)”: 无法从“CString”为“const std::basic_string<charT> &”推导 模板 参数 d:\360data\Documents\Visual Studio 2008\Projects\TEST\TEST\TESTDlg.cpp 466 TEST
错误 7 error C2784: “std::basic_string<charT> boost::regex_replace(const std::basic_string<charT> &,const boost::basic_regex<charT,traits> &,Formatter,boost::regex_constants::match_flag_type)”: 无法从“CString”为“const std::basic_string<charT> &”推导 模板 参数 d:\360data\Documents\Visual Studio 2008\Projects\TEST\TEST\TESTDlg.cpp 466 TEST
错误 8 error C2780: “OutputIterator boost::regex_replace(OutputIterator,BidirectionalIterator,BidirectionalIterator,const boost::basic_regex<charT,traits> &,Formatter,boost::regex_constants::match_flag_type)”: 应输入 6 个参数,却提供了 3 个 d:\360data\Documents\Visual Studio 2008\Projects\TEST\TEST\TESTDlg.cpp 466 TEST