diff --git a/include/fmt/base.h b/include/fmt/base.h index 8333d5166804..b1311ba8962a 100644 --- a/include/fmt/base.h +++ b/include/fmt/base.h @@ -1636,7 +1636,9 @@ template args[1 + (NUM_ARGS != 0 ? NUM_ARGS : +1)]; + static constexpr size_t ARGS_ARR_SIZE = 1 + (NUM_ARGS != 0 ? NUM_ARGS : +1); + + arg_t args[ARGS_ARR_SIZE]; named_arg_info named_args[NUM_NAMED_ARGS]; template @@ -1649,6 +1651,17 @@ struct format_arg_store { 0, (init_named_arg(named_args, arg_index, named_arg_index, values), 0)...}; } + + format_arg_store(format_arg_store&& rhs) { + args[0] = {named_args, NUM_NAMED_ARGS}; + for (size_t i = 1; i < ARGS_ARR_SIZE; ++i) args[i] = rhs.args[i]; + for (size_t i = 0; i < NUM_NAMED_ARGS; ++i) + named_args[i] = rhs.named_args[i]; + } + + format_arg_store(const format_arg_store& rhs) = delete; + format_arg_store& operator=(const format_arg_store& rhs) = delete; + format_arg_store& operator=(format_arg_store&& rhs) = delete; }; // A specialization of format_arg_store without named arguments.