Stopped memory leak with transferring tokens
This commit is contained in:
@@ -92,6 +92,16 @@ namespace LXC::Lexer
|
||||
// Constructor to set the data of the token for more complex token types //
|
||||
Token(const LexerContext& ctx, uint32_t start, unsigned short len, TokenType _type);
|
||||
|
||||
// Copy constructor //
|
||||
Token(const Token& other);
|
||||
|
||||
// Move constructor (transfers memory allocated) //
|
||||
Token(Token&& other) noexcept;
|
||||
|
||||
// Cannot use these as members are const //
|
||||
Token& operator=(const Token&) = delete;
|
||||
Token& operator=(Token&&) = delete;
|
||||
|
||||
// Deconstructor to clean up the allocated memory //
|
||||
~Token();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user