[#BloombergLP-bsltf] = xref:BloombergLP.adoc[BloombergLP]::bsltf :relfileprefix: ../ :mrdocs: Package namespace for BSL template‐testing facility types and helpers. == Types [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bsltf/AllocArgumentType.adoc[`AllocArgumentType`] | This class template declares a separate type for each template parameter value `N`, `bsltf::AllocArgumentType<N>`, that wraps an integer value and provides implicit conversion to and from `int`. The wrapped integer will be dynamically allocated using the supplied allocator, or the default allocator if none is supplied. Its main purpose is that having separate types for testing enables distinguishing them when calling through a function template interface, thereby avoiding ambiguities or accidental switching of arguments in the implementation of in‐place constructors. It further tests that allocators are propagated correctly, or not, as required. | xref:BloombergLP/bsltf/AllocBitwiseMoveableTestType.adoc[`AllocBitwiseMoveableTestType`] | This unconstrained (value‐semantic) attribute class that is bitwise‐moveable, uses a `bslma::Allocator` to supply memory, and defines the type traits `bslma::UsesBslmaAllocator` and `bslmf::IsBitwiseMoveable`. See the section for information on the class attributes. | xref:BloombergLP/bsltf/AllocEmplacableTestType.adoc[`AllocEmplacableTestType`] | This class provides a test object used to check that the arguments passed for creating an object with an in‐place representation are of the correct types and values. | xref:BloombergLP/bsltf/AllocTestType.adoc[`AllocTestType`] | This unconstrained (value‐semantic) attribute class that uses a `bsl::allocator<>` to supply memory and defines the type trait `bslma::UsesBslmaAllocator`. This class is primarily provided to facilitate testing of templates by defining a simple type representative of user‐defined types having an allocator. See the Attributes section under DESCRIPTION in the component‐level documentation for information on the class attributes. | xref:BloombergLP/bsltf/ArgumentType.adoc[`ArgumentType`] | This class template wraps an integer value and provides implicit conversion to, and explicit conversion from, `int`, while keeping track of copy and move operations. Its main purpose is for following an argument through a forwarding interface in test drivers. Each value of the template parameter `N` yields a unique type, enabling a test driver to distingusih them when calling through a function template interface, thereby avoiding ambiguities or accidental switching of arguments in the implementation of test‐class methods and constructors or in calls to methods and constructors of a class template under test. When an object of this type is copied or moved (via construction or assignment), the value returned by the `copyMoveState` accessor (the _copy/move_ _state_), is updated for the target object and, in the case of a move, for the source object as well. | xref:BloombergLP/bsltf/ArgumentTypeByValue.adoc[`ArgumentTypeByValue`] | This class works around a limitation in C++03 whereby initializing a pass‐by‐value parameter of type `bslmf::ArgumentType<N>` from a `MovableRef<bslmf::ArgumentType<N> >` results in an ambiguous conversion sequence (i.e., `MovableRef::operator T&` vs. `ArgumentType(MovableRef)` are equally good conversions). Pass‐by‐value use cases (e.g., recording the value category of multiple function arguments) can use this class as a parameter type, instead, eliminating the ambiguity because `MovableRef<AT>` ‐> `AT&` ‐> `ArgumentTypeByValue` requires _two_ user‐defined conversions and is therefore eliminated during overload resolution. | xref:BloombergLP/bsltf/ArgumentTypeDefault.adoc[`ArgumentTypeDefault`] | Empty class used as a default argument initializer for `ArgumentType`. Example usage: ` void func(ArgumentTypeByValue<1> arg1 = ArgumentTypeDefault(), ArgumentTypeByValue<2> arg2 = ArgumentTypeDefault()); ` | xref:BloombergLP/bsltf/BitwiseCopyableTestType.adoc[`BitwiseCopyableTestType`] | This unconstrained (value‐semantic) attribute class defines the `bsl::is_trivially_copyable` trait and does not allocate memory. See the section for information on the class attributes. | xref:BloombergLP/bsltf/BitwiseMoveableTestType.adoc[`BitwiseMoveableTestType`] | This unconstrained (value‐semantic) attribute class defines the `bslmf::IsBitwiseMoveable` and does not allocate memory. See the section for information on the class attributes. | xref:BloombergLP/bsltf/ConvertibleValueWrapper.adoc[`ConvertibleValueWrapper`] | This class provides a wrapper around an object of the specified (template parameter) `TYPE`. `TYPE` shall be CopyConstructible. If `TYPE` is a value‐semantic type, then this class will also be value semantic. Objects of this type are implicitly convertible to and from objects of the specified `TYPE`. | xref:BloombergLP/bsltf/CopyMoveState-0e.adoc[`CopyMoveState`] | Namespace for enumerators and helpers describing copy/move history of test objects. | xref:BloombergLP/bsltf/CopyMoveTracker.adoc[`CopyMoveTracker`] | Type that tracks whether it has been copied into, moved into, or moved from. | xref:BloombergLP/bsltf/DegenerateFunctor.adoc[`DegenerateFunctor`] | This test class template adapts a CopyConstructible class to offer a minimal or outright obstructive interface for testing generic code. To support the testing of standard containers, this adapter will be MoveConstructible, CopyConstructible, and nothrow Destructible as long as the adapted `FUNCTOR` satisfies the same requirements. This class will further be Swappable if (the template parameter) `ENABLE_SWAP` is `true` and the adapted `FUNCTOR` is MoveConstructible. The (inherited) function call operator should be the only other available method, no other operation (e.g., the unary address‐of operator) should be usable. We take advantage of the fact that defining a copy constructor inhibits the generation of a default constructor, and that constructors are not inherited by a derived class. `DegenerateFunctor` objects must be created through either the copy constructor, or by wrapping a `FUNCTOR` object through the static factory method of this class, `cloneBaseObject`. | xref:BloombergLP/bsltf/EmplacableTestType.adoc[`EmplacableTestType`] | This class provides a test object used to check that the arguments passed for creating an object with an in‐place representation are of the correct type and value. | xref:BloombergLP/bsltf/EnumeratedTestType.adoc[`EnumeratedTestType`] | This `struct` provides a namespace for defining an `enum` type that supports explicit conversion to and from an integral type for values from 0 to 127 (according to 7.2.7 of the C++11 standard). | xref:BloombergLP/bsltf/EvilBooleanType.adoc[`EvilBooleanType`] | This class provides a test type for predicates returning a type that is convertible‐to‐bool. It makes life reasonably difficult by disabling the address‐of and comma operators, but deliberately does not overload the `&&` and `||` operators, as we hope the standard will be updated to no longer require such support. Once C++11 becomes available, this class would use an `explicit operator bool()` conversion operator, and explicitly supply the `==` and `!=` operators, but we use the convertible‐to‐pointer‐to‐member idiom in the meantime. Implicitly defined operations fill out the API as needed. | xref:BloombergLP/bsltf/InputIterator.adoc[`InputIterator`] | | xref:BloombergLP/bsltf/InputIteratorUtil.adoc[`InputIteratorUtil`] | This namespace `struct` allows the easy creation of `begin` and `end` iterators from a variety of contiguous range types. Either the argument must be an array, or a container that supports the following operations: * `size()` * `operator` (if 0 != size()) | xref:BloombergLP/bsltf/MovableAllocTestType.adoc[`MovableAllocTestType`] | This class provides an unconstrained (value‐semantic) attribute type that records when move semantics have been invoked with the object instance as the source parameter. The class uses a `bslma::Allocator` to allocate memory and defines the type trait `bslma::UsesBslmaAllocator`. This class is primarily provided to facilitate testing of templates where move semantics need to be differentiated versus copy semantics. See the `Attributes` section under DESCRIPTION in the component‐level documentation for information on the class attributes. | xref:BloombergLP/bsltf/MovableTestType.adoc[`MovableTestType`] | This class provides an unconstrained (value‐semantic) attribute type that records when move semantics have been invoked with the object instance as the source parameter. This class is primarily provided to facilitate testing of templates where move semantics need to be differentiated versus copy semantics. See the `Attributes` section under DESCRIPTION in the component‐level documentation for information on the class attributes. | xref:BloombergLP/bsltf/MoveOnlyAllocTestType.adoc[`MoveOnlyAllocTestType`] | This unconstrained (value‐semantic) attribute class that uses a `bslma::Allocator` to supply memory and defines the type trait `bslma::UsesBslmaAllocator`. This class is primarily provided to facilitate testing of templates by defining a simple type representative of user‐defined types having an allocator. See the Attributes section under DESCRIPTION in the component‐level documentation for information on the class attributes. | xref:BloombergLP/bsltf/MoveState.adoc[`MoveState`] | Namespace for enumerators describing whether a test object was moved. | xref:BloombergLP/bsltf/NonAssignableTestType.adoc[`NonAssignableTestType`] | This unconstrained (value‐semantic) attribute class does not provide an assignment operator. | xref:BloombergLP/bsltf/NonCopyConstructibleTestType.adoc[`NonCopyConstructibleTestType`] | This unconstrained (value‐semantic) attribute class does not provide a copy constructor. | xref:BloombergLP/bsltf/NonDefaultConstructibleTestType.adoc[`NonDefaultConstructibleTestType`] | This unconstrained (value‐semantic) attribute class does not provide a default constructor. | xref:BloombergLP/bsltf/NonEqualComparableTestType.adoc[`NonEqualComparableTestType`] | This unconstrained (value‐semantic) attribute class does not provide equality‐comparison operators. | xref:BloombergLP/bsltf/NonOptionalAllocTestType.adoc[`NonOptionalAllocTestType`] | This unconstrained (value‐semantic) attribute class that uses a `bslma::Allocator` to allocate memory and defines the type trait `bslma::UsesBslmaAllocator`. This class does not provide a default constructor. | xref:BloombergLP/bsltf/NonTypicalOverloadsTestType.adoc[`NonTypicalOverloadsTestType`] | This unconstrained (value‐semantic) attribute class ensures that the operator new member and operator delete member never gets called by overloading and asserting in them. See the Attributes section under DESCRIPTION in the component‐level documentation for information on the class attributes. | xref:BloombergLP/bsltf/SimpleTestType.adoc[`SimpleTestType`] | This unconstrained (value‐semantic) attribute class does not allocate memory and does not define any traits. See the section for information on the class attributes. | xref:BloombergLP/bsltf/StdAllocTestType.adoc[`StdAllocTestType`] | This unconstrained (value‐semantic) attribute class uses a standard allocator of (template parameter) type `ALLOC` to allocate memory. This class does NOT define the type trait `bslma::UsesBslmaAllocator`, but the trait will be `true` if `ALLOC` is convertible from `bslma::Allocator *` (e.g., if it is an instantiation of `bsl::allocator`). This class is primarily provided to facilitate testing of templates by defining a simple type representative of user‐defined types using a standard allocator. See the section for information on the class attributes. | xref:BloombergLP/bsltf/StdAllocatorAdaptor.adoc[`StdAllocatorAdaptor`] | This class template provides the facade of an allocator but mostly delegates operations to the allocator object (of template parameter type) it adapts, except that it enables the propagation of the (stateful) allocator object to constructed elements, if appropriate. | xref:BloombergLP/bsltf/StdStatefulAllocator.adoc[`StdStatefulAllocator`] | This allocator implements the minimal interface to comply with section 17.6.3.5 ([allocator.requirements]) of the C++11 standard, while maintaining a distinct object state ‐ in this case a wrapped pointer to a `bslma::Allocator`. The template is configurable to control its allocator propagation properties, but does not support the BDE "scoped" allocator model, as scoped allocators should never propagate. Instances of this allocator delegate their operations to the wrapped allocator that constitutes its state. Note that while we define the various traits used by the C++11 allocator traits facility, they actually mean very little for this component, as it is the consumer of the allocator's responsibility to check and apply the traits correctly, typically by using `bsl::allocator_traits` to perform all memory allocation tasks rather than using the allocator directly. The `PROPAGATE_ON_CONTAINER_COPY_CONSTRUCTION` flag is consumed directly though, in the static member function `select_on_container_copy_construction`. | xref:BloombergLP/bsltf/StdTestAllocator-05.adoc[`StdTestAllocator`] | This allocator implements the minimal interface to comply with section 20.1.5 ([lib.allocator.requirements]) of the C++03 standard. Instances of this allocator delegate their operations to a globally configured delegate allocator as C++03 compliant allocators cannot have individually identifiable state (see `StdTestAllocatorConfiguration` and 'StdTestAllocatorConfigurationGuard). | xref:BloombergLP/bsltf/StdTestAllocatorConfiguration.adoc[`StdTestAllocatorConfiguration`] | This `struct` provides a namespace for functions that manipulate and access the _delegate allocator_ for `StdTestAllocator`. The delegate allocator is the allocator to which `StdTestAllocator` objects delegate their operations. The provided operations are _not_ thread‐safe. Note that this allocator is configured globally as C++03 standard compliant allocators cannot have individually identifiable state. | xref:BloombergLP/bsltf/StdTestAllocatorConfigurationGuard.adoc[`StdTestAllocatorConfigurationGuard`] | Upon construction, an object of this class saves the current *delegate allocator* for `StdTestAllocator` and and installs the user‐specified allocator as the delegate allocator. The delegate allocator is the globally configured allocator to which an `StdTestAllocator` objects delegate their operations. On destruction, the original delegate allocator is restored. | xref:BloombergLP/bsltf/StdTestAllocator_CommonUtil.adoc[`StdTestAllocator_CommonUtil`] | This `struct` provides a namespace for utilities that are common to all instantiations of the `StdTestAllocator` class template. | xref:BloombergLP/bsltf/TemplateTestFacility.adoc[`TemplateTestFacility`] | This `struct` provides a namespace that contains three aliases for types intended to be used as template parameters for testing templates. The namespace also contain two class method templates, `create` and `getIdentifier`, that respectively provides a consistent interface to (1) create a specified object of a parameterized type from an integer identifier and (2) get the identifier value of a specified object. The identifier value returned from the `getIdentifier` method is undefined unless the specified object was originally created with the `create` class method template. | xref:BloombergLP/bsltf/TemplateTestFacility_CompareHelper.adoc[`TemplateTestFacility_CompareHelper`] | Component‐private helper providing equality comparisons for test types. | xref:BloombergLP/bsltf/TemplateTestFacility_StubClass.adoc[`TemplateTestFacility_StubClass`] | This class provides a single method template, `method`, that simply returns the parameterized integer `IDENTIFIER`. Note that the purpose of this class is to serve as a stub class and method to be referred by `TemplateTestFacility::ObjectPtr` and `TemplateTestFacility::MethodPtr` respectively. | xref:BloombergLP/bsltf/TestValuesArray.adoc[`TestValuesArray`] | This class provides a container to store values of the (template parameter) type `VALUE`, and also provides the iterators to access the values. The iterators are designed to conform to a standard input iterator, and report any misuse of the iterator. | xref:BloombergLP/bsltf/TestValuesArrayIterator.adoc[`TestValuesArrayIterator`] | This class provide a STL‐conforming input iterator over values used for testing (see section [24.2.3 input.iterators]of the C++11 standard. A `TestValuesArrayIterator` provide access to elements of parameterized type `VALUE`. An iterator is considered dereferenceable all of the following are satisfied: 1. The iterator refers to a valid element (not `end`). 2. The iterator has not been dereferenced. 3. The iterator is not a copy of another iterator of which `operator++` have been invoked. An iterator is comparable if the iterator is not a copy of another iterator of which `operator++` have been invoked. | xref:BloombergLP/bsltf/TestValuesArraySentinel.adoc[`TestValuesArraySentinel`] | | xref:BloombergLP/bsltf/TestValuesArray_DefaultConverter.adoc[`TestValuesArray_DefaultConverter`] | This `struct` provides a namespace for an utility function, `createInplace`, that creates an object of the (template parameter) type `VALUE` from a character identifier. | xref:BloombergLP/bsltf/TestValuesArray_PostIncrementPtr.adoc[`TestValuesArray_PostIncrementPtr`] | This class is a wrapper that encapsulates a reference, providing non‐modifiable access to the element of `TestValuesArray` container. Object of this class is returned by post increment operator of TestValuesArray' container. | xref:BloombergLP/bsltf/UnionTestType.adoc[`UnionTestType`] | This union provides a union test type to facilitate testing of templates. | xref:BloombergLP/bsltf/WellBehavedMoveOnlyAllocTestType.adoc[`WellBehavedMoveOnlyAllocTestType`] | This unconstrained (value‐semantic) attribute class that uses a `bslma::Allocator` to supply memory and defines the type trait `bslma::UsesBslmaAllocator`. This class is primarily provided to facilitate testing of templates by defining a simple type representative of user‐defined types having an allocator. See the section for information on the class attributes. |=== == Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bsltf/copyMoveState-0f.adoc[`copyMoveState`] | `copyMoveState` overloads | xref:BloombergLP/bsltf/debugprint-04e.adoc[`debugprint`] | `debugprint` overloads | xref:BloombergLP/bsltf/getMovedFrom-01.adoc[`getMovedFrom`] | `getMovedFrom` overloads | xref:BloombergLP/bsltf/getMovedInto-0d.adoc[`getMovedInto`] | `getMovedInto` overloads | xref:BloombergLP/bsltf/setCopyMoveState-03.adoc[`setCopyMoveState`] | `setCopyMoveState` overloads | xref:BloombergLP/bsltf/setMovedInto-06.adoc[`setMovedInto`] | `setMovedInto` overloads | xref:BloombergLP/bsltf/swap-08.adoc[`swap`] | `swap` overloads | xref:BloombergLP/bsltf/operator_lshift-0b.adoc[`operator<<`] | Stream the integer representing the value of the specified `object` to the specified `stream`. Return `stream`. | xref:BloombergLP/bsltf/operator_not.adoc[`operator!`] | Return `true` if `value` is `e_ORIGINAL`; otherwise return `false`. | xref:BloombergLP/bsltf/operator_eq-049.adoc[`operator==`] | Equality operators | xref:BloombergLP/bsltf/operator_not_eq-0bd7.adoc[`operator!=`] | Inequality operators |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#