.TH "std::locale::id" 3cxx "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::locale::id \- Facet ID class\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBid\fP ()" .br .RI "Constructor\&. " .ti -1c .RI "size_t \fB_M_id\fP () \fBconst\fP \fBthrow\fP ()" .br .in -1c .SS "Friends" .in +1c .ti -1c .RI "template<\fBtypename\fP \fB_Facet\fP > bool \fBhas_facet\fP (\fBconst\fP \fBlocale\fP &) \fBthrow\fP ()" .br .RI "Test for the presence of a facet\&. " .ti -1c .RI "\fBclass\fP \fBlocale\fP" .br .ti -1c .RI "\fBclass\fP \fBlocale::_Impl\fP" .br .ti -1c .RI "template<\fBtypename\fP \fB_Facet\fP > \fBconst\fP \fB_Facet\fP & \fBuse_facet\fP (\fBconst\fP \fBlocale\fP &)" .br .RI "Return a facet\&. " .in -1c .SH "Detailed Description" .PP Facet ID class\&. The ID class provides facets with an index used to identify them\&. Every facet class must define a public static member locale::id, or be derived from a facet that provides this member, otherwise the facet cannot be used in a locale\&. The locale::id ensures that each class type gets a unique identifier\&. .SH "Constructor & Destructor Documentation" .PP .SS "std::locale::id::id ()\fC [inline]\fP" .PP Constructor\&. .SH "Friends And Related Symbol Documentation" .PP .SS "template<\fBtypename\fP \fB_Facet\fP > bool has_facet (\fBconst\fP \fBlocale\fP &)\fC [friend]\fP" .PP Test for the presence of a facet\&. 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\&. .PP \fBTemplate Parameters\fP .RS 4 \fI_Facet\fP The facet type to test the presence of\&. .RE .PP \fBParameters\fP .RS 4 \fI__loc\fP The locale to test\&. .RE .PP \fBReturns\fP .RS 4 true if \fC__loc\fP contains a facet of type _Facet, else false\&. .RE .PP .SS "template<\fBtypename\fP \fB_Facet\fP > \fBconst\fP \fB_Facet\fP & use_facet (\fBconst\fP \fBlocale\fP &)\fC [friend]\fP" .PP Return a facet\&. 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 std::bad_cast if the locale doesn't contain a facet of type Facet\&. .PP \fBTemplate Parameters\fP .RS 4 \fI_Facet\fP The facet type to access\&. .RE .PP \fBParameters\fP .RS 4 \fI__loc\fP The locale to use\&. .RE .PP \fBReturns\fP .RS 4 Reference to facet of type Facet\&. .RE .PP \fBExceptions\fP .RS 4 \fIstd::bad_cast\fP if \fC__loc\fP doesn't contain a facet of type _Facet\&. .RE .PP .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.