diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2020-03-27 18:07:13 +0100 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2020-03-27 18:07:13 +0100 |
commit | f5876b7c9fbaf07696605929e37f9921ce6e745e (patch) | |
tree | 07b07dac9d833cb35276d1d6e5a43dd754015c96 /lib/events | |
parent | 0591b3d58f7cff90fd6dcfb54c01f04b6a4549a4 (diff) | |
download | libquotient-f5876b7c9fbaf07696605929e37f9921ce6e745e.tar.gz libquotient-f5876b7c9fbaf07696605929e37f9921ce6e745e.zip |
Fix compatibility with MSVC 2015
Diffstat (limited to 'lib/events')
-rw-r--r-- | lib/events/reactionevent.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/events/reactionevent.h b/lib/events/reactionevent.h index a422abeb..7a4c9b5a 100644 --- a/lib/events/reactionevent.h +++ b/lib/events/reactionevent.h @@ -22,8 +22,11 @@ namespace QMatrixClient { -struct EventRelation -{ +struct EventRelation { + // To please MSVC 2015 that doesn't handle initialiser lists like proper + EventRelation(QString type = {}, QString eventId = {}, QString key = {}) + : type(std::move(type)), eventId(std::move(eventId)), key(std::move(key)) + {} using reltypeid_t = const char*; static constexpr reltypeid_t Reply() { return "m.in_reply_to"; } static constexpr reltypeid_t Annotation() { return "m.annotation"; } @@ -35,15 +38,15 @@ struct EventRelation static EventRelation replyTo(QString eventId) { - return EventRelation { Reply(), std::move(eventId) }; + return EventRelation(Reply(), std::move(eventId)); } static EventRelation annotate(QString eventId, QString key) { - return EventRelation { Annotation(), std::move(eventId), std::move(key) }; + return EventRelation(Annotation(), std::move(eventId), std::move(key)); } static EventRelation replace(QString eventId) { - return EventRelation { Replacement(), std::move(eventId) }; + return EventRelation(Replacement(), std::move(eventId)); } }; template <> @@ -70,8 +73,8 @@ public: return content<EventRelation>(QStringLiteral("m.relates_to")); } -private: - EventRelation _relation; +//private: +// EventRelation _relation; }; REGISTER_EVENT_TYPE(ReactionEvent) |