|
Boost : |
From: Daniel Frey (daniel.frey_at_[hidden])
Date: 2002-06-25 02:49:23
Dietmar Kuehl wrote:
>
> On Monday 24 June 2002 13:48, Daniel Frey wrote:
> > I noticed that boost doesn't have any helper for sizeof_array.
>
> One of the very first submissions to Boost was my "array.h" header which
> hasn't made it from the beta directory into the approved library part yet: It
> also contains obviously useful function 'begin()' and 'end()' for the obvious
> propose.
Time to look at it again? Maybe we can merge the best of it into a new
header/library. What I noticed about your array_traits.h are three
things:
- It states that it needs "bleeding edge compiler technology", but it is
some years old. What about current compilers?
- Values are calculated by functions, which prevents using them as
compile-time statics. I tried to avoid this by adding an intermediate
class, which could work for array_traits, too.
- You mix C++ arrays with STL containers. Although they are related in a
way, this would - again - prevent using them as compile-time statics, as
STL-containers are dynamic.
Before we start implementing anything, we should agree on the objectives
of such a library. I'd prefer not to mix STL-stuff with the "old"
arrays. Other opinions?
> > PS: I'm never sure if 'size_t' or 'std::size_t' is correct :)
>
> It depends on the headers you have included: If you included <cstddef>, it
> is 'std::size_t'; if you included <stddef.h> you can use both. There are other
> headers (eg. <cstdlib>/<stdlib.h>) also declare "size_t".
Let me rephrase my question: What is the recommended use of size_t?
Which header should I include, should I add std::, ...
Regards, Daniel
-- Daniel Frey aixigo AG - financial training, research and technology Schloß-Rahe-Straße 15, 52072 Aachen, Germany fon: +49 (0)241 936737-42, fax: +49 (0)241 936737-99 eMail: daniel.frey_at_[hidden], web: http://www.aixigo.de
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk