Boost logo

Boost :

From: rwgk (rwgk_at_[hidden])
Date: 2002-02-05 19:24:01

--- In boost_at_y..., "Andrei Alexandrescu" <andrewalex_at_h...> wrote:
> > I should confess that I've never thought about that. I have no
> > if it's possible to implement it in such a way without using
> > allocation.

Extracting the relevant information from this paper is not easy.
Could you please help?

I am working on an array family for numeric applications.
Here is a fragment of my equivalent of the proposed

  template <typename ElementType, std::size_t N>
  class small_plain
      ElementType elems[N];

      small_plain() { m_size = 0; }
      small_plain(std::size_t n) { m_size = n; }

      ElementType* begin() { return elems; }


      std::size_t m_size;

What would I have to do to avoid construction of the N elements?
Instead of
      ElementType elems[N];
would I have
      char_with_align<ElementType> char_like_elems[N];
What would my begin() do? Something like
      ElementType* begin() { reinterpret_cast<ElementType>
char_like_elems; }

Would you have example source code that is not too
convoluted with other concepts?


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