From 7f507a4e6bb6c423ee1ad023ae3885decb2a7842 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Thu, 7 Nov 2019 18:07:12 -0800 Subject: [PATCH] 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. --- pcbnew/class_board.h | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/pcbnew/class_board.h b/pcbnew/class_board.h index 2a6b7d4480..6a350866f4 100644 --- a/pcbnew/class_board.h +++ b/pcbnew/class_board.h @@ -201,17 +201,9 @@ private: // The default copy constructor & operator= are inadequate, // either write one or do not use it at all - BOARD( const BOARD& aOther ) : - BOARD_ITEM_CONTAINER( aOther ), m_NetInfo( this ) - { - assert( false ); - } + BOARD( const BOARD& aOther ) = delete; - BOARD& operator=( const BOARD& aOther ) - { - assert( false ); - return *this; // just to mute warning - } + BOARD& operator=( const BOARD& aOther ) = delete; public: static inline bool ClassOf( const EDA_ITEM* aItem )