1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<HTML> 3<HEAD> 4 <TITLE>Function Template imbue</TITLE> 5 <LINK REL="stylesheet" HREF="../../../../boost.css"> 6 <LINK REL="stylesheet" HREF="../theme/iostreams.css"> 7</HEAD> 8<BODY> 9 10<!-- Begin Banner --> 11 12 <H1 CLASS="title">Function Template <CODE>imbue</CODE></H1> 13 <HR CLASS="banner"> 14 15<!-- End Banner --> 16 17<DL class="page-index"> 18 <DT><A href="#description">Description</A></DT> 19 <DT><A href="#headers">Headers</A></DT> 20 <DT><A href="#reference">Reference</A></DT> 21</DL> 22 23<A NAME="description"></A> 24<H2>Description</H2> 25 26<P> 27 The function template <CODE>imbue</CODE> is invoked automatically by the Iostreams library when the <CODE>std::locale</CODE> of a library stream or stream buffer is set using <CODE>std::basic_ios::imbue</CODE> or <CODE>std::basic_streambuf::pubimbue</CODE>. When the <CODE>std::locale</CODE> of an instance of <A HREF="../guide/generic_streams.html#stream_buffer"><CODE>stream_buffer</CODE></A> or <A HREF="../guide/generic_streams.html#stream"><CODE>stream</CODE></A> is set, <CODE>imbue</CODE> is invoked on the underlying Device; when the <CODE>std::locale</CODE> of a <A HREF="../classes/filtering_streambuf.html"><CODE>filtering_streambuf</CODE></A> or <A HREF="../classes/filtering_streambuf.html"><CODE>filtering_stream</CODE></A> is set, <CODE>imbue</CODE> is invoked on each Filter and Device in the underlying chain. 28</P> 29 30<A NAME="headers"></A> 31<H2>Headers</H2> 32 33<DL> 34 <DT><A CLASS="header" HREF="../../../../boost/iostreams/imbue.hpp"><CODE><boost/iostreams/detail/imbue.hpp></CODE></A></DT> 35 <DT><A CLASS="header" HREF="../../../../boost/iostreams/operations.hpp"><CODE><boost/iostreams/detail/operations.hpp></CODE></A></DT> 36</DL> 37 38<A NAME="reference"></A> 39<H2>Reference</H2> 40 41<A NAME="synopsis"></A> 42<H4>Synopsis</H4> 43 44<PRE CLASS="broken_ie"><SPAN CLASS="keyword">namespace</SPAN> boost { <SPAN CLASS="keyword">namespace</SPAN> iostreams { 45 46<SPAN CLASS="keyword">template</SPAN><<SPAN CLASS="keyword">typename</SPAN> <A CLASS="documented" HREF="#template_params">T</A>> 47<SPAN CLASS="keyword">void</SPAN> <A CLASS="documented" HREF="#semantics">imbue</A>(T& t, <SPAN CLASS="keyword">const</SPAN> std::locale& loc); 48 49} } <SPAN CLASS="comment">// End namespace boost::io</SPAN></PRE> 50 51<A NAME="template_params"></A> 52<H4>Template Parameters</H4> 53 54<TABLE STYLE="margin-left:2em" BORDER=0 CELLPADDING=2> 55<TR> 56 <TR> 57 <TD VALIGN="top"><I>T</I></TD><TD WIDTH="2em" VALIGN="top">-</TD> 58 <TD>A model of one of the <A HREF="../guide/concepts.html#filter_concepts">Filter</A> or <A HREF="../guide/concepts.html#device_concepts">Device</A> concepts</TD> 59 </TR> 60</TABLE> 61 62<A NAME="semantics"></A> 63<H4>Semantics</H4> 64 65<P>The semantics of <CODE>imbue</CODE> for a Filter or Device type <CODE>T</CODE> depends on its <A HREF="../guide/traits.html#category">category</A> as follows:</P> 66 67<TABLE STYLE="margin-left:2em; margin-bottom:2em" BORDER=1 CELLPADDING=4> 68 <TR><TH><CODE>category_of<T>::type</CODE></TH><TH>semantics</TH></TR> 69 <TR> 70 <TD VALIGN="top">Convertible to <A HREF="../guide/traits.html#category_tags"><CODE>streambuf_tag</CODE></A></TD> 71 <TD>calls <CODE>t.pubimbue(loc)</CODE></TD> 72 </TR> 73 <TR> 74 <TD VALIGN="top">Convertible to <A HREF="../guide/traits.html#category_tags"><CODE>localizable_tag</CODE></A> but not to <A HREF="../guide/traits.html#category_tags"><CODE>streambuf_tag</CODE></A></TD> 75 <TD>calls <CODE>t.imbue(loc)</CODE></TD> 76 </TR> 77 <TR> 78 <TD VALIGN="top"><I>otherwise</I></TD> 79 <TD>no-op</TD> 80 </TR> 81</TABLE> 82 83<!-- Begin Footer --> 84 85<HR> 86 87<P CLASS="copyright">© Copyright 2008 <a href="http://www.coderage.com/" target="_top">CodeRage, LLC</a><br/>© Copyright 2004-2007 <a href="https://www.boost.org/users/people/jonathan_turkanis.html" target="_top">Jonathan Turkanis</a></P> 88<P CLASS="copyright"> 89 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at <A HREF="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</A>) 90</P> 91 92<!-- End Footer --> 93 94</BODY> 95