<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:root@zta.lk" title="Aleksej Lebedev <root@zta.lk>"> <span class="fn">Aleksej Lebedev</span></a>
</span> changed
<a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - ostream_iterator::operator* is not constant"
href="http://llvm.org/bugs/show_bug.cgi?id=19425">bug 19425</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>ASSIGNED
</td>
<td>RESOLVED
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>---
</td>
<td>INVALID
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - ostream_iterator::operator* is not constant"
href="http://llvm.org/bugs/show_bug.cgi?id=19425#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - ostream_iterator::operator* is not constant"
href="http://llvm.org/bugs/show_bug.cgi?id=19425">bug 19425</a>
from <span class="vcard"><a class="email" href="mailto:root@zta.lk" title="Aleksej Lebedev <root@zta.lk>"> <span class="fn">Aleksej Lebedev</span></a>
</span></b>
<pre>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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>