Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 4
    Who owns the memory pointed at by string_view? Commented Jul 1, 2022 at 10:30
  • @tkausl The underlying buffer of the string_view object being passed to tokenize is managed by the call site (in this case, it's the main function). Commented Jul 1, 2022 at 10:31
  • 3
    I'm talking about the string_views you store in your vector. Commented Jul 1, 2022 at 10:35
  • @tkausl Aha yeah that's fair. I'll fix it. But my question still remains, why doesn't that iterator thing compile with string_view as its template argument? Commented Jul 1, 2022 at 10:38
  • 3
    std::string_view is fancy form of const reference, so problem is same as stream iterator to const reference. Commented Jul 1, 2022 at 11:34