Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenlib/BLI_resource_collector.hh')
-rw-r--r--source/blender/blenlib/BLI_resource_collector.hh9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_resource_collector.hh b/source/blender/blenlib/BLI_resource_collector.hh
index 20180f3b2c9..ecae9b8c682 100644
--- a/source/blender/blenlib/BLI_resource_collector.hh
+++ b/source/blender/blenlib/BLI_resource_collector.hh
@@ -108,6 +108,15 @@ class ResourceCollector : NonCopyable, NonMovable {
}
/**
+ * Construct an object with the same value in the ResourceCollector and return a reference to the
+ * new value.
+ */
+ template<typename T> T &add_value(T &&value, const char *name)
+ {
+ return this->construct<T>(name, std::forward<T>(value));
+ }
+
+ /**
* Returns a reference to a linear allocator that is owned by the ResourcesCollector. Memory
* allocated through this allocator will be freed when the collector is destructed.
*/