Boost logo

Boost :

From: Powell, Gary (powellg_at_[hidden])
Date: 2002-03-29 18:16:20


Asger>While I understand the code above, I just re-read the
documentation for
Asger>operator->* a few times. It is still greek to me. I didn't know
there
Asger>was a operator->* in C++ at all, so that is probably why. Maybe
you could Asger>help poor souls like me, and explain this a bit more?

Well I didn't know that it could be overloaded until someone else
pointed it out, Might have been Jens Maurer, but its been a while.

I think of operator->* as holding an offset to either a member variable
or a member function, depending on what its pointing to. It's a way
cool operator for things that have inheritence trees. But it also turns
out to be useful for LL stuff as well.

Relationship to bind:
  It's just syntactic sugar. They are the same for member functions, in
fact we wrote bind first, and then implemented operator->* to call the
same underlying code that bind uses. To tell you the truth, I wish I had
operator.(), and sometimes reading (&_1)->*FooFn(), isn't as clear to
me, as using "bind". But its available and you can use it or not.

Re: Learning LL,
  I find playing around with it one of the best ways. Simple stuff
first, as the compile errors can get pretty bad.

  Yours,
 -Gary-


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk