Skip to content

Commit d2a0ec7

Browse files
committed
switch to unique_ptr
1 parent f99b998 commit d2a0ec7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

include/inja/parser.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -621,8 +621,8 @@ class Parser {
621621
const FunctionStorage& function_storage)
622622
: config(parser_config), lexer(lexer_config), template_storage(template_storage), function_storage(function_storage) {}
623623

624-
std::shared_ptr<Template> parse(std::string_view input, std::string_view path) {
625-
auto result = std::make_shared<Template>(static_cast<std::string>(input));
624+
std::unique_ptr<Template> parse(std::string_view input, std::string_view path) {
625+
auto result = std::make_unique<Template>(static_cast<std::string>(input));
626626
parse_into(*result, path);
627627
return result;
628628
}

single_include/inja/inja.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2059,8 +2059,8 @@ class Parser {
20592059
const FunctionStorage& function_storage)
20602060
: config(parser_config), lexer(lexer_config), template_storage(template_storage), function_storage(function_storage) {}
20612061

2062-
std::shared_ptr<Template> parse(std::string_view input, std::string_view path) {
2063-
auto result = std::make_shared<Template>(static_cast<std::string>(input));
2062+
std::unique_ptr<Template> parse(std::string_view input, std::string_view path) {
2063+
auto result = std::make_unique<Template>(static_cast<std::string>(input));
20642064
parse_into(*result, path);
20652065
return result;
20662066
}

0 commit comments

Comments
 (0)