
20 Jan
2010
20 Jan
'10
6:59 p.m.
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.