Re: Genericizing move_to for range_attribute

Seth <[email protected]> Thu, 3 Jun 2021 12:59:18 +0200
Newsgroups gmane.comp.parsers.spirit.general
Message-ID <[email protected]>
> And then you can use either of those as Attributes to the raw[]
> directive, instead of boost::iterator_range. For more modern C++20
> code, it's nice to not have to bring iterator_range into the picture.

Ah. I see. That's a pretty limited scope.

I'm curious whether `move_to` from iterator range is used internally for
different scenarios (like container attributes), so it might require
some more impact analysis.

That said, I wasn't previously aware of `x3::traits::is_range`. I was
going to point out that that seems like a very poor name for this trait
(as "range" means a different thing 99.9% of the time; std::vector<char>
is a range, and so is "Hello world"). But given that it exists, and with
this meaning, I think I agree that your change makes sense if sense
nothing else breaks.

There's been many many times I wrote the conversion action.

Do you happen to know whether `string_view`/`span` statically asset
contiguous iterators? Libstdc++ doesn't seem to correctly implement the
iterator category for it (yet?), and we probably should try to help
people not shoot themselves in the foot

Seth