DLG4::VolumeBuilders
A fluent interface for Geant4 geometry definition.
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
UnitOrValue< T, NativeType > Struct Template Reference

#include <DLG4Units.hh>

Public Member Functions

 UnitOrValue (const UnitBase< T, NativeType > &u)
 
template<typename Scalar , typename = std::enable_if_t<std::is_arithmetic_v<Scalar> >>
 UnitOrValue (Scalar d)
 

Public Attributes

G4double val
 

Detailed Description

template<class T, class NativeType>
struct DLG4::Units::UnitOrValue< T, NativeType >

Type-erases unit or value to just a value.

BYPASSES TYPE SAFETY!!

Definition at line 620 of file DLG4Units.hh.

Constructor & Destructor Documentation

◆ UnitOrValue() [1/2]

template<class T , class NativeType >
UnitOrValue ( const UnitBase< T, NativeType > &  u)
inline

Definition at line 623 of file DLG4Units.hh.

624 : val(u.Native) { u.CheckUnit("UnitOrValue"); }

◆ UnitOrValue() [2/2]

template<class T , class NativeType >
template<typename Scalar , typename = std::enable_if_t<std::is_arithmetic_v<Scalar> >>
UnitOrValue ( Scalar  d)
inline

Definition at line 628 of file DLG4Units.hh.

629 : val(static_cast<G4double>(d)) {
630 }

Member Data Documentation

◆ val

template<class T , class NativeType >
G4double val

Definition at line 621 of file DLG4Units.hh.


The documentation for this struct was generated from the following file: