Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2006-03-15 09:16:02


signal_template.hpp:213 is:

    #if BOOST_WORKAROUND(BOOST_MSVC, <= 0x1700)

What is 0x1700 supposed to mean here? The comment mentions 6.0 and 7.0,
which correspond to 1200 and 1300 (decimal). This workaround disables
disconnect() for non-groups on all versions of MSVC; doesn't this cause
unexpected test failures?

Furthermore, if I try to compile the example I was sent:

#include <boost/signal.hpp>
#include <boost/bind.hpp>
using namespace boost;

typedef signal<void(int)> sig_t;
typedef sig_t::slot_function_type func_t;

struct A
{
    void f(int)
    {
    }
};

int main()
{
    sig_t sig;
    A a;
    func_t x = bind(&A::f, ref(a), _1);
    sig.connect(x);
    sig(42);
    sig.disconnect(x);
    sig(42);
}

with the workaround set to 1300, it still doesn't work:

C:\Documents and Settings\Peter
Dimov\cvs\boost\boost\signals\signal_template.hpp(242) : error C2666:
'boost::operator`=='' : 4 overloads have similar conversions
        C:\Documents and Settings\Peter
Dimov\cvs\boost\boost\function\function_template.hpp(689): could be 'void
boost::operator ==<R,T0,Allocator>(const boost::function1<R,T0,Allocator>
&,const boost::function1<R,T0,Allocator> &)'
        with
        [
            R=void,
            T0=int,
            Allocator=std::allocator<void>
        ]
        C:\Documents and Settings\Peter
Dimov\cvs\boost\boost\function\function_base.hpp(649): or
'boost::enable_if_c<B,T>::type boost::operator
==<boost::signal1<R,T1,Combiner,Group,GroupCompare,SlotFunction>::slot_function_type>(Functor,const
boost::function_base &)'
        with
        [
            B=true,
            T=bool,
            R=boost::detail::function_traits_helper<boost::add_pointer<void
(int)>::type>::result_type,
            T1=boost::detail::function_traits_helper<boost::add_pointer<void
(int)>::type>::arg1_type,
            Combiner=boost::last_value<void>,
            Group=int,
            GroupCompare=std::less<int>,
            SlotFunction=boost::function<void (int)>,
            Functor=boost::signal1<boost::detail::function_traits_helper<boost::add_pointer<void
(int)>::type>::result_type,boost::detail::function_traits_helper<boost::add_pointer<void
(int)>::type>::arg1_type,boost::last_value<void>,int,std::less<int>,boost::function<void
(int)>>::slot_function_type
        ]
        C:\Documents and Settings\Peter
Dimov\cvs\boost\boost\function\function_base.hpp(640): or
'boost::enable_if_c<B,T>::type boost::operator ==<Function>(const
boost::function_base &,Functor)'
        with
        [
            B=true,
            T=bool,
            Function=func_t,
            Functor=func_t
        ]
        or 'built-in C++
operator==(boost::function1<R,T0,Allocator>::safe_bool,
boost::function1<R,T0,Allocator>::safe_bool)'
        with
        [
            R=void,
            T0=int,
            Allocator=std::allocator<void>
        ]
        and
        [
            R=void,
            T0=int,
            Allocator=std::allocator<void>
        ]
        while trying to match the argument list
'(boost::signal1<R,T1,Combiner,Group,GroupCompare,SlotFunction>::slot_function_type,
const func_t)'
        with
        [
            R=boost::detail::function_traits_helper<boost::add_pointer<void
(int)>::type>::result_type,
            T1=boost::detail::function_traits_helper<boost::add_pointer<void
(int)>::type>::arg1_type,
            Combiner=boost::last_value<void>,
            Group=int,
            GroupCompare=std::less<int>,
            SlotFunction=boost::function<void (int)>
        ]
        C:\Documents and Settings\Peter
Dimov\cvs\boost\boost\signals\signal_template.hpp(224) : see reference to
function template instantiation 'void
boost::signal1<R,T1,Combiner,Group,GroupCompare,SlotFunction>::do_disconnect<T>(const
Function &,boost::mpl::bool_<C_>)' being compiled
        with
        [
            R=boost::detail::function_traits_helper<boost::add_pointer<void
(int)>::type>::result_type,
            T1=boost::detail::function_traits_helper<boost::add_pointer<void
(int)>::type>::arg1_type,
            Combiner=boost::last_value<void>,
            Group=int,
            GroupCompare=std::less<int>,
            SlotFunction=boost::function<void (int)>,
            T=func_t,
            Function=func_t,
            C_=false
        ]
        testbed.cpp(23) : see reference to function template instantiation
'void
boost::signal1<R,T1,Combiner,Group,GroupCompare,SlotFunction>::disconnect<func_t>(const
T &)' being compiled
        with
        [
            R=boost::detail::function_traits_helper<boost::add_pointer<void
(int)>::type>::result_type,
            T1=boost::detail::function_traits_helper<boost::add_pointer<void
(int)>::type>::arg1_type,
            Combiner=boost::last_value<void>,
            Group=int,
            GroupCompare=std::less<int>,
            SlotFunction=boost::function<void (int)>,
            T=func_t
        ]

--
Peter Dimov
http://www.pdimov.com 

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