|
template<typename U , typename = std::enable_if_t<std::is_convertible_v<U *, T *>>> |
| i_shared_ptr (const std::shared_ptr< U > &ptr) |
|
template<typename U , typename std::enable_if<!std::is_same< T, U >::value, int >::type = 0> |
| i_shared_ptr (const i_shared_ptr< U > &other) |
|
| i_shared_ptr (const std::shared_ptr< std::remove_const_t< T > > &other) |
|
template<typename U > |
| i_shared_ptr (i_shared_ptr< U > &&other, typename enable_if_abstract< U >::type *=nullptr) |
|
| i_shared_ptr (std::shared_ptr< T > &&other) |
|
template<typename First , typename... Rest, typename = std::enable_if_t< !std::is_same_v<std::decay_t<First>, i_shared_ptr<T>> && !is_exact_std_shared_ptr<std::decay_t<First>>::value >> |
| i_shared_ptr (First &&first, Rest &&... rest) |
|
| i_shared_ptr (T *other) |
|
template<typename X = T, typename = std::enable_if_t<std::is_base_of_v< VolumeBuilders::IVolumeBuilder, X>>> |
| operator G4VSolid * () |
|
template<typename X = T, typename = std::enable_if_t<std::is_base_of_v< VolumeBuilders::IVolumeBuilder, X>>> |
| operator G4LogicalVolume * () |
|
template<typename X = T, typename = std::enable_if_t<std::is_base_of_v< VolumeBuilders::IVolumeBuilder, X>>> |
| operator G4VPhysicalVolume * () |
|
template<typename X = T, typename = std::enable_if_t<std::is_base_of_v< VolumeBuilders::IVolumeBuilder, X>>> |
| operator G4Transform3D () const |
|
template<typename T>
class DLG4::i_shared_ptr< T >
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.
- Template Parameters
-
T | The type of the object to be shared. |
Definition at line 36 of file i_shared_ptr.hh.