From 0e3cfcde619fb60e6e43bf0ffe715df6d5c22218 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Tue, 16 Sep 2014 19:57:28 +0200 Subject: Improved lexer readabilty and replaced raw new in tree construction * "new" in Tree::addNode member method was replaced with C++14 std::make_unique * renamed and constified lexer local variables to increase readabilty ** replaced chunky if-clauses with switch-clauses where appropriate * updated README.md to mention C++14 requirement --- src/tree.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/tree.cc') diff --git a/src/tree.cc b/src/tree.cc index e377c95..bc1414b 100644 --- a/src/tree.cc +++ b/src/tree.cc @@ -100,7 +100,7 @@ std::string Tree::print() { template Node* Tree::addNode(Node** place, Args&&... args) { this->node_collection_.emplace_back( - new NType(std::forward(args)...) + std::make_unique(std::forward(args)...) ); if ( place != nullptr ) { -- cgit v1.2.3