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 );
精彩评论