You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
while it != childs.rend(): ->
Cannot assign type 'reverse_iterator' to 'reverse_iterator[iterator]'
deref(it) ->
Cannot assign type 'iter_reference_t[iterator]' to 'Node_ptr'
My solution so far which fully compiles and runs successfully is extending reverse_iterator of the class I am using with 2 constructor definitions:
However, make_reverse_iterator can have some extra logic since the constructor version is not guaranteed to work and depends on implementation specific details in some cases. I am using the set class where indeed it does work at least in a Windows environment which is compiling with MSVC 2019 and its associated STL libraries.
Is there anyway to import this as the reverse_iterator must have a template class of an Iterator template class with its 5 template parameters. But I have tried many things, and I always end up getting back to the same problem that I have no way to get the reference (among other things like specific reverse_iterator not being templated in the class I am using).
Otherwise this might be a feature request as I realize especially supporting template constructs through C++20 is a pretty broad scope task.
Also separately, I see the definitions in libcpp for reverse_iterators seem to have a lot of iterators in them which could be fixed (for ++ and --). Some of them seem correct, others do not - quite inconsistent. A simple PR if this is in fact buggy which it strongly looks like e.g. for set:
So I can simply pass the result of make_reverse_iterator to the constructor of reverse_iterator in the class. This however requires a cast to <set[…].reverse_iterator(<set[…].reverse_iterator>object). Probably the best solution at the moment. Compiles and works though. Probably could just use a cast and not use the extra construction also. And after testing, <set[…].reverse_iterator>make_reverse_iterator(...) works fine, and is the solution then.
I would like to use the function
std::make_reverse_iterator
:Gives errors such as:
My solution so far which fully compiles and runs successfully is extending
reverse_iterator
of the class I am using with 2 constructor definitions:However,
make_reverse_iterator
can have some extra logic since the constructor version is not guaranteed to work and depends on implementation specific details in some cases. I am using theset
class where indeed it does work at least in a Windows environment which is compiling with MSVC 2019 and its associated STL libraries.Is there anyway to import this as the reverse_iterator must have a template class of an Iterator template class with its 5 template parameters. But I have tried many things, and I always end up getting back to the same problem that I have no way to get the reference (among other things like specific reverse_iterator not being templated in the class I am using).
Otherwise this might be a feature request as I realize especially supporting template constructs through C++20 is a pretty broad scope task.
Also separately, I see the definitions in libcpp for reverse_iterators seem to have a lot of iterators in them which could be fixed (for ++ and --). Some of them seem correct, others do not - quite inconsistent. A simple PR if this is in fact buggy which it strongly looks like e.g. for set:
The text was updated successfully, but these errors were encountered: