diff --git a/.gitignore b/.gitignore index 060ca13..3fb2b98 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,7 @@ dist .coveralls.yml .vscode +.vs doc/html doc/latex diff --git a/include/inja/node.hpp b/include/inja/node.hpp index be0bf98..e85df57 100644 --- a/include/inja/node.hpp +++ b/include/inja/node.hpp @@ -33,6 +33,8 @@ class SetStatementNode; class NodeVisitor { public: + virtual ~NodeVisitor() = default; + virtual void visit(const BlockNode& node) = 0; virtual void visit(const TextNode& node) = 0; virtual void visit(const ExpressionNode& node) = 0; @@ -59,7 +61,7 @@ public: size_t pos; AstNode(size_t pos) : pos(pos) { } - virtual ~AstNode() { }; + virtual ~AstNode() { } }; @@ -326,7 +328,7 @@ public: void accept(NodeVisitor& v) const { v.visit(*this); - }; + } }; class SetStatementNode : public StatementNode { @@ -338,7 +340,7 @@ public: void accept(NodeVisitor& v) const { v.visit(*this); - }; + } }; } // namespace inja diff --git a/include/inja/renderer.hpp b/include/inja/renderer.hpp index ad04f27..baece36 100644 --- a/include/inja/renderer.hpp +++ b/include/inja/renderer.hpp @@ -304,7 +304,7 @@ class Renderer : public NodeVisitor { case Op::Power: { auto args = get_arguments<2>(node); if (args[0]->is_number_integer() && args[1]->get() >= 0) { - int result = std::pow(args[0]->get(), args[1]->get()); + int result = static_cast(std::pow(args[0]->get(), args[1]->get())); result_ptr = std::make_shared(std::move(result)); json_tmp_stack.push_back(result_ptr); } else { diff --git a/single_include/inja/inja.hpp b/single_include/inja/inja.hpp index a69457b..c767ef7 100644 --- a/single_include/inja/inja.hpp +++ b/single_include/inja/inja.hpp @@ -2351,6 +2351,8 @@ class SetStatementNode; class NodeVisitor { public: + virtual ~NodeVisitor() = default; + virtual void visit(const BlockNode& node) = 0; virtual void visit(const TextNode& node) = 0; virtual void visit(const ExpressionNode& node) = 0; @@ -2377,7 +2379,7 @@ public: size_t pos; AstNode(size_t pos) : pos(pos) { } - virtual ~AstNode() { }; + virtual ~AstNode() { } }; @@ -2644,7 +2646,7 @@ public: void accept(NodeVisitor& v) const { v.visit(*this); - }; + } }; class SetStatementNode : public StatementNode { @@ -2656,7 +2658,7 @@ public: void accept(NodeVisitor& v) const { v.visit(*this); - }; + } }; } // namespace inja @@ -3672,7 +3674,7 @@ class Renderer : public NodeVisitor { case Op::Power: { auto args = get_arguments<2>(node); if (args[0]->is_number_integer() && args[1]->get() >= 0) { - int result = std::pow(args[0]->get(), args[1]->get()); + int result = static_cast(std::pow(args[0]->get(), args[1]->get())); result_ptr = std::make_shared(std::move(result)); json_tmp_stack.push_back(result_ptr); } else {