#include <symbol-table.hh>
Public Member Functions | |
bool | operator== (std::string_view s2) const |
const char * | c_str () const |
operator const std::string_view () const | |
bool | empty () const |
Friends | |
class | SymbolTable |
std::ostream & | operator<< (std::ostream &os, const SymbolStr &symbol) |
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.
|
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.