mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
Fixed a bug on creating a span from empty string
This commit is contained in:
parent
c6f3579ad1
commit
e19f6b5f36
@ -270,7 +270,7 @@ public:
|
|||||||
|
|
||||||
// from string
|
// from string
|
||||||
constexpr basic_string_span(std::string& s) noexcept
|
constexpr basic_string_span(std::string& s) noexcept
|
||||||
: span_(&(s.at(0)), narrow_cast<std::ptrdiff_t>(s.length()))
|
: span_(const_cast<pointer>(s.data()), narrow_cast<std::ptrdiff_t>(s.length()))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
// from containers. Containers must have .size() and .data() function signatures
|
// from containers. Containers must have .size() and .data() function signatures
|
||||||
|
Loading…
Reference in New Issue
Block a user