|
BDE 4.14.0 Production release
|
Provide a compile-time check for the bsl::pair type.
This component defines a simple template structure used to evaluate whether it's parameter is a bsl::pair type. A t_TYPE that has this trait fulfills the following requirements, where mX is a modifiable object and X a non-modifiable object of t_TYPE:
Note that first and second are not member functions, but data members.
The bslmf::IsPair trait is not used to construct pair objects, as a pair behaves like any other type w.r.t. the constructors and bslma::Allocator. Nevertheless, it is used for different purposes in libraries that depend on bslalg. For instance, some libraries use it for printing (a pair does not have a printing method, but it is possible to use the trait to forward the call to print to its two members if they both have the printable trait).