https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90919

            Bug ID: 90919
           Summary: vector::iterator is constructible from a pointer
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

This compiles:

#include <vector>
int main()
{
  std::vector<int> v{1, 2, 3};
  std::vector<int>::iterator iter(&v[0]);
}

Maybe it would be better if it didn't, it just encourages non-portable code.
The whole point of __normal_iterator is that it's not just a pointer.

Reply via email to