imbue
当库流或流缓冲区的 std::locale
使用 std::basic_ios::imbue
或 std::basic_streambuf::pubimbue
设定时,Iostreams 库会自动调用函数模板 imbue
。当 <a href="../guide/generic_streams.html#stream_buffer">stream_buffer</a>
或 <a href="../guide/generic_streams.html#stream">stream</a>
实例的 std::locale
设定时,imbue
会在底层设备上调用;当 <a href="../classes/filtering_streambuf.html">filtering_streambuf</a>
或 <a href="../classes/filtering_streambuf.html">filtering_stream</a>
的 std::locale
设定时,imbue
会在底层链条中的每个过滤器和设备上调用。
<boost/iostreams/detail/imbue.hpp>
<boost/iostreams/detail/operations.hpp>
namespace boost { namespace iostreams { template<typename T> void imbue(T& t, const std::locale& loc); } } // End namespace boost::io
T | - | <a href="../guide/concepts.html#filter_concepts">Filter</a> 或 <a href="../guide/concepts.html#device_concepts">Device</a> 概念之一的模型 |
对于过滤器或设备类型 T
,imbue
的语义取决于其 <a href="../guide/traits.html#category">category</a>
,如下所示
category_of<T>::type | 语义 |
---|---|
可转换为 <a href="../guide/traits.html#category_tags">streambuf_tag</a> |
调用 t.pubimbue(loc) |
可转换为 <a href="../guide/traits.html#category_tags">localizable_tag</a> ,但不能转换为 <a href="../guide/traits.html#category_tags">streambuf_tag</a> |
调用 t.imbue(loc) |
其他情况 | 无操作 |
© Copyright 2008 <a href="http://www.coderage.com/" target="_top">CodeRage, LLC</a>
© Copyright 2004-2007 <a href="/users/people/jonathan_turkanis.html" target="_top">Jonathan Turkanis</a>
根据 Boost Software License 第 1.0 版分发。(请参阅随附文件 LICENSE_1_0.txt,或访问 <a href="/LICENSE_1_0.txt">https://boost.ac.cn/LICENSE_1_0.txt</a>
上的副本)