fourdst::libcomposition v1.5.2
Robust atomic species information library
Loading...
Searching...
No Matches
std::hash< fourdst::atomic::Species > Struct Reference

Specialization of std::hash for fourdst::atomic::Species. More...

#include <atomicSpecies.h>

Public Member Functions

size_t operator() (const fourdst::atomic::Species &s) const noexcept
 Computes the hash for a Species object.
 

Detailed Description

Specialization of std::hash for fourdst::atomic::Species.

This allows fourdst::atomic::Species objects to be used as keys in unordered associative containers like std::unordered_map and std::unordered_set. The hash is computed based on the species' name (m_name), as it is expected to be a unique identifier for each species.

Usage Example
#include <unordered_map>
#include <string>
int main() {
std::unordered_map<fourdst::atomic::Species, double> abundance;
fourdst::atomic::Species h1("H1", ...);
abundance[h1] = 0.999;
return 0;
}
Represents an atomic species (isotope) with its fundamental physical properties.

Definition at line 425 of file atomicSpecies.h.

Member Function Documentation

◆ operator()()

size_t std::hash< fourdst::atomic::Species >::operator() ( const fourdst::atomic::Species & s) const
inlinenoexcept

Computes the hash for a Species object.

Parameters
sThe Species object to hash.
Returns
The hash value of the species' name.

Definition at line 431 of file atomicSpecies.h.


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