// bsltf_stdtestallocator_cpp03.h -*-C++-*- // Automatically generated file. **DO NOT EDIT** #ifndef INCLUDED_BSLTF_STDTESTALLOCATOR_CPP03 #define INCLUDED_BSLTF_STDTESTALLOCATOR_CPP03 //@PURPOSE: Provide C++03 implementation for bsltf_stdtestallocator.h // //@CLASSES: See bsltf_stdtestallocator.h for list of classes // //@SEE_ALSO: bsltf_stdtestallocator // //@DESCRIPTION: This component is the C++03 translation of a C++11 component, // generated by the 'sim_cpp11_features.pl' program. If the original header // contains any specially delimited regions of C++11 code, then this generated // file contains the C++03 equivalent, i.e., with variadic templates expanded // and rvalue-references replaced by 'bslmf::MovableRef' objects. The header // code in this file is designed to be '#include'd into the original header // when compiling with a C++03 compiler. If there are no specially delimited // regions of C++11 code, then this header contains no code and is not // '#include'd in the original header. // // Generated on Fri Aug 12 18:48:16 2022 // Command line: sim_cpp11_features.pl bsltf_stdtestallocator.h #ifdef COMPILING_BSLTF_STDTESTALLOCATOR_H namespace BloombergLP { namespace bsltf { // =================================== // class StdTestAllocatorConfiguration // =================================== struct 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. public: // CLASS METHODS static void setDelegateAllocatorRaw(bslma::Allocator *basicAllocator); // Set the address of the delegate allocator to the specified // 'basicAllocator'. static bslma::Allocator* delegateAllocator(); // Return the address of the delegate allocator. Note that, this // method will initially return // '&bslma_NewDeleteAllocator::singleton()' if the // 'setDelegatingAllocator' class method has not been called. }; // ======================================== // class StdTestAllocatorConfigurationGuard // ======================================== class 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. bslma::Allocator *d_original_p; // original (restore at destruction) private: // NOT IMPLEMENTED StdTestAllocatorConfigurationGuard( const StdTestAllocatorConfigurationGuard&); StdTestAllocatorConfigurationGuard& operator=( const StdTestAllocatorConfigurationGuard&); public: // CREATORS explicit StdTestAllocatorConfigurationGuard(bslma::Allocator *temporaryAllocator); // Create a scoped guard that installs the specified // 'temporaryAllocator' as the delegate allocator. ~StdTestAllocatorConfigurationGuard(); // Restore the delegate allocator that was in place when this scoped // guard was created and destroy this guard. }; // ====================== // class StdTestAllocator // ====================== template <class TYPE> class 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). public: // PUBLIC TYPES // Deliberately use types that will *not* have the same representation as // the default 'size_t/ptrdiff_t' on most 64-bit platforms, yet will be // wide enough to support our regular testing, as verified on 32-bit // platforms. typedef bsls::Types::UintPtr size_type; typedef bsls::Types::IntPtr difference_type; typedef TYPE *pointer; typedef const TYPE *const_pointer; typedef TYPE& reference; typedef const TYPE& const_reference; typedef TYPE value_type; template <class BDE_OTHER_TYPE> struct rebind { // This nested 'struct' template, parameterized by some // 'BDE_OTHER_TYPE', provides a namespace for an 'other' type alias, // which is an allocator type following the same template as this one // but that allocates elements of 'BDE_OTHER_TYPE'. Note that this // allocator type is convertible to and from 'other' for any // 'BDE_OTHER_TYPE' including 'void'. typedef StdTestAllocator<BDE_OTHER_TYPE> other; }; // CREATORS StdTestAllocator(); // Create a 'StdTestAllocator' object. // StdTestAllocator(const StdTestAllocator& original) = default; // Create a 'StdTestAllocator' object. Note that this object will // compare equal to the default constructed object, because this type // has no state. template <class BDE_OTHER_TYPE> StdTestAllocator(const StdTestAllocator<BDE_OTHER_TYPE>&); // Create a 'StdTestAllocator' object. Note that this object will // compare equal to the default constructed object, because this type // has no state. // ~StdTestAllocator() = default; // Destroy this object. // MANIPULATORS // StdTestAllocator& operator=(const StdTestAllocator& rhs) = default; // Assign to this object the value of the specified 'rhs' object, and // return a reference providing modifiable access to this object. pointer allocate(size_type numElements); // Allocate enough (properly aligned) space for the specified // 'numElements' of type 'T'. The behavior is undefined unless // 'numElements <= max_size()'. void deallocate(pointer address, size_type numElements = 1); // Return memory previously at the specified 'address' for // 'numElements' back to this allocator. The 'numElements' argument is // ignored by this allocator type. The behavior is undefined unless // 'address' was allocated using this allocator object and has not // already been deallocated. #if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES // {{{ BEGIN GENERATED CODE // Command line: sim_cpp11_features.pl bsltf_stdtestallocator.h #ifndef BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT #define BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT 14 #endif #ifndef BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_A #define BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_A BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT #endif #if BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_A >= 0 template <class ELEMENT_TYPE> void construct(ELEMENT_TYPE *address); #endif // BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_A >= 0 #if BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_A >= 1 template <class ELEMENT_TYPE, class Args_01> void construct(ELEMENT_TYPE *address, BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01); #endif // BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_A >= 1 #if BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_A >= 2 template <class ELEMENT_TYPE, class Args_01, class Args_02> void construct(ELEMENT_TYPE *address, BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01, BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02); #endif // BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_A >= 2 #if BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_A >= 3 template <class ELEMENT_TYPE, class Args_01, class Args_02, class Args_03> void construct(ELEMENT_TYPE *address, BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01, BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02, BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03); #endif // BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_A >= 3 #if BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_A >= 4 template <class ELEMENT_TYPE, class Args_01, class Args_02, class Args_03, class Args_04> void construct(ELEMENT_TYPE *address, BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01, BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02, BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03, BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04); #endif // BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_A >= 4 #if BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_A >= 5 template <class ELEMENT_TYPE, class Args_01, class Args_02, class Args_03, class Args_04, class Args_05> void construct(ELEMENT_TYPE *address, BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01, BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02, BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03, BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04, BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05); #endif // BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_A >= 5 #if BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_A >= 6 template <class ELEMENT_TYPE, class Args_01, class Args_02, class Args_03, class Args_04, class Args_05, class Args_06> void construct(ELEMENT_TYPE *address, BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01, BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02, BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03, BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04, BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05, BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06); #endif // BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_A >= 6 #if BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_A >= 7 template <class ELEMENT_TYPE, class Args_01, class Args_02, class Args_03, class Args_04, class Args_05, class Args_06, class Args_07> void construct(ELEMENT_TYPE *address, BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01, BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02, BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03, BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04, BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05, BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06, BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07); #endif // BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_A >= 7 #if BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_A >= 8 template <class ELEMENT_TYPE, class Args_01, class Args_02, class Args_03, class Args_04, class Args_05, class Args_06, class Args_07, class Args_08> void construct(ELEMENT_TYPE *address, BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01, BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02, BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03, BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04, BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05, BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06, BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07, BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08); #endif // BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_A >= 8 #if BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_A >= 9 template <class ELEMENT_TYPE, class Args_01, class Args_02, class Args_03, class Args_04, class Args_05, class Args_06, class Args_07, class Args_08, class Args_09> void construct(ELEMENT_TYPE *address, BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01, BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02, BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03, BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04, BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05, BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06, BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07, BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08, BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) arguments_09); #endif // BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_A >= 9 #if BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_A >= 10 template <class ELEMENT_TYPE, class Args_01, class Args_02, class Args_03, class Args_04, class Args_05, class Args_06, class Args_07, class Args_08, class Args_09, class Args_10> void construct(ELEMENT_TYPE *address, BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01, BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02, BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03, BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04, BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05, BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06, BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07, BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08, BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) arguments_09, BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) arguments_10); #endif // BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_A >= 10 #if BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_A >= 11 template <class ELEMENT_TYPE, class Args_01, class Args_02, class Args_03, class Args_04, class Args_05, class Args_06, class Args_07, class Args_08, class Args_09, class Args_10, class Args_11> void construct(ELEMENT_TYPE *address, BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01, BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02, BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03, BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04, BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05, BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06, BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07, BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08, BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) arguments_09, BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) arguments_10, BSLS_COMPILERFEATURES_FORWARD_REF(Args_11) arguments_11); #endif // BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_A >= 11 #if BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_A >= 12 template <class ELEMENT_TYPE, class Args_01, class Args_02, class Args_03, class Args_04, class Args_05, class Args_06, class Args_07, class Args_08, class Args_09, class Args_10, class Args_11, class Args_12> void construct(ELEMENT_TYPE *address, BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01, BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02, BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03, BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04, BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05, BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06, BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07, BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08, BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) arguments_09, BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) arguments_10, BSLS_COMPILERFEATURES_FORWARD_REF(Args_11) arguments_11, BSLS_COMPILERFEATURES_FORWARD_REF(Args_12) arguments_12); #endif // BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_A >= 12 #if BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_A >= 13 template <class ELEMENT_TYPE, class Args_01, class Args_02, class Args_03, class Args_04, class Args_05, class Args_06, class Args_07, class Args_08, class Args_09, class Args_10, class Args_11, class Args_12, class Args_13> void construct(ELEMENT_TYPE *address, BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01, BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02, BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03, BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04, BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05, BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06, BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07, BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08, BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) arguments_09, BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) arguments_10, BSLS_COMPILERFEATURES_FORWARD_REF(Args_11) arguments_11, BSLS_COMPILERFEATURES_FORWARD_REF(Args_12) arguments_12, BSLS_COMPILERFEATURES_FORWARD_REF(Args_13) arguments_13); #endif // BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_A >= 13 #if BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_A >= 14 template <class ELEMENT_TYPE, class Args_01, class Args_02, class Args_03, class Args_04, class Args_05, class Args_06, class Args_07, class Args_08, class Args_09, class Args_10, class Args_11, class Args_12, class Args_13, class Args_14> void construct(ELEMENT_TYPE *address, BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01, BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02, BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03, BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04, BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05, BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06, BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07, BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08, BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) arguments_09, BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) arguments_10, BSLS_COMPILERFEATURES_FORWARD_REF(Args_11) arguments_11, BSLS_COMPILERFEATURES_FORWARD_REF(Args_12) arguments_12, BSLS_COMPILERFEATURES_FORWARD_REF(Args_13) arguments_13, BSLS_COMPILERFEATURES_FORWARD_REF(Args_14) arguments_14); #endif // BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_A >= 14 #else // The generated code below is a workaround for the absence of perfect // forwarding in some compilers. template <class ELEMENT_TYPE, class... Args> void construct(ELEMENT_TYPE *address, BSLS_COMPILERFEATURES_FORWARD_REF(Args)... arguments); // }}} END GENERATED CODE #endif template <class ELEMENT_TYPE> void destroy(ELEMENT_TYPE *address); // TBD: fix comment // Invoke the 'TYPE' destructor for the object at the specified // 'address'. // ACCESSORS pointer address(reference object) const; // Return the address providing modifiable access to 'object'. const_pointer address(const_reference object) const; // Return the address providing non-modifiable access to 'object'. size_type max_size() const; // Return the maximum number of elements of type 'TYPE' that can be // allocated using this allocator in a single call to the 'allocate' // method. Note that there is no guarantee that attempts at allocating // less elements than the value returned by 'max_size' will not throw. }; // ============================ // class StdTestAllocator<void> // ============================ template <> class StdTestAllocator<void> { // This specialization of 'StdTestAllocator' for 'void' type as the // parameterized 'TYPE' does not contain members that are unrepresentable // for 'void'. public: // PUBLIC TYPES // 'size_type' and 'difference_type' were deliberately changed from fixed // 32 bit types to being the size of a pointer, to avoid a cascade of // warnings on 64-bit builds. typedef bsls::Types::UintPtr size_type; typedef bsls::Types::IntPtr difference_type; typedef void *pointer; typedef const void *const_pointer; typedef void value_type; template <class BDE_OTHER_TYPE> struct rebind { // This nested 'struct' template, parameterized by some // 'BDE_OTHER_TYPE', provides a namespace for an 'other' type alias, // which is an allocator type following the same template as this one // but that allocates elements of 'BDE_OTHER_TYPE'. Note that this // allocator type is convertible to and from 'other' for any // 'BDE_OTHER_TYPE' including 'void'. typedef StdTestAllocator<BDE_OTHER_TYPE> other; }; // CREATORS StdTestAllocator(); // Create a 'StdTestAllocator' object. // StdTestAllocator(const StdTestAllocator& original) = default; // Create a 'StdTestAllocator' object. Note that this object will // compare equal to the default constructed object because, because // this type has no state. template <class BDE_OTHER_TYPE> StdTestAllocator(const StdTestAllocator<BDE_OTHER_TYPE>&); // Create a 'StdTestAllocator' object. Note that this object will // compare equal to the default constructed object because, because // this type has no state. // ~StdTestAllocator() = default; // Destroy this object. // MANIPULATORS // StdTestAllocator& operator=( // const StdTestAllocator& rhs) = default; // Assign to this object the value of the specified 'rhs' object, and // return a reference providing modifiable access to this object. }; // FREE OPERATORS template <class TYPE1, class TYPE2> bool operator==(const StdTestAllocator<TYPE1>& lhs, const StdTestAllocator<TYPE2>& rhs); // Return 'true' because 'StdTestAllocator' does not hold a state. template <class TYPE1, class TYPE2> bool operator!=(const StdTestAllocator<TYPE1>& lhs, const StdTestAllocator<TYPE2>& rhs); // Return 'false' because 'StdTestAllocator' does not hold a state. // ====================== // class StdTestAllocator // ====================== struct StdTestAllocator_CommonUtil { // This 'struct' provides a namespace for utilities that are common to // all instantiations of the 'StdTestAllocator' class template. // CLASS METHODS static size_t maxSize(size_t elementSize); // Return the maximum number of objects, each taking the specified // 'elementSize' bytes of storage, that can potentially be allocated by // a 'StdTestAllocator'. Note that this function is mostly about // insulating consumers of this component from a standard header, so // that this test component does not hide missing header dependencies // in testing scenarios. }; // ============================================================================ // INLINE AND TEMPLATE FUNCTION IMPLEMENTATIONS // ============================================================================ // ---------------------------------------- // class StdTestAllocatorConfigurationGuard // ---------------------------------------- // CREATORS inline StdTestAllocatorConfigurationGuard::StdTestAllocatorConfigurationGuard( bslma::Allocator *temporaryAllocator) : d_original_p(StdTestAllocatorConfiguration::delegateAllocator()) { BSLS_ASSERT(temporaryAllocator); StdTestAllocatorConfiguration::setDelegateAllocatorRaw(temporaryAllocator); } inline StdTestAllocatorConfigurationGuard::~StdTestAllocatorConfigurationGuard() { BSLS_ASSERT(d_original_p); StdTestAllocatorConfiguration::setDelegateAllocatorRaw(d_original_p); } // ---------------------- // class StdTestAllocator // ---------------------- // CREATORS template <class TYPE> inline StdTestAllocator<TYPE>::StdTestAllocator() { } template <class TYPE> template <class BDE_OTHER_TYPE> StdTestAllocator<TYPE>::StdTestAllocator( const StdTestAllocator<BDE_OTHER_TYPE>&) { } // MANIPULATORS template <class TYPE> inline typename StdTestAllocator<TYPE>::pointer StdTestAllocator<TYPE>::allocate(typename StdTestAllocator<TYPE>::size_type numElements) { return static_cast<pointer>(StdTestAllocatorConfiguration::delegateAllocator()-> allocate(bslma::Allocator::size_type(numElements * sizeof(TYPE)))); } template <class TYPE> inline void StdTestAllocator<TYPE>::deallocate(pointer address, size_type) { StdTestAllocatorConfiguration::delegateAllocator()->deallocate(address); } #if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES // {{{ BEGIN GENERATED CODE // Command line: sim_cpp11_features.pl bsltf_stdtestallocator.h #ifndef BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT #define BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT 14 #endif #ifndef BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_B #define BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_B BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT #endif #if BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_B >= 0 template <class TYPE> template <class ELEMENT_TYPE> inline void StdTestAllocator<TYPE>::construct(ELEMENT_TYPE *address) { ::new (static_cast<void*>(address)) ELEMENT_TYPE( ); } #endif // BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_B >= 0 #if BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_B >= 1 template <class TYPE> template <class ELEMENT_TYPE, class Args_01> inline void StdTestAllocator<TYPE>::construct(ELEMENT_TYPE *address, BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01) { ::new (static_cast<void*>(address)) ELEMENT_TYPE( BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01)); } #endif // BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_B >= 1 #if BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_B >= 2 template <class TYPE> template <class ELEMENT_TYPE, class Args_01, class Args_02> inline void StdTestAllocator<TYPE>::construct(ELEMENT_TYPE *address, BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01, BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02) { ::new (static_cast<void*>(address)) ELEMENT_TYPE( BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01), BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02)); } #endif // BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_B >= 2 #if BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_B >= 3 template <class TYPE> template <class ELEMENT_TYPE, class Args_01, class Args_02, class Args_03> inline void StdTestAllocator<TYPE>::construct(ELEMENT_TYPE *address, BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01, BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02, BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03) { ::new (static_cast<void*>(address)) ELEMENT_TYPE( BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01), BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02), BSLS_COMPILERFEATURES_FORWARD(Args_03,arguments_03)); } #endif // BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_B >= 3 #if BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_B >= 4 template <class TYPE> template <class ELEMENT_TYPE, class Args_01, class Args_02, class Args_03, class Args_04> inline void StdTestAllocator<TYPE>::construct(ELEMENT_TYPE *address, BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01, BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02, BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03, BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04) { ::new (static_cast<void*>(address)) ELEMENT_TYPE( BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01), BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02), BSLS_COMPILERFEATURES_FORWARD(Args_03,arguments_03), BSLS_COMPILERFEATURES_FORWARD(Args_04,arguments_04)); } #endif // BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_B >= 4 #if BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_B >= 5 template <class TYPE> template <class ELEMENT_TYPE, class Args_01, class Args_02, class Args_03, class Args_04, class Args_05> inline void StdTestAllocator<TYPE>::construct(ELEMENT_TYPE *address, BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01, BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02, BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03, BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04, BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05) { ::new (static_cast<void*>(address)) ELEMENT_TYPE( BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01), BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02), BSLS_COMPILERFEATURES_FORWARD(Args_03,arguments_03), BSLS_COMPILERFEATURES_FORWARD(Args_04,arguments_04), BSLS_COMPILERFEATURES_FORWARD(Args_05,arguments_05)); } #endif // BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_B >= 5 #if BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_B >= 6 template <class TYPE> template <class ELEMENT_TYPE, class Args_01, class Args_02, class Args_03, class Args_04, class Args_05, class Args_06> inline void StdTestAllocator<TYPE>::construct(ELEMENT_TYPE *address, BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01, BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02, BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03, BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04, BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05, BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06) { ::new (static_cast<void*>(address)) ELEMENT_TYPE( BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01), BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02), BSLS_COMPILERFEATURES_FORWARD(Args_03,arguments_03), BSLS_COMPILERFEATURES_FORWARD(Args_04,arguments_04), BSLS_COMPILERFEATURES_FORWARD(Args_05,arguments_05), BSLS_COMPILERFEATURES_FORWARD(Args_06,arguments_06)); } #endif // BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_B >= 6 #if BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_B >= 7 template <class TYPE> template <class ELEMENT_TYPE, class Args_01, class Args_02, class Args_03, class Args_04, class Args_05, class Args_06, class Args_07> inline void StdTestAllocator<TYPE>::construct(ELEMENT_TYPE *address, BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01, BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02, BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03, BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04, BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05, BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06, BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07) { ::new (static_cast<void*>(address)) ELEMENT_TYPE( BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01), BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02), BSLS_COMPILERFEATURES_FORWARD(Args_03,arguments_03), BSLS_COMPILERFEATURES_FORWARD(Args_04,arguments_04), BSLS_COMPILERFEATURES_FORWARD(Args_05,arguments_05), BSLS_COMPILERFEATURES_FORWARD(Args_06,arguments_06), BSLS_COMPILERFEATURES_FORWARD(Args_07,arguments_07)); } #endif // BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_B >= 7 #if BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_B >= 8 template <class TYPE> template <class ELEMENT_TYPE, class Args_01, class Args_02, class Args_03, class Args_04, class Args_05, class Args_06, class Args_07, class Args_08> inline void StdTestAllocator<TYPE>::construct(ELEMENT_TYPE *address, BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01, BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02, BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03, BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04, BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05, BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06, BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07, BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08) { ::new (static_cast<void*>(address)) ELEMENT_TYPE( BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01), BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02), BSLS_COMPILERFEATURES_FORWARD(Args_03,arguments_03), BSLS_COMPILERFEATURES_FORWARD(Args_04,arguments_04), BSLS_COMPILERFEATURES_FORWARD(Args_05,arguments_05), BSLS_COMPILERFEATURES_FORWARD(Args_06,arguments_06), BSLS_COMPILERFEATURES_FORWARD(Args_07,arguments_07), BSLS_COMPILERFEATURES_FORWARD(Args_08,arguments_08)); } #endif // BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_B >= 8 #if BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_B >= 9 template <class TYPE> template <class ELEMENT_TYPE, class Args_01, class Args_02, class Args_03, class Args_04, class Args_05, class Args_06, class Args_07, class Args_08, class Args_09> inline void StdTestAllocator<TYPE>::construct(ELEMENT_TYPE *address, BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01, BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02, BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03, BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04, BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05, BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06, BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07, BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08, BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) arguments_09) { ::new (static_cast<void*>(address)) ELEMENT_TYPE( BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01), BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02), BSLS_COMPILERFEATURES_FORWARD(Args_03,arguments_03), BSLS_COMPILERFEATURES_FORWARD(Args_04,arguments_04), BSLS_COMPILERFEATURES_FORWARD(Args_05,arguments_05), BSLS_COMPILERFEATURES_FORWARD(Args_06,arguments_06), BSLS_COMPILERFEATURES_FORWARD(Args_07,arguments_07), BSLS_COMPILERFEATURES_FORWARD(Args_08,arguments_08), BSLS_COMPILERFEATURES_FORWARD(Args_09,arguments_09)); } #endif // BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_B >= 9 #if BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_B >= 10 template <class TYPE> template <class ELEMENT_TYPE, class Args_01, class Args_02, class Args_03, class Args_04, class Args_05, class Args_06, class Args_07, class Args_08, class Args_09, class Args_10> inline void StdTestAllocator<TYPE>::construct(ELEMENT_TYPE *address, BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01, BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02, BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03, BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04, BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05, BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06, BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07, BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08, BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) arguments_09, BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) arguments_10) { ::new (static_cast<void*>(address)) ELEMENT_TYPE( BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01), BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02), BSLS_COMPILERFEATURES_FORWARD(Args_03,arguments_03), BSLS_COMPILERFEATURES_FORWARD(Args_04,arguments_04), BSLS_COMPILERFEATURES_FORWARD(Args_05,arguments_05), BSLS_COMPILERFEATURES_FORWARD(Args_06,arguments_06), BSLS_COMPILERFEATURES_FORWARD(Args_07,arguments_07), BSLS_COMPILERFEATURES_FORWARD(Args_08,arguments_08), BSLS_COMPILERFEATURES_FORWARD(Args_09,arguments_09), BSLS_COMPILERFEATURES_FORWARD(Args_10,arguments_10)); } #endif // BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_B >= 10 #if BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_B >= 11 template <class TYPE> template <class ELEMENT_TYPE, class Args_01, class Args_02, class Args_03, class Args_04, class Args_05, class Args_06, class Args_07, class Args_08, class Args_09, class Args_10, class Args_11> inline void StdTestAllocator<TYPE>::construct(ELEMENT_TYPE *address, BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01, BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02, BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03, BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04, BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05, BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06, BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07, BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08, BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) arguments_09, BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) arguments_10, BSLS_COMPILERFEATURES_FORWARD_REF(Args_11) arguments_11) { ::new (static_cast<void*>(address)) ELEMENT_TYPE( BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01), BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02), BSLS_COMPILERFEATURES_FORWARD(Args_03,arguments_03), BSLS_COMPILERFEATURES_FORWARD(Args_04,arguments_04), BSLS_COMPILERFEATURES_FORWARD(Args_05,arguments_05), BSLS_COMPILERFEATURES_FORWARD(Args_06,arguments_06), BSLS_COMPILERFEATURES_FORWARD(Args_07,arguments_07), BSLS_COMPILERFEATURES_FORWARD(Args_08,arguments_08), BSLS_COMPILERFEATURES_FORWARD(Args_09,arguments_09), BSLS_COMPILERFEATURES_FORWARD(Args_10,arguments_10), BSLS_COMPILERFEATURES_FORWARD(Args_11,arguments_11)); } #endif // BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_B >= 11 #if BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_B >= 12 template <class TYPE> template <class ELEMENT_TYPE, class Args_01, class Args_02, class Args_03, class Args_04, class Args_05, class Args_06, class Args_07, class Args_08, class Args_09, class Args_10, class Args_11, class Args_12> inline void StdTestAllocator<TYPE>::construct(ELEMENT_TYPE *address, BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01, BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02, BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03, BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04, BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05, BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06, BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07, BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08, BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) arguments_09, BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) arguments_10, BSLS_COMPILERFEATURES_FORWARD_REF(Args_11) arguments_11, BSLS_COMPILERFEATURES_FORWARD_REF(Args_12) arguments_12) { ::new (static_cast<void*>(address)) ELEMENT_TYPE( BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01), BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02), BSLS_COMPILERFEATURES_FORWARD(Args_03,arguments_03), BSLS_COMPILERFEATURES_FORWARD(Args_04,arguments_04), BSLS_COMPILERFEATURES_FORWARD(Args_05,arguments_05), BSLS_COMPILERFEATURES_FORWARD(Args_06,arguments_06), BSLS_COMPILERFEATURES_FORWARD(Args_07,arguments_07), BSLS_COMPILERFEATURES_FORWARD(Args_08,arguments_08), BSLS_COMPILERFEATURES_FORWARD(Args_09,arguments_09), BSLS_COMPILERFEATURES_FORWARD(Args_10,arguments_10), BSLS_COMPILERFEATURES_FORWARD(Args_11,arguments_11), BSLS_COMPILERFEATURES_FORWARD(Args_12,arguments_12)); } #endif // BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_B >= 12 #if BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_B >= 13 template <class TYPE> template <class ELEMENT_TYPE, class Args_01, class Args_02, class Args_03, class Args_04, class Args_05, class Args_06, class Args_07, class Args_08, class Args_09, class Args_10, class Args_11, class Args_12, class Args_13> inline void StdTestAllocator<TYPE>::construct(ELEMENT_TYPE *address, BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01, BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02, BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03, BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04, BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05, BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06, BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07, BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08, BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) arguments_09, BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) arguments_10, BSLS_COMPILERFEATURES_FORWARD_REF(Args_11) arguments_11, BSLS_COMPILERFEATURES_FORWARD_REF(Args_12) arguments_12, BSLS_COMPILERFEATURES_FORWARD_REF(Args_13) arguments_13) { ::new (static_cast<void*>(address)) ELEMENT_TYPE( BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01), BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02), BSLS_COMPILERFEATURES_FORWARD(Args_03,arguments_03), BSLS_COMPILERFEATURES_FORWARD(Args_04,arguments_04), BSLS_COMPILERFEATURES_FORWARD(Args_05,arguments_05), BSLS_COMPILERFEATURES_FORWARD(Args_06,arguments_06), BSLS_COMPILERFEATURES_FORWARD(Args_07,arguments_07), BSLS_COMPILERFEATURES_FORWARD(Args_08,arguments_08), BSLS_COMPILERFEATURES_FORWARD(Args_09,arguments_09), BSLS_COMPILERFEATURES_FORWARD(Args_10,arguments_10), BSLS_COMPILERFEATURES_FORWARD(Args_11,arguments_11), BSLS_COMPILERFEATURES_FORWARD(Args_12,arguments_12), BSLS_COMPILERFEATURES_FORWARD(Args_13,arguments_13)); } #endif // BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_B >= 13 #if BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_B >= 14 template <class TYPE> template <class ELEMENT_TYPE, class Args_01, class Args_02, class Args_03, class Args_04, class Args_05, class Args_06, class Args_07, class Args_08, class Args_09, class Args_10, class Args_11, class Args_12, class Args_13, class Args_14> inline void StdTestAllocator<TYPE>::construct(ELEMENT_TYPE *address, BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) arguments_01, BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) arguments_02, BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) arguments_03, BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) arguments_04, BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) arguments_05, BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) arguments_06, BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) arguments_07, BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) arguments_08, BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) arguments_09, BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) arguments_10, BSLS_COMPILERFEATURES_FORWARD_REF(Args_11) arguments_11, BSLS_COMPILERFEATURES_FORWARD_REF(Args_12) arguments_12, BSLS_COMPILERFEATURES_FORWARD_REF(Args_13) arguments_13, BSLS_COMPILERFEATURES_FORWARD_REF(Args_14) arguments_14) { ::new (static_cast<void*>(address)) ELEMENT_TYPE( BSLS_COMPILERFEATURES_FORWARD(Args_01,arguments_01), BSLS_COMPILERFEATURES_FORWARD(Args_02,arguments_02), BSLS_COMPILERFEATURES_FORWARD(Args_03,arguments_03), BSLS_COMPILERFEATURES_FORWARD(Args_04,arguments_04), BSLS_COMPILERFEATURES_FORWARD(Args_05,arguments_05), BSLS_COMPILERFEATURES_FORWARD(Args_06,arguments_06), BSLS_COMPILERFEATURES_FORWARD(Args_07,arguments_07), BSLS_COMPILERFEATURES_FORWARD(Args_08,arguments_08), BSLS_COMPILERFEATURES_FORWARD(Args_09,arguments_09), BSLS_COMPILERFEATURES_FORWARD(Args_10,arguments_10), BSLS_COMPILERFEATURES_FORWARD(Args_11,arguments_11), BSLS_COMPILERFEATURES_FORWARD(Args_12,arguments_12), BSLS_COMPILERFEATURES_FORWARD(Args_13,arguments_13), BSLS_COMPILERFEATURES_FORWARD(Args_14,arguments_14)); } #endif // BSLTF_STDTESTALLOCATOR_VARIADIC_LIMIT_B >= 14 #else // The generated code below is a workaround for the absence of perfect // forwarding in some compilers. template <class TYPE> template <class ELEMENT_TYPE, class... Args> inline void StdTestAllocator<TYPE>::construct(ELEMENT_TYPE *address, BSLS_COMPILERFEATURES_FORWARD_REF(Args)... arguments) { ::new (static_cast<void*>(address)) ELEMENT_TYPE( BSLS_COMPILERFEATURES_FORWARD(Args,arguments)...); } // }}} END GENERATED CODE #endif template <class TYPE> template <class ELEMENT_TYPE> inline void StdTestAllocator<TYPE>::destroy(ELEMENT_TYPE *address) { address->~ELEMENT_TYPE(); } template <class TYPE> inline typename StdTestAllocator<TYPE>::pointer StdTestAllocator<TYPE>::address(reference object) const { return bsls::Util::addressOf(object); } template <class TYPE> inline typename StdTestAllocator<TYPE>::const_pointer StdTestAllocator<TYPE>::address(const_reference object) const { return bsls::Util::addressOf(object); } template <class TYPE> inline typename StdTestAllocator<TYPE>::size_type StdTestAllocator<TYPE>::max_size() const { return StdTestAllocator_CommonUtil::maxSize(sizeof(TYPE)); } // ---------------------------- // class StdTestAllocator<void> // ---------------------------- // CREATORS inline StdTestAllocator<void>::StdTestAllocator() { } template <class BDE_OTHER_TYPE> StdTestAllocator<void>::StdTestAllocator( const StdTestAllocator<BDE_OTHER_TYPE>&) { } // FREE OPERATORS template <class TYPE1, class TYPE2> inline bool operator==(const bsltf::StdTestAllocator<TYPE1>&, const bsltf::StdTestAllocator<TYPE2>&) { return true; } template <class TYPE1, class TYPE2> inline bool operator!=(const bsltf::StdTestAllocator<TYPE1>&, const bsltf::StdTestAllocator<TYPE2>&) { return false; } } // close package namespace } // close enterprise namespace #else // if ! defined(DEFINED_BSLTF_STDTESTALLOCATOR_H) # error Not valid except when included from bsltf_stdtestallocator.h #endif // ! defined(COMPILING_BSLTF_STDTESTALLOCATOR_H) #endif // ! defined(INCLUDED_BSLTF_STDTESTALLOCATOR_CPP03) // ---------------------------------------------------------------------------- // Copyright 2022 Bloomberg Finance L.P. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // ----------------------------- END-OF-FILE ----------------------------------