diff options
author | Adam <Adam@anope.org> | 2011-09-02 15:28:16 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2011-09-10 02:05:03 -0400 |
commit | 17ea4ed8f5c4b08668223897c6de87dd3bdd598c (patch) | |
tree | a32cf0bde18678d9ad8895f3e032cf69c48d13f2 /include | |
parent | feaef7cc4aa97a0851ad404fc76652560bb14a70 (diff) |
Fixed service_reference to work correctly with external classes
Diffstat (limited to 'include')
-rw-r--r-- | include/modules.h | 4 | ||||
-rw-r--r-- | include/services.h | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/include/modules.h b/include/modules.h index f76a1f58a..600b3ce8c 100644 --- a/include/modules.h +++ b/include/modules.h @@ -1219,7 +1219,7 @@ class CallBack : public Timer } }; -template<typename T> +template<typename T, typename U = T> class service_reference : public dynamic_reference<T> { Anope::string name; @@ -1238,7 +1238,7 @@ class service_reference : public dynamic_reference<T> } if (!this->ref) { - this->ref = Service<T>::FindService(this->name); + this->ref = static_cast<T *>(Service<U>::FindService(this->name)); if (this->ref) this->ref->AddReference(this); } diff --git a/include/services.h b/include/services.h index 47e9b8940..5b5cf46bb 100644 --- a/include/services.h +++ b/include/services.h @@ -396,6 +396,8 @@ template<typename T> class CoreExport Service : public Base }; template<typename T> Anope::map<T *> Service<T>::services; +template class Service<Base>; + #include "sockets.h" #include "socketengine.h" #include "extensible.h" |