|
From: Klaus S. <kl...@sp...> - 2007-09-21 19:26:35
|
Hi
in ql/patterns/singleton.hpp
68 template <class T>
69 T& Singleton<T>::instance() {
70 static std::map<Integer, boost::shared_ptr<T> > instances_;
71 #if defined(QL_ENABLE_SESSIONS)
72 Integer id = sessionId();
73 #else
74 Integer id = 0;
75 #endif
76 boost::shared_ptr<T>& instance = instances_[id];
77 if (!instance)
78 instance = boost::shared_ptr<T>(new T);
79 return *instance;
80 }
IMO this function should be declared as inline function to avoid linker
problem.
69 inline T& Singleton<T>::instance() {
Background: I'd problems with this function when linking QL under Windows to a
project without including the QL project into my project (simply linked
static QL library).
any comment?
cheers
--
Klaus Spanderen
Ludwig Erhard Str. 12
48734 Reken (Germany)
E-Mail: kl...@NO... (remove NOSPAM from the address)
|