Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
No way to use C++ template with template parameters #3252
I would like to use the function
Gives errors such as:
My solution so far which fully compiles and runs successfully is extending
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:
I got it to work by being quite clever with:
and in the set class:
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