|
Boost Users : |
From: nckgl (nickgl_at_[hidden])
Date: 2002-02-21 09:51:29
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)
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net