
16 Sep
2009
16 Sep
'09
6:46 a.m.
Andrey Semashev wrote:
Noncopyable nature doesn't mean its type is insignificant. This change would break the interface as the following code won't work anymore:
template< template< typename > class Ptr > void make_a(Ptr< A >& p);
scoped_ptr< A > p; make_a(p);
This may not be the most frequent use pattern but nonetheless it's valid.
I'd opt for this change if it wouldn't affect the interface in the breaking way. Otherwise, I like the way it is.
The difficulty that your example demonstrates is caused by the nature of template template parameters. scoped_ptr should not be blamed for that. BR, Dmitry