Boost logo

Boost :

Subject: [boost] sp_convertible<> on MSVC10
From: Zachary Turner (divisortheory_at_[hidden])
Date: 2010-02-19 09:41:57


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


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