RE: [boost] [Boost-bugs] [ boost-Bugs-1059388 ] shared_ptr::operator->() const return type should be const

I think you're wront about this, shared_ptr should behave just like a pointer (in this aspect). it really doesn't matter if the pointer is const or not, what matters is the constness of the pointee. typedef int* pint_t; const pint_t p = new int(1); //p is const(same as int * const) int &ref_to_int = *p; //but *p isn't eyal. -----Original Message----- From: SourceForge.net [mailto:noreply@sourceforge.net] Sent: Wednesday, November 03, 2004 12:29 PM To: noreply@sourceforge.net Subject: [boost] [Boost-bugs] [ boost-Bugs-1059388 ] shared_ptr::operator->() const return type should be const Bugs item #1059388, was opened at 2004-11-03 13:29 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1059388&group_id=7586 Category: smart_ptr Group: None Status: Open Resolution: None Priority: 5 Submitted By: Roland (vzaznobin) Assigned to: Peter Dimov (pdimov) Summary: shared_ptr::operator-> () const return type should be const Initial Comment: shared_ptr::operator-> () const return type should be const const T * operator-> () const; T * operator-> (); ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1059388&group_id=7586 ------------------------------------------------------- This SF.Net email is sponsored by: Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux. http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click _______________________________________________ Boost-bugs mailing list Boost-bugs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/boost-bugs _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

"Eyal Farago" <eyal.farago@actimize.com> writes:
I think you're wront about this, shared_ptr should behave just like a pointer (in this aspect). it really doesn't matter if the pointer is const or not, what matters is the constness of the pointee.
typedef int* pint_t;
const pint_t p = new int(1); //p is const(same as int * const) int &ref_to_int = *p; //but *p isn't
eyal.
The OP is likely not watching this list. See the note below in the original message:
You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1059388&group_id=7586
-- Dave Abrahams Boost Consulting http://www.boost-consulting.com
participants (2)
-
David Abrahams
-
Eyal Farago