diff --git a/inc/format.h b/inc/format.h index 907d1d8..d65ad46 100644 --- a/inc/format.h +++ b/inc/format.h @@ -49,15 +49,18 @@ constexpr char_array_t format_args(char_array_t result, first_arg_t first_arg, o if constexpr(t_ast_i >= t_ast.size()) { return result; } else { - if (t_ast[t_ast_i].is_char()) { - result[t_result_i] = t_ast[t_ast_i].get_char(); + constexpr auto ast_node = t_ast[t_ast_i]; + + if (ast_node.is_char()) { + result[t_result_i] = ast_node.get_char(); return format_args(result, first_arg, other_args...); } else { - const auto formatted_arg = format_arg(first_arg); + constexpr auto fmt_node = ast_node.get_node(); + const auto formatted_arg = format_arg(first_arg); std::copy(formatted_arg.begin(), formatted_arg.end(), result.begin()+t_result_i); - return format_args(result, first_arg, other_args...); + return format_args(result, first_arg, other_args...); } } }