.TH "FBB::TypeTrait" "3bobcat" "2005\-2020" "libbobcat\-dev_5\&.07\&.00" "Error handler" .PP .SH "NAME" FBB::TypeTrait \- shortdesc .PP .SH "SYNOPSIS" \fB#include \fP .br .PP .SH "DESCRIPTION" .PP \fBFBB::TypeTrait\fP is a traits class\&. It does not define any member functions or data members, but merely types\&. It can be used to determine the basic type and other characteristics of (const) plain, (const) pointer or (const) reference types\&. It was designed after Alexandrescu\(cq\&s (2001) \fITypeTraits\fP template class\&. .PP The \fBFBB::LpromotesR\fP class template is used to determine, compile\-time, whether its second (right\-hand side) template type can be promoted to its first (left\-hand side) template type\&. .PP The \fBFBB::Use\fP class template expects two typenames \fILHS\fP and \fIRHS\fP and defines \fItypename Use::type\fP as \fILHS\fP if \fIRHS\fP can be promoted to \fILHS\fP or it defines \fItypename Use::type\fP as \fIRHS\fP\&. .PP .SH "NAMESPACE" \fBFBB\fP .br All constructors, members, operators and manipulators, mentioned in this man\-page, are defined in the namespace \fBFBB\fP\&. .PP .SH "INHERITS FROM" \- .PP .SH "TypeTrait" .PP \fBTYPE\fP is the template type parameter whose characteristics must be determined\&. .PP \fITypeTrait\fP defines the type \fIPlain\fP: the plain type (the type without const, pointer, reference type indication) of any const or non\-const plain, pointer, lvalue\- or rvalue\-reference type\&. .PP \fITypeTrait\fP defines the following \fIbool\fP values: .IP o \fIisClass\fP: \fItrue\fP if the template type argument represents a class (struct) type, \fIfalse\fP otherwise\&. .IP o \fIisConst\fP: \fItrue\fP if the template type argument represents a const type, \fIfalse\fP otherwise\&. .IP o \fIisPointer\fP: \fItrue\fP if the template type argument represents a pointer type, \fIfalse\fP otherwise\&. .IP o \fIisR_Ref\fP: \fItrue\fP if the template type argument represents a rvalue reference type, \fIfalse\fP otherwise\&. .IP o \fIisRef\fP: \fItrue\fP if the template type argument represents an lvalue reference type, \fIfalse\fP otherwise\&. .PP .SH "LpromotesR" .PP \fILpromotesR\fP defines the enum constant \fIyes\fP as 1 if an \fIRightType\fP argument can be promoted to \fILeftType\fP value or object\&. The enum value \fIyes\fP is defined as 0 if no such constructor is available or if such a constructor is defined using the \fIexplicit\fP keyword\&. .PP .SH "EXAMPLES" .PP Here is an example using \fILpromotesR\fP: .nf int main() { cout << \(dq\&string promotes char const *: \(dq\& << LpromotesR::yes << \(cq\&\en\(cq\&; // 1 cout << \(dq\&string promotes string \(dq\& << LpromotesR::yes << \(cq\&\en\(cq\&; // 1 cout << \(dq\&char const * promotes string \(dq\& << LpromotesR::yes << \(cq\&\en\(cq\&; // 0 } .fi .PP .SH "FILES" \fIbobcat/typetrait\fP \- defines the class interface .PP .SH "SEE ALSO" \fBbobcat\fP(7) .br Alexandrescu A\&. (2001) \fBModern C++ Design\fP, Addison\-Wesley, Boston\&. .PP .SH "BUGS" None Reported\&. .PP .SH "BOBCAT PROJECT FILES" .PP .IP o \fIhttps://fbb\-git\&.gitlab\&.io/bobcat/\fP: gitlab project page; .IP o \fIbobcat_5\&.07\&.00\-x\&.dsc\fP: detached signature; .IP o \fIbobcat_5\&.07\&.00\-x\&.tar\&.gz\fP: source archive; .IP o \fIbobcat_5\&.07\&.00\-x_i386\&.changes\fP: change log; .IP o \fIlibbobcat1_5\&.07\&.00\-x_*\&.deb\fP: debian package containing the libraries; .IP o \fIlibbobcat1\-dev_5\&.07\&.00\-x_*\&.deb\fP: debian package containing the libraries, headers and manual pages; .PP .SH "BOBCAT" Bobcat is an acronym of `Brokken\(cq\&s Own Base Classes And Templates\(cq\&\&. .PP .SH "COPYRIGHT" This is free software, distributed under the terms of the GNU General Public License (GPL)\&. .PP .SH "AUTHOR" Frank B\&. Brokken (\fBf\&.b\&.brokken@rug\&.nl\fP)\&. .PP