[span.streams.overview]

# 31 Input/output library [[input.output]](./#input.output)

## 31.9 Span-based streams [[span.streams]](span.streams#overview)

### 31.9.1 Overview [span.streams.overview]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iostreams.tex#L10001)

The header <spanstream> defines class templates and types
that associate stream buffers with objects whose types are
specializations of span as described in [[views.span]](views.span "23.7.2.2 Class template span")[.](#1.sentence-1)

[*Note [1](#note-1)*:

A user of these classes is responsible for ensuring
that the character sequence represented by the given span outlives the use of the sequence by objects of the classes in [[span.streams]](span.streams "31.9 Span-based streams")[.](#1.sentence-2)

Using multiple basic_spanbuf objects
referring to overlapping underlying sequences from different threads,
where at least one basic_spanbuf object is used
for writing to the sequence,
results in a data race[.](#1.sentence-3)

â *end note*]
