diff --git a/Telegram/SourceFiles/layout.h b/Telegram/SourceFiles/layout.h index c7303adc9..f4bead1ec 100644 --- a/Telegram/SourceFiles/layout.h +++ b/Telegram/SourceFiles/layout.h @@ -270,7 +270,7 @@ public: class OverviewItemInfo : public BasicInterface<OverviewItemInfo> { public: - OverviewItemInfo() : _top(0) { + OverviewItemInfo(Interfaces *) : _top(0) { } int32 top() const { return _top; diff --git a/Telegram/SourceFiles/structs.h b/Telegram/SourceFiles/structs.h index cdb0fe83b..6bfa3bb70 100644 --- a/Telegram/SourceFiles/structs.h +++ b/Telegram/SourceFiles/structs.h @@ -39,7 +39,7 @@ template <typename Type> struct InterfaceWrapTemplate { static const int Size = CeilDivideMinimumOne<sizeof(Type), sizeof(uint64)>::Result * sizeof(uint64); static void Construct(void *location, Interfaces *interfaces) { - (new (location) Type())->interfaces = interfaces; + new (location) Type(interfaces); } static void Destruct(void *location) { ((Type*)location)->~Type(); @@ -72,6 +72,14 @@ public: static const uint64 Bit() { return (1 << Index()); } + +}; + +template <typename Type> +class BasicInterfaceWithPointer : public BasicInterface<Type> { +public: + BasicInterfaceWithPointer(Interfaces *interfaces) : interfaces(interfaces) { + } Interfaces *interfaces = 0; };