diff --git a/src/App/AutoTransaction.h b/src/App/AutoTransaction.h index 84476b52f7..cd44fe7f70 100644 --- a/src/App/AutoTransaction.h +++ b/src/App/AutoTransaction.h @@ -32,7 +32,7 @@ class Application; /// Helper class to manager transaction (i.e. undo/redo) class AppExport AutoTransaction { -private: +public: /// Private new operator to prevent heap allocation void* operator new (std::size_t) = delete; @@ -121,7 +121,7 @@ public: friend class Application; -private: +public: /// Private new operator to prevent heap allocation void* operator new (std::size_t) = delete; diff --git a/src/App/DocumentObserver.h b/src/App/DocumentObserver.h index 84e7dbecdf..6ff92b857a 100644 --- a/src/App/DocumentObserver.h +++ b/src/App/DocumentObserver.h @@ -306,11 +306,11 @@ public: */ App::Document* operator->() const noexcept; -private: // disable - DocumentWeakPtrT(const DocumentWeakPtrT&); - DocumentWeakPtrT& operator=(const DocumentWeakPtrT&); + DocumentWeakPtrT(const DocumentWeakPtrT&) = delete; + DocumentWeakPtrT& operator=(const DocumentWeakPtrT&) = delete; +private: class Private; std::unique_ptr d; }; @@ -368,9 +368,11 @@ public: private: App::DocumentObject* _get() const noexcept; + +public: // disable - DocumentObjectWeakPtrT(const DocumentObjectWeakPtrT&); - DocumentObjectWeakPtrT& operator=(const DocumentObjectWeakPtrT&); + DocumentObjectWeakPtrT(const DocumentObjectWeakPtrT&) = delete; + DocumentObjectWeakPtrT& operator=(const DocumentObjectWeakPtrT&) = delete; private: class Private; @@ -444,10 +446,9 @@ public: return ptr.get(); } -private: // disable - WeakPtrT(const WeakPtrT&); - WeakPtrT& operator=(const WeakPtrT&); + WeakPtrT(const WeakPtrT&) = delete; + WeakPtrT& operator=(const WeakPtrT&) = delete; private: DocumentObjectWeakPtrT ptr; diff --git a/src/App/Property.h b/src/App/Property.h index a64dc8fe6e..a0eeefa027 100644 --- a/src/App/Property.h +++ b/src/App/Property.h @@ -286,11 +286,12 @@ protected: /// Verify a path for the current property virtual void verifyPath(const App::ObjectIdentifier & p) const; -private: +public: // forbidden - Property(const Property&); - Property& operator = (const Property&); + Property(const Property&) = delete; + Property& operator = (const Property&) = delete; +private: // Sync status with Property_Type void syncType(unsigned type); diff --git a/src/App/PropertyContainer.h b/src/App/PropertyContainer.h index c86b03e9a4..deea54b260 100644 --- a/src/App/PropertyContainer.h +++ b/src/App/PropertyContainer.h @@ -248,10 +248,10 @@ protected: virtual void handleChangedPropertyName(Base::XMLReader &reader, const char * TypeName, const char *PropName); virtual void handleChangedPropertyType(Base::XMLReader &reader, const char * TypeName, Property * prop); -private: +public: // forbidden - PropertyContainer(const PropertyContainer&); - PropertyContainer& operator = (const PropertyContainer&); + PropertyContainer(const PropertyContainer&) = delete; + PropertyContainer& operator = (const PropertyContainer&) = delete; protected: DynamicProperty dynamicProps; diff --git a/src/Base/Builder3D.h b/src/Base/Builder3D.h index 7dfa6b410a..bad25860c0 100644 --- a/src/Base/Builder3D.h +++ b/src/Base/Builder3D.h @@ -613,8 +613,10 @@ public: private: void increaseIndent(); void decreaseIndent(); - InventorBuilder (const InventorBuilder&); - void operator = (const InventorBuilder&); + +public: + InventorBuilder (const InventorBuilder&) = delete; + void operator = (const InventorBuilder&) = delete; private: std::ostream& result; diff --git a/src/Base/Handle.cpp b/src/Base/Handle.cpp index a74f76c376..4d55ee2ed8 100644 --- a/src/Base/Handle.cpp +++ b/src/Base/Handle.cpp @@ -76,7 +76,7 @@ int Handled::getRefCount() const return static_cast(*_lRefCount); } -const Handled& Handled::operator = (const Handled&) +Handled& Handled::operator = (const Handled&) { // we must not assign _lRefCount return *this; diff --git a/src/Base/Handle.h b/src/Base/Handle.h index 0816719462..a6f67cc2be 100644 --- a/src/Base/Handle.h +++ b/src/Base/Handle.h @@ -153,10 +153,11 @@ public: int unrefNoDelete() const; int getRefCount() const; - const Handled& operator = (const Handled&); + Handled& operator = (const Handled&); -private: - Handled(const Handled&); + Handled(const Handled&) = delete; + Handled(Handled&&) = delete; + Handled& operator = (Handled&&) = delete; private: QAtomicInt* _lRefCount; diff --git a/src/Base/InputSource.cpp b/src/Base/InputSource.cpp index 0c4039af80..e1ef01219d 100644 --- a/src/Base/InputSource.cpp +++ b/src/Base/InputSource.cpp @@ -104,9 +104,9 @@ struct StdInputStream::TextCodec StdInputStream::StdInputStream( std::istream& Stream, XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager* const manager ) : stream(Stream) - , fMemoryManager(manager) , codec(new TextCodec) { + (void)manager; } diff --git a/src/Base/InputSource.h b/src/Base/InputSource.h index 321b741c34..0b09e5f022 100644 --- a/src/Base/InputSource.h +++ b/src/Base/InputSource.h @@ -54,13 +54,13 @@ public : XMLSize_t readBytes( XMLByte* const toFill, const XMLSize_t maxToRead ) override; const XMLCh* getContentType() const override {return nullptr;} -private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- - StdInputStream(const StdInputStream&); - StdInputStream& operator=(const StdInputStream&); + StdInputStream(const StdInputStream&) = delete; + StdInputStream& operator=(const StdInputStream&) = delete; +private : // ----------------------------------------------------------------------- // Private data members // @@ -69,7 +69,6 @@ private : // per platform. // ----------------------------------------------------------------------- std::istream &stream; - XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager* const fMemoryManager; struct TextCodec; std::unique_ptr codec; }; @@ -83,10 +82,10 @@ public : XERCES_CPP_NAMESPACE_QUALIFIER BinInputStream* makeStream() const override; -private: - StdInputSource(const StdInputSource&); - StdInputSource& operator=(const StdInputSource&); + StdInputSource(const StdInputSource&) = delete; + StdInputSource& operator=(const StdInputSource&) = delete; +private: std::istream &stream; }; diff --git a/src/Base/Parameter.cpp b/src/Base/Parameter.cpp index dea8b99004..8fe5da1478 100644 --- a/src/Base/Parameter.cpp +++ b/src/Base/Parameter.cpp @@ -133,10 +133,9 @@ public: return fWhatToShow; } -private: // unimplemented copy ctor and assignment operator DOMPrintFilter(const DOMPrintFilter&) = delete; - DOMPrintFilter & operator = (const DOMPrintFilter&); + DOMPrintFilter & operator = (const DOMPrintFilter&) = delete; ShowType fWhatToShow; }; diff --git a/src/Base/Sequencer.h b/src/Base/Sequencer.h index fcb9f93376..dac92da7d9 100644 --- a/src/Base/Sequencer.h +++ b/src/Base/Sequencer.h @@ -370,9 +370,8 @@ public: void setProgress(size_t); bool wasCanceled() const; -private: - SequencerLauncher(const SequencerLauncher&); - void operator=(const SequencerLauncher&); + SequencerLauncher(const SequencerLauncher&) = delete; + void operator=(const SequencerLauncher&) = delete; }; /** Access to the only SequencerBase instance */ diff --git a/src/Base/Stream.h b/src/Base/Stream.h index 123dc4d9c9..ad39055cb1 100644 --- a/src/Base/Stream.h +++ b/src/Base/Stream.h @@ -81,9 +81,8 @@ public: OutputStream& operator << (float f); OutputStream& operator << (double d); -private: - OutputStream (const OutputStream&); - void operator = (const OutputStream&); + OutputStream (const OutputStream&) = delete; + void operator = (const OutputStream&) = delete; private: std::ostream& _out; @@ -117,9 +116,8 @@ public: return !_in.eof(); } -private: - InputStream (const InputStream&); - void operator = (const InputStream&); + InputStream (const InputStream&) = delete; + void operator = (const InputStream&) = delete; private: std::istream& _in; @@ -149,9 +147,9 @@ protected: std::ios_base::openmode which = std::ios::in | std::ios::out) override; -private: - ByteArrayOStreambuf(const ByteArrayOStreambuf&); - ByteArrayOStreambuf& operator=(const ByteArrayOStreambuf&); +public: + ByteArrayOStreambuf(const ByteArrayOStreambuf&) = delete; + ByteArrayOStreambuf& operator=(const ByteArrayOStreambuf&) = delete; private: QBuffer* _buffer; @@ -180,9 +178,9 @@ protected: pos_type seekpos(std::streambuf::pos_type pos, std::ios_base::openmode which = std::ios::in | std::ios::out) override; -private: - ByteArrayIStreambuf(const ByteArrayIStreambuf&); - ByteArrayIStreambuf& operator=(const ByteArrayIStreambuf&); +public: + ByteArrayIStreambuf(const ByteArrayIStreambuf&) = delete; + ByteArrayIStreambuf& operator=(const ByteArrayIStreambuf&) = delete; private: const QByteArray& _buffer; @@ -210,9 +208,9 @@ protected: pos_type seekpos(std::streambuf::pos_type sp, std::ios_base::openmode which = std::ios::in | std::ios::out) override; -private: - IODeviceOStreambuf(const IODeviceOStreambuf&); - IODeviceOStreambuf& operator=(const IODeviceOStreambuf&); +public: + IODeviceOStreambuf(const IODeviceOStreambuf&) = delete; + IODeviceOStreambuf& operator=(const IODeviceOStreambuf&) = delete; protected: QIODevice* device; @@ -238,9 +236,9 @@ protected: pos_type seekpos(std::streambuf::pos_type sp, std::ios_base::openmode which = std::ios::in | std::ios::out) override; -private: - IODeviceIStreambuf(const IODeviceIStreambuf&); - IODeviceIStreambuf& operator=(const IODeviceIStreambuf&); +public: + IODeviceIStreambuf(const IODeviceIStreambuf&) = delete; + IODeviceIStreambuf& operator=(const IODeviceIStreambuf&) = delete; protected: QIODevice* device; @@ -286,9 +284,9 @@ private: bool flushBuffer(); bool writeStr(const char* s, std::streamsize num); -private: - PyStreambuf(const PyStreambuf&); - PyStreambuf& operator=(const PyStreambuf&); +public: + PyStreambuf(const PyStreambuf&) = delete; + PyStreambuf& operator=(const PyStreambuf&) = delete; private: PyObject* inp; @@ -316,9 +314,9 @@ protected: std::ios_base::openmode which = std::ios::in | std::ios::out) override; -private: - Streambuf(const Streambuf&); - Streambuf& operator=(const Streambuf&); +public: + Streambuf(const Streambuf&) = delete; + Streambuf& operator=(const Streambuf&) = delete; private: std::string::const_iterator _beg; diff --git a/src/Base/Writer.h b/src/Base/Writer.h index 64ed502613..05d65558ad 100644 --- a/src/Base/Writer.h +++ b/src/Base/Writer.h @@ -156,10 +156,11 @@ protected: bool forceXML; int fileVersion; -private: - Writer(const Writer&); - Writer& operator=(const Writer&); +public: + Writer(const Writer&) = delete; + Writer& operator=(const Writer&) = delete; +private: std::unique_ptr CharStream; }; diff --git a/src/Gui/DocumentObserver.h b/src/Gui/DocumentObserver.h index f1057c446a..cc25e73c2e 100644 --- a/src/Gui/DocumentObserver.h +++ b/src/Gui/DocumentObserver.h @@ -158,11 +158,11 @@ public: */ Gui::Document* operator->() const noexcept; -private: // disable - DocumentWeakPtrT(const DocumentWeakPtrT&); - DocumentWeakPtrT& operator=(const DocumentWeakPtrT&); + DocumentWeakPtrT(const DocumentWeakPtrT&) = delete; + DocumentWeakPtrT& operator=(const DocumentWeakPtrT&) = delete; +private: class Private; std::unique_ptr d; }; @@ -220,9 +220,11 @@ public: private: ViewProviderDocumentObject* _get() const noexcept; + +public: // disable - ViewProviderWeakPtrT(const ViewProviderWeakPtrT&); - ViewProviderWeakPtrT& operator=(const ViewProviderWeakPtrT&); + ViewProviderWeakPtrT(const ViewProviderWeakPtrT&) = delete; + ViewProviderWeakPtrT& operator=(const ViewProviderWeakPtrT&) = delete; private: class Private; @@ -297,10 +299,9 @@ public: return ptr.get(); } -private: // disable - WeakPtrT(const WeakPtrT&); - WeakPtrT& operator=(const WeakPtrT&); + WeakPtrT(const WeakPtrT&) = delete; + WeakPtrT& operator=(const WeakPtrT&) = delete; private: ViewProviderWeakPtrT ptr; diff --git a/src/Gui/NavigationStyle.h b/src/Gui/NavigationStyle.h index a6c6bf51e1..762380bf56 100644 --- a/src/Gui/NavigationStyle.h +++ b/src/Gui/NavigationStyle.h @@ -114,6 +114,7 @@ public: public: NavigationStyle(); ~NavigationStyle() override; + NavigationStyle(const NavigationStyle&) = delete; NavigationStyle& operator = (const NavigationStyle& ns); void setViewer(View3DInventorViewer*); @@ -265,7 +266,6 @@ protected: //@} private: - NavigationStyle(const NavigationStyle&); struct NavigationStyleP* pimpl; friend struct NavigationStyleP; }; diff --git a/src/Gui/NotificationBox.h b/src/Gui/NotificationBox.h index f25cae4c44..5fb229f0a6 100644 --- a/src/Gui/NotificationBox.h +++ b/src/Gui/NotificationBox.h @@ -46,9 +46,9 @@ namespace Gui */ class NotificationBox { +public: NotificationBox() = delete; -public: enum class Options { None = 0x0, diff --git a/src/Gui/SoFCOffscreenRenderer.h b/src/Gui/SoFCOffscreenRenderer.h index f8c0ff99f1..844c641e4a 100644 --- a/src/Gui/SoFCOffscreenRenderer.h +++ b/src/Gui/SoFCOffscreenRenderer.h @@ -32,6 +32,7 @@ #include #include +#include namespace Gui { @@ -50,9 +51,10 @@ public: */ static SoFCOffscreenRenderer& instance(); + SoFCOffscreenRenderer(const SoFCOffscreenRenderer&) = delete; + SoFCOffscreenRenderer& operator=(const SoFCOffscreenRenderer&) = delete; + private: - SoFCOffscreenRenderer(const SoFCOffscreenRenderer&); - SoFCOffscreenRenderer& operator=(const SoFCOffscreenRenderer&); static SoFCOffscreenRenderer* inst; protected: diff --git a/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp b/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp index bd26610a81..615d69f5c2 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp @@ -118,6 +118,8 @@ private: } ~FemPostObjectSelectionObserver() = default; + +public: FemPostObjectSelectionObserver(const FemPostObjectSelectionObserver&) = delete; FemPostObjectSelectionObserver& operator= (const FemPostObjectSelectionObserver&) = delete; diff --git a/src/Mod/Mesh/App/Core/Info.h b/src/Mod/Mesh/App/Core/Info.h index 4da36098ee..f87bd0f733 100644 --- a/src/Mod/Mesh/App/Core/Info.h +++ b/src/Mod/Mesh/App/Core/Info.h @@ -81,8 +81,8 @@ protected: protected: const MeshKernel &_rclMesh; // const reference to mesh data structure -private: - MeshInfo(); // not accessible default constructor +public: + MeshInfo() = delete; // not accessible default constructor }; diff --git a/src/Mod/Mesh/App/Core/Iterator.h b/src/Mod/Mesh/App/Core/Iterator.h index d251399d87..5fc685c8c9 100644 --- a/src/Mod/Mesh/App/Core/Iterator.h +++ b/src/Mod/Mesh/App/Core/Iterator.h @@ -286,9 +286,9 @@ protected: const MeshPointArray& _rclPAry; MeshFacetArray::_TConstIterator _clIter; -private: - MeshFastFacetIterator (const MeshFastFacetIterator&); - void operator = (const MeshFastFacetIterator&); +public: + MeshFastFacetIterator (const MeshFastFacetIterator&) = delete; + void operator = (const MeshFastFacetIterator&) = delete; }; inline MeshFastFacetIterator::MeshFastFacetIterator (const MeshKernel &rclM) diff --git a/src/Mod/Mesh/App/Core/KDTree.h b/src/Mod/Mesh/App/Core/KDTree.h index 0cc54bc95d..c3b3d97e08 100644 --- a/src/Mod/Mesh/App/Core/KDTree.h +++ b/src/Mod/Mesh/App/Core/KDTree.h @@ -55,8 +55,9 @@ private: class Private; Private* d; - MeshKDTree(const MeshKDTree&); - void operator= (const MeshKDTree&); +public: + MeshKDTree(const MeshKDTree&) = delete; + void operator= (const MeshKDTree&) = delete; }; } // namespace MeshCore diff --git a/src/Mod/Mesh/App/Core/Tools.h b/src/Mod/Mesh/App/Core/Tools.h index 3de8c9a633..2c64929a0a 100644 --- a/src/Mod/Mesh/App/Core/Tools.h +++ b/src/Mod/Mesh/App/Core/Tools.h @@ -88,9 +88,9 @@ protected: Wm4::Sphere3 _akSphere; bool _bTooFewPoints; -private: - MeshSearchNeighbours (const MeshSearchNeighbours&); - void operator = (const MeshSearchNeighbours&); +public: + MeshSearchNeighbours (const MeshSearchNeighbours&) = delete; + void operator = (const MeshSearchNeighbours&) = delete; }; inline bool MeshSearchNeighbours::CheckDistToFacet (const MeshFacet &rclF) diff --git a/src/Mod/Mesh/Gui/SoFCMeshObject.h b/src/Mod/Mesh/Gui/SoFCMeshObject.h index 56fcfed4cf..2659a6a13e 100644 --- a/src/Mod/Mesh/Gui/SoFCMeshObject.h +++ b/src/Mod/Mesh/Gui/SoFCMeshObject.h @@ -48,8 +48,7 @@ class MeshGuiExport SoSFMeshObject : public SoSField { public: static void initClass(); -private: - SoSFMeshObject(const SoSFMeshObject&); + SoSFMeshObject(const SoSFMeshObject&) = delete; }; // ------------------------------------------------------- diff --git a/src/Mod/Part/App/Geometry.h b/src/Mod/Part/App/Geometry.h index a11a7bece3..6ca3eb8e33 100644 --- a/src/Mod/Part/App/Geometry.h +++ b/src/Mod/Part/App/Geometry.h @@ -131,9 +131,9 @@ protected: boost::uuids::uuid tag; std::vector> extensions; -private: - Geometry(const Geometry&); - Geometry& operator = (const Geometry&); +public: + Geometry(const Geometry&) = delete; + Geometry& operator = (const Geometry&) = delete; }; class PartExport GeomPoint : public Geometry diff --git a/src/Mod/Part/App/Geometry2d.h b/src/Mod/Part/App/Geometry2d.h index 8f268e03ae..fd0d193396 100644 --- a/src/Mod/Part/App/Geometry2d.h +++ b/src/Mod/Part/App/Geometry2d.h @@ -66,9 +66,9 @@ public: protected: Geometry2d(); -private: - Geometry2d(const Geometry2d&); - Geometry2d& operator = (const Geometry2d&); +public: + Geometry2d(const Geometry2d&) = delete; + Geometry2d& operator = (const Geometry2d&) = delete; }; class PartExport Geom2dPoint : public Geometry2d diff --git a/src/Mod/Points/App/PointsAlgos.cpp b/src/Mod/Points/App/PointsAlgos.cpp index 60ef029adf..2085d93ba6 100644 --- a/src/Mod/Points/App/PointsAlgos.cpp +++ b/src/Mod/Points/App/PointsAlgos.cpp @@ -216,7 +216,6 @@ public: virtual double toDouble(Base::InputStream&) const = 0; virtual int getSizeOf() const = 0; -private: Converter(const Converter&) = delete; Converter(Converter&&) = delete; Converter& operator= (const Converter&) = delete; @@ -307,7 +306,7 @@ protected: return seekoff(pos, std::ios_base::beg); } -private: +public: DataStreambuf(const DataStreambuf&) = delete; DataStreambuf(DataStreambuf&&) = delete; DataStreambuf& operator=(const DataStreambuf&) = delete;