Commit 74c2590f authored by Dominik Charousset's avatar Dominik Charousset

Allow conversion from const char* to string_view

parent 132614e9
......@@ -19,6 +19,7 @@
#pragma once
#include <cstddef>
#include <cstring>
#include <iosfwd>
#include <iterator>
#include <limits>
......@@ -105,11 +106,10 @@ public:
// nop
}
template <size_t N>
constexpr string_view(const char (&cstr)[N]) noexcept
constexpr string_view(const char* cstr) noexcept
: data_(cstr),
size_(N - 1) {
static_assert(N > 0, "");
size_(strlen(cstr)) {
// nop
}
constexpr string_view(const string_view&) noexcept = default;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment