Skip to content

ludus::foundation::NameLiteral

Ludus Wiki · API overview · Browse API

Struct

Compile-time descriptor of a string literal; not an interned ID.
Bind Spelling explicitly through StringTable::TryIntern during setup and cache the NameId.

Declared in modules/foundation/strings/include/ludus/foundation/strings/string_table.hpp

#include <ludus/foundation/strings/string_table.hpp>
struct ludus::foundation::NameLiteral final

Fields

Spelling

std::string_view ludus::foundation::NameLiteral::Spelling
Borrowed counted view of the literal, excluding its final (terminating) array element.

Declared in modules/foundation/strings/include/ludus/foundation/strings/string_table.hpp

Fingerprint

uint64 ludus::foundation::NameLiteral::Fingerprint
FNV-1a-64 of Spelling (SymbolFingerprint64). It is not collision-free, is not the table's lookup hash and cannot stand in for a NameId.

Related types: uint64

Declared in modules/foundation/strings/include/ludus/foundation/strings/string_table.hpp

Methods

NameLiteral

template <usize N>
explicit ludus::foundation::NameLiteral::NameLiteral(const char(&spelling)[N]) noexcept
Source must remain alive until binding. consteval does not prove lifetime.

Related types: usize

Declared in modules/foundation/strings/include/ludus/foundation/strings/string_table.hpp