
18 Oct
2021
18 Oct
'21
11:06 p.m.
On 19/10/2021 03:34, Peter Dimov wrote:
So yes, having two string views may be bad, but the alternative is having four of five.
Those are not the only options. Another possibility is to define a boost::any_string_view which is *not* a clone of {std,boost}::string_view but just does conversion duck-typing boilerplate (i.e. it defines no methods of its own other than conversions, and the only useful thing you can do with one is to assign it to a {std,boost,other}::string_view). Ideally, this is what would appear in Boost.Core. This is somewhat auto-hostile, but that's not unprecedented (Boost.Units is also auto-hostile).