ObjectTable: Remove explicit specialization in class scope
Function template 'LookupObject' in ObjectTable class has a specialization in class scope, which is not allowed. While MSVC seems OK with that, clang complains about it. Fix this issue by moving the definition of the specialisation outside the class scope, and moving the declaration in the '.cc' file.
This commit is contained in:
parent
15816327b4
commit
a281f6d70d
|
@ -202,6 +202,14 @@ ObjectTable::ObjectTableEntry* ObjectTable::LookupTable(X_HANDLE handle) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Generic lookup
|
||||||
|
template <>
|
||||||
|
object_ref<XObject> ObjectTable::LookupObject<XObject>(X_HANDLE handle) {
|
||||||
|
auto object = ObjectTable::LookupObject(handle, false);
|
||||||
|
auto result = object_ref<XObject>(reinterpret_cast<XObject*>(object));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
XObject* ObjectTable::LookupObject(X_HANDLE handle, bool already_locked) {
|
XObject* ObjectTable::LookupObject(X_HANDLE handle, bool already_locked) {
|
||||||
handle = TranslateHandle(handle);
|
handle = TranslateHandle(handle);
|
||||||
if (!handle) {
|
if (!handle) {
|
||||||
|
|
|
@ -46,14 +46,6 @@ class ObjectTable {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generic lookup
|
|
||||||
template <>
|
|
||||||
object_ref<XObject> LookupObject<XObject>(X_HANDLE handle) {
|
|
||||||
auto object = LookupObject(handle, false);
|
|
||||||
auto result = object_ref<XObject>(reinterpret_cast<XObject*>(object));
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
X_STATUS AddNameMapping(const std::string& name, X_HANDLE handle);
|
X_STATUS AddNameMapping(const std::string& name, X_HANDLE handle);
|
||||||
void RemoveNameMapping(const std::string& name);
|
void RemoveNameMapping(const std::string& name);
|
||||||
X_STATUS GetObjectByName(const std::string& name, X_HANDLE* out_handle);
|
X_STATUS GetObjectByName(const std::string& name, X_HANDLE* out_handle);
|
||||||
|
@ -86,6 +78,10 @@ class ObjectTable {
|
||||||
std::unordered_map<std::string, X_HANDLE> name_table_;
|
std::unordered_map<std::string, X_HANDLE> name_table_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Generic lookup
|
||||||
|
template <>
|
||||||
|
object_ref<XObject> ObjectTable::LookupObject<XObject>(X_HANDLE handle);
|
||||||
|
|
||||||
} // namespace util
|
} // namespace util
|
||||||
} // namespace kernel
|
} // namespace kernel
|
||||||
} // namespace xe
|
} // namespace xe
|
||||||
|
|
Loading…
Reference in New Issue