Make join() handle non-const-only begin/end ranges (#1786)
See fmtlib/fmt#1784. Add tests that demonstrate the problem and check obvious variations.
This commit is contained in:
@@ -3420,15 +3420,14 @@ arg_join<It, Sentinel, wchar_t> join(It begin, Sentinel end, wstring_view sep) {
|
||||
\endrst
|
||||
*/
|
||||
template <typename Range>
|
||||
arg_join<detail::iterator_t<const Range>, detail::sentinel_t<const Range>, char>
|
||||
join(const Range& range, string_view sep) {
|
||||
arg_join<detail::iterator_t<Range>, detail::sentinel_t<Range>, char> join(
|
||||
Range&& range, string_view sep) {
|
||||
return join(std::begin(range), std::end(range), sep);
|
||||
}
|
||||
|
||||
template <typename Range>
|
||||
arg_join<detail::iterator_t<const Range>, detail::sentinel_t<const Range>,
|
||||
wchar_t>
|
||||
join(const Range& range, wstring_view sep) {
|
||||
arg_join<detail::iterator_t<Range>, detail::sentinel_t<Range>, wchar_t> join(
|
||||
Range&& range, wstring_view sep) {
|
||||
return join(std::begin(range), std::end(range), sep);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user