<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/78433>78433</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
the user_iterator_impl is broken
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
natanelh-mobileye
</td>
</tr>
</table>
<pre>
https://en.cppreference.com/w/cpp/named_req/Iterator
according to all documentation, C++ iterators should have operator* that returns a reference to T, but in user_iterator_impl it returns T itself; that is, it returns a User* instead of User*&. this can cause issues for example, when you have something like:
```c
x = op.users();
y = make_filter_range(x, foo);
auto z = *y.begin(); // maybe a bit of code smell, but should work!
// this errors with something like " unexpected operator* "
```
that is an iterator and should behave as expected of one!
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsk0GPmzAQhX_NcBktggGScOCQbITU-_YcGTMEN8amttkk_fUVkOxuV5WQkDHv88x7Y-G9OhvmCooDFMdITKG3rjIiCMO6fxlsozTfOWpse6_6EEYP2R6oBqrZxHIcHXfs2EiOpR2A6itQLccRqDZi4Pbk-DdQ_SOwE8E6SI6Q7IWU1rXKnDFYFFpja-U0sAkiKGuAXvEV6AB0QPXQefS9nXSLvXhntOODRnsMvQjoOEzOeBT4Uc6MfptRzRRQGZw8u9MTd1LDqFF9Ct9QBc-6g-ywEpWfteor-qfn5URlfGDRou2en4A2MYZeeZTCoBSTZ1TeT-yxsw75JoZR8wy89mzwbqe1D28HDv3sg1YXno1d7IFNsj5yXd8QsiPaMZ578EA7oBKyw7p5XzYHceFTp3Rgd3LCnBlod5sP7Kz9-reYgsU_iwRof48bPivzQcQ1WBzEvWEU2Kgwdylty-gH1vrp5yOMq3UXoPRR9apdbGDn5syuKvTfmkQgwsnwbWQZuP0nSiD6ZsC6fASCwnzMAwrTPqtoeDFTePykdmgNA6UYtVXWllkpIq7SbVLkZZ7lRdRX6XabJGJXyqZIdl1RJgUVCe3asuVykxVNpCpKKE_SdJsSFXkWc0NJyplsJW02BaeQJzwIpWOt34fYunO0ZF5td3mWRVo0rP1yr4gMX9eBmFssjpGrZs1LM5095IlWPvhPSlBBcxV6_u_MemycvbCJJqe_XcizCv3UPO7hjHu8XkZnf7EMQPU6lUD1UuTfAAAA__-bkErU">