Boost logo

Boost :

From: vesa_karvonen (vesa_karvonen_at_[hidden])
Date: 2002-02-15 04:38:24


--- In boost_at_y..., "Emily Winch" <emily_at_b...> wrote:
> There's an associative_list,[...]
> for anyone who wants to have a look.[...]

I had a very quick peek and haven't actually tried the code, but I
think I spotted a bug:

    self_type& operator=(const self_type& other){
      self_type temp = other;
      temp.swap(other);
// ^^^^ ^^^^^
      return *this;
    }

Some random thoughts:

At any rate, this is interesting - mainly because this class is not
exactly either a run-time nor a compile-time component.

The name "associative_list" is perhaps a bit too generic for this
class. Mainly because it doesn't say that it uses types as keys and
objects as values.

My intuition tells me that something is missing. Perhaps it is the
higher order algorithms or perhaps something else.

Have you considered mutating algorithms such as push_front<key>
(assoc_list,value)?

Does the associative_list allow multiple elements with the same key?


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk