Skip to content
Snippets Groups Projects
Commit 1ced7171 authored by Wuttke, Joachim's avatar Wuttke, Joachim Committed by Wuttke, Joachim
Browse files

IFactory.h: explain create_new

parent 401a586c
No related branches found
No related tags found
No related merge requests found
...@@ -98,6 +98,12 @@ protected: ...@@ -98,6 +98,12 @@ protected:
DescriptionMap_t m_descriptions; //!< map of correspondence of objectsId and description 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() template <class T> T* create_new()
{ {
return new T(); return new T();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment