原因:
1.文档不够完善
2.熟悉程度不够,学习曲线比较陡峭,直接用有可能失控
3.实现太过复杂,还需要mpl库的支持
4.如果使用,iostreams将成为底层,整个项目都会对其依赖,有风险
5.说白了,还是能力不够,不过了解了一些iostreams归纳出来的concepts也是非常有收货。
6.网上的一句归纳:
在真正掌握模版之前尽量少用 //////////////////////////////////////////////
Device Concepts
The most important Device concepts are these:
- Device: Base for all Device concepts, provides associated character type and category.
- Source: Provides read-only access to a sequence of characters.
- Sink: Provides write-only access to a sequence of characters.
- BidirectionalDevice: Provides access to two separate sequences of characters, one for reading and the other for writing.
- SeekableDevice: Provides read-write access to a single sequence of characters, with a single repositionable read/write head.
Filter Concepts
The most important Filter concepts are these:
- Filter: Base for all Filter concepts, provides associated character type and category.
- InputFilter: Filters characters read from a Source.
- OutputFilter: Filters characters written to a Sink
- BidirectionalFilter: Filters two separate character sequences, one read from a Sink and the other written to a Sink.
- SeekableFilter: Filters a single characters sequence, controlled by a SeekableDevice, providing filtered input, output and random access with a single repositionable read/write head
Optional Behavior
Boost.Iostreams prvides several concepts corresponding to optional behavior that a Filter or Device might implement:
- Blocking: A Device which blocks when it receives a read or write request until all requested characters are available, or until the end of a stream is reached.
- Direct: A Device which provides access to its controlled sequences as regions of memory rather than via a socket-like interface.
- Closable: A Filter or Device which receives notifications immediately before a stream is closed.
- Flushable A Filter or Device which receives notifications when a stream is flushed.
- Localizable: A Filter or Device which receives notifications when the
locale
of a stream or stream buffer is set using basic_ios::imbue
or basic_streambuf::pubimbue
. - Multi-Character: A Filter which provides access to its controlled sequences several characters at a time, via a socket-like interface.
- OptimallyBuffered A Filter or Device which will be fitted with a buffer of custom size if no buffer size is explicitly requested by the user.
- Peekable: A source which allows characters to be put back to the input sequence.
- Pipable: A Filter which can appear in pipelines.