/* ex_7_4.c++ */

#include <iostream>
#include <map>
using namespace std;

typedef unsigned char phy_addr[6];

class bt_addr {
	phy_addr addr;
public:
	bt_addr(const phy_addr& ba) {memcpy(addr, ba, sizeof(phy_addr));}
	const phy_addr& get_phy_addr() const {return addr;}
	bool operator< (const bt_addr& other) const;
};


bool bt_addr::operator< (const bt_addr& other) const {
	return (memcmp(this->addr, other.get_phy_addr(), sizeof(phy_addr)) < 0);
}


typedef map<bt_addr, short> bt_dev_map;

int main(void) {
	bt_dev_map m;
	phy_addr a1 = { 1,1,1,1,1,1 };
	m[a1] = 1;
	phy_addr a2 = { 0,3,2,4,9,7 };
	m[a2] = 2;
	
	bt_dev_map::iterator it;
	it = m.begin();
	do {
		cout << it->second << endl;
	} while (++it != m.end());

	return 0;
} 