开发者

boost split usage

I have a string of format [id1,id2,id3]. i'm using boost split to split the string and fill it in a vector.

boost::split(ids, message, boost::is_any_of("[, ]"));

ids is my vector declared a开发者_StackOverflow中文版s std::vector<std::string> ids.

now only the odd indices of the vector contains the ids, the even ones are empty. can anyone tell me what could be the reason and how to fix it.


boost::algorithm::split( ids, message, boost::is_any_of("[, ]"),
                         boost::algorithm::token_compress_on );
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜