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

vec_iterator member typedef iterator_concept should only be defined in C++20 #195

Closed
theodelrieu opened this issue Sep 29, 2021 · 2 comments

Comments

@theodelrieu
Copy link

Hello,

After upgrading Boost to 1.77.0, I had compiler errors when trying to combine boost::container::flat_map and range-v3.

I'm using apple-clang 13, in C++17 mode.

vec_iterator added the following line, with no #ifdef around:

typedef std::contiguous_iterator_tag                                             iterator_concept;

Problem is that std::contiguous_iterator_tag is only defined in C++20, and it relies on a forward declaration found in boost/move/detail/iterator_traits.hpp (which is illegal IIRC).

Since range-v3 provides emulated concepts, it has to check the inheritence hierarchy of these tags, which requires them to be defined. As it makes use of iterator_concept the compiler is not happy:

/Users/theo/.conan/data/range-v3/0.11.0-r3/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/concepts/concepts.hpp:878:13: error: incomplete type >'std::contiguous_iterator_tag' used in type trait expression
          META_IS_BASE_OF(U, T) &&
TristanFloch pushed a commit to TristanFloch/container that referenced this issue Sep 30, 2021
TristanFloch pushed a commit to TristanFloch/container that referenced this issue Jan 4, 2022
TristanFloch pushed a commit to TristanFloch/container that referenced this issue Jan 4, 2022
@igaztanaga
Copy link
Member

I've tried to detect if the standard library defines std::contiguous_iterator_tag in commit before forward declaring it in the commit:

boostorg/move@78f26da

and then, following your suggestion, defined vec_iterator::iterator_concept when std::contiguous_iterator tag it's defined:

19e68ee

Let me know if this fix helps with the issue.

TristanFloch pushed a commit to TristanFloch/container that referenced this issue Jan 5, 2022
@igaztanaga
Copy link
Member

I've just checked that with the mentioned commits on Boost.Move and Boost.Container makes range-v3 happy with boost::container::vector in C++17 and C++20 modes.

igaztanaga added a commit that referenced this issue Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants