You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Passing a separator to scan_list_ex when scanning a list of strings will have no effect, because the separator will be consumed by the string scanner.
In the following example:
intmain() {
std::vector<std::string> vs;
constauto result = scn::scan_list_ex("0, 42, 84", vs, scn::list_separator(','));
for (constauto & s : vs)
std::cout << s << std::endl;
return0;
}
vs will contain [ "0,", "42,", "84" ] (see how the commas have been included in each string).
On a related note, I've written a scanner specialization for ranges that parse them with the same formats as those generated by fmt/ranges.h (see the tests). Would you be interested in adding this to the library (perhaps as scn/ranges.h, to follow fmt's architecture)? If so I could look into opening a PR.
The text was updated successfully, but these errors were encountered:
This is no longer relevant: scan_list is no longer available. An experimental implementation of scanning of ranges is also available in <scn/ranges.h>. Closing.
Passing a separator to
scan_list_ex
when scanning a list of strings will have no effect, because the separator will be consumed by the string scanner.In the following example:
vs
will contain[ "0,", "42,", "84" ]
(see how the commas have been included in each string).On a related note, I've written a scanner specialization for ranges that parse them with the same formats as those generated by fmt/ranges.h (see the tests). Would you be interested in adding this to the library (perhaps as
scn/ranges.h
, to followfmt
's architecture)? If so I could look into opening a PR.The text was updated successfully, but these errors were encountered: