mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-10 13:01:18 +00:00
Replaced the queue of Token pointers with values.
We were getting memory leaks (as told by the CRT detectors, which I also added), and there's really no reason (as long as we're careful) to use pointers there.
This commit is contained in:
@@ -6,21 +6,19 @@
|
||||
#include <stack>
|
||||
#include <set>
|
||||
#include "stream.h"
|
||||
#include "token.h"
|
||||
|
||||
namespace YAML
|
||||
{
|
||||
struct Token;
|
||||
|
||||
class Scanner
|
||||
{
|
||||
public:
|
||||
Scanner(std::istream& in);
|
||||
~Scanner();
|
||||
|
||||
Token *GetNextToken();
|
||||
void EatNextToken();
|
||||
void PopNextToken();
|
||||
Token *PeekNextToken();
|
||||
bool IsEmpty();
|
||||
void PopToken();
|
||||
Token& PeekToken();
|
||||
|
||||
private:
|
||||
// scanning
|
||||
@@ -72,7 +70,7 @@ namespace YAML
|
||||
Stream INPUT;
|
||||
|
||||
// the output (tokens)
|
||||
std::queue <Token *> m_tokens;
|
||||
std::queue <Token> m_tokens;
|
||||
|
||||
// state info
|
||||
bool m_startedStream, m_endedStream;
|
||||
|
Reference in New Issue
Block a user