From 5d141bce7219aeb34d3de8cfae68d643bf9a3a16 Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Wed, 22 Mar 2017 15:01:29 -0400 Subject: SERVER-26025 Smart pointer with clone on copy This clonable pointer works like a unique_ptr, but upon copy it invokes a customizable cloning function. A `clone` member function is used by default. There exist several customization points. --- src/mongo/base/concept/copy_constructible.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/mongo/base/concept/copy_constructible.h (limited to 'src/mongo/base/concept/copy_constructible.h') diff --git a/src/mongo/base/concept/copy_constructible.h b/src/mongo/base/concept/copy_constructible.h new file mode 100644 index 00000000000..c96856cc485 --- /dev/null +++ b/src/mongo/base/concept/copy_constructible.h @@ -0,0 +1,14 @@ +#pragma once + +namespace mongo { +namespace concept { +/** + * The CopyConstructable concept models a type which can be copy constructed. + * + * The expression: `CopyConstructible{ copyConstructible }` should be valid. + */ +struct CopyConstructible { + CopyConstructible(const CopyConstructible&); +}; +} // namespace concept +} // namespace mongo -- cgit v1.2.1