From 14a00d0051d9c0f97105145bd2ecf7679bb015a3 Mon Sep 17 00:00:00 2001 From: 12xx12 <44411062+12xx12@users.noreply.github.com> Date: Wed, 11 Nov 2020 22:38:51 +0100 Subject: changing cComposite Chat to newer c++ standart (#5028) * upgraded to new C++ for loops and fixed errors * readded delete instruction * now using unique ptr * added test for text only (that was causing an error for me) * using unique ptr constructor * added move constructor and deleted copy constructor * fixed deconstuctor http prefixes are constexpr and std::string_view * fixed whitespace Co-authored-by: 12xx12 <12xx12100@gmail.com> --- src/CompositeChat.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/CompositeChat.h') diff --git a/src/CompositeChat.h b/src/CompositeChat.h index 675837548..b52b76bc5 100644 --- a/src/CompositeChat.h +++ b/src/CompositeChat.h @@ -152,9 +152,8 @@ public: } ; - - using cParts = std::vector; - + /** the parts have to be allocated with new else the part specific parts are not saved (only the cBasePart members). */ + using cParts = std::vector>; /** Creates a new empty chat message. Exported manually due to the other overload needing a manual export. */ @@ -166,6 +165,12 @@ public: Exported manually due to ToLua++ generating extra output parameter. */ cCompositeChat(const AString & a_ParseText, eMessageType a_MessageType = mtCustom); + cCompositeChat(cCompositeChat && a_Other) = default; + + /** Copy constructor is explicitly deleted because m_Parts is not copyable. */ + cCompositeChat(cCompositeChat & a_Other) = delete; + cCompositeChat(const cCompositeChat & a_Other) = delete; + ~cCompositeChat(); // tolua_export // The following are exported in ManualBindings in order to support chaining - they return "self" in Lua (#755) -- cgit v1.2.3