@@ -646,9 +646,9 @@ struct formatter<join_view<It, Sentinel, Char>, Char> {
646
646
#endif
647
647
formatter<remove_cvref_t <value_type>, Char> value_formatter_;
648
648
649
- using view_ref = conditional_t <std::is_copy_constructible<It>::value,
650
- const join_view<It, Sentinel, Char>& ,
651
- join_view<It, Sentinel, Char>&& >;
649
+ using view = conditional_t <std::is_copy_constructible<It>::value,
650
+ const join_view<It, Sentinel, Char>,
651
+ join_view<It, Sentinel, Char>>;
652
652
653
653
public:
654
654
using nonlocking = void ;
@@ -658,9 +658,10 @@ struct formatter<join_view<It, Sentinel, Char>, Char> {
658
658
}
659
659
660
660
template <typename FormatContext>
661
- auto format (view_ref& value, FormatContext& ctx) const
662
- -> decltype(ctx.out()) {
663
- auto it = std::forward<view_ref>(value).begin ;
661
+ auto format (view& value, FormatContext& ctx) const -> decltype(ctx.out()) {
662
+ using iter =
663
+ conditional_t <std::is_copy_constructible<view>::value, It, It&>;
664
+ iter it = value.begin ;
664
665
auto out = ctx.out ();
665
666
if (it == value.end ) return out;
666
667
out = value_formatter_.format (*it, ctx);
0 commit comments