Skip to content

Commit

Permalink
Template basic_string_view on Traits in parse overloads
Browse files Browse the repository at this point in the history
  • Loading branch information
HowardHinnant committed May 20, 2021
1 parent ebb5719 commit 38267fa
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions include/date/date.h
Original file line number Diff line number Diff line change
Expand Up @@ -8080,7 +8080,7 @@ struct parse_manip
, offset_(offset)
{}

parse_manip(std::basic_string_view<CharT> format, Parsable& tp,
parse_manip(std::basic_string_view<CharT, Traits> format, Parsable& tp,
std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
std::chrono::minutes* offset = nullptr)
: format_(format)
Expand Down Expand Up @@ -8198,20 +8198,20 @@ parse(const CharT* format, Parsable& tp,

// basic_string_view formats

template <class Parsable, class CharT>
template <class Parsable, class CharT, class Traits>
inline
auto
parse(std::basic_string_view<CharT> format, Parsable& tp)
-> decltype(from_stream(std::declval<std::basic_istream<CharT>&>(), format.data(), tp),
parse_manip<Parsable, CharT>{format, tp})
parse(std::basic_string_view<CharT, Traits> format, Parsable& tp)
-> decltype(from_stream(std::declval<std::basic_istream<CharT, Traits>&>(), format.data(), tp),
parse_manip<Parsable, CharT, Traits>{format, tp})
{
return {format, tp};
}

template <class Parsable, class CharT, class Traits, class Alloc>
inline
auto
parse(std::basic_string_view<CharT> format,
parse(std::basic_string_view<CharT, Traits> format,
Parsable& tp, std::basic_string<CharT, Traits, Alloc>& abbrev)
-> decltype(from_stream(std::declval<std::basic_istream<CharT, Traits>&>(), format.data(),
tp, &abbrev),
Expand All @@ -8220,21 +8220,21 @@ parse(std::basic_string_view<CharT> format,
return {format, tp, &abbrev};
}

template <class Parsable, class CharT>
template <class Parsable, class CharT, class Traits>
inline
auto
parse(std::basic_string_view<CharT> format, Parsable& tp, std::chrono::minutes& offset)
-> decltype(from_stream(std::declval<std::basic_istream<CharT>&>(), format.data(),
tp, std::declval<std::basic_string<CharT>*>(), &offset),
parse_manip<Parsable, CharT>{format, tp, nullptr, &offset})
parse(std::basic_string_view<CharT, Traits> format, Parsable& tp, std::chrono::minutes& offset)
-> decltype(from_stream(std::declval<std::basic_istream<CharT, Traits>&>(), format.data(),
tp, std::declval<std::basic_string<CharT, Traits>*>(), &offset),
parse_manip<Parsable, CharT, Traits>{format, tp, nullptr, &offset})
{
return {format, tp, nullptr, &offset};
}

template <class Parsable, class CharT, class Traits, class Alloc>
inline
auto
parse(std::basic_string_view<CharT> format, Parsable& tp,
parse(std::basic_string_view<CharT, Traits> format, Parsable& tp,
std::basic_string<CharT, Traits, Alloc>& abbrev, std::chrono::minutes& offset)
-> decltype(from_stream(std::declval<std::basic_istream<CharT, Traits>&>(), format.data(),
tp, &abbrev, &offset),
Expand Down

0 comments on commit 38267fa

Please sign in to comment.