Skip to content

Commit

Permalink
Fix deprecated copy warning in TCommandSet
Browse files Browse the repository at this point in the history
warning: implicitly-declared ‘constexpr TCommandSet& TCommandSet::operator=(const TCommandSet&)’ is deprecated [-Wdeprecated-copy]
note: because ‘TCommandSet’ has user-provided ‘TCommandSet::TCommandSet(const TCommandSet&)’
  • Loading branch information
magiblot committed Sep 24, 2024
1 parent 7fec3be commit 646168a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/tvision/views.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ class TCommandSet

TCommandSet() noexcept;
TCommandSet( const TCommandSet& ) noexcept;
TCommandSet& operator = ( const TCommandSet& ) noexcept;

Boolean has( int cmd ) noexcept;

Expand Down
6 changes: 6 additions & 0 deletions source/tvision/tcmdset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 646168a

Please sign in to comment.