<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>libstdc++: std::locale::id Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript"> $(document).ready(initResizable); </script> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.7.4 --> <div id="top"> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">libstdc++</div> </td> </tr> </tbody> </table> </div> </div> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> initNavTree('a00583.html',''); </script> <div id="doc-content"> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> | <a href="#friends">Friends</a> </div> <div class="headertitle"> <div class="title">std::locale::id Class Reference<div class="ingroups"><a class="el" href="a01190.html">Locales</a></div></div> </div> </div> <div class="contents"> <!-- doxytag: class="std::locale::id" --> <p>Facet ID class.The ID class provides facets with an index used to identify them. Every facet class must define a public static member <a class="el" href="a00583.html" title="Facet ID class.The ID class provides facets with an index used to identify them. Every facet class mu...">locale::id</a>, or be derived from a facet that provides this member, otherwise the facet cannot be used in a locale. The <a class="el" href="a00583.html" title="Facet ID class.The ID class provides facets with an index used to identify them. Every facet class mu...">locale::id</a> ensures that each class type gets a unique identifier. <a href="a00583.html#details">More...</a></p> <p><a href="a02207.html">List of all members.</a></p> <h2><a name="pub-methods"></a> Public Member Functions</h2> <ul> <li><a class="el" href="a00583.html#a05733d8d1ad35f4fa4feef3313b1bce3">id</a> () <li><a class="anchor" id="af1c4c319debe9b1a90e219f0f6c446f2"></a><!-- doxytag: member="std::locale::id::_M_id" ref="af1c4c319debe9b1a90e219f0f6c446f2" args="() const " --> size_t <b>_M_id</b> () const throw () </ul> <h2><a name="friends"></a> Friends</h2> <ul> <li>template<typename _Facet > bool <a class="el" href="a00583.html#ae49220e9bc66bb10e1ca224ad30ced8e">has_facet</a> (const <a class="el" href="a00581.html">locale</a> &) throw () <li><a class="anchor" id="a0a09223e17db306b813d8b07b4b344fc"></a><!-- doxytag: member="std::locale::id::locale" ref="a0a09223e17db306b813d8b07b4b344fc" args="" --> class <b>locale</b> <li><a class="anchor" id="ad6cc86eddbc65fb7e6d6d09b2c42d697"></a><!-- doxytag: member="std::locale::id::locale::_Impl" ref="ad6cc86eddbc65fb7e6d6d09b2c42d697" args="" --> class <b>locale::_Impl</b> <li>template<typename _Facet > const _Facet & <a class="el" href="a00583.html#ab3e92cb07fc76f241463323e6beb5bef">use_facet</a> (const <a class="el" href="a00581.html">locale</a> &) </ul> <hr/><a name="details" id="details"></a><h2>Detailed Description</h2> <div class="textblock"><p>Facet ID class.</p> <p>The ID class provides facets with an index used to identify them. Every facet class must define a public static member <a class="el" href="a00583.html" title="Facet ID class.The ID class provides facets with an index used to identify them. Every facet class mu...">locale::id</a>, or be derived from a facet that provides this member, otherwise the facet cannot be used in a locale. The <a class="el" href="a00583.html" title="Facet ID class.The ID class provides facets with an index used to identify them. Every facet class mu...">locale::id</a> ensures that each class type gets a unique identifier. </p> <p>Definition at line <a class="el" href="a00926_source.html#l00437">437</a> of file <a class="el" href="a00926_source.html">locale_classes.h</a>.</p> </div><hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="a05733d8d1ad35f4fa4feef3313b1bce3"></a><!-- doxytag: member="std::locale::id::id" ref="a05733d8d1ad35f4fa4feef3313b1bce3" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">std::locale::id::id </td> <td>(</td> <td class="paramname"></td><td>)</td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Constructor. </p> <p>Definition at line <a class="el" href="a00926_source.html#l00468">468</a> of file <a class="el" href="a00926_source.html">locale_classes.h</a>.</p> </div> </div> <hr/><h2>Friends And Related Function Documentation</h2> <a class="anchor" id="ae49220e9bc66bb10e1ca224ad30ced8e"></a><!-- doxytag: member="std::locale::id::has_facet" ref="ae49220e9bc66bb10e1ca224ad30ced8e" args="(const locale &)" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<typename _Facet > </div> <table class="memname"> <tr> <td class="memname">bool has_facet </td> <td>(</td> <td class="paramtype">const <a class="el" href="a00581.html">locale</a> & </td> <td class="paramname"></td><td>)</td> <td> throw ()<code> [friend]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Test for the presence of a facet. </p> <p>has_facet tests the locale argument for the presence of the facet type provided as the template parameter. Facets derived from the facet parameter will also return true.</p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">Facet</td><td>The facet type to test the presence of. </td></tr> <tr><td class="paramname">locale</td><td>The locale to test. </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>true if locale contains a facet of type Facet, else false. </dd></dl> </div> </div> <a class="anchor" id="ab3e92cb07fc76f241463323e6beb5bef"></a><!-- doxytag: member="std::locale::id::use_facet" ref="ab3e92cb07fc76f241463323e6beb5bef" args="(const locale &)" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<typename _Facet > </div> <table class="memname"> <tr> <td class="memname">const _Facet& use_facet </td> <td>(</td> <td class="paramtype">const <a class="el" href="a00581.html">locale</a> & </td> <td class="paramname"></td><td>)</td> <td><code> [friend]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Return a facet. </p> <p>use_facet looks for and returns a reference to a facet of type Facet where Facet is the template parameter. If has_facet(locale) is true, there is a suitable facet to return. It throws <a class="el" href="a00390.html" title="Thrown during incorrect typecasting.If you attempt an invalid dynamic_cast expression, an instance of this class (or something derived from this class) is thrown.">std::bad_cast</a> if the locale doesn't contain a facet of type Facet.</p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">Facet</td><td>The facet type to access. </td></tr> <tr><td class="paramname">locale</td><td>The locale to use. </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>Reference to facet of type Facet. </dd></dl> <dl><dt><b>Exceptions:</b></dt><dd> <table class="exception"> <tr><td class="paramname"><a class="el" href="a00390.html" title="Thrown during incorrect typecasting.If you attempt an invalid dynamic_cast expression, an instance of this class (or something derived from this class) is thrown.">std::bad_cast</a></td><td>if locale doesn't contain a facet of type Facet. </td></tr> </table> </dd> </dl> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="a00926_source.html">locale_classes.h</a></li> </ul> </div> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="a01137.html">std</a> </li> <li class="navelem"><a class="el" href="a00581.html">locale</a> </li> <li class="navelem"><a class="el" href="a00583.html">id</a> </li> <li class="footer">Generated by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </li> </ul> </div> </body> </html>