|
DLG4::VolumeBuilders
A fluent interface for Geant4 geometry definition.
|
#include <i_shared_ptr.hh>
A wrapper for std::shared_ptr that allows and facilitates many implicit(i) type conversions.
such as from T to i_shared_ptr<T>. Very useful for accepting paramters in a CRTP fluent base class You can accept a type erased class or ctor parameters to it and avoid BOTH the overload (ctor params) AND the templating (handled in the tpe erasing class in ONE place) at the method definition.
WARNING******** DO NOT ADD POINTER DATA TO THIS CLASS. DO NOT DELETE THROUGH shared_ptr BASE REFERENCE. The base class (shared_ptr) has a non-virtual destructor.. Technically any deletion through a base class pointer is undefined behavior according to C++. According to real compilers, It's fine, so long as there is nothing here that requires a delete call or such. This COULD be rewritten to hold the shared pointer instead of inheriting from it. AI even might get it right, might.
| T | The type of the object to be shared. |