diff --git a/include/fmt/core.h b/include/fmt/core.h index 771a1c00..a850c1c6 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -1833,6 +1833,15 @@ decltype(auto) get_appendable_buffer(Output&& out) { return get_buffer(std::forward(out)); } } + +template +FMT_INLINE auto get_iterator(Buf& buf, Output&&) -> decltype(buf.out()) { + return buf.out(); +} +template +auto get_iterator(buffer&, Output&& out) { + return out; +} #else template auto get_buffer(OutputIt out) -> iterator_buffer { @@ -1843,16 +1852,16 @@ template out) -> buffer& { return get_container(out); } -#endif -template -FMT_INLINE auto get_iterator(Buf& buf, Output&&) -> decltype(buf.out()) { +template +FMT_INLINE auto get_iterator(Buf& buf, OutputIt) -> decltype(buf.out()) { return buf.out(); } -template -auto get_iterator(buffer&, Output&& out) { +template +auto get_iterator(buffer&, OutputIt out) -> OutputIt { return out; } +#endif // A type-erased reference to an std::locale to avoid a heavy include. class locale_ref {