|
Boost : |
From: Alexei Alexandrov (alexei.alexandrov_at_[hidden])
Date: 2006-04-17 06:51:13
JOAQUIN LOPEZ MU?Z <joaquin <at> tid.es> writes:
>
> OK, I've carefully read the standard and I understand now that
> convertiblity between X and itself is tantamount to
> X being copy constructible (my naive understanding was that
> X is always convertible to X by definition.) For the purposes
> of my code, I can then replace the calls of the form
>
> is_convertible<X,Y>
>
> with calls to
>
> template<typename From,typename From>
> struct is_same_or_convertible:
> mpl::or_<
> is_same<From,To>
> is_convertible<From,To>
> >
> {};
>
> and thus avoid executing is_convertible<From,To> whith
> From=To.
>
I checked this fix (having fixed some obvious typos in it) out with the test
case I posted earlier (in multi_index problem thread) - it doesn't help (sigh).
The error is:
D:\src\3rd-parties\boost/boost/type_traits/is_convertible.hpp(254): error: no
suitable user-defined conversion from "const name_record" to "const
base_record" exists
BOOST_STATIC_CONSTANT(bool, value =
^
detected during:
instantiation of
class "boost::detail::is_convertible_basic_impl<From, To> [with
From=boost::detail::is_convertible_impl<const name_record, const
base_record>::ref_type, To=const base_record]" at line 286
instantiation of class "boost::detail::is_convertible_impl<From,
To> [with From=const name_record, To=const base_record]" at line 362
instantiation of
class "boost::detail::is_convertible_impl_dispatch<From, To> [with From=const
name_record, To=const base_record]" at line 409
instantiation of class "boost::is_convertible<From, To> [with
From=const name_record, To=const base_record]" at line 25 of "D:\src\3rd-
parties\boost/boost/mpl/aux_/preprocessed/plain/or.hpp"
instantiation of class "boost::mpl::aux::or_impl<false, T1, T2, T3,
T4> [with T1=boost::is_convertible<const name_record, const base_record>,
T2=boost::mpl::false_, T3=boost::mpl::false_, T4=boost::mpl::false_]" at line
50 of "D:\src\3rd-parties\boost/boost/mpl/aux_/preprocessed/plain/or.hpp"
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk