mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-02 11:28:20 +00:00
Correct basic_string_view from string ctor
This commit is contained in:
parent
1f918159ed
commit
0d6dd0cc6a
@ -296,9 +296,10 @@ template <typename Char> class basic_string_view {
|
||||
: data_(s), size_(std::char_traits<Char>::length(s)) {}
|
||||
|
||||
/** Constructs a string reference from a ``std::basic_string`` object. */
|
||||
template <typename Alloc>
|
||||
FMT_CONSTEXPR basic_string_view(const std::basic_string<Char, Alloc>& s)
|
||||
FMT_NOEXCEPT : data_(s.data()),
|
||||
template <typename Traits, typename Alloc>
|
||||
FMT_CONSTEXPR basic_string_view(
|
||||
const std::basic_string<Char, Traits, Alloc>& s) FMT_NOEXCEPT
|
||||
: data_(s.data()),
|
||||
size_(s.size()) {}
|
||||
|
||||
template <
|
||||
@ -389,10 +390,10 @@ inline basic_string_view<Char> to_string_view(const Char* s) {
|
||||
return s;
|
||||
}
|
||||
|
||||
template <typename Char, typename Traits, typename Allocator>
|
||||
template <typename Char, typename Traits, typename Alloc>
|
||||
inline basic_string_view<Char> to_string_view(
|
||||
const std::basic_string<Char, Traits, Allocator>& s) {
|
||||
return {s.data(), s.size()};
|
||||
const std::basic_string<Char, Traits, Alloc>& s) {
|
||||
return s;
|
||||
}
|
||||
|
||||
template <typename Char>
|
||||
|
Loading…
Reference in New Issue
Block a user