@masonwheeler said in Contiguous iterators (C++)?:
Yeah, that's generally the best way to handle C++ issues: give up and move to a sane language.
That's unfair (I know, I saw the ). Another "saner" language would just tell you "you can't do that!" and that would be the end of it. The "problem" @cvi is trying to solve is to have a bunch of code he's already written (and code he will write in the future) make better use of the information available to the type system so the compiler makes a better choice at compile time, without changing the code he's already written.
He could solve the problem trivially if he was willing to change the code and manually select the function to call each time, which is what "saner" languages would force you to do (or worse, make the choice at run time). The beauty of C++ (in the sense that Cthulhu is beautiful) is that it lets you solve problems other languages don't even know exist.