Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reverse_fold has no static assert for requiring bidirectional sequence #211

Open
Kojoley opened this issue Apr 1, 2019 · 1 comment
Open

Comments

@Kojoley
Copy link
Contributor

Kojoley commented Apr 1, 2019

The example from documentation https://www.boost.org/doc/libs/1_69_0/libs/fusion/doc/html/fusion/algorithm/iteration/functions/reverse_fold.html compiles fine as-is, but replacing vector with cons yield a compile error. This seems to be a regression, because I came to it at debugging failure in Proto tests, but it might be introduced a long time ago.

Update: the Proto test/example is simply violating Fusion invariants. I opened a PR to fix it boostorg/proto#15.

@Kojoley
Copy link
Contributor Author

Kojoley commented Apr 1, 2019

It turns out that Fusion is fine, reverse_fold requires a Bidirectional Sequence while cons is a Forward Sequence, though it could have a static assert like reverse_view has

BOOST_STATIC_ASSERT((
is_base_of<
bidirectional_traversal_tag
, typename traits::category_of<first_type>::type>::value));

@Kojoley Kojoley changed the title reverse_fold is broken for cons reverse_fold has no static assert for requiring bidirectional sequence Apr 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant