Skip to content
Snippets Groups Projects
  • Nat Goodspeed's avatar
    6dcbbaeb
    Replace boost::ptr_map<name, etc> with std::map<name, shared_ptr>. · 6dcbbaeb
    Nat Goodspeed authored
    On Windows, unlike on Mac or Linux, boost::ptr_map<> started insisting on this
    concept of clonability. In other words, it wants to own a unique instance of
    the pointee; if you copy a value_type -- even to dereference an iterator! --
    it wants to construct a whole new instance of the mapped_type. That's nuts. A
    std::map<..., boost::shared_ptr<>> has the property I want (the mapped_type
    goes away when the entry is erased), plus it's willing to pass around the
    shared_ptr to the same instance of the mapped_type. This change also permits
    simplifying a couple awkward kludges I'd already had to make to accommodate
    ptr_map's idiosyncracies.
    6dcbbaeb
    History
    Replace boost::ptr_map<name, etc> with std::map<name, shared_ptr>.
    Nat Goodspeed authored
    On Windows, unlike on Mac or Linux, boost::ptr_map<> started insisting on this
    concept of clonability. In other words, it wants to own a unique instance of
    the pointee; if you copy a value_type -- even to dereference an iterator! --
    it wants to construct a whole new instance of the mapped_type. That's nuts. A
    std::map<..., boost::shared_ptr<>> has the property I want (the mapped_type
    goes away when the entry is erased), plus it's willing to pass around the
    shared_ptr to the same instance of the mapped_type. This change also permits
    simplifying a couple awkward kludges I'd already had to make to accommodate
    ptr_map's idiosyncracies.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.