Metafunction representing a compile‐time constant of the specified (template parameter) t_TYPE with the specified (template parameter) t_VALUE.

Synopsis

Declared in <bslmf_integralconstant.h>

template<
    class t_TYPE,
    t_TYPE t_VALUE>
struct integral_constant
    : std::integral_constant<t_TYPE, t_VALUE>

Base Classes

Name

Description

std::integral_constant<t_TYPE, t_VALUE>

Type Aliases

Name

Description

type

Alias for this integral_constant specialization.

value_type

Member Functions

Name

Description

operator()

Return a copy of the template argument t_VALUE.

operator value_type

Static Data Members

Name

value

Derived Classes

Name

Description

AAModelBsl

Model tag for bsl‐AA types.

AAModelIsSupported<TYPE, AAModelLegacy>

Specialization of AAModelIsSupported for MODEL == AAModelStl, yielding true_type if TYPE can use bslma::Allocator * as its memory resource. Specifically, it is true if UsesBslmaAllocator<TYPE> is true or if TYPE::allocator_type exists and is convertible from bslma::Allocator *.

AAModelIsSupported<TYPE, AAModelBsl>

Specialization of AAModelIsSupported for MODEL == AAModelBsl, yielding true_type if TYPE::allocator_type exists and is convertible from bsl::allocator<char>.

AAModelIsSupported<TYPE, AAModelStl>

Specialization of AAModelIsSupported for MODEL == AAModelStl, yielding true_type if TYPE::allocator_type exists; otherwise, yielding false_type unless AAModelIsSupported<TYPE, AAModelBsl> is true. The latter condition exists so that bsl‐AA always implies stl‐AA even if AAModelIsSupported<TYPE, AAModelBsl> is explicitly specialized to true for a type that does not have an allocator_type member.

AAModelIsSupported<TYPE, AAModelPmr>

Specialization of AAModelIsSupported for MODEL == AAModelPmr, yielding true_type if TYPE::allocator_type exists and is convertible from bsl::polymorphic_allocator<char>.

AAModelLegacy

Model tag for legacy‐AA types.

AAModelNone

Model tag for non‐AA types.

AAModelPmr

Model tag for pmr‐AA types.

AAModelStl

Model tag for stl‐AA types.

ArrayPrimitives_CanBitwiseCopy

Metafunction that is true when FROM_TYPE and TO_TYPE are the same type (ignoring top‐level const) and that type is bit‐wise copyable.

HasFallbackEnumerator

This struct should be specialized for third‐party types that need to declare the fact that they have a fallback enumerator value. Clients that specialize this struct must ensure that if HasFallbackEnumerator<TYPE>::value is true, then IsEnumeration<TYPE>::value is also true; otherwise, the behavior is undefined.

HasPointerSemantics

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

HasTrait

This meta‐function evaluates to bsl::true_type if the (template parameter) TYPE has the (template parameter) TRAIT, and to bsl::false_type otherwise.

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.

IsBitwiseCopyable<bsl::pair<T1, T2>>

IsBitwiseEqualityComparable<bsl::pair<T1, T2>>

IsBitwiseMoveable<bsl::pair<T1, T2>>

IsBitwiseMoveable<bslma::ManagedPtrDeleter>

IsBitwiseMoveable<bslstl::HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>>

IsBitwiseMoveable<bslstl::BidirectionalNodePool<VALUE, ALLOCATOR>>

IsChoice

This struct should be specialized for third‐party types that need to expose "choice" behavior. See the component‐level documentation for further information.

IsCustomizedType

This struct should be specialized for third‐party types that need to expose "customized type" behavior. See the component‐level documentation for further information.

IsDynamic

Meta‐function indicating whether the specified t_TYPE is in the bdlat dynamic‐type category.

IsEnumeration

This struct should be specialized for third‐party types that need to expose "enumeration" behavior. See the component‐level documentation for further information.

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.

IsInplaceFunc

This class is a Boolean metafunction that determines whether or not the specified FN template parameter should be allocated within the footprint of the InplaceBuffer (i.e., using the small‐object optimization.)

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.

IsSequence

This struct should be specialized for third‐party types that need to expose "sequence" behavior. See the component‐level documentation for further information.

IsSimple

Meta‐function indicating whether the specified TYPE is in the bdlat simple‐type category.

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.

NumberUtil_IsSigned

This class will be a bsl::true_type if the specified (template parameter type) t_TYPE is a signed type, and bsl::false_type otherwise. t_TYPE shall be an integral type. Note that currently bsl::is_signed is not available for C++03 platforms.

Optional_ConstructsFromType

This metafunction is derived from bsl::true_type if t_ANY_TYPE is not derived from bsl::optional<t_TYPE>, t_ANY_TYPE is not a tag type, and t_TYPE is constructible from t_ANY_TYPE.

Optional_PropagatesAllocator

This metafunction is derived from bsl::true_type if t_TYPE is an allocator‐aware const type, and if t_ANY_TYPE is the same as t_TYPE, minus the cv qualification. This trait is used to enable a constructor overload for a const qualified allocator‐aware ValueType taking an rvalue of Optional_Base of the non‐const qualified ValueType. Such an overload needs to propagate the allocator.

Pair_ConstructionParametersPackLength

This component‐private component‐private meta‐function determines the number of elements in a tuple containing parameters for piecewise construction of a bsl::pair member having the specified TYPE. Result value depends on the TYPE, whether it takes a bslma::Allocator* constructor argument and, if so, whether that argument follows an argument of type bsl::allocator_arg_t.

Pair_IndexOfType<T2, T1, T2>

This partial specialization of Pair_IndexOfType returns the index of second element of pair.

Pair_IndexOfType<T1, T1, T2>

This partial specialization of Pair_IndexOfType returns the index of first element of pair.

SimpleTypeIdOf<bdlt::TimeTz>

SimpleTypeIdOf<long long>

SimpleTypeIdOf<bdlt::DateTz>

SimpleTypeIdOf<bdlt::Date>

SimpleTypeIdOf<unsigned short>

SimpleTypeIdOf<bdldfp::Decimal64>

SimpleTypeIdOf<bsl::vector<char>>

SimpleTypeIdOf<unsigned long>

SimpleTypeIdOf<short>

SimpleTypeIdOf<signed char>

SimpleTypeIdOf<char>

SimpleTypeIdOf<float>

SimpleTypeIdOf<bdlt::Time>

SimpleTypeIdOf<bsl::string>

SimpleTypeIdOf<bool>

SimpleTypeIdOf<unsigned char>

SimpleTypeIdOf<int>

SimpleTypeIdOf<unsigned long long>

SimpleTypeIdOf<double>

SimpleTypeIdOf<long>

SimpleTypeIdOf<unsigned int>

SimpleTypeIdOf<bdlt::Datetime>

SimpleTypeIdOf<bdlt::DatetimeTz>

UsesBslmaAllocator<bsl::pair<T1, T2>>

UsesBslmaAllocator

This metafunction is derived from true_type if TYPE adheres to the bslma allocator usage idiom and false_type otherwise. Note that this trait must be explicitly associated with a type in order for this metafunction to return true; simply having a constructor that implicitly converts bslma::Allocator * to TYPE is deprecated as a means of indicating that a type follows the bslma allocator usage idiom.

Variant_AssignsFromType

This component‐private metafunction is derived from bsl::true_type if (template parameter) t_TYPE is neither a tag type nor the type (template parameter) t_VARIANT (modulo cv‐qualification), there is a unique best match alternative in t_VARIANT for std::declval<t_TYPE>(), and that alternative is constructible and assignable from std::declval<t_TYPE>(); otherwise, this metafunction is derived from bsl::false_type.

Variant_ConstructsFromType

This component‐private metafunction is derived from bsl::true_type if (template parameter) t_TYPE is neither a tag type, nor the type (template parameter) t_VARIANT (modulo cv‐qualification), nor the corresponding (possibly cv‐qualified) std::variant type, there is a unique best match alternative in t_VARIANT for std::declval<t_TYPE>(), and that alternative is constructible from std::declval<t_TYPE>(); otherwise, this metafunction is derived from bsl::false_type.

Variant_ConvertsWithoutNarrowing<t_DEST, t_SOURCE, bsl::void_t<decltype(Variant_ArrayHelper<t_DEST>{{std::declval<t_SOURCE>()}})>>

This component‐private metafunction is derived from bsl::true_type if (template parameter) t_SOURCE can be converted to (template parameter) t_DEST without narrowing, and bsl::false_type otherwise. A conversion from pointer or pointer‐to‐member type to cv bool is considered narrowing even if the compiler does not implement P1957R2 (which was adopted as a DR); however, on compilers that do not implement P1957R2, we do not have the ability to check whether a user‐defined conversion sequence to cv bool would use a narrowing standard conversion, so on those compilers, we permit conversion to a t_DEST that is cv bool only if t_SOURCE is also cv bool, and not when t_SOURCE is a class type. This behavior is not expected to pose a problem for users migrating from bdlb::Variant, because that class does not support implicit conversions from an argument type to an alternative type.

Variant_CountCVType

This component‐private metafunction calculates the number of times (template parameter) t_TYPE occurs in (template parameters) t_HEAD, t_TAIL..., where two types that differ only in top‐level cv‐qualification are considered to be the same.

Variant_CountCVType<t_TYPE, BSLSTL_VARIANT_NOT_A_TYPE>

Specialization for purposes of the sim_cpp11_features.pl script.

Variant_CountType<t_TYPE, BSLSTL_VARIANT_NOT_A_TYPE>

Specialization for purposes of the sim_cpp11_features.pl script.

Variant_CountType

This component‐private metafunction calculates the number of times (template parameter) t_TYPE occurs in (template parameters) t_HEAD, t_TAIL.... An alternative must have the same cv‐qualification as t_TYPE in order to be counted.

Variant_HasUniqueCVType<t_TYPE, bsl::variant<t_HEAD, t_TAIL...>>

Variant_HasUniqueType<t_TYPE, bsl::variant<t_HEAD, t_TAIL...>>

Variant_IsAlternativeConstructibleFrom

This component‐private metafunction is derived from bsl::true_type if there is a unique best match alternative in (template parameter) t_VARIANT for 'std::declval<t_TYPE>() and that alternative is constructible from `std::declval<t_TYPE>(), and `bsl::false_type' otherwise.

Variant_IsBitwiseMoveableAll

This component‐private metafunction is derived from bsl::true_type if all template arguments are bitwise moveable, and from bsl::false_type otherwise.

Variant_IsCopyAssignableAll

This component‐private metafunction is derived from bsl::true_type if all template parameters are copy assignable, and bsl::false_type otherwise.

Variant_IsCopyConstructibleAll

This component‐private metafunction is derived from bsl::true_type if all template parameters are copy constructible, and bsl::false_type otherwise.

Variant_IsMoveAssignableAll

This component‐private metafunction is derived from bsl::true_type if all template parameters are move assignable, and bsl::false_type otherwise.

Variant_IsMoveConstructibleAll

This component‐private metafunction is derived from bsl::true_type if all template parameters are move constructible, and bsl::false_type otherwise.

Variant_IsSameReturnType

This component‐private metafunction derives from bsl::true_type if, for each alternative ALTi in (template parameter) t_VARIANT with index less than or equal to (template parameter) t_INDEX, decltype(std::declval<t_VISITOR>(std::declval<ALTi>())) is t_RET; otherwise, this metafunction derives from bsl::false_type. Note that ALTi has the cv‐ and ref‐qualifiers from t_VARIANT added to it. This metafunction is used to determine whether invoking the visitor results in the same type and value category for all alternatives.

Variant_ReturnValueHelper

This struct is a component‐private meta‐function. Do not use. This meta‐function checks whether the template parameter type VISITOR has the member ResultType defined using "SFINAE" (Substitution Failure Is Not An Error). A value of true indicates VISITOR::ResultType exists, and false otherwise.

Variant_TypeToIndexImpl<t_INDEX, t_TYPE, BSLSTL_VARIANT_NOT_A_TYPE>

This partial specialization is used when the list of alternatives t_HEAD, t_TAIL... is empty, i.e., t_TYPE wasn't found in the originally supplied list of alternatives.

Variant_UsesBslmaAllocatorAny

This component‐private metafunction is derived from bsl::true_type if at least one template argument uses an allocator, and from bsl::false_type otherwise.

Variant_isAlternativeAssignableFrom

This component‐private metafunction is derived from bsl::true_type if there is a unique best match alternative in (template parameter) t_VARIANT for std::declval<t_TYPE>() and that alternative is both constructible and assignable from std::declval<t_TYPE>(), and bsl::false_type otherwise.

is_arithmetic

This struct template implements the is_arithmetic meta‐function defined in the C++11 standard [meta.unary.comp]to determine if the (template parameter) t_TYPE is an arithmetic type. This struct derives from bsl::true_type if the t_TYPE is an arithmetic type, and from bsl::false_type otherwise.

is_convertible

This struct template implements the is_convertible meta‐function defined in the C++11 standard to determine whether the (template parameter) t_FROM_TYPE is implicitly convertible to the (template parameter) t_TO_TYPE.

is_copy_constructible

This struct template implements a meta‐function to determine whether the (template parameter) t_TYPE is copy constructible. This struct derives from bsl::true_type if the t_TYPE is copy constructible, and from bsl::false_type otherwise. This meta‐function has the same syntax as the is_copy_constructible meta‐function defined in the C++11 standard [meta.unary.prop]; on C++03 platforms, however, this meta‐function defaults to true_type for all types that are not explicitly declared to have the bslmf::IsNonCopyable trait using the BSLMF_NESTED_TRAIT_DECLARATION macro. To mark a type as non‐copyable, bslmf::IsNonCopyable must be specialized (for that type) to inherit from bsl::true_type.

is_empty

This struct is a meta‐function to determine whether the (template parameter) t_TYPE is an empty class type. This struct derives from bsl::true_type if the t_TYPE is empty, and from bsl::false_type otherwise. This meta‐function has the same syntax as the is_empty meta‐function defined in the C++11 standard [meta.unary.prop]; on C++03 platforms, however, this meta‐function defaults to true_type if t_TYPE is a class or struct with no non‐static data members other than bit‐fields of length 0, no virtual member functions, no virtual base classes, and no base class B for which is_empty<B>::value is false; otherwise is_empty defaults to false_type. Note that this meta‐function will fail to compile for a union that is the same size as an empty class in C++03.

is_enum

This struct template implements the is_enum meta‐function defined in the C++11 standard [meta.unary.cat]to determine if the (template parameter) t_TYPE is an enumerated type. This struct derives from bsl::true_type if the t_TYPE is an enumerated type, and from bsl::false_type otherwise.

is_floating_point

This struct template implements the is_floating_point meta‐function defined in the C++11 standard [meta.unary.cat]to determine if the (template parameter) t_TYPE is a floating‐point type.

is_function

This struct template implements the is_function meta‐function defined in the C++11 standard [meta.unary.cat]to determine if the (template parameter) t_TYPE is a function type. This struct derives from bsl::true_type if the t_TYPE is a function type, and from bsl::false_type otherwise. This implementation relies on the fact that neither function types nor reference types can be cv‐qualified so that is_const<const t_TYPE> will actually yield false.

is_fundamental

This struct template implements a meta‐function for checking if a type is fundamental as defined in the C++11 standard [basic.fundamental]. Note that this is subtly differemt from bslmf::IsFundamental, which also returns true_type for references to fundamental types.

is_integral

This struct template implements the is_integral meta‐function defined in the C++11 standard to determine if the (template parameter) t_TYPE is an integral type.

is_lvalue_reference

Metafunction that is true if the (template parameter) t_TYPE is an lvalue reference type.

is_polymorphic

This struct template implements the is_polymorphic meta‐function defined in the C++11 standard [meta.unary.prop]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.

variant_size<variant<t_HEAD, t_TAIL...>>

Created with MrDocs