A __Stream__ is a communication channel where data is reliably transferred as an ordered sequence of bytes. Streams are either synchronous or asynchronous, and may allow reading, writing, or both. Note that a particular type may model more than one concept. For example, the networking types__socket__ and __ssl_stream__ support both __SyncStream__ and __AsyncStream__. All stream algorithms in Beast are declared as template functions using these concepts:
These template metafunctions check whether a given type meets the requirements for the various stream concepts, and some additional useful utilities. The library uses these type checks internally and also provides them as public interfaces so users may use the same techniques to augment their own code. The use of these type checks helps provide more concise errors during compilation: