---------------
#include <map>
#include <iostream>
class IP
{
public:
int a;
int b;
int c;
int d;
};
int main() {
map <IP, int> ip_balance;
IP ip;
ip_balance[ip]++;
return 0;
}
-------------------------
(упрощенная вырезка)
не компилируется, говорит:
/usr/include/c++/3.2.2/bits/stl_function.h: In member function `bool
std::less<_Tp>::operator()(const _Tp&, const _Tp&) const [with _Tp = IP]':
/usr/include/c++/3.2.2/bits/stl_map.h:224: instantiated from `_Tp& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const _Key&) [with _Key = IP, _Tp = int, _Compare = std::less<IP>, _Alloc = std::allocator<std::pair<const IP, int> >]'
test.cpp:28: instantiated from here
/usr/include/c++/3.2.2/bits/stl_function.h:197: no match for `const IP& < const
IP&' operator
-----------------
понимаю, что вопрос ламерский -ногами не пинать.