11/21 How do I pass a pointer to a member function in C++ or Java
(inner class and shit)?
\_ Java: You don't. C++: You don't without pretty serious pain.
\_ Wrong. Pass a java.lang.reflect.Method object. In C++,
just take the address. --pld
\_ Java: use a java.lang.reflect.Method object. C++: take
address. What do you mean by "inner class and shit"? -pld
\_ At my last job (where I respected most people for the most
part and thought they were pretty smart) everyone would
boo and hiss whenever anyone mentioned using reflection,
claiming that it was so slow and inefficient. How bad
is it to use? What are the performance issues?
\_ The more helpful answer is you shouldn't use a pmf or
Reflection unless you know what you're doing. Maybe you
should rethink your design. --pld
? _/
Reflection unless you need to, and know what you're doing.
Perhaps you should rethink your design and use a more natural
solution (eg, interaces and adapters) --pld
\_ reflection is very slow, not a good idea. avoid at all cost. |