Re: [eigen] overloaded operator new |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] overloaded operator new
- From: "Gael Guennebaud" <gael.guennebaud@xxxxxxxxx>
- Date: Mon, 5 Jan 2009 18:27:19 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=0aeS+1cvZY7zT8DW9ejL2X+5lsT28glKqTpZBndNs5U=; b=K9a/uiUQMXJJFq9qjqE0sNcM5K6GVik2YyBHDnp3t27JFNtSc4KH6RofdghrtliPdG aq+RwalDtO0sXANc/fvwspdc2pF7DrmE7ZUh148hzwXSK1vOI0ERb9c6ZA1WsJUr4oQt LD2SG6dmTeEb/7BsvjEsC6dV1Esphjx+mRYxs=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=nrgoTGDinXzE/TFKUC1+1WfP/GtBRfvvJg+N7h9iQ3tceNBQtde49F5U4WeYI2woeR u5+960uSa2L7/Ur/aq0lhrDz0ShDHpAm1dbJlQGLTlN/84ithk0Y6537bVpnHYHaNx0H Am0MnPKBsohcPAWlnhyCUW/PdCkgCsGGHF8nA=
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
>
> ---
>
>
---