G
Guest
Hi!
I've just read the Multicast-Observer = Typed message article and
implemented the template at the end of the article. The implementation
looks like this:
#include <list>
template<typename T>
class Message
{
public:
class MessageReceiver
{
public:
virtual void process(const T& message) = 0;
};
...
typedef std::list<MessageReceiver*> MessageReceiverList;
private:
static MessageReceiverList m_messageReceivers;
};
template<typename T>
Message<T>::MessageReceiverList Message<T>::m_messageReceivers;
For some reason I get an compile error at the last line, the defintion
of the static member. Any ideas why?
/M
I've just read the Multicast-Observer = Typed message article and
implemented the template at the end of the article. The implementation
looks like this:
#include <list>
template<typename T>
class Message
{
public:
class MessageReceiver
{
public:
virtual void process(const T& message) = 0;
};
...
typedef std::list<MessageReceiver*> MessageReceiverList;
private:
static MessageReceiverList m_messageReceivers;
};
template<typename T>
Message<T>::MessageReceiverList Message<T>::m_messageReceivers;
For some reason I get an compile error at the last line, the defintion
of the static member. Any ideas why?
/M