EleFits  5.0.0
A modern C++ API on top of CFITSIO

◆ as()

Record< TValue > 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
RecordVec< VariantValue > RecordSeq
A sequence of records of any type.
Definition: RecordVec.h:126