I have std::string wktString:
PROJCS["OSGB 1936 / British National Grid",GEOGCS["OSGB 1936",DATUM...
并尝试拆分此字符串
#include <boost/algorithm/string.hpp>
...
std::vector<std::string> proj_list;
boost::split(proj_list, wktString, boost::is_any_of("["));
std::cout << "split finish";
当我编译时,我在"拆分完成"之前有一个分割错误。为什么?
绝对需要更多信息。该程序编译并运行没有错误:
#include <iostream>
#include <vector>
#include <boost/algorithm/string.hpp>
int main ()
{
std::string wktString = "PROJCS["OSGB 1936 / British National Grid",GEOGCS["OSGB 1936",DATUM...";
std::vector<std::string> proj_list;
boost::split(proj_list, wktString, boost::is_any_of("["));
for ( int i = 0; i < proj_list.size(); ++i )
std::cout << proj_list[i] << std::endl;
}