P0448R1: A strstream replacement using span<charT> as buffer—Peter Sommerlad

Save to:
Instapaper Pocket Readability

A new WG21 paper is available. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: P0448R1

Date: 2017-06-07

A strstream replacement using span<charT> as buffer

by Peter Sommerlad

Excerpt:

This paper proposes a class template basic_spanbuf and the corresponding stream class templates to enable the use of streams on externally provided memory buffers. No ownership or re-allocation support is given. For those features we have string-based streams. ...

Today, with span we actually have a library type representing such buffers views we can use for specifying (and implementing) such streams. They can be used in areas where dynamic (re-)allocation of stringstreams is not acceptable but the burden of caring for a pre-existing buffer during the lifetime of the stream is manageable.

Changes from p0448r0

  • provide explanation why non-copy-ability, while technically feasible, is an OK thing.
  • remove wrong Allocator template parameter (we never allocate anything).
  • adhere to new section numbering of the standard.
  • tried to clarify lifetime and threading issues.

Add a Comment

You must sign in or register to add a comment.

Comments (0)

There are currently no comments on this entry.