Boost logo

Boost :

From: Mark Rodgers (mark.rodgers_at_[hidden])
Date: 2000-05-31 04:38:24


From: Dave Abrahams <abrahams_at_[hidden]

> OK, bring on the comments.

Are users ever expected to use associative_vector directly,
or just indirectly via vector_set and vector_multiset? If
the latter, shouldn't associative_vector be in a detail
namespace, and perhaps associative_vector.hpp could live in
the detail directory??? Without documentation it's hard
to tell... :-)

It doesn't compile with Borland C++Builder 4 or BCC 5.5.
The first complaint is because there is no such thing as
std::identity. Certainly an identity functor is useful,
so perhaps a boost::identity would be in order. I added
one to the top of vector_set.hpp to get the ball rolling.

The next problem was associative_vector's assignment operator.
Borland didn't recognise it as one and generated a default.
Then it couldn't disambiguate the generated assignment operator
and the one supplied. I changed this to

    Self& operator=(const Self &rhs)
      { Self temp(rhs); swap(temp); return *this; }

I also had problems with the test program's sorted and
uniqued functions. For example, in the line

  const std::vector<int> unique_input = uniqued(sorted_input);

the compiler instantiated uniqued<const std::vector<int> >
since that is the type of sorted_input. Naturally it didn't
like sorting or erasing from containers of this type! I
changed it to

// test_set
  const std::vector<int> sorted_input
        = sorted<std::vector<int> >(input);
  const std::vector<int> unique_input
       = uniqued<std::vector<int> >(sorted_input);

// test_multiset
  const std::vector<int> sorted_input
        = sorted<std::vector<int> >(input);

That made it all work and the tests then ran without error.
Now I can try it out with some tests of my own, and will
ponder it all further. I'll get back to you if I have
any comments.

Mark


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