aboutsummaryrefslogtreecommitdiff
path: root/include/jsoncons/allocator_holder.hpp
diff options
context:
space:
mode:
authorRichard <q@1bpm.net>2022-09-04 00:32:56 +0100
committerRichard <q@1bpm.net>2022-09-04 00:32:56 +0100
commit1d055261b4144dbf86b2658437015b15d4dd9bff (patch)
tree6049b19d1bf953a650383de1a5e438b8b82679f6 /include/jsoncons/allocator_holder.hpp
downloadcsound-json-1d055261b4144dbf86b2658437015b15d4dd9bff.tar.gz
csound-json-1d055261b4144dbf86b2658437015b15d4dd9bff.tar.bz2
csound-json-1d055261b4144dbf86b2658437015b15d4dd9bff.zip
initial
Diffstat (limited to 'include/jsoncons/allocator_holder.hpp')
-rw-r--r--include/jsoncons/allocator_holder.hpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/include/jsoncons/allocator_holder.hpp b/include/jsoncons/allocator_holder.hpp
new file mode 100644
index 0000000..b69fcfe
--- /dev/null
+++ b/include/jsoncons/allocator_holder.hpp
@@ -0,0 +1,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