Re: [eigen] overloaded operator new

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


On Mon, Jan 5, 2009 at 3:59 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
> Hi List *cough* Gael *cough*
>
> Currently, we have:
>
> struct ei_with_aligned_operator_new : WithAlignedOperatorNew {};

well, they are both struct (not class), so everything is always public.

> so this is private inheritance. So my understanding is that in
> ei_with_aligned_operator_new (and thus in any subclass of it) the
> aligned operator new is private.
>
> So HOW can it be called when from a global context I do
> X *x = new X;
> where X inherits ei_with_aligned_operator_new?
>
> Should we use public inheritance instead, like this?
> struct ei_with_aligned_operator_new : public WithAlignedOperatorNew {};
>
> Notice that classes inheriting ei_with_aligned_operator_new already
> inherit it publicly.
>
> Also notice that if we make that change we need to do the same in the
> new ei_matrix_with_aligned_operator_new defined in Matrix.h.
>
> Cheers,
> Benoit
>
> ---
>
>

---


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/