Boost logo

Boost :

From: Thomas Holenstein (tholenst_at_[hidden])
Date: 2000-05-26 08:01:57


Hello,

OK, here are some suggestions about Nico's array class.
Some of them might have been discussed before. So please
ignore these.

I think

- rangecheck should be private (Does the aggregate
  restriction does hold for methods?)

- an array<int, N> should be comparable to a array<short, N>,
  so we probably need more templatized versions of operator==,
  operator<, etc.

- an array<int, N> should be comparable to an array<int, M>,
  returnig false (I'm not sure of this...)

- sometimes it would be useful to have full grown iterators,
  instead of just pointers. (see for example the libstdc++-v3
  faq on http://sourceware.cygnus.com/libstdc++/faq/#5_1 )

- Why do you include <iterator>?

- I think Jeremy's right, use mismatch for !=. It's faster.
  

Furthermore I suggest not making it an aggregate: after
all, if you want a array of 1000 Elements of a class which
has no default constructur, you could get quite busy.
Otherwise it would be possible to have a constructor
array<..>(const T& elem = T())

Thomas


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