In my my previous question it was suggested that the performance of my boost::spirit::x3
parser could be improved by parsing into a boost::string_view
I'd simply write what you want:
v = boost::string_view(&*b, std::distance(b,e));
You might want to check that storage is contiguous¹ as a concept check for your input range. In that respect, it might be clearer to also require the iterator to be random-access, and write:
v = boost::string_view(&*b, e-b);
¹ this is a requirement for string_view anyways