Commit 12f46838 authored by Victor Zverovich's avatar Victor Zverovich

Make iterator_t an alias template

parent 874d6727
...@@ -266,9 +266,8 @@ inline Dest bit_cast(const Source& source) { ...@@ -266,9 +266,8 @@ inline Dest bit_cast(const Source& source) {
} }
// An implementation of iterator_t for pre-C++20 systems. // An implementation of iterator_t for pre-C++20 systems.
template <typename T> struct iterator_t { template <typename T>
typedef decltype(std::begin(std::declval<const T&>())) type; using iterator_t = decltype(std::begin(std::declval<T&>()));
};
template <typename Allocator> template <typename Allocator>
typename Allocator::value_type* allocate(Allocator& alloc, std::size_t n) { typename Allocator::value_type* allocate(Allocator& alloc, std::size_t n) {
...@@ -3313,13 +3312,13 @@ arg_join<It, wchar_t> join(It begin, It end, wstring_view sep) { ...@@ -3313,13 +3312,13 @@ arg_join<It, wchar_t> join(It begin, It end, wstring_view sep) {
\endrst \endrst
*/ */
template <typename Range> template <typename Range>
arg_join<typename internal::iterator_t<Range>::type, char> join( arg_join<internal::iterator_t<const Range>, char> join(
const Range& range, string_view sep) { const Range& range, string_view sep) {
return join(std::begin(range), std::end(range), sep); return join(std::begin(range), std::end(range), sep);
} }
template <typename Range> template <typename Range>
arg_join<typename internal::iterator_t<Range>::type, wchar_t> join( arg_join<internal::iterator_t<const Range>, wchar_t> join(
const Range& range, wstring_view sep) { const Range& range, wstring_view sep) {
return join(std::begin(range), std::end(range), sep); return join(std::begin(range), std::end(range), sep);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment