Skip to content

Commit 646168a

Browse files
committed
Fix deprecated copy warning in TCommandSet
warning: implicitly-declared ‘constexpr TCommandSet& TCommandSet::operator=(const TCommandSet&)’ is deprecated [-Wdeprecated-copy] note: because ‘TCommandSet’ has user-provided ‘TCommandSet::TCommandSet(const TCommandSet&)’
1 parent 7fec3be commit 646168a

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

include/tvision/views.h

+1
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ class TCommandSet
211211

212212
TCommandSet() noexcept;
213213
TCommandSet( const TCommandSet& ) noexcept;
214+
TCommandSet& operator = ( const TCommandSet& ) noexcept;
214215

215216
Boolean has( int cmd ) noexcept;
216217

source/tvision/tcmdset.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,15 @@ TCommandSet::TCommandSet() noexcept
3434
}
3535

3636
TCommandSet::TCommandSet( const TCommandSet& tc ) noexcept
37+
{
38+
*this = tc;
39+
}
40+
41+
TCommandSet& TCommandSet::operator = ( const TCommandSet& tc ) noexcept
3742
{
3843
for( int i = 0; i < 32; i++ )
3944
cmds[i] = tc.cmds[i];
45+
return *this;
4046
}
4147

4248
Boolean TCommandSet::has( int cmd ) noexcept

0 commit comments

Comments
 (0)