From f89061f53f4968d0ca938307df1b4aae664a2dbf Mon Sep 17 00:00:00 2001 From: Constantin Masson Date: Fri, 4 Sep 2026 08:20:33 +0200 Subject: [PATCH] fix: add const correctness to render and render_to methods (#346) --- include/inja/environment.hpp | 4 ++-- single_include/inja/inja.hpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/inja/environment.hpp b/include/inja/environment.hpp index 64e3f6b..2ff9813 100644 --- a/include/inja/environment.hpp +++ b/include/inja/environment.hpp @@ -117,7 +117,7 @@ public: return render(parse(input), data); } - std::string render(const Template& tmpl, const json& data) { + std::string render(const Template& tmpl, const json& data) const { std::stringstream os; render_to(os, tmpl, data); return os.str(); @@ -154,7 +154,7 @@ public: write(temp, data, filename_out); } - std::ostream& render_to(std::ostream& os, const Template& tmpl, const json& data) { + std::ostream& render_to(std::ostream& os, const Template& tmpl, const json& data) const { Renderer(render_config, template_storage, function_storage).render_to(os, tmpl, data); return os; } diff --git a/single_include/inja/inja.hpp b/single_include/inja/inja.hpp index 51442fe..bf18089 100644 --- a/single_include/inja/inja.hpp +++ b/single_include/inja/inja.hpp @@ -2943,7 +2943,7 @@ public: return render(parse(input), data); } - std::string render(const Template& tmpl, const json& data) { + std::string render(const Template& tmpl, const json& data) const { std::stringstream os; render_to(os, tmpl, data); return os.str(); @@ -2980,7 +2980,7 @@ public: write(temp, data, filename_out); } - std::ostream& render_to(std::ostream& os, const Template& tmpl, const json& data) { + std::ostream& render_to(std::ostream& os, const Template& tmpl, const json& data) const { Renderer(render_config, template_storage, function_storage).render_to(os, tmpl, data); return os; }