#include <algorithm>
#include <typeinfo>
#include <iostream>
#include <sstream>
Go to the source code of this file.
Namespaces | |
namespace | CLHEP |
Data Structures | |
class | G4AnyType |
class | G4AnyType::Placeholder |
class | G4AnyType::Ref< ValueType > |
class | G4BadAnyCast |
Defines | |
#define | G4AnyType_h 1 |
Functions | |
template<typename ValueType> | |
ValueType * | any_cast (G4AnyType *operand) |
template<typename ValueType> | |
const ValueType * | any_cast (const G4AnyType *operand) |
template<typename ValueType> | |
ValueType | any_cast (const G4AnyType &operand) |
#define G4AnyType_h 1 |
Definition at line 45 of file G4AnyType.hh.
ValueType any_cast | ( | const G4AnyType & | operand | ) |
value
Definition at line 210 of file G4AnyType.hh.
00210 { 00211 const ValueType* result = any_cast<ValueType>(&operand); 00212 if (!result) { 00213 throw G4BadAnyCast(); 00214 } 00215 return *result; 00216 }
const ValueType* any_cast | ( | const G4AnyType * | operand | ) |
ValueType* any_cast | ( | G4AnyType * | operand | ) |
value
Definition at line 201 of file G4AnyType.hh.
References G4AnyType::fContent, and G4AnyType::TypeInfo().
00201 { 00202 return operand && operand->TypeInfo() == typeid(ValueType) 00203 ? &static_cast<G4AnyType::Ref<ValueType>*>(operand->fContent)->fRef : 0; 00204 }