Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Overloading composite operators?

Reply
Thread Tools

Overloading composite operators?

 
 
bq
Guest
Posts: n/a
 
      08-12-2004
Hello,
This post is really two questions.
Question 1:
What is the current status on a revision of ISO C++, specifically
regarding plans for overloading composite operators? Some people in
this group probably would know. By "overloading composite operators" I
mean conversion of an expression like
A = B * C;
into a single function call (instead of three calls; one to "*",
another to copy and another to "="). Here A, B and C are of a
user-defined class type, say a type that represents matrices.

Question 2:
I've read quite a bit about using "lazy evaluation" to avoid
unnecessary copying. Lazy evaluation seems fairly complex and runs
into problems when an object appears more than once in an expression
e.g. matrix multiplication of the form
A = A * A;
or
A = B + C * A;
The advantage of overlaoding the composites "= *", "= +", etc, is that
the function that gets to do the work will have access to A, B and C,
so it can detect any aliasing and then behave accordingly. I am new to
C++ (only read Koenig & Moo, currently reading Josuttis' STL book), so
I'd like to know what the experts think of this issue. Does
overloading composite operators obviate the need for lazy evaluation?

Thanks.
bq
 
Reply With Quote
 
 
 
 
Jack Klein
Guest
Posts: n/a
 
      08-13-2004
On 12 Aug 2004 15:09:37 -0700, http://www.velocityreviews.com/forums/(E-Mail Removed) (bq) wrote in
comp.lang.c++:

> Hello,
> This post is really two questions.
> Question 1:
> What is the current status on a revision of ISO C++, specifically
> regarding plans for overloading composite operators? Some people in
> this group probably would know. By "overloading composite operators" I
> mean conversion of an expression like
> A = B * C;
> into a single function call (instead of three calls; one to "*",
> another to copy and another to "="). Here A, B and C are of a
> user-defined class type, say a type that represents matrices.
>
> Question 2:
> I've read quite a bit about using "lazy evaluation" to avoid
> unnecessary copying. Lazy evaluation seems fairly complex and runs
> into problems when an object appears more than once in an expression
> e.g. matrix multiplication of the form
> A = A * A;
> or
> A = B + C * A;
> The advantage of overlaoding the composites "= *", "= +", etc, is that
> the function that gets to do the work will have access to A, B and C,
> so it can detect any aliasing and then behave accordingly. I am new to
> C++ (only read Koenig & Moo, currently reading Josuttis' STL book), so
> I'd like to know what the experts think of this issue. Does
> overloading composite operators obviate the need for lazy evaluation?
>
> Thanks.
> bq


This group discusses the C++ language as it is. If you want to ask
questions about, or make proposals for, new language features in
future versions of the C++ standard, you need to post to the moderated
newsgroup news:comp.std.c.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      08-13-2004
Jack Klein wrote:
> [...]
> This group discusses the C++ language as it is. If you want to ask
> questions about, or make proposals for, new language features in
> future versions of the C++ standard, you need to post to the moderated
> newsgroup news:comp.std.c.


Correction:

news:comp.std.c++
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Overloading __init__ & Function overloading Iyer, Prasad C Python 3 09-30-2005 02:17 PM
Composite vs non composite Controls Mike ASP .Net Web Controls 4 03-11-2005 05:47 AM
Losing Composite Control property that another Composite Control ... Chad ASP .Net Building Controls 0 02-01-2005 09:01 PM
Possible to create a composite control that has a child control that is a validator that validates the composite control itself? Jonathan Eric Miller ASP .Net Building Controls 2 07-22-2004 10:58 PM
Composite control with dynamic composite controls sleigh ASP .Net 1 02-12-2004 06:24 PM



Advertisments