Subject: [boost] shared_ptr/intrusive_ptr conflict
From: Gennadiy Rozental (rogeeff_at_[hidden])
Date: 2010-01-20 13:59:11


Hi,

Following snippet fails to compile with gcc 4:

----------------
#include <boost/shared_ptr.hpp>
#include <boost/intrusive_ptr.hpp>

boost::shared_ptr<void> sharedPtr;

template <class T>
boost::shared_ptr<T>
get_concrete()
{
    return boost::static_pointer_cast<T,void>(sharedPtr);
}

int main()
{
     boost::shared_ptr<int> p = get_concrete<int>();
}
----------------

due to the presence of intrusive_ptr.hpp. it seems like SFINAE should have
kicked in.

Any help with how to work this around? Do we need to fix above header?

Gennadiy.