
20 Jan
2010
20 Jan
'10
9:31 p.m.
Am Wednesday 20 January 2010 19:59:11 schrieb Gennadiy Rozental:
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?
I'm not sure why that is, static_pointer_cast is an overload without any SFINAE involvement that should still match to shared_ptr, but the workaround is simple: remove the unnecessary "void" template argument in get_concrete.