Boost logo

Boost :

From: Stefan Slapeta (stefan_at_[hidden])
Date: 2006-02-09 16:13:32


John Maddock wrote:

> Which const?
>

From-type.

The compiler complained about the fact that there are only
non-const-argument constructors in auto_ptr:

Error : function call '[std::auto_ptr<const foo *>].auto_ptr({lval}
const std::auto_ptr<const foo *>)' does not match
'std::auto_ptr<const foo *>::auto_ptr(const foo **) throw()' (explicit)
'std::auto_ptr<const foo *>::auto_ptr(std::auto_ptr<const foo *> &)
throw()'
'std::auto_ptr<const foo *>::auto_ptr<typename
__T0>(std::auto_ptr<__T1_0> &) throw()'
'std::auto_ptr<const foo *>::auto_ptr(std::auto_ptr_ref<const foo *>)
throw()'

>
> The only case I can think of is along the lines of:
>
> class foo
> {
> public:
> foo(bar&);
> };
>
> is_convertible<bar,foo>::value should be true.
> is_convertible<const bar,foo>::value should be false.
>

I see ... that would of course change the semantics.

stefan


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk