开发者

How does boost::split work?

开发者 https://www.devze.com 2023-02-01 06:05 出处:网络
Does the boost split function require copying the source string before split? For example- const char *c = \"S1 S2 S3\";

Does the boost split function require copying the source string before split?

For example-

const char *c = "S1 S2 S3";
std::vector<std::string> v;
boost:开发者_运维技巧:split(v, c, boost::is_any_of(" "));


It works exactly like your code. No need to copy.


You do not have to copy, according to this it will make copies for you (you could also store references). There is no problems with const inputs thus.

0

精彩评论

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