Class ElemData

Inheritance Relationships

Derived Types

Class Documentation

class ElemData

Compile-time elemental identity: atomic symbol and atomic number.

All members, the constructor, observer methods, and comparison operators are constexpr, allowing compile-time construction and use. Comparison operators compare on atomic number Z, enabling sorting of element lists by Z. Serves as a base class for more specific per-element data records, such as ionization potentials or isotopic data.

Subclassed by elem::IonizationData, elem::IsotopeData

Public Functions

inline constexpr ElemData(std::array<char, 2> symbol, unsigned int z) noexcept

Construct an ElemData record.

Parameters:
  • symbol – Two-character atomic symbol; single-char symbols use ‘\0’ as the second character (e.g. {‘H’, ‘\0’})

  • z – Atomic number

ElemData(const ElemData&) = default
auto operator=(const ElemData&) -> ElemData& = default
ElemData(ElemData&&) = default
auto operator=(ElemData&&) -> ElemData& = default
~ElemData() = default
inline constexpr auto symbol() const noexcept -> const std::array<char, 2>&

Return the two-character atomic symbol.

inline constexpr auto Z() const noexcept -> unsigned int

Return the atomic number.

inline constexpr auto operator==(const ElemData &o) const noexcept -> bool
inline constexpr auto operator!=(const ElemData &o) const noexcept -> bool
inline constexpr auto operator<(const ElemData &o) const noexcept -> bool
inline constexpr auto operator>(const ElemData &o) const noexcept -> bool
inline constexpr auto operator<=(const ElemData &o) const noexcept -> bool
inline constexpr auto operator>=(const ElemData &o) const noexcept -> bool

Protected Attributes

std::array<char, 2> symbol_

Two-character atomic symbol

unsigned int Z_