
Consider the following code: class Base { public: virtual ~Base() = 0 {}; virtual double get() = 0; }; class D1 : public Base { public: D1(double n) : val_(n) {} double get() const { return val_; } private: double val_; }; class D2 : public Base { D2(double n) : val_(n) {} double get() const { return val_; } private: double val_; }; bool operator < (const Base& left, const Base& right) { return (left.get() < right.get()); } I can create a ptr_set of Base like this: boost::ptr_set<Base> set; But I can't create a ptr_map with Base as key, like this: boost::ptr_map<Base, Base> map; The problem is that Base is abstract and so the key cannot be instantiated by ptr_map. What is the cause for this distinction between ptr_set and ptr_map. -- Aaron Levy aaron.levy@yandex.com