Yume
Public Member Functions | Static Public Member Functions | List of all members
yume::Atom Class Reference

Atoms represent strings in a string pool. More...

#include <atom.hpp>

Public Member Functions

constexpr Atom ()=delete
 
constexpr Atom (std::string_view str)
 
auto constexpr operator<=> (const Atom &other) const noexcept=default
 

Static Public Member Functions

static auto make_atom (std::string_view value) noexcept -> Atom
 

Detailed Description

Atoms represent strings in a string pool.

This means two atoms created with the same string value will contain identical pointers to that string. Thus, comparing Atoms is extremely cheap, as it only consists of a pointer equality check.

Definition at line 12 of file atom.hpp.

Constructor & Destructor Documentation

◆ Atom() [1/2]

constexpr yume::Atom::Atom ( )
constexprdelete

◆ Atom() [2/2]

constexpr yume::Atom::Atom ( std::string_view  str)
inlineexplicitconstexpr

Definition at line 17 of file atom.hpp.

Member Function Documentation

◆ make_atom()

static auto yume::Atom::make_atom ( std::string_view  value) -> Atom
inlinestaticnoexcept

Definition at line 23 of file atom.hpp.

Referenced by yume::make_atom().

◆ operator<=>()

auto constexpr yume::Atom::operator<=> ( const Atom other) const
constexprdefaultnoexcept

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