@@ -1260,7 +1260,7 @@ template <typename Context> class value {
1260
1260
};
1261
1261
1262
1262
template <typename Context, typename T>
1263
- FMT_CONSTEXPR auto make_arg (const T & value) -> basic_format_arg<Context>;
1263
+ FMT_CONSTEXPR auto make_arg (T& & value) -> basic_format_arg<Context>;
1264
1264
1265
1265
// To minimize the number of types we need to deal with, long is translated
1266
1266
// either to int or to long long depending on its size.
@@ -1513,7 +1513,7 @@ template <typename Context> class basic_format_arg {
1513
1513
detail::type type_;
1514
1514
1515
1515
template <typename ContextType, typename T>
1516
- friend FMT_CONSTEXPR auto detail::make_arg (const T & value)
1516
+ friend FMT_CONSTEXPR auto detail::make_arg (T& & value)
1517
1517
-> basic_format_arg<ContextType>;
1518
1518
1519
1519
template <typename Visitor, typename Ctx>
@@ -1674,19 +1674,7 @@ constexpr auto encode_types() -> unsigned long long {
1674
1674
}
1675
1675
1676
1676
template <typename Context, typename T>
1677
- FMT_CONSTEXPR auto make_arg (const T& value) -> basic_format_arg<Context> {
1678
- basic_format_arg<Context> arg;
1679
- arg.type_ = mapped_type_constant<T, Context>::value;
1680
- arg.value_ = arg_mapper<Context>().map (value);
1681
- return arg;
1682
- }
1683
-
1684
- // The type template parameter is there to avoid an ODR violation when using
1685
- // a fallback formatter in one translation unit and an implicit conversion in
1686
- // another (not recommended).
1687
- template <bool IS_PACKED, typename Context, type, typename T,
1688
- FMT_ENABLE_IF (IS_PACKED)>
1689
- FMT_CONSTEXPR FMT_INLINE auto make_arg(T&& val) -> value<Context> {
1677
+ FMT_CONSTEXPR FMT_INLINE auto make_value (T&& val) -> value<Context> {
1690
1678
const auto & arg = arg_mapper<Context>().map (std::forward<T>(val));
1691
1679
1692
1680
constexpr bool formattable_char =
@@ -1715,9 +1703,26 @@ FMT_CONSTEXPR FMT_INLINE auto make_arg(T&& val) -> value<Context> {
1715
1703
return {arg};
1716
1704
}
1717
1705
1706
+ template <typename Context, typename T>
1707
+ FMT_CONSTEXPR auto make_arg (T&& value) -> basic_format_arg<Context> {
1708
+ basic_format_arg<Context> arg;
1709
+ arg.type_ = mapped_type_constant<T, Context>::value;
1710
+ arg.value_ = make_value<Context>(value);
1711
+ return arg;
1712
+ }
1713
+
1714
+ // The type template parameter is there to avoid an ODR violation when using
1715
+ // a fallback formatter in one translation unit and an implicit conversion in
1716
+ // another (not recommended).
1717
+ template <bool IS_PACKED, typename Context, type, typename T,
1718
+ FMT_ENABLE_IF (IS_PACKED)>
1719
+ FMT_CONSTEXPR FMT_INLINE auto make_arg(T&& val) -> value<Context> {
1720
+ return make_value<Context>(val);
1721
+ }
1722
+
1718
1723
template <bool IS_PACKED, typename Context, type, typename T,
1719
1724
FMT_ENABLE_IF (!IS_PACKED)>
1720
- inline auto make_arg(const T & value) -> basic_format_arg<Context> {
1725
+ FMT_CONSTEXPR inline auto make_arg(T& & value) -> basic_format_arg<Context> {
1721
1726
return make_arg<Context>(value);
1722
1727
}
1723
1728
FMT_END_DETAIL_NAMESPACE
0 commit comments