1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<HTML> 3<HEAD> 4 <TITLE>Class Template chain</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">Class Template <CODE>char_traits</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<HR> 24 25<A NAME="description"></A> 26<H2>Description</H2> 27 28<P> 29 The class template <CODE>boost::iostreams::char_traits</CODE> is a derived class of <CODE>std::char_traits</CODE> which has an additional static function <A HREF='#would_block_function'><CODE>would_block</CODE></A>, used to indicate that an attempt to read a character has failed because no input is currently available. 30</P> 31 32<P> 33 The constants <CODE>WOULD_BLOCK</CODE> and <CODE>WWOULD_BLOCK</CODE> are provided for convenience. 34</P> 35 36<A NAME="headers"></A> 37<H2>Headers</H2> 38 39<DL class="page-index"> 40 <DT><A CLASS="header" HREF="../../../../boost/iostreams/char_traits.hpp"><CODE><boost/iostreams/char_traits.hpp></CODE></A></DT> 41</DL> 42 43<A NAME="reference"></A> 44<H2>Reference</H2> 45 46<A NAME="synopsis"></A> 47<H3>Synopsis</H3> 48 49<PRE CLASS="broken_ie"><SPAN CLASS="keyword">namespace</SPAN> boost { <SPAN CLASS="keyword">namespace</SPAN> iostreams { 50 51<SPAN CLASS="keyword">const</SPAN> <SPAN CLASS="keyword">int</SPAN> <A CLASS="documented" HREF="#WOULD_BLOCK">WOULD_BLOCK</A>; 52 53<SPAN CLASS="keyword">const</SPAN> std::wint_t <A CLASS="documented" HREF="#WWOULD_BLOCK">WWOULD_BLOCK</A>; 54 55<SPAN CLASS="keyword">template</SPAN><<SPAN CLASS="keyword">typename</SPAN> <A CLASS="documented" HREF="#template_params">Ch</A>> 56<SPAN CLASS="keyword">class</SPAN> <A CLASS="documented" HREF="#template_params">char_traits</A> : public std::char_traits<Ch> { 57 <SPAN CLASS='keyword'>static</SPAN> <SPAN CLASS='keyword'>typename</SPAN> std::char_traits<Ch>::int_type <A CLASS='documented' HREF='#would_block_function'>would_block</A>(); 58}; 59 60} } // End namespace boost::io</PRE> 61 62<A NAME="WOULD_BLOCK"></A> 63<H3>Constant <CODE>WOULD_BLOCK</CODE></H3> 64 65<PRE CLASS="broken_ie"> <SPAN CLASS="keyword">const</SPAN> <SPAN CLASS="keyword">int</SPAN> WOULD_BLOCK;</PRE> 66 67<P>The return value of <CODE>char_traits<char>::would_block</CODE>. Used by the function template <A HREF="../functions/get.html"><CODE>get</CODE></A> to indicate that no character could be returned because input was temporarily unavailable.</P> 68 69<A NAME="WWOULD_BLOCK"></A> 70<H3>Constant <CODE>WWOULD_BLOCK</CODE></H3> 71 72<PRE CLASS="broken_ie"> <SPAN CLASS="keyword">const</SPAN> std::wint_t WWOULD_BLOCK;</PRE> 73 74<P>The return value of <CODE>char_traits<wchar_t>::would_block</CODE>. Used by the function template <A HREF="../functions/get.html"><CODE>get</CODE></A> to indicate that no character could be returned because input was temporarily unavailable.</P> 75 76<A NAME="char_traits"></A> 77<H3>Class Template <CODE>boost::iostreams::char_traits</CODE></H3> 78 79<A NAME="template_params"></A> 80<H4>Template parameters</H4> 81 82<TABLE STYLE="margin-left:2em" BORDER=0 CELLPADDING=2> 83 <TR> 84 <TD VALIGN="top"><I>Ch</I></TD><TD WIDTH="2em" VALIGN="top">-</TD> 85 <TD>The character type</TD> 86 </TR> 87</TABLE> 88 89<A NAME="would_block_function"></A> 90<H4><CODE>char_traits::would_block</CODE></H4> 91 92<PRE CLASS="broken_ie"> <SPAN CLASS='keyword'>static</SPAN> <SPAN CLASS='keyword'>typename</SPAN> std::char_traits<Ch>::int_type would_block();</PRE> 93 94<P> 95 Returns an instance of <CODE>int_type</CODE> used by the function template <A HREF='../functions/get.html'><CODE>get</CODE></A> to indicate that an attempt to read a character from a <A HREF='../concepts/source.html'>Source</A> has failed because no input is currently available. Future attempts to read a character may succeed. 96</P> 97 98<!-- Begin Footer --> 99 100<HR> 101 102<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> 103<P CLASS="copyright"> 104 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>) 105</P> 106 107<!-- End Footer --> 108 109</BODY> 110