To clarify a possible precedence ambiguity in the English language: We are taking about "smart (pointer to member)", not "(smart pointer) to member".
I would define a smart pointer to member as a class X with operator ->* (T* lhs, X rhs)
overloaded.
In his article "Implementing operator->* for Smart Pointers", Scott Meyers only briefly touches smart pointer to member, because back then (1999) the specific problem was difficult enough for raw pointer to member (side note: the latter is solved elegantly with lambdas here).
Anyhow, Scott Meyers writes in a footnote:
Shortly after writing the draft of this article, one of my consulting clients showed me a problem that was naturally solved by smart pointers to members. I was surprised, too.
I've tried to find an example for such a natural smart pointer to member. But I could neither come up with anything myself nor did online search uncover what I was looking for.
Do you know of any real world "smart pointer to member" example?
EDIT:
I'm not looking for any ->*
overload (as done by some EDSLs).
Aiming at examples with semantics that resemble the built-in ->*
, my definition above explicitly requires lhs
to be a raw pointer.