[Boost-bugs] [Boost C++ Libraries] #7658: Ambiguity error with function overloads

Subject: [Boost-bugs] [Boost C++ Libraries] #7658: Ambiguity error with function overloads
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-11-07 16:11:48


#7658: Ambiguity error with function overloads
------------------------------------------------+---------------------------
 Reporter: Ulrich Brandstätter <ulien@…> | Owner: dgregor
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: function
  Version: Boost 1.51.0 | Severity: Problem
 Keywords: |
------------------------------------------------+---------------------------
 The following code (relevant for a convenient thread-callback API) fails
 to compile with VC2010 due to a C2668 error:


 {{{
 typedef boost::function<void (int i)> fooCallback;
 typedef boost::function<void (int i, int k)> barCallback;

 void TestBF(fooCallback fc) {}
 void TestBF(barCallback bc) {}
 void MyFunc (int a, int b) {}

 int main(int argc, char **argv) {

     TestBF (&MyFunc);
     return 0;
 }
 }}}



 Without calling TestBF in main, everything is fine, there is no multiple
 definition error.
 A (most likely) related discussion thread can be found here:
 [http://boost.2283326.n4.nabble.com/Boost-Function-detecting-ignored-
 arguments-td4631919.html].

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7658>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:11 UTC