Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > operator overloading

Reply
Thread Tools

operator overloading

 
 
Johan
Guest
Posts: n/a
 
      01-16-2005
Hi,

What does overloading operator () exactly do ?.

John


 
Reply With Quote
 
 
 
 
Rolf Magnus
Guest
Posts: n/a
 
      01-16-2005
Johan wrote:

> Hi,
>
> What does overloading operator () exactly do ?.


You get an object that you can use like a function.

 
Reply With Quote
 
 
 
 
osmium
Guest
Posts: n/a
 
      01-16-2005
"Johan" writes:

> What does overloading operator () exactly do ?.


The buzz word you need to know to learn more is functor. Aka function
object. A few minutes of googling didn't turn up anything I really liked.
(Wikipedia seems to be down - not a good start). If you have access to a
decent technical library the best write up I know of is in _Mastering
Object-Oriented Design ion C++_ by Horstmann, p. 220.

Note that this is the only way you can have a comma in the argument list.

I found these two links, don't really like either one of them, but they were
the only two of the first thirty or so hits that even seemed worth saving.

http://www.free-web-template.org/fu/functor.html

http://www.sgi.com/tech/stl/functors.html


 
Reply With Quote
 
rami
Guest
Posts: n/a
 
      01-16-2005
Andrei Alexandrescu's Generic Programming is the best book i have read
about the techniques used with templates to generalize your approach.
It has a detailed chapter on functors.

Also if you ae actually looking for functors you may find good
tutorials in boost library.
Regards,
Ramneek
osmium wrote:
> "Johan" writes:
>
> > What does overloading operator () exactly do ?.

>
> The buzz word you need to know to learn more is functor. Aka

function
> object. A few minutes of googling didn't turn up anything I really

liked.
> (Wikipedia seems to be down - not a good start). If you have access

to a
> decent technical library the best write up I know of is in _Mastering


> Object-Oriented Design ion C++_ by Horstmann, p. 220.
>
> Note that this is the only way you can have a comma in the argument

list.
>
> I found these two links, don't really like either one of them, but

they were
> the only two of the first thirty or so hits that even seemed worth

saving.
>
> http://www.free-web-template.org/fu/functor.html
>
> http://www.sgi.com/tech/stl/functors.html


 
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 operator->*() and operator->() gob00st@googlemail.com C++ 2 02-21-2009 04:26 AM
overloading operator->*() and operator->() gob00st@googlemail.com C++ 11 02-20-2009 08:52 PM
user defined conversion operator or operator overloading? hurcan solter C++ 3 08-29-2007 07:39 PM
Why is overloading operator. (member operator) forbidden? dascandy@gmail.com C++ 11 05-16-2007 07:54 PM
Operator overloading on "default" operator John Smith C++ 2 10-06-2004 10:22 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57