includefile(include/header)

COMMENT(manpage, section, releasedate, archive, short name)
manpage(FBB::TypeTrait)(3bobcat)(_CurYrs_)(libbobcat-dev__CurVers_-x.tar.gz)
                    (Error handler)

manpagename(FBB::TypeTrait)(shortdesc)

manpagesynopsis()
    bf(#include <bobcat/typetrait>)nl()

manpagedescription()

    bf(FBB::TypeTrait) 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's (2001)
tt(TypeTraits) template class.

    The bf(FBB::LpromotesR) 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.

    The bf(FBB::Use) class template expects two typenames tt(LHS) and tt(RHS)
and defines tt(typename Use<LHS, RHS>::type) as tt(LHS) if tt(RHS) can be
promoted to tt(LHS) or it defines tt(typename Use<LHS, RHS>::type) as tt(RHS).

includefile(include/namespace)

manpagesection(INHERITS FROM)
    -

manpagesection(TypeTrait<TYPE>)
    
    bf(TYPE) is the template type parameter whose characteristics must be
determined. 

    tt(TypeTrait<TYPE>) defines the type tt(Plain): the plain type (the type
without const, pointer, reference type indication) of any const or non-const
plain, pointer, lvalue- or rvalue-reference type.

    tt(TypeTrait<TYPE>) defines the following tt(bool) values:    
    itemization(
    itt(isClass): tt(true) if the template type argument represents a
        class (struct) type, tt(false) otherwise.
    itt(isConst): tt(true) if the template type argument represents a
        const type, tt(false) otherwise.
    itt(isPointer): tt(true) if the template type argument represents a
        pointer type, tt(false) otherwise.
    itt(isR_Ref): tt(true) if the template type argument represents a
        rvalue reference type, tt(false) otherwise.
    itt(isRef): tt(true) if the template type argument represents an
        lvalue reference type, tt(false) otherwise.
    )

manpagesection(LpromotesR<LeftType, RightType>)

    tt(LpromotesR<LeftType, RightType>) defines the enum constant tt(yes) as 1
if an tt(RightType) argument can be promoted to tt(LeftType) value or object.
The enum value tt(yes) is defined as 0 if no such constructor is available or if
such a constructor is defined using the tt(explicit) keyword.
    

manpagesection(EXAMPLES)


    Here is an example using tt(LpromotesR):
        verb(
    int main()
    {
        cout << "string promotes char const *: " << 
                LpromotesR<string, char const *>::yes << '\n';  // 1
        cout << "string promotes string " << 
                LpromotesR<string, string>::yes << '\n';        // 1
        cout << "char const * promotes string " << 
                LpromotesR<char const *, string>::yes << '\n';  // 0
    }
        )

manpagefiles()
    em(bobcat/typetrait) - defines the class interface

manpageseealso()
    bf(bobcat)(7)nl()
    Alexandrescu A. (2001) bf(Modern C++ Design), Addison-Wesley, Boston.

manpagebugs()
    None Reported.

includefile(include/trailer)
