Boost logo

Boost Users :

From: gast128 (gast128_at_[hidden])
Date: 2004-12-14 08:03:52


Dear all,

We all waited for the operator==. Unfortunately it does not compile on VC++
7.1. What do I wrong:

namespace Tstb
{
   int f0 ();
   int f1 (int a);
   int f2 (int a, int b);
   int f3 (int a, int b, int c);
}

void Test
{
   boost::function<int ()> fc1 = &Tstb::f0;
   boost::function<int ()> fc2 = &Tstb::f0;
   boost::function<int ()> fc3 = boost::bind(&Tstb::f1, 2);
  
   bool b = false;

   b = (fc1 == fc2);
   b = (fc1 == fc3);
   b = (fc2 == fc3);
}

It gives:
c:\Work\Test\Testmfc\Testboost\Testfunction.cpp(164) : error
C2666: 'operator`=='' : 4 overloads have similar conversions
        c:\Work Sdk\Boost\boost\function\function_base.hpp(562): could
be 'boost::enable_if_c<B,T>::type boost::operator
==<boost::function<Signature>>(const boost::function_base &,Functor)' [found
using argument-dependent lookup]
        with
        [
            B=true,
            T=bool,
            Signature=int (void),
            Functor=boost::function<int (void)>
        ]
        c:\Work Sdk\Boost\boost\function\function_template.hpp(594):
or 'void boost::operator ==<R,Allocator>(const
boost::function0<R,Allocator> &,const boost::function0<R,Allocator> &)' [found
using argument-dependent lookup]
        with
        [
            R=int,
            Allocator=std::allocator<void>
        ]
        c:\Work Sdk\Boost\boost\function\function_base.hpp(571):
or 'boost::enable_if_c<B,T>::type boost::operator
==<boost::function<Signature>>(Functor,const boost::function_base &)' [found
using argument-dependent lookup]
        with
        [
            B=true,
            T=bool,
            Signature=int (void),
            Functor=boost::function<int (void)>
        ]
        or 'built-in C++ operator==
(boost::function0<R,Allocator>::safe_bool,
boost::function0<R,Allocator>::safe_bool)'
        with
        [
            R=int,
            Allocator=std::allocator<void>
        ]
        and
        [
            R=int,
            Allocator=std::allocator<void>
        ]
        while trying to match the argument list '(boost::function<Signature>,
boost::function<Signature>)'
        with
        [
            Signature=int (void)
        ]
        and
        [
            Signature=int (void)
        ]
etc.

Wkr,
me


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net