Fixed a bug on creating a span from empty string

This commit is contained in:
Anna Gringauze 2015-12-07 15:22:11 -08:00
parent c6f3579ad1
commit e19f6b5f36

View File

@ -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