Afficher un message
Vieux 06/04/2008, 21h39   #7
jwest
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Overload = and [ ] to store complex value terms in class

On 2008-04-06, joe <joeycook@mail.com> wrote:
>
>> adaptor & operator = ( const std::complex<double> & 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.
  Réponse avec citation
 
Page generated in 0,05836 seconds with 9 queries