[smart_ptr] explicit instantiation of boost::shared_ptr

Hi there,
I got a bug report that the following code doesn't compile:
#include

Hi, The easiest fix I can think of is to change return px[ i ]; to return static_cast< typename boost::detail::sp_array_access< T >::type
( px[ i ] );
This seems to work for me with the current develop (master should be the
same). I get no other errors.
-----Original Message-----
From: Petr Machata
Sent: Tuesday, November 11, 2014 21:55
To: Peter Dimov
Cc: boost@lists.boost.org
Subject: [smart_ptr] explicit instantiation of boost::shared_ptr
Hi there,
I got a bug report that the following code doesn't compile:
#include

"Peter Dimov"
The easiest fix I can think of is to change
return px[ i ];
to
return static_cast< typename boost::detail::sp_array_access< T
::type ( px[ i ] );
Ah, clever, thanks! Do you want to track this issue somehow? Do I open a trac ticket, or create a pull request, or...?
This seems to work for me with the current develop (master should be the same). I get no other errors.
Those other errors were caused by wrong (missing) -I flags. Nothing of interest. Thanks, Petr.

Petr Machata
return static_cast< typename boost::detail::sp_array_access< T >::type > ( px[ i ] );
Do you want to track this issue somehow? Do I open a trac ticket, or create a pull request, or...?
Actually, array_fail_array_access.cpp fails with this patch (as in, it compiles successfully, which is a failure). Arguably it's not a big deal that the subscription operator exists if it doesn't actually do anything. But I expect the base class variant would keep the test failing. Let me know what you think. Thanks, Petr.

Petr Machata wrote:
::type > ( px[ i ] ); ... Actually, array_fail_array_access.cpp fails with this patch (as in, it compiles successfully, which is a failure). Arguably it's not a big deal
return static_cast< typename boost::detail::sp_array_access< T that the subscription operator exists if it doesn't actually do anything. But I expect the base class variant would keep the test failing. Let me know what you think.
I've "fixed" the test instead (on develop).
participants (2)
-
Peter Dimov
-
Petr Machata