8#ifndef INCLUDED_BSLMA_BSLALLOCATOR
9#define INCLUDED_BSLMA_BSLALLOCATOR
512#include <bslscm_version.h>
538#if BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
542# define COMPILING_BSLMA_BSLALLOCATOR_H
544# undef COMPILING_BSLMA_BSLALLOCATOR_H
547#define BSLMA_BSLALLOCATOR_DEPRECATE_ASSIGN \
548 BSLS_DEPRECATE_FEATURE("bsl", "bsl_allocator_assign", \
549 "Do not assign allocators.")
555struct BslAllocator_Voidish;
579template <class TYPE = polymorphic_allocator<>::value_type>
591 BloombergLP::bslmf::IsBitwiseCopyable);
593 BloombergLP::bslmf::IsBitwiseEqualityComparable);
611 template <
class ANY_TYPE>
636#ifdef BSLS_COMPILERFEATURES_SUPPORT_DEFAULTED_FUNCTIONS
649 template <
class ANY_TYPE>
696 template <
class ELEMENT_TYPE>
699#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
715 template <
class ELEMENT_TYPE,
class ARG1,
class... ARGS>
718 ARGS&&... arguments);
719 template <
class ELEMENT_TYPE,
class ARG1,
class... ARGS>
722 ARGS&&... arguments);
727 template <
class ELEMENT_TYPE>
763 :
public allocator<BloombergLP::bslma::BslAllocator_Voidish>
781 BloombergLP::bslmf::IsBitwiseCopyable);
783 BloombergLP::bslmf::IsBitwiseEqualityComparable);
811#ifdef BSLS_COMPILERFEATURES_SUPPORT_DEFAULTED_FUNCTIONS
823 template <
class ANY_TYPE>
862#ifdef BSLS_COMPILERFEATURES_SUPPORT_ALIAS_TEMPLATES
863 template <
class ELEMENT_TYPE>
866 template <
class ELEMENT_TYPE>
869 template <
class ELEMENT_TYPE>
879 template <
typename ARG>
886 template <
class ELEMENT_TYPE>
908 template <
class TYPE2>
915#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
916 template <
class TYPE2,
class ARG1,
class... ARGS>
927 template <
class TYPE2,
class ARG1,
class... ARGS>
939 template <
class ELEMENT_TYPE>
980:
Base(BloombergLP::
bslma::Default::defaultAllocator())
991#ifndef BSLS_COMPILERFEATURES_SUPPORT_DEFAULTED_FUNCTIONS
1001template <
class TYPE>
1002template <
class ANY_TYPE>
1011template <
class TYPE>
1017 "'bsl::allocator' objects cannot be assigned");
1029template <
class TYPE>
1034 return Base::allocate(n);
1037template <
class TYPE>
1041 Base::deallocate(p, n);
1044template <
class TYPE>
1045template <
class ELEMENT_TYPE>
1049 BloombergLP::bslma::ConstructionUtil::construct(address, *
this);
1052#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
1053template <
class TYPE>
1054template <
class ELEMENT_TYPE,
class ARG1,
class... ARGS>
1058 ARGS&&... arguments)
1060 BloombergLP::bslma::ConstructionUtil::construct(
1067template <
class TYPE>
1068template <
class ELEMENT_TYPE,
class ARG1,
class... ARGS>
1071 ELEMENT_TYPE *address,
1073 ARGS&&... arguments)
1075 BloombergLP::bslma::ConstructionUtil::construct(
1083template <
class TYPE>
1084template <
class ELEMENT_TYPE>
1088 BloombergLP::bslma::DestructionUtil::destroy(address);
1093template <
class TYPE>
1098 return BloombergLP::bsls::Util::addressOf(x);
1101template <
class TYPE>
1106 return BloombergLP::bsls::Util::addressOf(x);
1109template <
class TYPE>
1119 const size_type MAX_NUM_ELEMENTS = MAX_NUM_BYTES /
sizeof(TYPE);
1121 return MAX_NUM_ELEMENTS;
1124template <
class TYPE>
1128 return static_cast<BloombergLP::bslma::Allocator *
>(this->resource());
1131template <
class TYPE>
1155#ifndef BSLS_COMPILERFEATURES_SUPPORT_DEFAULTED_FUNCTIONS
1164template <
class ANY_TYPE>
1180#if BSLS_PLATFORM_CMP_MSVC
1197template <
class TYPE>
1200 BloombergLP::bslma::Allocator *b)
1205template <
class TYPE>
1207bool operator==(BloombergLP::bslma::Allocator *a,
1213template <
class TYPE>
1216 BloombergLP::bslma::Allocator *b)
1221template <
class TYPE>
1223bool operator!=(BloombergLP::bslma::Allocator *a,
1239template <
class TYPE>
1245template <
class TYPE>
void * void_pointer
Definition bslma_bslallocator.h:788
const void * const_pointer
Definition bslma_bslallocator.h:787
BSLMF_NESTED_TRAIT_DECLARATION(allocator, BloombergLP::bslmf::IsBitwiseEqualityComparable)
allocator & operator=(const allocator &rhs)=default
BSLMF_NESTED_TRAIT_DECLARATION(allocator, BloombergLP::bslmf::IsBitwiseCopyable)
const void * const_void_pointer
Definition bslma_bslallocator.h:789
void * pointer
Definition bslma_bslallocator.h:786
void value_type
Definition bslma_bslallocator.h:790
Definition bslma_bslallocator.h:580
value_type & reference
Definition bslma_bslallocator.h:597
BloombergLP::bslma::Allocator * mechanism() const
Definition bslma_bslallocator.h:1126
void destroy(ELEMENT_TYPE *address)
Definition bslma_bslallocator.h:1086
void construct(ELEMENT_TYPE *address, ARG1 &argument1, ARGS &&... arguments)
Definition bslma_bslallocator.h:1056
BaseTraits::const_pointer const_pointer
Definition bslma_bslallocator.h:602
BSLMF_NESTED_TRAIT_DECLARATION(allocator, BloombergLP::bslmf::IsBitwiseCopyable)
TYPE value_type
Definition bslma_bslallocator.h:596
allocator(const allocator &original) BSLS_KEYWORD_NOEXCEPT
Definition bslma_bslallocator.h:995
value_type const & const_reference
Definition bslma_bslallocator.h:598
BaseTraits::pointer pointer
Definition bslma_bslallocator.h:601
BSLMA_BSLALLOCATOR_DEPRECATE_ASSIGN allocator & operator=(const allocator &rhs)
Definition bslma_bslallocator.h:1014
void deallocate(TYPE *p, std::size_t n=1)
Definition bslma_bslallocator.h:1039
allocator(BloombergLP::bslma::Allocator *mechanism)
Definition bslma_bslallocator.h:986
void construct(ELEMENT_TYPE *address)
Definition bslma_bslallocator.h:1047
BSLS_ANNOTATION_NODISCARD pointer allocate(size_type n, const void *hint=0)
Definition bslma_bslallocator.h:1032
const_pointer address(const_reference x) const
Definition bslma_bslallocator.h:1104
BaseTraits::void_pointer void_pointer
Definition bslma_bslallocator.h:603
pointer address(reference x) const
Definition bslma_bslallocator.h:1096
void construct(ELEMENT_TYPE *address, BSLS_COMPILERFEATURES_FORWARD_REF(ARG1) argument1, ARGS &&... arguments)
Definition bslma_bslallocator.h:1070
allocator select_on_container_copy_construction() const
Return a default-constructed allocator.
Definition bslma_bslallocator.h:1133
BaseTraits::const_void_pointer const_void_pointer
Definition bslma_bslallocator.h:604
allocator(const allocator< ANY_TYPE > &original) BSLS_KEYWORD_NOEXCEPT
Definition bslma_bslallocator.h:1004
BaseTraits::difference_type difference_type
Definition bslma_bslallocator.h:600
BSLMF_NESTED_TRAIT_DECLARATION(allocator, BloombergLP::bslmf::IsBitwiseEqualityComparable)
BSLS_KEYWORD_CONSTEXPR size_type max_size() const
Definition bslma_bslallocator.h:1111
allocator()
Definition bslma_bslallocator.h:979
BaseTraits::size_type size_type
Definition bslma_bslallocator.h:599
bool is_equal(const memory_resource &other) const BSLS_KEYWORD_NOEXCEPT
Definition bslma_memoryresource.h:554
Definition bslma_polymorphicallocator.h:452
memory_resource * resource() const
Return the address of the memory resource supplied on construction.
Definition bslma_polymorphicallocator.h:1048
#define BSLMA_BSLALLOCATOR_DEPRECATE_ASSIGN
Definition bslma_bslallocator.h:547
#define BSLS_ANNOTATION_NODISCARD
Definition bsls_annotation.h:373
#define BSLS_COMPILERFEATURES_FORWARD_REF(T)
Definition bsls_compilerfeatures.h:2012
#define BSLS_COMPILERFEATURES_FORWARD(T, V)
Definition bsls_compilerfeatures.h:2018
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
#define BSLS_KEYWORD_CONSTEXPR
Definition bsls_keyword.h:588
#define BSLS_KEYWORD_NOEXCEPT
Definition bsls_keyword.h:632
#define BSLS_REVIEW_OPT(X)
Definition bsls_review.h:977
bool operator!=(const FileCleanerConfiguration &lhs, const FileCleanerConfiguration &rhs)
bool operator==(const FileCleanerConfiguration &lhs, const FileCleanerConfiguration &rhs)
Definition bdlb_printmethods.h:283
Definition balxml_encoderoptions.h:68
Definition bslma_bslallocator.h:612
allocator< ANY_TYPE > other
Definition bslma_bslallocator.h:614
rebind_alloc(const ARG &allocatorArg)
Definition bslma_bslallocator.h:880
rebind_alloc()
Definition bslma_bslallocator.h:871
allocator_type::size_type size_type
Definition bslma_bslallocator.h:860
allocator_type::difference_type difference_type
Definition bslma_bslallocator.h:859
static void construct(allocator_type &m, TYPE2 *p, ARG1 &argument1, ARGS &&... arguments)
Definition bslma_bslallocator.h:917
allocator_type::void_pointer void_pointer
Definition bslma_bslallocator.h:857
allocator_type::const_void_pointer const_void_pointer
Definition bslma_bslallocator.h:858
static pointer allocate(allocator_type &m, size_type n, const_void_pointer)
Definition bslma_bslallocator.h:896
static allocator_type select_on_container_copy_construction(const allocator_type &)
Definition bslma_bslallocator.h:953
static void destroy(allocator_type &m, ELEMENT_TYPE *p)
Definition bslma_bslallocator.h:940
TYPE value_type
Definition bslma_bslallocator.h:853
false_type propagate_on_container_swap
Definition bslma_bslallocator.h:964
allocator_type::const_pointer const_pointer
Definition bslma_bslallocator.h:856
static void construct(allocator_type &m, TYPE2 *p, BSLS_COMPILERFEATURES_FORWARD_REF(ARG1) argument1, ARGS &&... arguments)
Definition bslma_bslallocator.h:928
static pointer allocate(allocator_type &m, size_type n)
Definition bslma_bslallocator.h:891
static void deallocate(allocator_type &m, pointer p, size_type n)
Definition bslma_bslallocator.h:903
false_type propagate_on_container_move_assignment
Definition bslma_bslallocator.h:962
static void construct(allocator_type &m, TYPE2 *p)
Definition bslma_bslallocator.h:909
false_type is_always_equal
Definition bslma_bslallocator.h:958
allocator_type::pointer pointer
Definition bslma_bslallocator.h:855
false_type propagate_on_container_copy_assignment
Definition bslma_bslallocator.h:960
static BSLS_KEYWORD_CONSTEXPR size_type max_size(const allocator_type &m)
Definition bslma_bslallocator.h:946
allocator< TYPE > allocator_type
Definition bslma_bslallocator.h:852
Definition bslma_allocatortraits.h:1061
BloombergLP::bslma::AllocatorTraits_ConstPointerType< ALLOCATOR_TYPE >::type const_pointer
Definition bslma_allocatortraits.h:1152
BloombergLP::bslma::AllocatorTraits_VoidPointerType< ALLOCATOR_TYPE >::type void_pointer
Definition bslma_allocatortraits.h:1155
BloombergLP::bslma::AllocatorTraits_SizeType< ALLOCATOR_TYPE >::type size_type
Definition bslma_allocatortraits.h:1165
BloombergLP::bslma::AllocatorTraits_PointerType< ALLOCATOR_TYPE >::type pointer
Definition bslma_allocatortraits.h:1149
ALLOCATOR_TYPE allocator_type
Definition bslma_allocatortraits.h:1144
BloombergLP::bslma::AllocatorTraits_ConstVoidPointerType< ALLOCATOR_TYPE >::type const_void_pointer
Definition bslma_allocatortraits.h:1158
BloombergLP::bslma::AllocatorTraits_DifferenceType< ALLOCATOR_TYPE >::type difference_type
Definition bslma_allocatortraits.h:1162
Definition bslmf_integralconstant.h:244
Definition bslma_isstdallocator.h:201
Definition bslma_usesbslmaallocator.h:343