mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Avoid using std::get except in holds_alternative-asserting accessors
This commit is contained in:
@@ -16,6 +16,18 @@
|
||||
|
||||
std::map<std::string, Symbol *> symbols;
|
||||
|
||||
Label &Symbol::label()
|
||||
{
|
||||
assert(std::holds_alternative<Label>(data));
|
||||
return std::get<Label>(data);
|
||||
}
|
||||
|
||||
Label const &Symbol::label() const
|
||||
{
|
||||
assert(std::holds_alternative<Label>(data));
|
||||
return std::get<Label>(data);
|
||||
}
|
||||
|
||||
void sym_AddSymbol(Symbol &symbol)
|
||||
{
|
||||
// Check if the symbol already exists
|
||||
|
||||
Reference in New Issue
Block a user