Boost logo

Boost :

From: jsiek_at_[hidden]
Date: 2000-01-10 05:00:34

Gavin Collings writes:
> > > array_ref takes raw memory and turns it into an array, it makes more
> > > sense for it to provide array style initialisation too.
> >
> > Do you mean the initializer list? I wasn't intending array_ref to
> > be fixed size.
> No, I was thinking of calling std::construct() / uninitialized_xxx in an
> array_ref constructor, and std::destroy in the destructor. That wouldn't be
> appropriate in the case you describe, since initialisation, destruction is
> external to array_ref. It would be more useful in the case where a derived
> class provides raw memory and utilises array_ref to turn it into an initialized
> array of T (and tidies up). Perhaps I misread your example as an example of
> preferred usage? It could be implemented as an option using an extra
> constructor and a flag, or a template argument...

Ahh, the code I gave was just implementation, not usage. I'll do an
example with the next upload.

Boost list run by bdawes at, gregod at, cpdaniel at, john at