What purpose does `gsl::string_span` aim at?
问题 During reading Microsoft's implementation of Cpp Core Guidelines, I run across two questions: Why is gsl::string_span provided where gsl::span already works well? Why is gsl::zstring_span provided where std::string is already guaranteed to be null-terminated since C++11? Any illustrating situations will be highly appreciated. 回答1: span("Hi") is {'H', 'i', '\0'} whereas string_span("Hi") is {'H', 'i'} . string_span checks for the terminating null character and does not include it in the span.