| Topic: |
DEVELOP > c-Plus-Plus |
| User: |
"Ioannis Vranos" |
| Date: |
04 Jan 2008 11:13:35 AM |
| Object: |
Must assignment be a member function always? |
In TC++PL3 on page 676, it is mentioned at the bottom:
"I introduced a new Vector (rather than using a valarray) because I
needed to define assignment (and assignment must be a member function;
11.2.2). However, valarray is a strong candidate for the representation
of that Vector".
OK, the assignment must be defined in a way that performs the evaluation
of U=M*V+W, so we can't use a valarray directly since it has its
assignment operations already defined.
However (and having checked 11.2.2 where I did not find something
relevant), "must assignment be a member function" always?
.
|
|
| User: "Victor Bazarov" |
|
| Title: Re: Must assignment be a member function always? |
04 Jan 2008 11:22:38 AM |
|
|
Ioannis Vranos wrote:
In TC++PL3 on page 676, it is mentioned at the bottom:
"I introduced a new Vector (rather than using a valarray) because I
needed to define assignment (and assignment must be a member function;
11.2.2). However, valarray is a strong candidate for the
representation of that Vector".
OK, the assignment must be defined in a way that performs the
evaluation of U=M*V+W, so we can't use a valarray directly since it
has its assignment operations already defined.
However (and having checked 11.2.2 where I did not find something
relevant), "must assignment be a member function" always?
See [over.*****]/1, the first sentence.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
.
|
|
|
|

|
Related Articles |
|
|