Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
pfultz2
on Sept 21, 2014
|
parent
|
context
|
favorite
| on:
Rust lifetimes: Getting away with things that woul...
Actually, it should be written more like this:
template<typename T> std::pair<T, std::vector<std::string_view>> tokenize_string(T &&str);
So then it uses `std::forward` to conditionally move the string for rvalues, and `T` will be a reference to the original string for lvalues.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: