EleFits  4.0.1
A modern C++ API on top of CFitsIO

◆ as()

template<typename T >
template<typename TValue >
Record<TValue> Euclid::Fits::RecordVec< T >::as ( const std::string keyword) const

Find and cast the first record with given keyword.

Template Parameters
TValueThe destination value type.

Although the method returns a Record, it can itself be sliced as its value, so the following works:

RecordSeq records; // Equivalent to RecordVec<VariantValue>
// ...
int i = records.as<int>("KEYWORD"); // Get the value as int
Euclid::Fits::RecordSeq
RecordVec< VariantValue > RecordSeq
A sequence of records of any type.
Definition: RecordVec.h:131