Group: comp.lang.c++
From: jwest
Date: Sunday, April 06, 2008 2:39 PM
Subject: Re: Overload = and [ ] to store complex value terms in class

On 2008-04-06, joe wrote:
>
>> adaptor & operator = ( const std::complex & val ) const
>> {
>> v.real_data[index] = val.real();
>> v.imag_data[index] = val.imag();
>
> ---> return *this;
>
>
>> }
>>
>
> This example is well more thought out than mine. (Disregard mine in
> favor of Gianni's version). Except for the above correction; although
> I think I prefer the adapter's operator just to return 'val'

I'll change a statement in my OP a bit. This wasn't beyond my ability,
this was WAY beyond my ability :). Thank you both very much. I'll get it
implemented in the code with a citation to your posts on Google. The
class will primarily be used by engineering students with most of their
programming experience in Matlab, so I'm pretty confident that making
access look as much like access to a standard array/vector will ultimately
save us a lot of time in the future.

Safety Articles | Usenet Groups | 20lbs in 30 days