Skip to content

Commit

Permalink
switch to unique_ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
jbohanon committed Mar 18, 2024
1 parent f99b998 commit d2a0ec7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions include/inja/parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -621,8 +621,8 @@ class Parser {
const FunctionStorage& function_storage)
: config(parser_config), lexer(lexer_config), template_storage(template_storage), function_storage(function_storage) {}

std::shared_ptr<Template> parse(std::string_view input, std::string_view path) {
auto result = std::make_shared<Template>(static_cast<std::string>(input));
std::unique_ptr<Template> parse(std::string_view input, std::string_view path) {
auto result = std::make_unique<Template>(static_cast<std::string>(input));
parse_into(*result, path);
return result;
}
Expand Down
4 changes: 2 additions & 2 deletions single_include/inja/inja.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2059,8 +2059,8 @@ class Parser {
const FunctionStorage& function_storage)
: config(parser_config), lexer(lexer_config), template_storage(template_storage), function_storage(function_storage) {}

std::shared_ptr<Template> parse(std::string_view input, std::string_view path) {
auto result = std::make_shared<Template>(static_cast<std::string>(input));
std::unique_ptr<Template> parse(std::string_view input, std::string_view path) {
auto result = std::make_unique<Template>(static_cast<std::string>(input));
parse_into(*result, path);
return result;
}
Expand Down

0 comments on commit d2a0ec7

Please sign in to comment.