Boost logo

Boost :

From: nee Spangenberg (dsp_at_[hidden])
Date: 2003-12-10 08:35:07


Hello Boosters,

I observe some signature inconsistencies of the auto_array class
template in the current CVS sandbox and those of the XX_array
smart pointer class templates and the array class template and
want to ask how to resolve these.
My point of discussion concerns the signess of its argument, not
the constness of this member function. We all are aware of
discussions like "signed/unsigned integers in interfaces", but I
think one has to make a clear cut, where to use which signature.

- Using ptrdiff_t (as in the smart pointer classes) matches the
   built-in signature of array-accesible pointers. We can view
   an array smart pointer as an interface-wrapper of such a
   native array.

- Using the size_type member of the array class template
  supports the Standard Container Requirements, so we
  have some consistency here, also.

- The auto_array class template defines an usigned size_type
  and uses this as an argument of its operator[] overload.

Hmmh, I really don't like the last point, because it tries to merge
to different interfaces here. Should it not use ptrdiff_t as well,
because auto_array is more a smartpointer than a container
wrapper?

Btw: Did someone honestly think about *two* overloads, one signed,
one unsigned or is that simply bull...dozer?

Similar problems are found in the auto_temp_buf class, where
the in-class typedef relates ptrdiff_t to its size_type....

Greetings from Bremen,

Daniel


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