dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #07735
Re: question concerning Generic* operator=
On Tue, Apr 29, 2008 at 09:48:54PM +0200, kent-and@xxxxxxxxx wrote:
> > On Tue, Apr 29, 2008 at 06:46:05PM +0200, Kent-Andre Mardal wrote:
> >>
> >> We have the following operator= in GenericVector
> >>
> >> /// Assignment operator
> >> virtual const GenericVector& operator= (const GenericVector& x) = 0;
> >>
> >> and a similar one in eg. EpetraVector:
> >>
> >> /// Assignment operator
> >> const EpetraVector& operator= (const EpetraVector& x);
> >>
> >> Is this operator an implementation of the operator in GenericVector ?
> >>
> >> Kent
> >
> > I don't think so. We have the same thing in all the concrete classes:
> > first
> >
> > virtual const FooVector& operator= (const GenericVector& x) = 0;
> >
> > and then also
> >
> > const FooVector& operator= (const FooVector& x) = 0;
> >
> > I don't know why we have both. I thought you added this?
> >
>
> I guess I`m to blame. I added it because otherwise I got into trouble.
> Anyway, I just added
>
> GenericVector& operator=(real a) in GenericVector and
> EpetraVector& operator=(real a) in EpetraVector,
>
> and this seems inconsistent with the other operator=.
> But seems to work fine. I am just confused about operators.
>
> Kent
(I didn't see this before my post just a minute ago.)
ok, I'll trust you that we need the extra assignment operator, for now
;-).
--
Anders
References