mode(模式?):
input: 使用一個character隊列,用來輸入
output: 使用一個character隊列,用來輸出
bidirectional: 使用兩個character隊列,分別用來輸入、輸出
input-seekable: 使用一個character隊列用來輸入,包含一個讀索引游標
output-seekable: 使用一個character隊列用來輸出,包含一個寫索引游標
seekable: 使用一個character隊列用來輸入輸出,包含一個讀/寫復用的索引游標
dual-seekable: 使用一個character隊列來輸入輸出,包含兩個索引游標分別用來標識讀寫
bidirectional-seekable: 使用兩個character隊列分別用來輸入輸出,同時每個隊列包含一個各自的索引游標
*blocking: 如果讀請求永遠比剩下的character少除了end情況,而且寫請求需要的永遠比現有的少。那就是一個blocking。
The Blocking concept does not apply to filters. Instead, filters are required to be blocking-preserving, which means that
a read request never produces fewer characters than requested unless end-of-stream has been reached or unless a read request to a downsteam Source produces fewer characters than requested, and
a write request never consumes fewer characters than requested unless a write request to a downsteam Sink consumes fewer characters than requested.
*如果熟悉stl應該就了解traits技術(應該是技巧)
<boost/iostreams/traits.hpp>
這里是boost::iostream庫的traits
還有個模版元函數mod_of