← Back to team overview

dolfin team mailing list archive

Re: question concerning Generic* operator=

 

> 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?
>
> --
> Anders

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





Follow ups

References