Implementation details for basic_syncbuf and related stream types.

Types

Name

Description

AlgorithmUtil

Provide a namespace for implementing helper routines for algorithm implementations.

BadWeakPtr

This class provides an exception type thrown when a weak_ptr object is locked after the managed object has been destroyed. This class conforms to the C++11 standard specification of std::bad_weak_ptr.

BidirectionalIterator

Given an ITER_IMP type that implements a minimal subset of an iterator interface, this template generates a complete iterator that meets all of the requirements of a "bidirectional iterator" in the C++ standard. If T is const‐qualified, then the resulting type is a constant iterator. T shall not be a function, reference type or void. ITER_IMP must provide public operations so that, for objects i and j of type ITER_IMP, the following operations are supported: ` ITER_IMP i; default construction ITER_IMP j(i); copy construction i = j assignment ++i increment to next element ‐‐i decrement to previous element i == j // convertible to bool equality comparison *i // reference convertible to T& element access (dereference) `

BidirectionalNodePool

This class provides methods for creating and destroying nodes using the appropriate allocator‐traits of the (template parameter) type ALLOCATOR.

BoyerMooreHorspoolSearcher

This class template implements an STL‐compliant searcher object that uses the Boyer, Moore, Horspool Algorithm. Several non‐standard accessors are also provided.

BoyerMooreHorspoolSearcher_CharImp

This class template implements the same interfaces as the BoyerMooreHorspoolSearcher_GeneralImp; however, the implementation is specialized for a value_type of char. Notably, needle metadata is stored/accessed from a fixed size array, not a dynamically‐sized container.

BoyerMooreHorspoolSearcher_GeneralImp

This class template implements the same interfaces as the BoyerMooreHorspoolSearcher_CharImp for arbitrary value_type.

CallableVariable

This metafunction returns a type that is an alias for CALLABLE unless that is a function type, in which case it is an alias for CALLABLE &. This should be used to declare variables of an arbitrary callable type, typically a template type parameter, that may turn out to be a function type. Note that this metafunction is necessary as the C++ language does not allow variables of function type, nor may functions return a function type.

DefaultSearcher

This class template defines functors that can search for the sequence of value_type values defined on construction (i.e., the "needle") in sequences of value_type values (i.e., "haystacks") passed to the functor's operator().

DefaultSearcher_CanOptimize

This component‐private meta‐function struct provides a member enumerator value that is true if all of the specified FORWARD_ITR_NEEDLE, EQUAL, and FORWARD_ITR_HAYSTACK meet the criteria for an optimization of the default searcher, and has the value false otherwise.

ForwardIterator

Given an ITER_IMP type that implements a minimal subset of an iterator interface, this template generates a complete iterator that meets all of the requirements of a "forward iterator" in the C++ standard. If T is const‐qualified, then the resulting type is a const iterator. T shall not be a function, reference type or void. ITER_IMP must provide public operations so that, for objects i and j of type ITER_IMP, the following operations are supported: ` ITER_IMP i; Default construction ITER_IMP j(i); Copy construction i = j Assignment ++i Increment to next element i == j // convertible to bool Equality comparison *i // reference convertible to T& Element access (dereference) `

Function_ArgTypes

This component‐private struct template provides the following nested typedefs for bsl::function for a specified PROTOTYPE which must be a function type: ` argument_type ‐‐ Only if PROTOTYPE takes exactly one argument first_argument_type ‐‐ Only if PROTOTYPE takes exactly two arguments second_argument_type ‐‐ Only if PROTOTYPE takes exactly two arguments ` The C++ Standard requires that function define these typedefs for compatibility with one‐ and two‐argument legacy (now deprecated) functor adaptors. bsl::function publicly inherits from an instantiation of this template in order to conditionally declare the above nested types. This primary (unspecialized) template provides no typedefs.

Function_InvokerUtil

This struct is a namespace containing a single function template, invokerForFunc, that returns a pointer to a function that is used to invoke a callable object of a particular type.

Function_InvokerUtilNullCheck

Provides an isNull static method that that returns whether or not its argument is "null", i.e., it cannot be invoked. For must FUNC types isNull always returns false as every instance of FUNC is invocable. However, specializations of this class, especially for pointer types, have isNull functions that sometimes return true. This class is a customization point: types outside of this component can (but rarely should) specialize this template. In particular, bslstl_function contains a specialization for bsl::function.

Function_InvokerUtil_Dispatch

Specializations of this class contain a static invoke method that can invoke a callable object of type FUNC, converting each argument in PROTOTYPE (a function prototype) to the corresponding argument in the invocation of the callable object and converting the return value of the invocation to the return type of PROTOTYPE. The INVOCATION_TYPE specifies the category of callable object: pointer to function, pointer to member function, pointer to data member, inplace functor (i.e., one that qualifies for the small‐object optimization) and out‐of‐place functor (i.e., one that is not stored in the small‐object buffer).

Function_InvokerUtil_ForwardType

forward declaration

Function_InvokerUtil_ForwardTypeImp

forward declaration

Function_InvokerUtil_IsExplicitlyConvertible

forward declaration

Function_InvokerUtil_IsExplicitlyConvertibleImp

forward declaration

Function_InvokerUtil_IsFuncInvocable

forward declaration

Function_InvokerUtil_IsFuncInvocableImp

forward declaration

Function_InvokerUtil_ResultType

forward declaration

Function_InvokerUtil_ResultTypeImp

forward declaration

Function_IsInvocableWithPrototype

Forward declaration of the component‐private Function_IsInvocableWithPrototype struct template. The primary (unspecialized) template is not defined. This struct template implements a boolean metafunction that publicly inherits from bsl::true_type if an object of the specified FUNC type is invocable under the specified PROTOTYPE, and inherits from bsl::false_type otherwise. An object of FUNC type is invocable under the PROTOTYPE if it is Lvalue‐Callable with the arguments of the PROTOTYPE, and returns an object of type convertible to the return type of the PROTOTYPE. If the return type of the PROTOTYPE is void, then any type is considered convertible to the return type of the PROTOTYPE. In C++03, FUNC is considered Lvalue‐Callable with the argument and return types of the PROTOTYPE if it is not an integral type. This struct template requires PROTOTYPE to be an unqualified function type.

Function_IsReferenceCompatible

This metafunction is derived from true_type if a reference to the specified FROM_TYPE parameter type can be substituted for a reference to the specified TO_TYPE parameter type with no loss of information; otherwise, it is derived from false_type. By default, this metafunction yields true_type if FROM_TYPE is the same as TO_TYPE; else it yields false_type. bdef_Function should specialize this template to yield true_type when FROM_TYPE is an instantiation of bdef_Function and TO_TYPE is the corresponding instantiation of bsl::function with the same function prototype. Instantiation will fail if either FROM_TYPE or TO_TYPE are reference types.

Function_Rep

This is a component‐private class. Do not use.

Function_SmallObjectOptimization

This utility struct provides a namespace for several types, type traits, and constants used in the implementation of the small‐object optimization for bsl::function.

Function_Variadic

This component‐private class template contains the physical representation and provides the variadic interfaces for bsl::function.

HashTable

This class template implements a value‐semantic container type holding an unordered sequence of (possibly duplicate) elements, that can be rapidly accessed using their key, with the constraint on the container that elements whose keys compare equal according to the specified COMPARATOR will be stored in a stable, contiguous sequence within the container. The value type and key type of the elements maintained by a HashTable are determined by aliases provided through the (template parameter) type KEY_CONFIG. Elements in a HashTable are stored in "nodes" that are allocated using an allocator of the specified ALLOCATOR type (rebound to the node type), and elements are constructed directly in the node using the allocator as described in the C++11 standard under the allocator‐aware container requirements in ([container.requirements.general], C++11 23.2.1). The (template parameter) types HASHER and COMPARATOR shall be copy‐constructible function‐objects. HASHER shall support a function call operator compatible with the following statements: ` HASHER hash; KEY_CONFIG::KeyType key; std::size_t result = hash(key); ` where the definition of the called function meets the requirements of a hash function, as specified in {`bslstl_hash`}. COMPARATOR shall support the a function call operator compatible with the following statements: ` COMPARATOR compare; KEY_CONFIG::KeyType key1, key2; bool result = compare(key1, key2); ` where the definition of the called function defines an equivalence relationship on keys that is both reflexive and transitive. The HASHER and COMPARATOR attributes of this class are further constrained, such for any two objects whose keys compare equal by the comparator, shall produce the same value from the hasher.

HashTableBucketIterator

HashTableIterator

HashTable_ArrayProctor

This class probably already exists in bslalg

HashTable_BaseHasher

This struct adapts the (template parameter) HASHER type for use as the base hasher of a HashTable.

HashTable_Comparator

Comparator adapter used by HashTable.

HashTable_ComparatorWrapper

This class provides a wrapper around a functor that can compare two values and return a bool, so that the function call operator is always declared as const qualified.

HashTable_HashWrapper

This class provides a wrapper around a functor satisfying the Hash requirements ({`bslstl_hash`}) such that the function call operator is always declared as const qualified.

HashTable_NodeProctor

This class implements a proctor that, unless its release method has previously been invoked, automatically deallocates a managed list of nodes upon destruction by recursively invoking the deleteNode method of a supplied factory on each node. The (template parameter) type FACTORY shall be provide a member function that can be called as if it had the following signature: ` void deleteNode(bslalg::BidirectionalLink *node); `

HashTable_Util

This utility struct provide utilities for initializing and destroying bucket lists in anchors that are managed by a HashTable. They cannot migrate down to bslalg::HashTableImpUtil as they rely on the standard library bslma_allocatortraits for their implementation.

IoManip_QuotedStringFormatter

Private class: do not use outside of bslstl_iomanip.h header. This private class provides a temporary storage that can be extracted to/from a stream and provides data to the standard implementation of the quoted function. Note that this class does not contain the storage itself, but only points to an external object. Note that QuotedStringViewFormatter is designed so that its objects are returned as temporary objects (of opaque type) from 'bsl::quoted`, and then passed to a streaming operator; it serves as a temporary proxy for a string value.

IoManip_QuotedStringViewFormatter

Private class: do not use outside of bslstl_iomanip.h header. This private class provides a temporary storage that can be extracted to a stream and provides data to the standard implementation of the quoted function. Note that QuotedStringViewFormatter is designed to be returned as a temporary object (of opaque type) from 'bsl::quoted`, and passed to a streaming operator; it serves as a temporary proxy for a string value. Also note that this value is copied to bsl::string data member that is owned by the object of this class.

IsConvertibleToCString

This struct template implements a meta‐function to determine if the (template parameter) t_TYPE is convertible to const t_CHAR_TYPE *.

IsConvertibleToStringView

This struct template implements a meta‐function to determine if the (template parameter) t_TYPE is convertible to bsl::basic_string_view<t_CHAR_TYPE, t_CHAR_TRAITS>.

IteratorUtil

This utility struct provides a namespace for functions on iterators and iterator ranges.

IteratorUtil_LegacyInsertDistance

This supporting utility type is used for type‐based dispatch as part of the implementation of the similarly structured functions insertDistance and canCalculateInsertDistance from IteratorUtil. Selection between the primary template and secondary (much simpler) one is performed based on the defaulted third parameter that checks if the (template parameter) type t_SENTINEL is convertible to the (template parameter) type t_INPUT_ITERATOR. When the primary template is selected, the decision to delegate distance calculation to bsl::distance is performed using tag dispatch.

MapComparator

Optional_Base

This component‐private class template implements the functionality of bsl::optional. The primary template is instantiated when TYPE is allocator‐aware, and holds the allocator that is used to create the stored object.

Optional_ConstructFromForwardRef

Tag type selecting construction from a forwarding reference.

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_CopyConstructFromOtherOptional

Tag type selecting copy construction from another optional.

Optional_CopyConstructFromStdOptional

Tag type selecting copy construction from a std::optional.

Optional_Data

This component‐private struct manages a value_type object in Optional_Base by inheriting from Optional_DataImp. In addition, this primary template properly destroys the owned instance of t_TYPE in its destructor.

Optional_DataImp

This component‐private struct manages a value_type object in an Optional_Base object. This class provides an abstraction for const value type. An Optional_Base object may contain an object of const type. An assignment to such an Optional_Base object should not succeed. However, unless the Optional_Base object itself is const, it should be possible to change the value of the Optional_Base object using emplace. In order to allow for that, this class manages a non‐const object of value_type, but all the accessors return a const adjusted reference to the managed object.

Optional_ImmovableHelper

This struct is used to implement direct initialization of the private data member of the std::optional class, which makes it possible to support immovable types returned from the transform member function.

Optional_InvokeConstructorTag

Constructor tag used to implement the transform function.

Optional_IsBslOptional

Metafunction that is false_type for types that are not bsl::optional.

Optional_IsTriviallyDestructible

This metafunction is derived from std::is_trivially_destructible<t_TYPE> in C++11 and later. In C++03, the metafunction is derived from bsl::is_trivially_copyable, a trait that implies the type is also trivially destructible.

Optional_MoveConstructFromOtherOptional

Tag type selecting move construction from another optional.

Optional_MoveConstructFromStdOptional

Tag type selecting move construction from a std::optional.

Optional_NulloptConstructToken

This trivial tag type is used to create nullopt_t objects prior to C++17.

Optional_OptNoSuchType

This component‐private trivial tag type is used to distinguish between arguments passed by a user, and an enable_if argument. It is not default constructible so the following construction never invokes a constrained single parameter constructor: ` optional<SomeType> o(int, {}); `

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_GetImpUtil

This utility class template provides functions for selecting the element of pair, returned from bsl::get(bsl::pair<T1, T2>), by its index.

Pair_IndexOfType

This meta‐function provides a compile‐time way to obtain the index of bsl::pair element, having the (template parameter) type T. If neither type of pair's element is equal to T or both pair's elements have the same type, code is not compiled.

RandomAccessIterator

Given an ITER_IMP type that implements a minimal subset of an iterator interface, this template generates a complete iterator that meets all of the requirements of a "random‐access iterator" in the C++ standard. If T is const‐qualified, then the resulting type is a const iterator. T shall not be a function, reference type or void. ITER_IMP must provide public operations so that, for objects i and j of type ITER_IMP and n of an integral type, the following operations are supported: ` ITER_IMP i; default construction ITER_IMP j(i); copy construction i = j assignment ++i increment to next element ‐‐i decrement to previous element i += n increment by n elements i ‐= n decrement by n elements j ‐ i // convertible to ptrdiff_t distance from i to j i == j // convertible to bool equality comparison i < j // convertible to bool less‐than comparison *i // reference convertible to T& element access (dereference) `

SetComparator

SharedPtrAllocateInplaceRep

This class provides a concrete implementation of the SharedPtrRep protocol for in‐place instances of the (template parameter) TYPE. Upon destruction of this object, the destructor of TYPE is invoked on the shared object.

SharedPtrAllocateOutofplaceRep

This class provides a concrete implementation of the SharedPtrRep protocol for out‐of‐place instances of the parameterized TYPE. Upon destruction of this object, the parameterized DELETER type is invoked on the pointer to the shared object.

SharedPtrAllocateOutofplaceRep_InitProctor

This proctor is used for out‐of‐place shared pointer instantiations. Generally, a proctor is created prior to constructing a SharedPtrAllocateOutofplaceRep and released after successful construction. In the event that an exception is thrown during construction of the representation, the proctor will delete the provided pointer using the provided deleter. Note that the provided deleter is held by reference and must remain valid for the lifetime of the proctor. If the proctor is not released before it's destruction, a copy of the deleter is instantiated to delete the pointer (in case operator() is non‐`const`). Also note that if the deleter throws during copy construction, the provided pointer will not be destroyed.

SharedPtrArrayAllocateInplaceRep

This class provides a concrete implementation of the SharedPtrRep protocol for in‐place instances of the (template parameter) TYPE, which must be an array. Upon destruction of this object, each element of the array is destructed.

SharedPtrNilDeleter

This struct provides a function‐like shared pointer deleter that does nothing when invoked.

SharedPtrUtil

This struct provides a namespace for operations on shared pointers.

SharedPtr_DefaultDeleter

This struct provides a function‐like shared pointer deleter that invokes delete with the passed pointer. If the template parameter is true, then the pointer is deleted using operator delete []. Otherwise, it is deleted using operator delete.

SharedPtr_IsCallable

Forward declaration of component‐private type trait to indicate whether an object of (template parameter) type FUNCTOR can be called as a function with an argument of (template parameter) type ARG

SharedPtr_IsFactoryFor

Forward declaration of component‐private type trait to indicate whether a pointer to a FACTORY has a deleteObject member that can be called as factory‐>deleteObject((ARG *)p).

SharedPtr_IsNullableFactory

Forward declaration of component‐private type trait to indicate whether a pointer to a FACTORY has a deleteObject member that can be called as factory‐>deleteObject((ARG *)p).

SharedPtr_IsPointerCompatible

Forward declaration of component‐private type trait to indicate whether a pointer to a SOURCE_TYPE is compatible with a pointer to DEST_TYPE. [util.smartptr.shared]/5 says: "for the purposes of ..., a pointer type SOURCE_TYPE* is said to be compatible with a pointer type DEST_TYPE* when either SOURCE_TYPE* is convertible to DEST_TYPE* or SOURCE_TYPE is U[N]and DEST_TYPE is cv U[]."

SharedPtr_IsPointerConvertible

Forward declaration of component‐private type trait to indicate whether a pointer to a SOURCE_TYPE can be converted to a pointer to a DEST_TYPE. [util.smartptr.shared.const]/8 says "either DEST_TYPE is U[N]and SOURCE_TYPE()[]N]is convertible to DEST_TYPE, or DEST_TYPE is U[]and SOURCE_TYPE()[]]is convertible to DEST_TYPE".

SharedPtr_RepFromExistingSharedPtr

This struct is for internal use only, providing a tag for shared_ptr constructors to recognize that a passed SharedPtrRep was obtained from an existing shared_ptr object.

SharedPtr_RepProctor

This class implements a proctor that, unless its release method has previously been invoked, automatically releases a reference held by the bslma::SharedPtrRep object that is supplied at construction.

SharedPtr_TestIsCallable

Component‐private metafunction testing whether FUNCTOR is callable.

SimplePool

This class provides methods for creating and deleting nodes using the appropriate allocator‐traits of the parameterized ALLOCATOR. This type is intended to be used as a private base‐class for a node‐based container, in order to take advantage of the empty‐base‐class optimization in the case where the base‐class has 0 size (as may the case if the parameterized ALLOCATOR is not a bslma::Allocator).

SimplePool_Type

For use only by bslstl::SimplePool. This struct provides a namespace for a set of types used to define the base‐class of a SimplePool. The parameterized ALLOCATOR is bound to MaxAlignedType to ensure the allocated memory is maximally aligned.

StdExceptUtil

This struct provides a namespace for static utility functions that throw standard library exceptions.

StopCallback_CallbackStorage

The primary class template stores an object of non‐reference type given by the template parameter t_CALLBACK. (That is, the primary template provides the implementation only when t_IS_REFERENCE is false.)

StopCallback_NoAlloc

This component‐private empty class is used as a dummy "allocator" when bsl::stop_callback wraps a non‐allocator‐aware type.

StopCallback_Node

This component‐private class is used to implement bsl::stop_callback. It overrides the virtual invoke method of bslstl::StopStateCallbackNode, which allows it to be registered and invoked by bslstl::StopState.

StopState

Shared stop state that tracks a stop request and registered callbacks.

StopStateCallbackNode

Intrusive list node that stores a registered stop‐callback invocation.

StopState_ListNode

This component‐private class represents a node in a doubly‐linked list.

StopToken_RefCountedState

This component‐private struct adds a reference count to the internal StopState class. This reference count represents the number of bsl::stop_source objects that refer to the stop state (NOT the total number of objects that refer to the stop state).

StringRefData

This class is an intermediate link between bslstl::StringRef used in BDE and bsl::string_view and is kept only for compatibility with legacy code.

StringRefImp

This class provides a reference‐semantic‐like (see below) mechanism that allows const std::string values, which are represented externally as either an std::string or null‐terminated c‐style string (or parts thereof), to be treated both uniformly and efficiently when passed as an argument to a function in which the string's length will be needed. The interface of this class provides a subset of accessor methods found on std::string (but none of the manipulators) ‐‐ all of which apply to the referenced string. But, because only non‐modifiable access is afforded to the referenced string value, each of the manipulators on this type ‐‐ assignment in particular ‐‐ apply to this string‐reference object itself (as if it had pointer semantics). Hence, this class has a hybrid of reference‐ and pointer‐semantics.

StringRefImp_CompareUtil

[*PRIVATE*]This class provides a namespace for private comparison implementation functions.

SyncBufBase

Allocator‐independent base of basic_syncbuf. Also this is used by the manipulators: emit_on_flush, noemit_on_flush, flush_emit (the ALLOCATOR template argument cannot be deduced from basic_ostream<CHAR_TYPE, CHAR_TRAITS>).

SyncBufBaseUtil

Internal utils.

TreeIterator

This class provides an STL‐conforming bidirectional iterator over the ordered bslalg::RbTreeNode objects in a binary tree (see section [24.2.6 bidirectional.iterators]of the C++11 standard). A TreeIterator provides access to values of the parameterized VALUE, over a binary tree composed of nodes of the parameterized NODE (which must derive from bslalg::RbTreeNode). The parameterized DIFFERENCE_TYPE determines the standard required difference_type of the iterator, without requiring access to the allocator‐traits for the node. The behavior of the operator* method is undefined unless the iterator is at a valid position in the tree (i.e., not the end) and the referenced element has not been removed since the iterator was constructed. NODE must derives from bslalg::RbTreeNode, and contains a value method that returns a reference providing modifiable access to a type that is convertible to the parameterized VALUE (e.g., a bslstl::TreeNode object).

TreeNode

This POD‐like class describes a node suitable for use in a red‐black binary search tree of values of the parameterized VALUE. This class is a "POD‐like" to facilitate efficient allocation and use in the context of a container implementation. In order to meet the essential requirements of a POD type, this class does not define a constructor or destructor. The manipulator, value, returns a modifiable reference to d_value so that it may be constructed in‐place by the appropriate bsl::allocator_traits object.

TreeNodePool

This class provides methods for creating and deleting nodes using the appropriate allocator traits of the (template parameter) type ALLOCATOR. This type is intended to be used as a private base‐class for a node‐based container, in order to take advantage of the empty‐base‐class optimization in the case where the base class has 0 size (as may be the case if the (template parameter) type ALLOCATOR is not a bslma::Allocator).

UnorderedMapKeyConfiguration

This struct provides a namespace for key‐configuration utilities used by bsl::unordered_map to extract keys from stored value objects.

UnorderedSetKeyConfiguration

The UnorderedSetKeyConfiguration type.

Variant_AllocatorBase

This component‐private struct keeps track of the allocator for a bsl::variant object. The primary template is used when the variant is not allocator‐aware (because it has no allocator‐aware alternatives).

Variant_ArrayHelper

This component‐private struct is used to check whether an alternative given by (template parameter) t_TYPE is a potential match for an argument of a bsl::variant constructor or assignment operator that does not take an explicitly specified alternative type. The standard allows such conversion only when the declaration t_TYPE d_x[]= {expr}; is valid, where expr is the (forwarded) argument expression.

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_Base

This component‐private struct defines the data representation of bsl::variant and contains the implementations of its special member functions (which must be defaulted in bsl::variant itself). This class also contains implementations of additional constructors and methods needed for the correct functionality of the variant class hierarchy.

Variant_CVQualAlt

This component‐private metafunction calculates the alternative type at index (template parameter) t_INDEX in (template parameter) t_VARIANT, where the cv‐ and ref‐qualifiers of t_VARIANT are added to the alternative type. This metafunction is used to calculate the return type of bsl::visit.

Variant_CheckForP1957R2

This component‐private metafunction checks whether a conversion from a pointer type to (template parameter) t_TYPE is narrowing. It is instantiated only for bool, and its behavior depends on whether the compiler has implemented P1957R2.

Variant_ConstructFromStdTag

This component‐private tag type is used as a parameter type for constructors of Variant_Base that accept a std::variant.

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_ConvertIndex

This component‐private metafunction computes the index of the alternative in (template parameter) t_VARIANT that is the "unique" best match for conversion from std::declval<t_TYPE>(), or bsl::variant_npos if there is no such alternative. An alternative that occurs multiple times in t_VARIANT (possibly with varying cv‐qualifications) is considered to occur only once; thus, if all alternatives that are tied for the best match are the same type (possibly with varying cv‐qualifications), the result is the lowest index at which that type (with any cv‐qualification) occurs.

Variant_ConvertsWithoutNarrowing

Metafunction that is true_type when t_SOURCE converts to t_DEST without narrowing, and false_type otherwise.

Variant_CopyAssignBase

This component‐private class has deleted copy assignment operator if (template parameter) t_ISCOPYASSIGNABLE is false. All other special member functions are defaulted.

Variant_CopyAssignVisitor

This component‐private class is a visitor that is used to implement the copy assignment operator for bsl::variant.

Variant_CopyConstructVisitor

This component‐private class is a visitor that is used to implement the copy constructor for bsl::variant.

Variant_CopyConstructorBase

This component‐private class has deleted copy constructor if (template parameter) t_ISCOPYCONSTRUCTIBLE is false. All other special member functions are defaulted.

Variant_CorrespondingStdVariant

This component‐private metafunction declares a member type that is an alias to the std::variant type corresponding to t_TYPE if one exists, and void otherwise.

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_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_DataImp

This component‐private class manages an object of type (template parameter) t_TYPE that is stored in a variant object. Note that t_TYPE may be const‐qualified, in which case the internally stored object is not const, but the interface of this class prevents modification thereof.

Variant_DestructorVisitor

This component‐private struct is a visitor that destroys the active alternative of the visited variant object.

Variant_EqualVisitor

Component‐private visitor for variant == comparison.

Variant_Function

Component‐private vtable entry invoking a visitor on alternative t_INDEX.

Variant_FunctionId

Component‐private vtable entry invoking a tagged visitor on alternative t_INDEX.

Variant_GreaterOrEqualVisitor

Component‐private visitor for variant >= comparison.

Variant_GreaterThanVisitor

Component‐private visitor for variant > comparison.

Variant_HasUniqueCVType

This component‐private metafunction derives from bsl::true_type if (template parameter) t_TYPE occurs exactly once as an alternative of (template parameter) t_VARIANT, and bsl::false_type otherwise, where two types that differ only in top‐level cv‐qualification are considered to be the same. The primary template (used when t_VARIANT is not a bsl::variant) is not defined.

Variant_HasUniqueType

This component‐private metafunction derives from bsl::true_type if (template parameter) t_TYPE occurs exactly once as an alternative of (template parameter) t_VARIANT, and bsl::false_type otherwise. An alternative must have the same cv‐qualification as t_TYPE in order to be counted. The primary template (used when t_VARIANT is not a bsl::variant) is not defined.

Variant_HashVisitor

This component‐private class is a visitor that is used to implement hashAppend for bsl::variant.

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_IsAssignable

This component‐private metafunction derives from std::is_assignable<t_LHS, t_RHS> in C++11 and later, and bsl::true_type in C++03.

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_IsConstructible

This component‐private metafunction derives from std::is_constructible<t_TO, t_FROM> in C++11 and later, and bsl::true_type in C++03.

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_IsTag

This component‐private metafunction is derived from bsl::true_type if (template parameter) t_TYPE is not a tag type. This metafunction requires any cv and ref qualifications to be removed from the queried type.

Variant_LessOrEqualVisitor

Component‐private visitor for variant <= comparison.

Variant_LessThanVisitor

Component‐private visitor for variant < comparison.

Variant_MoveAssignBase

This component‐private class has deleted move assignment operator if (template parameter) t_ISMOVEASSIGNABLE is false. All other special member functions are defaulted.

Variant_MoveAssignVisitor

This component‐private class is a visitor that is used to implement the move assignment operator for bsl::variant.

Variant_MoveConstructVisitor

This component‐private class is a visitor that is used to implement the move constructor for bsl::variant.

Variant_MoveConstructorBase

This component‐private class has deleted move constructor if (template parameter) t_ISMOVECONSTRUCTIBLE is false. All other special member functions are defaulted.

Variant_NoSuchType

This component‐private trivial tag type is used to distinguish between arguments passed by a user, and an enable_if argument. It is not default constructible so the following construction never invokes a constrained single parameter constructor: ` struct SomeType { SomeType(int, const std::string &s = "default"){} };

Variant_NotEqualVisitor

Component‐private visitor for variant != comparison.

Variant_OverloadHelper

This component‐private metafunction provides a member typedef Index representing the value that should be computed by Variant_ConvertIndex. The primary template is instantiated when the partial specialization below is not viable because no viable alternative exists for the conversion or because the best match is not "unique" (see the documentation of Variant_ConvertIndex for an explanation).

Variant_OverloadSetImp

This component‐private metafunction computes an overload set consisting of one function, named candidate, for each type in (template parameters) t_HEAD, t_TAIL..., having one parameter of that type. Each such function participates in overload resolution only when std::declval<t_SRC>() is convertible to the alternative without narrowing, and returns bsl::integral_constant<t_INDEX + i>, where i is the zero‐based index of the corresponding alternative. Note that a type that occurs multiple times in t_HEAD, t_TAIL... (possibly with varying cv‐qualifications) will only result in the generation of a single candidate. This implementation relies on expression SFINAE, decltype, std::declval, and P1957R2; since these features are not available in C++03, the C++03 version requires an exact match modulo cv‐qualification.

Variant_SMFBase

This component‐private class has special member functions that are either deleted or defaulted according to the specified template parameters.

Variant_SwapVisitor

This component‐private class is a visitor that is used to implement bsl::variant::swap.

Variant_TypeToIndex

This component‐private metafunction calculates the zero‐based index of (template parameter) t_TYPE in the list of alternatives in (template parameter) t_VARIANT, or bsl::variant_npos if there is no such alternative. The primary template (used when t_VARIANT is not a bsl::variant) is not defined.

Variant_TypeToIndexImpl

This component‐private metafunction provides implementation for Variant_TypeToIndex. It evaluates to t_INDEX + i where i is the zero‐based index of (template parameter) t_TYPE in (template parameters) t_HEAD, t_TAIL..., or bsl::variant_npos if t_TYPE is not found.

Variant_Union

This component‐private union can hold a Variant_DataImp object for any alternative in (template parameters) t_TYPES.... The primary template is used when t_TYPES... is empty.

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_VTable

This component‐private struct computes an array in which element i is a pointer to Variant_Function<t_RET, t_VISITOR, t_VARIANT, i>::functionImpl, defined above as a function that invokes a t_VISITOR with alternative i of t_VARIANT and implicitly converts the return type to t_RET.

Variant_VTableId

This component‐private struct computes an array in which element i is a pointer to Variant_FunctionId<t_RET, t_VISITOR, t_VARIANT, i>::functionImpl, defined above as a function that invokes a t_VISITOR with a tag representing i and alternative i of t_VARIANT, implicitly converting the return type to t_RET. Implementation note: The constexpr static maps of pointers defined by Variant_VTable and this class have deliberately been defined in two different classes as having them in the same class caused issues with Clang and Microsoft Visual C++.

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.

to_chars_result

Result type for the to_chars function.

Type Aliases

Name

Description

Pair_IndexSequence

Pair_IndexSequence is an alias to the bslmf::IntegerSequence class template specialized for the common case of the integer sequence were the element type T is std::size_t.

Pair_MakeIndexSequence

Pair_MakeIndexSequence is an alias template to the bslmf::MakeIntegerSequence meta‐function specialized for the common case of the integer sequence were the element type T is std::size_t.

StringRef

This typedef is an alias to StringRefImp<char>.

StringRefWide

Wide‐character string ref type (StringRefImp<wchar_t>).

Functions

Name

Description

hashAppend

Pass the specified input to the specified hashAlg

operator+

Addition operators

operator++

Increment operators

operator‐

Subtraction operators

operator‐‐

Decrement operators

operator>>

Read quoted string from the specified input stream into the underlying string of the specified object. Note that the object here is const because the QuotedStringFormatter is designed to be returned as a temporary object from 'bsl::quoted`, serving as a proxy for the underlying string.

optional_acceptsBslOptional

Component‐private constraint helper for Optional_DerivedFromBslOptional.

optional_acceptsStdOptional

Component‐private constraint helper for Optional_DerivedFromStdOptional.

swap

swap overloads

to_chars

Write the specified value into the character buffer [first, last)].

variant_swapImpl

variant_swapImpl overloads

operator<<

Write the value of the specified object to the specified output stream.

operator==

Equality operators

operator!=

Inequality operators

operator<

Return true if (1) the specified lhs iterator refers to an element before the specified rhs iterator in the iteration sequence, or (2) rhs (and not lhs) has the past‐the‐end value for an iterator over this sequence, and false otherwise. The behavior is undefined unless lhs and rhs are iterators into the same underlying sequence.

operator<=

Return true if (1) the specified lhs iterator has the same value as the specified rhs iterator, or (2) lhs refers to an element before rhs in the iteration sequence, or (3) rhs has the past‐the‐end value for an iterator over this sequence, and false otherwise. The behavior is undefined unless lhs and rhs are iterators into the same underlying sequence.

operator>

Return true if (1) the specified lhs iterator refers to an element after the specified rhs iterator in the iteration sequence, or (2) lhs (and not rhs) has the past‐the‐end value for an iterator over this sequence, and false otherwise. The behavior is undefined unless lhs and rhs are iterators into the same underlying sequence.

operator>=

Return true if (1) the specified lhs iterator has the same value as the specified rhs iterator, or (2) lhs has the past‐the‐end value for an iterator over this sequence, or (3) lhs refers to an element after rhs in the iteration sequence, and false otherwise. The behavior is undefined unless lhs and rhs are iterators into the same underlying sequence.

Variables

Name

Description

variant_constructsFromStd

This component‐private constexpr variable template is true if t_VARIANT is a specialization of bsl::variant, and t_STD_VARIANT is the std::variant type (possibly with added cvref‐qualification) that has the same sequence of alternatives, and each alternative of t_VARIANT is constructible from the corresponding alternative of t_STD_VARIANT (with cv‐qualification and value category matching that of t_STD_VARIANT). Note that we use bsl::conjunction_v for its short‐circuiting properties: if t_STD_VARIANT isn`t a std::variant` (for example, if it`s a `bsl::variant`) we avoid recursing into the constraints of `bsl::variant.

Concepts

Name

Description

IteratorUtil_ModernIterator

Concept identifying iterators that expose an iterator_concept type.

Optional_ConvertibleToBool

Component‐private concept modeling the exposition‐only boolean‐testable concept.

Optional_DerivedFromBslOptional

Component‐private concept that is satisfied when t_TYPE derives from bsl::optional.

Optional_DerivedFromOptional

This component‐private concept models whether a type is derived from one of std::optional or bsl::optional.

Optional_DerivedFromStdOptional

Component‐private concept that is satisfied when t_TYPE derives from std::optional.

Created with MrDocs