From 2ad753ece42b6208ff530b857c3fe53f87d594ab Mon Sep 17 00:00:00 2001 From: slipher Date: Sun, 5 Apr 2020 04:13:48 +0200 Subject: [PATCH] clang/error: fix: non-type template argument refers to function Export that does not have linkage --- radiant/dialog.cpp | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/radiant/dialog.cpp b/radiant/dialog.cpp index 1c628ff1..66f2d998 100644 --- a/radiant/dialog.cpp +++ b/radiant/dialog.cpp @@ -256,24 +256,28 @@ public: } }; +template +struct AddDataCustom_Wrapper { + static void Export(const native &self, const Callback &returnz) { + native *p = &const_cast(self); + auto widget = Self::from(p); + Widget::Get::thunk_(widget, returnz); + } + + static void Import(native &self, T value) { + native *p = &self; + auto widget = Self::from(p); + Widget::Set::thunk_(widget, value); + } +}; + template void AddDataCustom(DialogDataList &self, typename Widget::Type widget, Property const &property) { using Self = typename Widget::Type; using T = typename Widget::Other; using native = typename std::remove_pointer::type; - struct Wrapper { - static void Export(const native &self, const Callback &returnz) { - native *p = &const_cast(self); - auto widget = Self::from(p); - Widget::Get::thunk_(widget, returnz); - } - - static void Import(native &self, T value) { - native *p = &self; - auto widget = Self::from(p); - Widget::Set::thunk_(widget, value); - } - }; + using Wrapper = AddDataCustom_Wrapper; + self.push_back(new CallbackDialogData( make_property>(*static_cast(widget)), property -- 2.39.2