Must assignment be a member function always?



 DEVELOP > c-Plus-Plus > Must assignment be a member function always?

LINK TO THIS PAGE  


rating :  0   |  0


  Page 1 of 1

1

 
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
.


  Page 1 of 1

1

 


Related Articles
error: must use '.*' or '->*' to call pointer-to-member function in '__unary_op (...)'
Help: template function specialisation must accept scalar types only
You must include the .cpp file instead of only .h file when using templates in VC++ ...?
must iterator be bound to owner/source?
c++ classic books, must have books ?
Standard 23.1 - std::map::value_type must be assignable?
Re: I have no idea why this isn't working - must be missing something simple
initial value of reference to non-const must be an lvalue
xlc - A template dependent name that is a type must be qualified with "typename"
YOU MUST KNOW THIS MAN
I must rebuild when I excute project
Need C++ Beautifier - must be VERY configurable
When must "=" be overloaded?
Re: I have no idea why this isn't working - must be missing something simple
must pass by value
 

NEWER

pg.1232     pg.940     pg.716     pg.544     pg.412     pg.311     pg.234     pg.175     pg.130     pg.96     pg.70     pg.50     pg.35     pg.24     pg.16     pg.10     pg.6     pg.3     pg.1

OLDER