Adding a constructor to UTF8Range that uses std::string
Summary:
Currently UTF8Range has a constructor that allows you construct an object of type UTF8Range using only an object of type folly::Range. Adding a constructor so that we can construct an UTF8Range object using a std::string.
Currently,
void sampleMethod(UTF8StringPiece sp) {...}
/*
...
*/
std::string str = "example";
folly::UTF8Range utf8Range(str);
folly::StringPiece sp(str);
sampleMethod(utf8Range); // works
sampleMethod(sp); // works
sampleMethod(str); // doesn't work
This diff hopes to fix this issue.
Reviewed By: ddrcoder
Differential Revision:
D3221144
fb-gh-sync-id:
dd6ec4d7790d4602dccb3b63a4861d358aed3608
fbshipit-source-id:
dd6ec4d7790d4602dccb3b63a4861d358aed3608