By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,605 Members | 1,473 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,605 IT Pros & Developers. It's quick & easy.

Derive other function name from __FUNCTION__? And call the function.

P: n/a
I would have one more question related to a problem, about which I have
discussed earlier:

http://groups.google.fi/group/comp.l...07f29eaecd75c3

I would need to call a private method from a public method this way:

class wrapper_c
{
public:

int method1()
{
return intermediateMethod<int>(&wrapper_c::finalMethod1);

}
But I would not want to write to each methodX the names of the
finalMethodX
(the names of the finalMethodXs, which the methodXs should call).

Is there any mechanism (just) to derive the name of the finalMethodX
from methodX?
(And then call the finalMethdoX from methodX.)
Is it possible?

I would like to do something like this:
int method1()
{
return
intermediateMethod<int>(&wrapper_c::nameDerivedFro m__FUNCTION__);

}

int method2()
{
return
intermediateMethod<int>(&wrapper_c::nameDerivedFro m__FUNCTION__);

}

( I would not like to write a different finalMethodX name to different
methods...)
I mentioned the __FUNCTION__, just to try to make my question more
understandable.
I am interested about any kinds of solutions. It does not need to use
the __FUNCTION__ (macro).

I do not wish to make any separate lists / manual mappings between the
methodX and derivedMethodX methods.

Thank you!

Nov 16 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a

If I could use a macro to implement the issue,
it would be ok too for this kind of a situation(!).
(Originally I was trying to avoid using a macro, but I think it could
be tolerable in this situation, if it is only applicaple.)

I could use a macro to implement this:

intermediateMethod<int>(&wrapper_c::nameDerivedFro m__FUNCTION__);

(I do not know yet is it possible.)
Tips are welcome!

Nov 16 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.