Bloomberg meta‐function implementations used by bsl::is_same.

Types

Name

Description

AddPointer_Compute

This utility struct is a private implementation detail that hosts an overloaded pair of functions that, through SFINAE, can determine whether it is legal to form a pointer to a specified t_TYPE.

AddReference

This meta‐function class defines a typedef, Type, that is an alias for a reference to the parameterized t_TYPE. References to cv‐qualified void will produce the original void type and not a reference (see specializations below). References‐to‐references "collapse" to produce an alias to the original reference type, which is the revised rule according to the C++11 standard. Note that there is no requirement that the parameterized t_TYPE be a complete type.

ArrayToConstPointer

Meta‐function mapping an array type to a const pointer type.

ArrayToPointer

Meta‐function mapping an array type to a pointer type.

ConstForwardingType

DEPRECATED: Use ForwardingType instead.

DetectNestedTrait

This struct template metafunction detects whether the specified t_TRAIT parameter is associated with the specified t_TYPE parameter using the nested type trait mechanism. This trait derives from bsl::true_type if and only if t_TYPE is a class type that associated with the specified trait using the BSLMF_NESTED_TRAIT_DECLARATION macro, and from bsl::false_type otherwise. Users should not specialize this trait directly for their types, but should always use the macro to make a nested trait association.

EnableIf

This struct template implements a meta‐function that provides a typedef type that is an alias to the (template parameter) t_TYPE if the (template parameter) t_COND is true; otherwise, type is not provided. If t_TYPE is not specified, it is set to void. Note that this generic default template provides type for when t_COND is true; a template specialization is provided (below) that omits type for when t_COND is false.

FloatingTypeStructuralTraits

This is the primary template declaration for bslmf::FloatingTypeStructuralTraits, which is never defined.

ForwardingRefType

This template metafunction has a member Type computed such that, for a specified t_TYPE parameter, a function with argument of t_TYPE can be called efficiently from another function (e.g., a wrapper) by declaring the corresponding parameter of the other wrapper as 'typename ForwardingRefType<t_TYPE>::Type'. The Type member is computed to minimize the number of expensive copies while forwarding the arguments as faithfully as possible.

ForwardingRefTypeUtil

Provide a namespace for the forwardToTarget function.

ForwardingRefType_Category

This component‐private struct provides a namespace for the type dispatch category enumeration values.

ForwardingRefType_Dispatch

This component‐private class template is a metafunction whose value member is the forwarding category for the specified t_TYPE.

ForwardingType

This template metafunction has a member Type computed such that, for a specified t_TYPE parameter, a function with argument of t_TYPE can be called efficiently from another function (e.g., a wrapper) by declaring the corresponding parameter of the other wrapper as 'typename ForwardingType<t_TYPE>::Type'. The Type member is computed to minimize the number of expensive copies while forwarding the arguments as faithfully as possible.

ForwardingTypeUtil

Provide a namespace for the forwardToTarget function.

ForwardingType_Category

This component‐private struct provides a namespace for thpe type dispatch category enumeration values.

ForwardingType_Dispatch

This component‐private class template is a metafunction whose value member is the forwarding category for the specified t_TYPE.

ForwardingType_Imp<Signaler_NotArg, 5>

Rvalue of user type (i.e., class or union) is forwarded as a const reference.

FunctionPointerCLinkage

C function pointer linkage tag.

FunctionPointerCPlusPlusLinkage

C++ function pointer linkage tag.

FunctionPointerTraits

This class gives information about the specified t_PROTOTYPE. The general definition gives no information, but specializations for function pointers types define nested types ResultType, ArgumentList, and Linkage.

HasPointerSemantics

Metafunction indicating whether the (template parameter) t_TYPE has pointer‐like semantics.

If

This meta‐function selects t_IF_TRUE_TYPE if t_CONDITION is non‐zero. and t_IF_FALSE_TYPE otherwise.

IntegerSequence

This class template represents a compile‐time sequence of integers. When passed as an argument to a function template, the specified parameter pack t_INTS can be deduced and used a in pack expansion.

InvokeResultDeductionFailed

When invoke_result cannot deduce the actual return type of a functor (in C++03 mode), it yields this type as a placeholder. The advantage of using this placeholder instead of a compilation failure (e.g., using a static assert) is that the return type of an INVOKE() operation is often discarded, so our failure to deduce the return type is often harmless. Since InvokeResultDeductionFailed is a return type, it must be convertible from the actual return type; this conversion is accomplished by means of a constructor that makes it convertible from any type.

InvokeResult_AddCVRef

Starting with type, t_UNQUAL_TYPE, generate a new type by applying the following steps in order:

InvokeResult_BaseCalcUtil

Forward declaration

InvokeResult_FuncPtrImp

Forward declaration

InvokeResult_FunctorImp

Forward declaration

InvokeResult_Index

Metafunction helpers for deducing the return type of an expression.

InvokeResult_MemFuncPtrImp

Forward declaration

InvokeResult_MemFuncPtrImpDispatch

Forward declaration.

InvokeResult_MemObjPtrImp

Forward declaration

InvokeResult_MemObjPtrImpDispatch

Forward declaration.

InvokeResult_MemPtrArgQualifiers

This metafunction determines which cv qualifiers and reference qualifiers should be propagated from the first argument of invoke_result. This primary template is instantiated when t_ARG_TYPE is the same or is derived from t_MEMOF_CLASS. The constant k_IS_LVALUE is true iff t_ARG_TYPE is an lvalue reference; the constant k_IS_CONST is true iff t_ARG_TYPE is const‐qualified; and the constant k_IS_VOLATILE is true iff t_ARG_TYPE is volatile‐qualified.

InvokeResult_Type

Metafunction to convert a type index back to a type. For each specialization of this struct, the type member will be the type corresponding to index. For example, if index is e_UCHAR, then InvokeResult_Type<index>::type is unsigned char.

InvokeResult_VoidChecker

Empty type used to detect void expressions. The size of this type is the same as bslmf::Tag<1>.

IsAccessibleBaseOf

This struct template provides a type trait to determine if one class is an accessible base class of another class. Note that, while similar to std::is_base_of, when the derived relationship is via private, protected, or ambiguous inheritance IsAccessibleBaseOf evaluates to false.

IsArray

This struct template implements a meta‐function to determine if the (template parameter) t_TYPE is an array type. This struct derives from bsl::true_type if the t_TYPE is an array type, and bsl::false_type otherwise.

IsBitwiseCopyable

This struct template provides a meta‐function to determine whether the (template parameter) t_TYPE is bitwise copyable.

IsBitwiseEqualityComparable

This trait struct is a metafunction that determines whether the specified parameter t_TYPE is bitwise EqualityComparable. If IsBitwiseEqualityComparable<t_TYPE> is derived from true_type then t_TYPE is bitwise EqualityComparable. Otherwise, bitwise equality comparability cannot be inferred for t_TYPE. This trait can be associated with a bitwise EqualityComparable user‐defined class by specializing this class or by using the BSLMF_NESTED_TRAIT_DECLARATION macro.

IsBitwiseMoveable

Trait metafunction that determines whether the specified parameter t_TYPE is bitwise moveable. If IsBitwiseMoveable<t_TYPE> is derived from bsl::true_type then t_TYPE is bitwise moveable. Otherwise, bitwise moveability cannot be inferred for t_TYPE. This trait can be associated with a bitwise moveable user‐defined class by specializing this class or by using the BSLMF_NESTED_TRAIT_DECLARATION macro.

IsBitwiseMoveable_Imp<allocator<unsigned long>>

Core implementation of the IsBitwiseMoveable trait. A class is detected as being bitwise moveable iff it is trivially copyable or it has a nested trait declaration for the IsBitwiseMoveable trait. In C++03 however, detection of trivially copyable classes is imperfect and depends on programmer intervention. As many empty classes (including standard classes like std::less<T> would not be detected as being trivially copyable and, therefore, bitwise moveable, a heuristic is put in place whereby any type of one byte size is assumed to be bitwise moveable. See component‐level documentation for this component for more details on this heuristic and how to avoid false positives.

IsClass

This meta‐function derives from bsl::true_type if the (template parameter) t_TYPE is a class type, or a reference to a class type, and from bsl::false_type otherwise.

IsConvertible

This struct template implements a meta‐function to determine if the (template parameter) t_FROM_TYPE is convertible to the (template parameter) t_TO_TYPE. This struct derives from bsl::true_type if the t_FROM_TYPE is convertible to t_TO_TYPE, and from bsl::false_type otherwise. Note that both t_FROM_TYPE and t_TO_TYPE should be complete types, arrays of unknown bound, or (possibly cv‐qualified) void types.

IsConvertibleToAny

This struct template implements a meta‐function to determine if the (template parameter) t_TYPE is convertible to any other type. This struct derives from bsl::true_type if t_TYPE is convertible to any type, and bsl::false_type otherwise.

IsConvertible_CheckComplete

Private helper for IsConvertible complete‐type checks.

IsEnum

This struct provides a meta‐function that computes, at compile time, whether the (template parameter) t_TYPE is an enumerated type. It derives from bsl::true_type if t_TYPE is an enumerated type, and from bsl::false_type otherwise.

IsFunctionPointer

This template determines if the specified t_PROTOTYPE is a free (i.e., non‐member) function pointer. value is defined as 1 if the specified t_PROTOTYPE is a function pointer type, and a zero value otherwise.

IsFundamental

This struct template implements a meta‐function for checking if a type is fundamental, or a reference to a fundamental type. The static constant value member will be 1 if t_TYPE is fundamental and 0 otherwise.

IsFundamental_Imp<bsl::nullptr_t>

This partial specialization of IsFundamental_Imp derives from bsl::true_type for when the (template parameter) t_TYPE is void.

IsMemberFunctionPointer

This template determines if the specified t_PROTOTYPE is a member function pointer. value is defined as 1 if the specified t_PROTOTYPE is a member function, and a zero value otherwise.

IsNil

Metafunction that is true for Nil and false for all other types.

IsPair

Metafunction that is false for all types except bsl::pair specializations.

IsPointer

This struct template implements a meta‐function to determine if the (template parameter) t_TYPE is a pointer type. This struct derives from bsl::true_type if the t_TYPE is a pointer type (but not a pointer to non‐static member), and bsl::false_type otherwise.

IsPolymorphic

This struct template implements a meta‐function to determine if the (template parameter) t_TYPE is a (possibly cv‐qualified) polymorphic type. This struct derives from bsl::true_type if the t_TYPE is a polymorphic type, and bsl::false_type otherwise.

IsReferenceWrapper

This struct template implements a boolean metafunction used to detect if the specified t_TYPE is a reference wrapper. Clients may specialize this struct template to inherit from bsl::true_type for t_TYPE types that are specializations of bsl::reference_wrapper. The behavior is undefined if any other specialization of this struct template is defined. Note that this struct template

IsSame

This struct template implements a meta‐function to determine if the (template parameter) t_TYPE1 and the (template parameter) t_TYPE2 are the same. This struct derives from bsl::true_type if t_TYPE1 and t_TYPE2 are the same, and bsl::false_type otherwise.

IsTransparentPredicate

This struct template implements a meta‐function to determine whether the (template parameter) t_COMPARATOR is transparent (has a publicly accessible member that is a type named is_transparent). This generic default template derives from bsl::false_type. Template specializations are provided (below) that derive from bsl::true_type.

IsTriviallyCopyableCheck

This struct exists to return the same value as is_trivially_copyable and is intended to never be specialized. The purpose of using it is to perform the following static assert that the bsl and std versions of is_trivially_copyable are in sync.

IsTriviallyCopyable_DetectTrait

This struct template implements a meta‐function to determine whether the (non‐cv‐qualified) (template parameter) t_TYPE has been explicitly tagged with the trivially copyable trait. If the flag t_K_INTRINSIC is true then the compiler has already determined that t_TYPE is trivially copyable without user intervention, and the check for nested traits can be optimized away.

IsTriviallyCopyable_Intrinsic

This struct template implements a meta‐function to determine whether the (non‐cv‐qualified) (template parameter) t_TYPE is trivially copyable.

IsTriviallyDefaultConstructible_DetectTrait

This struct template implements a meta‐function to determine whether the (non‐cv‐qualified) (template parameter) t_TYPE has been explicitly tagged with the trivially default constructible trait. If the flag t_K_INTRINSIC is true then the compiler has already determined that t_TYPE is trivially default constructible without user intervention, and the check for nested traits can be optimized away.

IsVoid

This struct template implements a meta‐function to determine if the (template parameter) t_TYPE is the (possibly cv‐qualified) void type. This struct derives from bsl::true_type if t_TYPE is the void type, and bsl::false_type otherwise.

MakeIntegerSequence_ConcatUtil

This component‐private class template provides a specialization that concatenates two integer sequences. This template is not defined unless the (template parameter) types t_S1 and t_S2 are specializations of the class template bslmf::IntegerSequence.

MakeIntegerSequence_Impl<t_T, bsl::integral_constant<std::size_t, 0>>

This partial specialization of the bslmf::MakeIntegerSequence_Impl meta‐function is a recursion break condition for an empty integer sequence.

MakeIntegerSequence_Impl<t_T, bsl::integral_constant<std::size_t, 1>>

This partial specialization of the bslmf::MakeIntegerSequence_Impl meta‐function is a recursion break condition for an integer sequence having the length 1.

MakeIntegerSequence_Impl<t_T, bsl::integral_constant<std::size_t, 2>>

This partial specialization of the bslmf::MakeIntegerSequence_Impl meta‐function is a recursion break condition for an integer sequence having the length 2.

MakeIntegerSequence_Impl<t_T, bsl::integral_constant<std::size_t, 3>>

This partial specialization of the bslmf::MakeIntegerSequence_Impl meta‐function is a recursion break condition for an integer sequence having the length 3.

MakeIntegerSequence_Impl<t_T, bsl::integral_constant<std::size_t, 4>>

This partial specialization of the bslmf::MakeIntegerSequence_Impl meta‐function is a recursion break condition for an integer sequence having the length 4.

MakeIntegerSequence_Impl<t_T, bsl::integral_constant<std::size_t, 5>>

This partial specialization of the bslmf::MakeIntegerSequence_Impl meta‐function is a recursion break condition for an integer sequence having the length 5.

MakeIntegerSequence_Impl<t_T, bsl::integral_constant<std::size_t, 6>>

This partial specialization of the bslmf::MakeIntegerSequence_Impl meta‐function is a recursion break condition for an integer sequence having the length 6.

MakeIntegerSequence_Impl<t_T, bsl::integral_constant<std::size_t, 7>>

This partial specialization of the bslmf::MakeIntegerSequence_Impl meta‐function is a recursion break condition for an integer sequence having the length 7.

MakeIntegerSequence_Impl<t_T, bsl::integral_constant<std::size_t, 8>>

This partial specialization of the bslmf::MakeIntegerSequence_Impl meta‐function is a recursion break condition for an integer sequence having the length 8.

MatchAnyType

Any type can be converted into this type.

MatchArithmeticType

This copy‐constructible mechanism can be used as a formal parameter for functions where an arithmetic type can be confused with an iterator type. A copy‐constructible mechanism is needed so that such objects can be used as function arguments.

MemberFunctionPointerTraits

This metafunction determines the traits of a member function type, including the type of the object that it is a member of, its result type, and the type of its list of arguments.

MemberFunctionPointerTraits_ClassType

This class determines whether the specified t_PROTOTYPE is a const, volatile or noexcept member function of the specified t_TYPE. The Type member will be a correctly const and/or volatile qualified version of t_TYPE. This metafunction is necessary because some old compilers do not correctly dispatch to the correct partial specialization of MemberFunctionPointerTraits_Imp based on cv‐qualification of the member‐function pointer.

MemberFunctionPointerTraits_Imp<t_PROTOTYPE, t_BSLMF_RETURN const volatile(t_TYPE::*)(t_ARGS...) noexcept>

Specialization to determine the traits of member functions. A modern compiler will match only non‐cv member functions, but some older compilers might match this to any member function.

MemberPointerTraits

This utility struct template provides the following nested typedefs:: ClassType: The type of the class for which the specified t_TYPE is: a pointer to member object.: MemberType: The type of the member object of the class for which the: specified t_TYPE is a pointer to member object. These typedefs will only be defined if t_TYPE is a

MemberPointerTraits_Imp<t_MEMBER_TYPEt_CLASS_TYPE::*>

MetaInt

Instantiating this template produces a distinct type for each non‐negative integer value. This template has been deprecated in favor of the standard integral_constant template.

MovableRefUtil

This struct provides a collection of utility functions operating on objects of type MovableRef<t_TYPE>. The primary use of these utilities is to create a consistent notation for using the C++03 MovableRef<t_TYPE> objects and the C++11 t_TYPE&& r‐value references.

MovableRefUtil_AddLvalueReference

forward declaration

MovableRefUtil_AddMovableReference

forward declaration

MovableRefUtil_Decay

forward declaration

MovableRefUtil_PropertyTraits

forward declaration

MovableRefUtil_RemoveReference

forward declaration

MovableRef_Helper

forward declaration

NestedTraitDeclaration

Class t_TYPE will be convertible to NestedTraitDeclaration<t_TYPE,t_TRAIT,true> if t_TRAIT is associated with t_TYPE using the BSLMF_NESTED_TRAIT_DECLARATION macro. Nested trait detection depends on t_COND being true. If t_COND is false, the nested trait detection will not see the conversion it is looking for and will not associate t_TRAIT with t_TYPE. This feature is used by BSLMF_NESTED_TRAIT_DECLARATION_IF to turn a trait on or off depending on a compile‐time condition (usually another trait).

Nil

This struct is empty and represents a nil type.

NthParameter

Metafunction to compute the specified t_N`th element of the specified `t_PARAMS template parameter pack. The Type nested typedef will match the t_N`th element of `t_PARAMS, where t_N is zero‐based (so that an t_N of zero corresponds to the first parameter.

NthParameter_Sentinel

Sentinel type used internally by NthParameter (declared but not defined).

RemoveCvq

This class implements a meta‐function for stripping top‐level const/volatile qualifiers from it's parameter type.

RemoveReference

This struct template implements a meta‐function to remove the reference‐ness from the (template parameter) t_TYPE. Note that although this struct is functionally equivalent to bsl::remove_reference, the use of bsl::remove_reference should be preferred.

ResultType

Metafunction to return the result type of the specified functor type t_FUNC. The nested type is identical to t_FUNC::result_type if such a type exists; otherwise, it is identical to t_FUNC::ResultType if that type exists; otherwise, it is identical to the t_FALLBACK template parameter if it was specified; otherwise, it is undefined.

ResultType_BdeIdiom

Metafunction to detect the BDE ResultType idiom as part of the implementation of bslmf::ResultType. This struct is instantiated when t_FUNC::result_type doesn't exist. This primary template is matched when t_FUNC::ResultType also does not exist. The t_FALLBACK type, if any, is produced.

ResultType_Fallback

Metafunction that defines type to be the specified t_FALLBACK type unless t_FALLBACK is bslmf::Nil.

SelectTrait

Instantiate each specified (template parameter) t_TRAIT1 to t_TRAIT9 metafunction using the specified (template parameter) t_TYPE. Inherit from SelectTraitCase<TRAITx>, where x is 1 if t_TRAIT1<t_TYPE>::value is true, 2 if t_TRAIT2<t_TYPE>::value is true, etc.. If none of the traits evaluates to true, then inherit from SelectTraitCase<>, which means that none of the traits match.

SelectTraitCase

This template expresses a class that is unique for the specified (template parameter) t_TRAIT metafunction. An instantiation of this template is the "compile‐time return value" of SelectTrait (see below). SelectTraitCase acts as a sort of compile‐time pointer‐to‐metafunction that holds the identity of a metafunction similar to the way a pointer‐to‐function holds (at run‐time) the identity of a function. As in the pointer‐to‐function case, a SelectTraitCase can also be used indirectly to evaluate t_TRAIT (at compile time). Also note that, when SelectTraitCase is specialized with the default t_TRAIT type parameter, SelectTrait_False, it essentially means that none of the traits specified to SelectTrait match.

SelectTrait_False

Metafunction that always returns false.

Switch

This meta‐function, parameterized by an integral t_SWITCH_SELECTOR and types t_T0 up to t_T9, provides a single type alias, Type, which resolves, through specialization for a particular value N of t_SWITCH_SELECTOR, to the type TN, or to Nil if t_SWITCH_SELECTOR is negative or larger than the number of template arguments provided for the types.

Tag

This template class is never intended to produce a run‐time instance. The only useful attribute of a tag is its size (which is, of course, computable at compile time, even if an instance is never created). Note that in case of overflow on Linux 64‐bit machines, we split the size into 2 data members.

TypeList

Compile‐time list of zero or more types.

TypeListTypeAt

This template is specialized below to return the type the t_INDEX`th member of the typelist `t_LIST. If 0 > t_INDEX <= t_LIST::LENGTH then Type will be defined as the type of the member. Note that t_INDEX is relative to 1.

TypeRep

Generate a reference to t_TYPE for use in meta‐functions.

UsesAllocatorArgT

User‐specialized trait type indicating that the constructor of t_TYPE can be invoked using bsl::allocator_arg as its first argument and an allocator object as its second argument.

Util

This struct provides several functions that are specified in the <utility> header of the C++ Standard, in order to support the bsl library implementation without cycles into the native standard library, and on platforms with only C++03 compilers available, where library features may be emulated.

VoidType

Metafunction that always yields type void for any well‐formed list of type parameters. This metafunction is useful when using SFINAE to probe for well‐formed types.

Type Aliases

Name

Description

MakeIntegerSequence

MakeIntegerSequence is defined to simplify creation of bslmf::IntegerSequence type that represents a collection of increasing integer values of the specified type t_T in a range of [0..t_N) having] the specified t_N‐value length.

MakeIntegerSequence_ConcatUtil_t

bslmf::MakeIntegerSequence_ConcatUtil_t is an alias to the result type of the bslmf::MakeIntegerSequence_ConcatUtil meta‐function.

MovableRef

The alias template MovableRef<t_TYPE> yields an r‐value reference of type t_TYPE&&.

MovableRef_Deduced

This component‐private alias template names the type t_TYPE&& if and only if the specified t_TYPE is not an lvalue reference.

Switch2

switch meta‐function among two types.

Switch3

switch meta‐function among three types.

Switch4

switch meta‐function among four types.

Switch5

switch meta‐function among five types.

Switch6

Select the type associated with selector value 6.

Switch7

Select the type associated with selector value 7.

Switch8

Select the type associated with selector value 8.

Switch9

Alias for a nine‐way Switch metafunction.

TypeList0

Typelist of zero type parameters.

TypeList1

Typelist of one type parameter.

TypeList10

Typelist of ten type parameters.

TypeList11

Typelist of eleven type parameters.

TypeList12

Typelist of twelve type parameters.

TypeList13

Typelist of thirteen type parameters.

TypeList14

Typelist of fourteen type parameters.

TypeList15

Typelist of fifteen type parameters.

TypeList16

Typelist of sixteen type parameters.

TypeList17

Typelist of seventeen type parameters.

TypeList18

Typelist of eighteen type parameters.

TypeList19

Typelist of nineteen type parameters.

TypeList2

Typelist of two type parameters.

TypeList20

Typelist of twenty type parameters.

TypeList3

Typelist of three type parameters.

TypeList4

Typelist of four type parameters.

TypeList5

Typelist of five type parameters.

TypeList6

Typelist of six type parameters.

TypeList7

Typelist of seven type parameters.

TypeList8

Typelist of eight type parameters.

TypeList9

Typelist of nine type parameters.

TypeListNil

Sentinel type representing an empty typelist element.

TypeListTypeOf

Classic Bloomberg code uses a 1‐based index into the type list.

Functions

Name

Description

operator,

Return InvokeResult_VoidChecker() if the left argument is of type cv‐`void`; otherwise bslmf::Tag<false>(). This overload of the comma operator is declared but not defined, and is intended to be used in metafunctions in an unevaluated context to detect void expressions. For any non‐void expression expr, (expr,InvokeResult_VoidChecker()), will match this overload and produce a result of type bslmf::Tag<false>. However, const t_TYPE& will not match void, so if expr is a void expression, the built‐in comma operator is matched and the result will have type InvokeResult_VoidChecker (i.e., the second argument).

Variables

Name

Description

IsBitwiseCopyable_v

This template variable represents the result value of the bslmf::IsBitwiseCopyable meta‐function.

IsBitwiseMoveable_v

This template variable represents the result value of the bslmf::IsBitwiseMoveable meta‐function.

Concepts

Name

Description

BooleanTestable

Concept that a type supports boolean testing and logical negation with the conventional semantics defined by the C++20 standard [concept.booleantestable].

ContainerCompatibleRange

Require that (template parameter) t_RANGE meets the requirements of input range and that the values referenced by the iterators of that range type have the same type or are convertible to the (template parameter) t_TYPE.

Created with MrDocs