diff options
Diffstat (limited to 'src/mongo/util/decorable.h')
-rw-r--r-- | src/mongo/util/decorable.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mongo/util/decorable.h b/src/mongo/util/decorable.h index 34fb4a78d87..0545ec2f6ae 100644 --- a/src/mongo/util/decorable.h +++ b/src/mongo/util/decorable.h @@ -105,8 +105,13 @@ public: return Decoration<T>(getRegistry()->declareDecoration<T>()); } + template <typename T> + static Decoration<T> declareDecorationWithOwner() { + return Decoration<T>(getRegistry()->declareDecorationWithOwner<T, D>()); + } + protected: - Decorable() : _decorations(getRegistry()) {} + Decorable() : _decorations(getRegistry(), this) {} ~Decorable() = default; private: |