blob: b69fcfea98d1e580a29bed2fc2bb151a53d0c21c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
// Copyright 2013 Daniel Parker
// Distributed under the Boost license, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See https://github.com/danielaparker/jsoncons for latest version
#ifndef JSONCONS_ALLOCATOR_HOLDER_HPP
#define JSONCONS_ALLOCATOR_HOLDER_HPP
namespace jsoncons {
template <class Allocator>
class allocator_holder
{
public:
using allocator_type = Allocator;
private:
allocator_type alloc_;
public:
allocator_holder() = default;
allocator_holder(const allocator_holder&) = default;
allocator_holder(allocator_holder&&) = default;
allocator_holder& operator=(const allocator_holder&) = default;
allocator_holder& operator=(allocator_holder&&) = default;
allocator_holder(const allocator_type& alloc)
: alloc_(alloc)
{}
~allocator_holder() = default;
allocator_type get_allocator() const
{
return alloc_;
}
};
}
#endif
|