Boost logo

Boost :

Subject: [boost] [smart_ptr] post 1.34 regression
From: Gennadiy Rozental (rogeeff_at_[hidden])
Date: 2009-04-20 14:58:38


Hi,

Following snippet compiles fine with 1.34.1

--------------------------
#include "boost/shared_ptr.hpp"

class Base {
public:
   virtual ~Base() {}
};

class Derived;

boost::shared_ptr<Base>
foo()
{
    return boost::shared_ptr<Derived>();
}

class Derived : public Base {};
--------------------------

It fails though with boost 1.36:
a.cpp: In function `boost::shared_ptr<Base> foo()':
a.cpp:13: error: conversion from `boost::shared_ptr<Derived>' to non-scalar type
`boost::shared_ptr<Base>' requested

Looks like it caused by additional argument in template constructor
sp_enable_if_convertible.

Is it intentional? Can we still support old use case?

Gennadiy


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