http://llvm.org/bugs/show_bug.cgi?id=19425

Aleksej Lebedev <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |INVALID

--- Comment #2 from Aleksej Lebedev <[email protected]> ---
You are probably right.

It is very confusing though.
Operator * doesn't really modify the iterator. It is the same way as *p doesn't
modify p when p is a pointer.

It is legal to do this with pointers. The following code does compile:

void write_5(int *const &i)
{
    *i = 5;
}

int main()
{
    int m[2];
    int *p = m;
    write_5(p);
    ++p;
}

The reason for iterators being treated not the same way as pointers is probably
very "technical" as it is often in C++.
Anyway, whatever the reason I apologize I didn't doublecheck this.

Thank you.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to