BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000706 [uClibc++] Other major always 02-08-06 18:31 02-08-06 21:13
Reporter faye2040 View Status public  
Assigned To gkajmowi
Priority normal Resolution fixed  
Status resolved   Product Version 0.1.12
Summary 0000706: compiling problem of bind2nd and mem_fun in uClibc++
Description Dear Mr Garrett Kajmowicz

Here is my sample c++ code:

#include <cstring>
#include <algorithm>
#include <list>

using namespace std;

class A {

public:
 A(const char *n): name(n) {}
 bool is(const char *n) const { return strcmp(n, name) == 0; }

private:
 const char *name;
};

typedef list<A *> aList;


void main()
{

 aList al;
 A a1("a1"), a2("a2");

 al.push_back(&a1);
 al.push_back(&a2);

 const aList& l = al;

 aList::const_iterator f = find_if(l.begin(), l.end(),
  bind2nd(mem_fun(&A::is), "a3"));

 if (f != l.end())
  return;
}


The error was reported by g++:

./include/functional: In function `std::binder2nd<Operation>
std::bind2nd(const Operation&, const T&) [with Operation =
std::mem_fun1_t<bool, const A, const char*>, T = char[3]]':
test.cpp:32: instantiated from here
./include/functional:256: error: no matching function for call to
`std::binder2nd<std::mem_fun1_t<bool, const A, const char*>
>::binder2nd(const std::mem_fun1_t<bool, const A, const char*>&, const A*)'
./include/functional:241: note: candidates are:
std::binder2nd<std::mem_fun1_t<bool, const A, const char*>
>::binder2nd(const std::binder2nd<std::mem_fun1_t<bool, const A, const
char*> >&)
./include/functional:246: note:
std::binder2nd<Operation>::binder2nd(const Operation&, const typename
Operation::second_argument_type&) [with Operation = std::mem_fun1_t<bool,
const A, const char*>]



Anthony Lee
Additional Information
Attached Files

- Relationships

- Notes
(0001068)
gkajmowi
02-08-06 21:13

Found fix. I was using the wrong type internally for parameters. It's a very trick bug to catch, though one which is obvious when implementing. Anyways, fixed in SVN.
 

- Issue History
Date Modified Username Field Change
02-08-06 18:31 faye2040 New Issue
02-08-06 18:31 faye2040 Status new => assigned
02-08-06 18:31 faye2040 Assigned To  => gkajmowi
02-08-06 21:13 gkajmowi Status assigned => resolved
02-08-06 21:13 gkajmowi Fixed in Version  => 0.2.0
02-08-06 21:13 gkajmowi Resolution open => fixed
02-08-06 21:13 gkajmowi Note Added: 0001068


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker