Clean up language

Remove mentions of `std::reference_wrapper` and rvalues
in favor of more common terminology like dangling references.

Fix function signature that references `fmt::arg`
in the API *.rst
This commit is contained in:
Mike Lui 2019-02-22 10:08:28 -05:00
parent 71e97b4819
commit 1ed12d6324
2 changed files with 5 additions and 7 deletions

View File

@ -54,7 +54,7 @@ participate in an overload resolution if the latter is not a string.
Named arguments Named arguments
--------------- ---------------
.. doxygenfunction:: fmt::arg(string_view, const T&) .. doxygenfunction:: fmt::arg(const S&, const T&)
Named arguments are not supported in compile-time checks at the moment. Named arguments are not supported in compile-time checks at the moment.

View File

@ -1385,10 +1385,10 @@ typename buffer_context<Char>::type::iterator vformat_to(
\rst \rst
Returns a named argument to be used in a formatting function. Returns a named argument to be used in a formatting function.
Usage is analogous to `std::reference_wrapper The named argument holds a reference and does not extend the lifetime
<https://en.cppreference.com/w/cpp/utility/functional/reference_wrapper>`_, of its arguments.
except that rvalues references are not disabled. Consequently, a dangling reference can accidentally be created.
The user should take care to only pass in temporaries when The user should take care to only pass this function temporaries when
the named argument is itself a temporary, as per the following example. the named argument is itself a temporary, as per the following example.
**Example**:: **Example**::
@ -1401,11 +1401,9 @@ inline internal::named_arg<T, FMT_CHAR(S)> arg(const S& name, const T& arg) {
return {name, arg}; return {name, arg};
} }
/// \cond
// Disable nested named arguments, e.g. ``arg("a", arg("b", 42))``. // Disable nested named arguments, e.g. ``arg("a", arg("b", 42))``.
template <typename S, typename T, typename Char> template <typename S, typename T, typename Char>
void arg(S, internal::named_arg<T, Char>) = delete; void arg(S, internal::named_arg<T, Char>) = delete;
/// \endcond
template <typename Container> struct is_contiguous : std::false_type {}; template <typename Container> struct is_contiguous : std::false_type {};