sp_convertible<> on MSVC10

I'm using 1.42, not trunk, so I don't know if this has already been addressed, but sp_convertible fails with some errors for me. 2>C:\dev\boost\1.42.0\boost/smart_ptr/detail/sp_convertible.hpp(49): error C2070: 'void': illegal sizeof operand 2> C:\dev\boost\1.42.0\boost/smart_ptr/detail/sp_convertible.hpp(68) : see reference to class template instantiation 'boost::detail::sp_convertible<Y,T>' being compiled 2> with 2> [ 2> Y=error_info_tag_t, 2> T=boost::exception_detail::error_info_base 2> ] 2> C:\dev\boost\1.42.0\boost/exception/info.hpp(159) : see reference to class template instantiation 'boost::detail::sp_enable_if_convertible<Y,T>' being compiled 2> with 2> [ 2> Y=error_info_tag_t, 2> T=boost::exception_detail::error_info_base 2> ] 2> C:\dev\boost\1.42.0\boost/exception/detail/exception_ptr.hpp(170) : see reference to function template instantiation 'const E &boost::operator <<<boost::unknown_exception,boost::tag_original_exception_type,const type_info*>(const E &,const boost::error_info<Tag,T> &)' being compiled 2> with 2> [ 2> E=boost::unknown_exception, 2> Tag=boost::tag_original_exception_type, 2> T=const type_info * 2> ] 2> C:\dev\boost\1.42.0\boost/exception/detail/exception_ptr.hpp(137) : see reference to function template instantiation 'void boost::unknown_exception::add_original_type<std::exception>(const E &)' being compiled 2> with 2> [ 2> E=std::exception 2> ] 2>C:\dev\boost\1.42.0\boost/exception/info.hpp(159): error C2664: 'boost::exception_detail::error_info_container::set' : cannot convert parameter 1 from 'boost::shared_ptr<T>' to 'const boost::shared_ptr<T> &' 2> with 2> [ 2> T=error_info_tag_t 2> ] 2> and 2> [ 2> T=boost::exception_detail::error_info_base 2> ] 2> Reason: cannot convert from 'boost::shared_ptr<T>' to 'const boost::shared_ptr<T>' 2> with 2> [ 2> T=error_info_tag_t 2> ] 2> and 2> [ 2> T=boost::exception_detail::error_info_base 2> ] 2> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called The line it's pointing to is this: enum _vt { value = sizeof( f( static_cast<Y*>(0) ) ) == sizeof(yes) }; and in particular it's having a problem determining the return type of f( static_cast<Y*>(0) ). It's thinking that whatever overload it's finding for f() here returns type void. Which doesn't make sense neither one returns void. Any ideas? Zach

Zachary Turner wrote:
The line it's pointing to is this:
enum _vt { value = sizeof( f( static_cast<Y*>(0) ) ) == sizeof(yes) };
and in particular it's having a problem determining the return type of f( static_cast<Y*>(0) ). It's thinking that whatever overload it's finding for f() here returns type void. Which doesn't make sense neither one returns void.
Any ideas?
None. It works on MSVC 7.1, 8.0, 9.0. I'm surprised that they don't test with Boost for regressions. :-) You can #define BOOST_SP_NO_SP_CONVERTIBLE to avoid the error.

On Fri, Feb 19, 2010 at 9:02 AM, Peter Dimov <pdimov@pdimov.com> wrote:
Zachary Turner wrote:
The line it's pointing to is this:
enum _vt { value = sizeof( f( static_cast<Y*>(0) ) ) == sizeof(yes) };
and in particular it's having a problem determining the return type of f( static_cast<Y*>(0) ). It's thinking that whatever overload it's finding for f() here returns type void. Which doesn't make sense neither one returns void.
Any ideas?
None. It works on MSVC 7.1, 8.0, 9.0. I'm surprised that they don't test with Boost for regressions. :-)
You can #define BOOST_SP_NO_SP_CONVERTIBLE to avoid the error.
This is really weird, but I can't reproduce it from my work computer. Maybe I need to look into it more.

Theres a regresion test failure on VC10 in this area: http://tinyurl.com/y8sfdos Thats on the VC10 release candidate. Theres a blog post @ http://blogs.msdn.com/vcblog/archive/2010/02/10/visual-studio-2010-release-c... which suggests that they've tested something with Boost, but who knows what they've actually tried.

On Fri, Feb 19, 2010 at 9:43 AM, Richard Webb <richard.webb@boldonjames.com>wrote:
Theres a regresion test failure on VC10 in this area: http://tinyurl.com/y8sfdos
Thats on the VC10 release candidate.
Theres a blog post @
http://blogs.msdn.com/vcblog/archive/2010/02/10/visual-studio-2010-release-c... which suggests that they've tested something with Boost, but who knows what they've actually tried.
I see. I guess I should report it to connect, it says they've tested with 1.40 but not 1.42

On Fri, Feb 19, 2010 at 9:50 AM, Zachary Turner <divisortheory@gmail.com>wrote:
On Fri, Feb 19, 2010 at 9:43 AM, Richard Webb < richard.webb@boldonjames.com> wrote:
Theres a regresion test failure on VC10 in this area: http://tinyurl.com/y8sfdos
Thats on the VC10 release candidate.
Theres a blog post @
http://blogs.msdn.com/vcblog/archive/2010/02/10/visual-studio-2010-release-c... which suggests that they've tested something with Boost, but who knows what they've actually tried.
I see. I guess I should report it to connect, it says they've tested with 1.40 but not 1.42
I reported it. In the meantime, how about implementing a workaround for MSVC10 release candidate that simply uses std::tr1::is_convertible? template< class Y, class T > struct sp_convertible { enum _vt { value = std::is_convertible<Y*, T*>::value }; }; works fine. Zach

On 20.02.2010 2:04, Zachary Turner wrote:
On Fri, Feb 19, 2010 at 9:50 AM, Zachary Turner<divisortheory@gmail.com>wrote:
In the meantime, how about implementing a workaround for MSVC10 release candidate that simply uses std::tr1::is_convertible?
template< class Y, class T> struct sp_convertible { enum _vt { value = std::is_convertible<Y*, T*>::value }; };
works fine.
Just a side note. While making such workarounds, please, don't forget about non-MSVC STL implementations, such as STLPort. AFAIK, it doesn't have TR1 in it.

Just out of curiosity, are you using the VC++ 10 release candidate? --Beman

On Feb 20, 2010, at 4:49 AM, Beman Dawes <bdawes@acm.org> wrote:
Just out of curiosity, are you using the VC++ 10 release candidate?
--Beman _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Yes
participants (5)
-
Andrey Semashev
-
Beman Dawes
-
Peter Dimov
-
Richard Webb
-
Zachary Turner