I am facing a problem with templated member function pointer. The code is as shown below.
#include <String>
#include <iostream>
template<typename T>
struct method_ptr
{
typedef void (T::*Function)(std::string&);
};
template <class T>
class EventHandler
{
private:
method_ptr<T>::Function m_PtrToCapturer;
};
e:\EventHandler.h(13) :
error C2146: syntax error : missing ';' before identifier 'm_PtrToCapturer'
I am facing this error.
Even If I use
method_ptr<EventHandler>::Function m_PtrToCapturer;
as member variable I am getting same error as above.