2
這是第一個發言:這兩個sregex_iterator語句之間爲什麼有區別?
string s("hello.world");
sregex_iterator pos(s.cbegin(), s.cend(), regex(R"(\.)"));
sregex_iterator end;
for (; pos != end; ++pos)
cout << pos->str() << endl;
這是第二次聲明:
string s("hello.world");
regex reg(R"(\.)");
sregex_iterator pos(s.cbegin(), s.cend(), reg);
sregex_iterator end;
for (; pos != end; ++pos)
cout << pos->str() << endl;
https://en.wiktionary.org/wiki/orphan –
@LightnessRacesinOrbit可憐的小迭代:( – Drop