Skip to content

Commit 6891470

Browse files
committed
Add dummy allocator utility to be able to use allocator_traits machinery without instantiating a real allocator
1 parent aca1350 commit 6891470

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

include/boost/container/allocator_traits.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,15 @@ namespace boost {
8686
namespace container {
8787
namespace dtl {
8888

89+
template <class T>
90+
class allocator_traits_dummy
91+
{
92+
public:
93+
typedef T value_type;
94+
T *allocate(std::size_t){ return 0; }
95+
void deallocate(T *, std::size_t){}
96+
};
97+
8998
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
9099

91100
template<class T, class ...Args>

0 commit comments

Comments
 (0)