Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
1ced7171
Commit
1ced7171
authored
4 years ago
by
Wuttke, Joachim
Committed by
Wuttke, Joachim
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
IFactory.h: explain create_new
parent
401a586c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Core/StandardSamples/IFactory.h
+6
-0
6 additions, 0 deletions
Core/StandardSamples/IFactory.h
with
6 additions
and
0 deletions
Core/StandardSamples/IFactory.h
+
6
−
0
View file @
1ced7171
...
@@ -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
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment