operator overloading

Discussion in 'C++' started by Johan, Jan 16, 2005.

  1. Johan

    Johan Guest

    Hi,

    What does overloading operator () exactly do ?.

    John
    Johan, Jan 16, 2005
    #1
    1. Advertising

  2. Johan

    Rolf Magnus Guest

    Johan wrote:

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


    You get an object that you can use like a function.
    Rolf Magnus, Jan 16, 2005
    #2
    1. Advertising

  3. Johan

    osmium Guest

    "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
    osmium, Jan 16, 2005
    #3
  4. Johan

    rami Guest

    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
    rami, Jan 16, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Smith
    Replies:
    2
    Views:
    417
    Ivan Vecerina
    Oct 6, 2004
  2. Replies:
    11
    Views:
    727
    James Kanze
    May 16, 2007
  3. hurcan solter
    Replies:
    3
    Views:
    725
    Cholo Lennon
    Aug 29, 2007
  4. Replies:
    11
    Views:
    557
  5. Replies:
    2
    Views:
    307
Loading...

Share This Page