Explicitly delete ctor/copy constr

This will throw the error when compiling instead of when running if a
developer accidentally instantiates the BOARD() ctor or copy
constructor.
This commit is contained in:
Seth Hillbrand 2019-11-07 18:07:12 -08:00
parent 6182133a4e
commit 7f507a4e6b
1 changed files with 2 additions and 10 deletions

View File

@ -201,17 +201,9 @@ private:
// The default copy constructor & operator= are inadequate, // The default copy constructor & operator= are inadequate,
// either write one or do not use it at all // either write one or do not use it at all
BOARD( const BOARD& aOther ) : BOARD( const BOARD& aOther ) = delete;
BOARD_ITEM_CONTAINER( aOther ), m_NetInfo( this )
{
assert( false );
}
BOARD& operator=( const BOARD& aOther ) BOARD& operator=( const BOARD& aOther ) = delete;
{
assert( false );
return *this; // just to mute warning
}
public: public:
static inline bool ClassOf( const EDA_ITEM* aItem ) static inline bool ClassOf( const EDA_ITEM* aItem )