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
0001065 [uClibc++] Other major always 10-05-06 02:41 05-29-07 17:17
Reporter peter_schueller View Status public  
Assigned To gkajmowi
Priority normal Resolution open  
Status assigned   Product Version 0.2.0
Summary 0001065: map comparison operator does not work
Description the map comparison operator== returns true if x.c == y.c && x.data = y.data.

the "=" is obviously a typo and should be ==

x.c is less<Key> per default, but neither less<T> nor binary_function<T> defines the operator==, also, for the contents of the map the comparison operator does not matter.

also, the map comparison operator== is not declared friend of the map class so it is not allowed to access c and data.

i have included a patch below which makes the operator work for me
Additional Information @Index: include/map
===================================================================
--- include/map (revision 1475)
+++ include/map (working copy)
@ -532,6 +532,8 @@
        using base::data;
        using base::c;
 
+ template <class _Key, class _T, class _Compare, class _Allocator> friend bool
+ operator==(const map<_Key,_T,_Compare,_Allocator>& x, const map<_Key,_T,_Compare,_Allocator>& y);
 };
 
 
@@ -778,7 +780,7 @@
        template <class Key, class T, class Compare, class Allocator> bool operator==
                (const map<Key,T,Compare,Allocator>& x, const map<Key,T,Compare,Allocator>& y)
        {
- if(x.c == y.c && x.data = y.data){
+ if(x.data == y.data){
                        return true;
                }
                return false;
Attached Files

- Relationships

- Notes
(0002415)
gkajmowi
05-29-07 17:17

I've finished re-writing the map and set classes. Do you know if this issue still exists at this point? There is no test case for the first problem (less<Key> problem) that I can see to confirm resolution of issue.
 

- Issue History
Date Modified Username Field Change
10-05-06 02:41 peter_schueller New Issue
10-05-06 02:41 peter_schueller Status new => assigned
10-05-06 02:41 peter_schueller Assigned To  => gkajmowi
05-29-07 17:17 gkajmowi Note Added: 0002415


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker