Boost logo

Boost Users :

Subject: Re: [Boost-users] [ptr_container] Abstract Key type in ptr_map<Key, Val> impossible?
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2010-06-27 22:45:05


AMDG

Mikhail Levin wrote:
> The following code would not compile.
>
> struct Key {
> bool operator<(const Key&) const;
> virtual void blah() const = 0;
> };
>
> struct Val {
> /* */
> };
>
> boost::ptr_map<Key, Val> map;
>
> Although
> boost::ptr_set<Key> set;
> seems to work.
>

I believe that ptr_map stores the key be value.

In Christ,
Steven Watanabe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net