From 29702704fb467df5f515d2791e9c1eb9c25f0ee8 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Thu, 10 May 2018 12:48:20 +1000 Subject: [PATCH] view: improve template deduction guides --- format.hpp | 2 +- view.hpp | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/format.hpp b/format.hpp index 18bc4c90..40377899 100644 --- a/format.hpp +++ b/format.hpp @@ -157,7 +157,7 @@ namespace util::format { auto specifiers (void) const& { - return util::make_view (m_specifiers); + return util::view {m_specifiers}; } template diff --git a/view.hpp b/view.hpp index 0f08fe9a..5d9484ec 100644 --- a/view.hpp +++ b/view.hpp @@ -426,6 +426,9 @@ namespace util { typename ContainerT::const_iterator >; + // base + count constructor + template + view (BeginT const &, size_t count) -> view; /////////////////////////////////////////////////////////////////////////// @@ -441,7 +444,7 @@ namespace util { auto make_view (ContainerT &t) { - return util::view { 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 { std::cbegin (t), std::cend (t) }; + return util::view { std::cbegin (t), std::cend (t) }; }