Opened 9 years ago
Last modified 9 years ago
#9577 assigned Feature Requests
trim_copy doesn't support string_ref
| Reported by: | Owned by: | Marshall Clow | |
|---|---|---|---|
| Milestone: | To Be Determined | Component: | algorithm |
| Version: | Boost 1.55.0 | Severity: | Problem |
| Keywords: | Cc: |
Description
boost::string_ref z = " AA BB "; boost::string_ref b = boost::trim_copy(z);
does not compile
Change History (3)
comment:1 by , 9 years ago
| Status: | new → assigned |
|---|---|
| Type: | Bugs → Feature Requests |
comment:2 by , 9 years ago
Would trim return a new string_ref or would it update it's input argument? I'd like a variant that returns a new string_ref.
Note:
See TracTickets
for help on using tickets.

Short answer:
trim_copyreturns a new container of the same type containing a copy of the input (w/o leading and trailing spaces)Since
string_refdoesn't actually own the underlying characters, it can't make a copy of them and return astring_refto the copy. (where would it put the characters that it copied?)That being said, I could see how
trim(nottrim_copy) on astring_refcould be a desired features.Changing to a feature request.