BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
mumufit::test Namespace Reference

Classes

class  IFactory
 Base class for all factories. More...
 

Functions

template<class T >
T * create_new ()
 Returns new instance of class T. More...
 

Function Documentation

◆ create_new()

template<class T >
T* mumufit::test::create_new ( )

Returns new instance of class T.

This templated function is used in catalogs in form of a function pointer 'create_new<T>', with no function arguments supplied. Equivalently, we could use a lambda function '[](){return new T;}'.

Definition at line 83 of file IFactory.h.

84 {
85  return new T();
86 }