From 0d6dd0cc6af15c9c77471e385f517d51014162ae Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Thu, 14 Nov 2019 05:57:23 -0800 Subject: [PATCH] Correct basic_string_view from string ctor --- include/fmt/core.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index 02a389fa..091da657 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -296,10 +296,11 @@ template class basic_string_view { : data_(s), size_(std::char_traits::length(s)) {} /** Constructs a string reference from a ``std::basic_string`` object. */ - template - FMT_CONSTEXPR basic_string_view(const std::basic_string& s) - FMT_NOEXCEPT : data_(s.data()), - size_(s.size()) {} + template + FMT_CONSTEXPR basic_string_view( + const std::basic_string& s) FMT_NOEXCEPT + : data_(s.data()), + size_(s.size()) {} template < typename S, @@ -389,10 +390,10 @@ inline basic_string_view to_string_view(const Char* s) { return s; } -template +template inline basic_string_view to_string_view( - const std::basic_string& s) { - return {s.data(), s.size()}; + const std::basic_string& s) { + return s; } template