mirror of
https://github.com/fmtlib/fmt.git
synced 2025-01-12 06:37:28 +00:00
Clarify lifetime of basic_format_args
This commit is contained in:
parent
674c326d7c
commit
455a7c0787
@ -1256,7 +1256,16 @@ inline format_arg_store<Context, Args...> make_format_args(
|
|||||||
return {args...};
|
return {args...};
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Formatting arguments. */
|
/**
|
||||||
|
\rst
|
||||||
|
A view of a collection of formatting arguments. To avoid lifetime issues it
|
||||||
|
should only be used as a parameter type in type-erased functions such as
|
||||||
|
``vformat``::
|
||||||
|
|
||||||
|
void vlog(fmt::string_view format_str, fmt::format_args args); // OK
|
||||||
|
fmt::format_args args = fmt::make_format_args(42); // Error: dangling reference
|
||||||
|
\endrst
|
||||||
|
*/
|
||||||
template <typename Context> class basic_format_args {
|
template <typename Context> class basic_format_args {
|
||||||
public:
|
public:
|
||||||
using size_type = int;
|
using size_type = int;
|
||||||
|
Loading…
Reference in New Issue
Block a user