Bug 534 - non-const Ptr<T>::operator * () returns const reference
non-const Ptr<T>::operator * () returns const reference
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: core
ns-3-dev
PC Linux
: P5 normal
Assigned To: ns-bugs
: bug
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-03-27 08:08 UTC by Nicola Baldo
Modified: 2009-04-16 07:32 UTC (History)
1 user (show)

See Also:


Attachments
program reproducing the bug (707 bytes, text/x-c++src)
2009-03-27 08:08 UTC, Nicola Baldo
Details
fix (462 bytes, patch)
2009-03-27 08:09 UTC, Nicola Baldo
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nicola Baldo 2009-03-27 08:08:45 UTC
Created attachment 404 [details]
program reproducing the bug

non-const Ptr<T>::operator * () returns const reference. 

This cause compilation of the attached program to fail with the following errors:

../scratch/ptr-dereference-and-assign.cc: In function ‘int main(int, char**)’:
../scratch/ptr-dereference-and-assign.cc:38: error: passing ‘const One’ as ‘this’ argument of ‘One& One::operator=(const One&)’ discards qualifiers
../scratch/ptr-dereference-and-assign.cc:48: error: passing ‘const Two’ as ‘this’ argument of ‘Two& Two::operator=(const Two&)’ discards qualifiers
Comment 1 Nicola Baldo 2009-03-27 08:09:41 UTC
Created attachment 405 [details]
fix
Comment 2 Mathieu Lacage 2009-04-16 07:20:44 UTC
I can't find any good reason to refuse this patch so, let's merge this.
Comment 3 Mathieu Lacage 2009-04-16 07:32:12 UTC
changeset e7873b6d3f5e