Use std::enable_shared_from_this instead of thisP parameters.

This commit is contained in:
Twan van Laarhoven
2020-05-06 22:59:10 +02:00
parent b4435e5e57
commit e005d47d56
20 changed files with 114 additions and 118 deletions
+2 -5
View File
@@ -113,9 +113,6 @@ class ValueViewer : public StyleListener {
Type##ValueViewer(DataViewer& parent, const Type ## StyleP& style)
#define IMPLEMENT_VALUE_VIEWER(Type) \
ValueViewerP Type##Style::makeViewer(DataViewer& parent, const StyleP& thisP) { \
assert(thisP.get() == this); \
return ValueViewerP(new Type##ValueViewer(parent, static_pointer_cast<Type##Style>(thisP))); \
ValueViewerP Type##Style::makeViewer(DataViewer& parent) { \
return ValueViewerP(new Type##ValueViewer(parent, static_pointer_cast<Type##Style>(intrusive_from_this()))); \
}