view: improve template deduction guides

This commit is contained in:
Danny Robson 2018-05-10 12:48:20 +10:00
parent 2ec9a7ebe6
commit 29702704fb
2 changed files with 6 additions and 3 deletions

View File

@ -157,7 +157,7 @@ namespace util::format {
auto
specifiers (void) const&
{
return util::make_view (m_specifiers);
return util::view {m_specifiers};
}
template <size_t Index>

View File

@ -426,6 +426,9 @@ namespace util {
typename ContainerT::const_iterator
>;
// base + count constructor
template <typename BeginT>
view (BeginT const &, size_t count) -> view<BeginT,BeginT>;
///////////////////////////////////////////////////////////////////////////
@ -441,7 +444,7 @@ namespace util {
auto
make_view (ContainerT &t)
{
return util::view<decltype(std::begin (t))> { std::begin (t), std::end (t) };
return util::view { std::begin (t), std::end (t) };
}
//-------------------------------------------------------------------------
@ -449,7 +452,7 @@ namespace util {
auto
make_view (const ContainerT &t)
{
return util::view<decltype(std::cbegin (t))> { std::cbegin (t), std::cend (t) };
return util::view { std::cbegin (t), std::cend (t) };
}