Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
folly
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
folly
Commits
ff884b61
Commit
ff884b61
authored
Jun 13, 2012
by
Tudor Bosman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clarify split / splitTo comments.
Test Plan: No Reviewed By: delong.j@fb.com FB internal diff: D494525
parent
6834f1d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
folly/String.h
folly/String.h
+6
-5
No files found.
folly/String.h
View file @
ff884b61
...
@@ -283,13 +283,14 @@ inline fbstring exceptionStr(const std::exception& e) {
...
@@ -283,13 +283,14 @@ inline fbstring exceptionStr(const std::exception& e) {
* The split interface here supports different output types, selected
* The split interface here supports different output types, selected
* at compile time: StringPiece, fbstring, or std::string. If you are
* at compile time: StringPiece, fbstring, or std::string. If you are
* using a vector to hold the output, it detects the type based on
* using a vector to hold the output, it detects the type based on
* what your vector contains.
* what your vector contains. If the output vector is not empty, split
* will append to the end of the vector.
*
*
* You can also use splitTo() to write the output to an arbitrary
* You can also use splitTo() to write the output to an arbitrary
* OutputIterator (e.g. std::inserter() on a std::set<>), in which
* OutputIterator (e.g. std::inserter() on a std::set<>), in which
* case you have to tell the function the type. (Rationale:
* case you have to tell the function the type. (Rationale:
* OutputIterators don't have a value_type, so we can't detect the
* OutputIterators don't have a value_type, so we can't detect the
* type in split without being told.)
* type in split
To
without being told.)
*
*
* Examples:
* Examples:
*
*
...
@@ -300,9 +301,9 @@ inline fbstring exceptionStr(const std::exception& e) {
...
@@ -300,9 +301,9 @@ inline fbstring exceptionStr(const std::exception& e) {
* folly::splitTo<StringPiece>(":", "asd:bsd:asd:csd",
* folly::splitTo<StringPiece>(":", "asd:bsd:asd:csd",
* std::inserter(s, s.begin()));
* std::inserter(s, s.begin()));
*
*
* Split also takes a flag (ignoreEmpty) that indicates whether
* Split also takes a flag (ignoreEmpty) that indicates whether
adjacent
*
adjacent tokens should be treated as one separator or not. Note
*
delimiters should be treated as one single separator (ignoring empty tokens)
*
that unlikely strtok() the default is to treat them as separators
.
*
or not (generating empty tokens)
.
*/
*/
template
<
class
Delim
,
class
String
,
class
OutputType
>
template
<
class
Delim
,
class
String
,
class
OutputType
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment