|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2002-11-30 14:44:13
"Peter Dimov" <pdimov_at_[hidden]> writes:
> From: "David Abrahams" <dave_at_[hidden]>
>> "Peter Dimov" <pdimov_at_[hidden]> writes:
>>
>> > It's fairly easy to provide a get_pointer for std::auto_ptr. ;-)
>>
>> One that works for regular pointers as well, and works on msvc6? I'd
>> love to see that!
>
> Now I'm not sure what you mean.
>
> namespace boost
> {
> template<class T> T * get_pointer(T * p) { return p; }
> template<class T> T * get_pointer(std::auto_ptr<T> const & p) { return
> p.get(); }
> }
Oh, good point. I guess that VC6 just prevents us from supplying a
generalized form:
template<class T> typename T::element_type get_pointer(T const& p) { return p.get(); }
Not very general anyway, I know ;-)
-Dave
-- David Abrahams dave_at_[hidden] * http://www.boost-consulting.com Boost support, enhancements, training, and commercial distribution
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk