#include <symbol-table.hh>
Public Member Functions | |
operator bool () const | |
auto | operator<=> (const Symbol other) const |
bool | operator== (const Symbol other) const |
Friends | |
class | SymbolTable |
class | std::hash< Symbol > |
Symbols have the property that they can be compared efficiently (using an equality test), because the symbol table stores only one copy of each string.
|
friend |
This class mainly exists to give us an operator<< for ostreams. We could also return plain strings from SymbolTable, but then we'd have to wrap every instance of a symbol that is fmt()ed, which is inconvenient and error-prone.
Symbols have the property that they can be compared efficiently (using an equality test), because the symbol table stores only one copy of each string.