From 646168a38bcc4e915b160d392d409f5c085e713e Mon Sep 17 00:00:00 2001 From: magiblot Date: Tue, 24 Sep 2024 13:28:45 +0200 Subject: [PATCH] Fix deprecated copy warning in TCommandSet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit warning: implicitly-declared ‘constexpr TCommandSet& TCommandSet::operator=(const TCommandSet&)’ is deprecated [-Wdeprecated-copy] note: because ‘TCommandSet’ has user-provided ‘TCommandSet::TCommandSet(const TCommandSet&)’ --- include/tvision/views.h | 1 + source/tvision/tcmdset.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/include/tvision/views.h b/include/tvision/views.h index a89f57699..f92de91ef 100644 --- a/include/tvision/views.h +++ b/include/tvision/views.h @@ -211,6 +211,7 @@ class TCommandSet TCommandSet() noexcept; TCommandSet( const TCommandSet& ) noexcept; + TCommandSet& operator = ( const TCommandSet& ) noexcept; Boolean has( int cmd ) noexcept; diff --git a/source/tvision/tcmdset.cpp b/source/tvision/tcmdset.cpp index 632f094b6..6ebcfb23a 100644 --- a/source/tvision/tcmdset.cpp +++ b/source/tvision/tcmdset.cpp @@ -34,9 +34,15 @@ TCommandSet::TCommandSet() noexcept } TCommandSet::TCommandSet( const TCommandSet& tc ) noexcept +{ + *this = tc; +} + +TCommandSet& TCommandSet::operator = ( const TCommandSet& tc ) noexcept { for( int i = 0; i < 32; i++ ) cmds[i] = tc.cmds[i]; + return *this; } Boolean TCommandSet::has( int cmd ) noexcept