diff --git a/libs/container/hashtable.h b/libs/container/hashtable.h index 7e4d8227..cdab5f2c 100644 --- a/libs/container/hashtable.h +++ b/libs/container/hashtable.h @@ -289,10 +289,10 @@ private: void size_decrement(){ --m_size; } - - HashTable( const HashTable& other ); - HashTable& operator=( const HashTable& other ); public: + HashTable( const HashTable& other ) = delete; // not copyable + HashTable& operator=( const HashTable& other ) = delete; // not assignable + HashTable() : m_bucketCount( 0 ), m_buckets( 0 ), m_size( 0 ){ initialise(); } diff --git a/libs/gtkutil/widget.h b/libs/gtkutil/widget.h index f2f392a8..b1fb880c 100644 --- a/libs/gtkutil/widget.h +++ b/libs/gtkutil/widget.h @@ -81,9 +81,6 @@ class ToggleShown { bool m_shownDeferred; - ToggleShown( const ToggleShown& other ); // NOT COPYABLE - ToggleShown& operator=( const ToggleShown& other ); // NOT ASSIGNABLE - static gboolean notify_visible( GtkWidget* widget, gpointer dummy, ToggleShown* self ){ /* destroy = notify::visible with visible = 0, thus let's filter it out */ if( gtk_main_level() > 0 ){ //== 0 at destroy time @@ -103,6 +100,9 @@ public: GtkWidget* m_widget; ToggleItem m_item; + ToggleShown( const ToggleShown& other ) = delete; // NOT COPYABLE + ToggleShown& operator=( const ToggleShown& other ) = delete; // NOT ASSIGNABLE + ToggleShown( bool shown ) : m_shownDeferred( shown ), m_widget( 0 ), m_item( ActiveCaller( *this ) ){ } diff --git a/libs/imagelib.h b/libs/imagelib.h index bfe278d9..c5550bf9 100644 --- a/libs/imagelib.h +++ b/libs/imagelib.h @@ -34,12 +34,13 @@ struct RGBAPixel class RGBAImage : public Image { - RGBAImage( const RGBAImage& other ); - RGBAImage& operator=( const RGBAImage& other ); public: RGBAPixel* pixels; unsigned int width, height; + RGBAImage( const RGBAImage& other ) = delete; // not copyable + RGBAImage& operator=( const RGBAImage& other ) = delete; // not assignable + RGBAImage( unsigned int _width, unsigned int _height ) : pixels( new RGBAPixel[_width * _height] ), width( _width ), height( _height ){ } diff --git a/plugins/entity/modelskinkey.h b/plugins/entity/modelskinkey.h index 60fd8d5d..16da57bc 100644 --- a/plugins/entity/modelskinkey.h +++ b/plugins/entity/modelskinkey.h @@ -40,9 +40,6 @@ class ModelSkinKey : public ModuleObserver ModelSkin* m_skin; Callback m_skinChangedCallback; - ModelSkinKey( const ModelSkinKey& ); - ModelSkinKey operator=( const ModelSkinKey& ); - void construct(){ m_skin = &GlobalModelSkinCache().capture( m_name.c_str() ); m_skin->attach( *this ); @@ -53,6 +50,9 @@ class ModelSkinKey : public ModuleObserver } public: + ModelSkinKey( const ModelSkinKey& ) = delete; // not copyable + ModelSkinKey operator=( const ModelSkinKey& ) = delete; // not assignable + ModelSkinKey( const Callback& skinChangedCallback ) : m_skinChangedCallback( skinChangedCallback ){ construct(); } diff --git a/plugins/entity/namekeys.h b/plugins/entity/namekeys.h index b5e3dc38..7d9e1c1b 100644 --- a/plugins/entity/namekeys.h +++ b/plugins/entity/namekeys.h @@ -55,8 +55,6 @@ class NameKeys : public Entity::Observer, public Namespaced Namespace* m_namespace; EntityKeyValues& m_entity; KeyIsNameFunc m_keyIsName; - NameKeys( const NameKeys& other ); - NameKeys& operator=( const NameKeys& other ); typedef std::map KeyValues; KeyValues m_keyValues; @@ -86,6 +84,9 @@ class NameKeys : public Entity::Observer, public Namespaced } } public: + NameKeys( const NameKeys& other ) = delete; // not copyable + NameKeys& operator=( const NameKeys& other ) = delete; // not assignable + NameKeys( EntityKeyValues& entity ) : m_namespace( 0 ), m_entity( entity ), m_keyIsName( Static::instance().m_keyIsName ){ m_entity.attach( *this ); } diff --git a/plugins/model/model.cpp b/plugins/model/model.cpp index f884e27e..81ae8ae0 100644 --- a/plugins/model/model.cpp +++ b/plugins/model/model.cpp @@ -453,9 +453,6 @@ class PicoModelInstance : }; typedef Array SurfaceRemaps; SurfaceRemaps m_skins; - - PicoModelInstance( const PicoModelInstance& ); - PicoModelInstance operator=( const PicoModelInstance& ); public: typedef LazyStatic StaticTypeCasts; @@ -508,6 +505,9 @@ public: constructRemaps(); } + PicoModelInstance( const PicoModelInstance& ) = delete; // not copyable + PicoModelInstance operator=( const PicoModelInstance& ) = delete; // not assignable + PicoModelInstance( const scene::Path& path, scene::Instance* parent, PicoModel& picomodel ) : Instance( path, parent, this, StaticTypeCasts::instance().get() ), m_picomodel( picomodel ), diff --git a/radiant/brush.h b/radiant/brush.h index 6f3e1c31..d351d898 100644 --- a/radiant/brush.h +++ b/radiant/brush.h @@ -378,7 +378,7 @@ public: releaseShader(); } // copy-construction not supported - FaceShader( const FaceShader& other ); + FaceShader( const FaceShader& other ) = delete; void instanceAttach(){ m_instanced = true; @@ -487,10 +487,6 @@ public: class FaceTexdef : public FaceShaderObserver { -// not copyable - FaceTexdef( const FaceTexdef& other ); -// not assignable - FaceTexdef& operator=( const FaceTexdef& other ); public: class SavedState { @@ -511,6 +507,11 @@ public: bool m_projectionInitialised; bool m_scaleApplied; +// not copyable + FaceTexdef( const FaceTexdef& other ) = delete; +// not assignable + FaceTexdef& operator=( const FaceTexdef& other ) = delete; + FaceTexdef( FaceShader& shader, const TextureProjection& projection, @@ -958,13 +959,13 @@ private: UndoObserver* m_undoable_observer; MapFile* m_map; -// assignment not supported - Face& operator=( const Face& other ); -// copy-construction not supported - Face( const Face& other ); - public: +// assignment not supported + Face& operator=( const Face& other ) = delete; +// copy-construction not supported + Face( const Face& other ) = delete; + Face( FaceObserver* observer ) : m_refcount( 0 ), m_shader( texdef_name_default() ), @@ -1704,7 +1705,7 @@ public: } // assignment not supported - Brush& operator=( const Brush& other ); + Brush& operator=( const Brush& other ) = delete; void setDoom3GroupOrigin( const Vector3& origin ){ //globalOutputStream() << "func_static origin before: " << m_funcStaticOrigin << " after: " << origin << "\n"; @@ -3425,9 +3426,6 @@ class BrushInstance : const LightList* m_lightList; BrushTransformModifier m_transform; - - BrushInstance( const BrushInstance& other ); // NOT COPYABLE - BrushInstance& operator=( const BrushInstance& other ); // NOT ASSIGNABLE public: static Counter* m_counter; @@ -3440,6 +3438,9 @@ public: STRING_CONSTANT( Name, "BrushInstance" ); + BrushInstance( const BrushInstance& other ) = delete; // NOT COPYABLE + BrushInstance& operator=( const BrushInstance& other ) = delete; // NOT ASSIGNABLE + BrushInstance( const scene::Path& path, scene::Instance* parent, Brush& brush ) : Instance( path, parent, this, StaticTypeCasts::instance().get() ), m_brush( brush ), diff --git a/radiant/grid.cpp b/radiant/grid.cpp index d9add927..5ee09b0e 100644 --- a/radiant/grid.cpp +++ b/radiant/grid.cpp @@ -120,12 +120,12 @@ void setGridPower( GridPower power ); class GridMenuItem { GridPower m_id; - - GridMenuItem( const GridMenuItem& other ); // NOT COPYABLE - GridMenuItem& operator=( const GridMenuItem& other ); // NOT ASSIGNABLE public: ToggleItem m_item; + GridMenuItem( const GridMenuItem& other ) = delete; // NOT COPYABLE + GridMenuItem& operator=( const GridMenuItem& other ) = delete; // NOT ASSIGNABLE + GridMenuItem( GridPower id ) : m_id( id ), m_item( ExportCaller( *this ) ){ } void set(){ diff --git a/radiant/map.cpp b/radiant/map.cpp index 1dad48d7..27732782 100644 --- a/radiant/map.cpp +++ b/radiant/map.cpp @@ -97,8 +97,6 @@ class NameObserver m_names.erase( name_read( c_str() ) ); } } - - NameObserver& operator=( const NameObserver& other ); public: NameObserver( UniqueNames& names ) : m_names( names ){ construct(); @@ -106,6 +104,7 @@ public: NameObserver( const NameObserver& other ) : m_names( other.m_names ), m_name( other.m_name ){ construct(); } + NameObserver& operator=( const NameObserver& other ) = delete; // not assignable ~NameObserver(){ destroy(); } diff --git a/radiant/referencecache.cpp b/radiant/referencecache.cpp index 190e879e..18494100 100644 --- a/radiant/referencecache.cpp +++ b/radiant/referencecache.cpp @@ -351,9 +351,9 @@ struct ModelResource : public Resource ASSERT_MESSAGE( !realised(), "ModelResource::~ModelResource: resource reference still realised: " << makeQuoted( m_name.c_str() ) ); } // NOT COPYABLE - ModelResource( const ModelResource& ); + ModelResource( const ModelResource& ) = delete; // NOT ASSIGNABLE - ModelResource& operator=( const ModelResource& ); + ModelResource& operator=( const ModelResource& ) = delete; void setModel( const NodeSmartReference& model ){ m_model = model;