From 1ced7171c89b0a2be4126a038f8abe04c7d7cff1 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (o)" <j.wuttke@fz-juelich.de> Date: Tue, 23 Jun 2020 20:50:50 +0200 Subject: [PATCH] IFactory.h: explain create_new --- Core/StandardSamples/IFactory.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Core/StandardSamples/IFactory.h b/Core/StandardSamples/IFactory.h index f0a0396253c..7e88f7049dc 100644 --- a/Core/StandardSamples/IFactory.h +++ b/Core/StandardSamples/IFactory.h @@ -98,6 +98,12 @@ protected: DescriptionMap_t m_descriptions; //!< map of correspondence of objectsId and description }; +//! Returns new instance of class T. +//! +//! This templated function is used in catalogues in form of a function pointer +//! 'create_new<T>', with no function arguments supplied. Equivalently, we could +//! use a lambda function '[](){return new T;}'. + template <class T> T* create_new() { return new T(); -- GitLab