StringSource: Use std::string_view

This commit is contained in:
Eelco Dolstra 2022-01-17 19:38:17 +01:00
parent 776eb97a43
commit 52ee7ec002

View file

@ -167,9 +167,9 @@ struct StringSink : Sink
/* A source that reads data from a string. */
struct StringSource : Source
{
const string & s;
std::string_view s;
size_t pos;
StringSource(const string & _s) : s(_s), pos(0) { }
StringSource(std::string_view s) : s(s), pos(0) { }
size_t read(char * data, size_t len) override;
};