Topic: ->* overloading
Author: lichtman@kotw0002.mch.sni.de (Manfred Lichtmannegger)
Date: 18 Oct 1994 09:09:45 GMT Raw View
Hello,
I had some trouble to overload ->* to make my
smart pointer template more complete. The problem
is that ->* is declared as a binary operator, but
when I want to apply it to a pointer to member
function I see no straightforward way to do
this. In the expression
(smartPtr->*methodPtr)(params)
->* should return a function with only params as
parameters but without a this-pointer. (*)
The other problem is that I have to introduce a
->* operator for each kind of pointer to member.
I would propose to define overloading of ->*
analogous to overloading of ->. It would return
T* or T& and the compiler can use this pointer
to evaluate the righthandside of the operator.
Greetings Manfred
(*) Defining a temporary object remembering the
this-pointer and the pointer to the member
function with an overloaded call operator
to apply the pointer to member function to
this this-pointer with params as arguments
seems to be a little bit overcomplicated.
For each signature I have to introduce an
extra call operator!
email: Manfred.Lichtmannegger@mch.sni.de
SNI BU BA NM 212
at Mch P/K room 91215
Rosenheimerstr. 116
81669 Muenchen Germany
Tel: 49-(0)89/4144-7723 Fax: 49-(0)89/4144-7720