0
我見過幾個例子,說明如何使用split_iterator不過的Visual Studio 2012是顯示我這個錯誤: Error: argument for class template "boost::algorithm::split_iterator" is missing
的boost :: split_iterator論據類模板失蹤
這是我的代碼:
...
#include "boost/algorithm/string/iter_find.hpp"
#include "boost/algorithm/string/finder.hpp"
...
const std::string sintactic_production_rule_representation[] =
{
...
"P → B eol P",
"P → F eol P",
...
}
...
for(int i = 0; i < N_PRODUCTIONS_SINTLL; i++)
{
std::vector<std::string> splittedProduction;
boost::split_iterator(
splittedProduction,
sintactic_production_rule_representation[i],
boost::first_finder("→")
);
}
我已經使用boost bcp工具提取了iter_find.hpp
和finder.hpp
以及對資源文件的依賴關係。
我也試過boost::split_iterator<std::string>(...)
得到一個參數不匹配錯誤。
'boost :: split_iterator'是一個類模板,而不是一個函數。也許你想使用'boost :: split'? –
@OlegAndriyanov我可以使用split來拆分字符串而不是單個字符嗎? – jmb95
也許http://stackoverflow.com/a/15789561/3153012是解決方案。 – jmb95