28 #include <boost/noncopyable.hpp>
29 #include <boost/scoped_ptr.hpp>
42 class ImplPtr :
private boost::noncopyable
44 typedef typename boost::scoped_ptr<_Impl>::unspecified_bool_type unspecified_bool_type;
47 typedef _Impl element_type;
50 ImplPtr( _Impl * impl_r = 0 ) : _impl( impl_r ) {}
53 void reset( _Impl * impl_r = 0 ) { _impl.reset( impl_r ); }
55 void swap(
ImplPtr rhs ) { _impl.swap( rhs._impl ); }
58 operator unspecified_bool_type()
const {
return _impl; }
60 const _Impl & operator*()
const {
return *_impl; }
61 const _Impl * operator->()
const {
return _impl.get(); }
62 const _Impl *
get()
const {
return _impl.get(); }
64 _Impl & operator*() {
return *_impl; }
65 _Impl * operator->() {
return _impl.get(); }
66 _Impl *
get() {
return _impl.get(); }
69 boost::scoped_ptr<_Impl> _impl;
79 inline bool operator< ( ImplPtr<_Impl> & lhs,
ImplPtr<_Impl> & rhs ) {
return lhs.get() < rhs.get(); }