21 Feb
2002
21 Feb
'02
2:51 p.m.
how do I define const smart pointer? for example for "int" type 1. scoped_ptr<const int> 2. const scoped_ptr<int> If the latter then it may be better to re-define get() as follows T* get(){ return px; } // never throws const T* get()const { return px; } // never throws Now scoped_ptr::get() is defined as follows T* get() const { return px; } // never throws The same apply to other accessors (operator-> and so on)