C++: How to put a pointer to a function, in a class template, without typedef'ing it?
Code:
#include <iostream> Code:
anisha@linux-uitj:~> g++ help.cpp -Wall |
I think your two related threads would have been easier to answer if they were one thread. So I will add my answer for your question in this thread into my answer in the other thread:
http://www.linuxquestions.org/questi...6/#post4279709 |
don't avoid typedefs they are very good style.
look at the X windows headers as a good example. |
You're using a value-based template parameter, not a type-based parameter; therefore, it won't compile with typename. Also, Parameter is undefined; if you move it to the second position and specify a return type for Method, it compiles. The problem is, you can't infer Parameter.
Code:
template <class MyDummyClass, typename Parameter, void (MyDummyClass::*Method)(Parameter)> |
All times are GMT -5. The time now is 06:09 AM. |