|
Boost : |
From: shunsuke (pstade.mb_at_[hidden])
Date: 2007-05-30 11:59:38
Thorsten Ottosen wrote:
> shunsuke skrev:
>> Hi,
>>
>> I found a snippet from <boost/assign/ptr_list_of.hpp>:
>>
>> template< class T >
>> class generic_ptr_list
>> {
>> // ...
>> public:
>> template< class PtrContainer >
>> operator std::auto_ptr<PtrContainer>() const
>> { .. }
>> };
>>
>> IIRC, this automatic conversion doesn't work on any conforming compiler.
>
> Why?
The rule seems complicated. :-(
This is because it requires two user-defined conversions?
generic_ptr_list -> operator auto_ptr() -> operator auto_ptr_ref() -> auto_ptr
In the case of lvalue:
generic_ptr_list -> operator auto_ptr&() -> auto_ptr
I hope a lawyer will look into this posting. :-)
Regards,
-- Shunsuke Sogame
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk