3#include "llvm/ADT/StringSet.h"
13 std::string_view m_str;
17 explicit constexpr Atom(std::string_view str) : m_str{str} {}
19 operator std::string_view()
const {
return m_str; }
20 explicit operator std::string()
const {
return std::string(m_str); }
24 const auto& data = Atom::interned.insert(value).first->first();
29 static inline llvm::StringSet interned{};
36auto inline operator""_a(
const char* value, std::size_t len)
noexcept ->
Atom {
37 return make_atom(std::string_view(value, len));
Atoms represent strings in a string pool.
static auto make_atom(std::string_view value) noexcept -> Atom
auto constexpr operator<=>(const Atom &other) const noexcept=default
constexpr Atom(std::string_view str)
auto make_atom(std::string_view value) noexcept -> Atom
Create an Atom with the given string content.