Make disallowed constructors and assignment operators public

This commit is contained in:
Will Bainbridge
2023-06-30 21:00:23 +01:00
parent de7121fb7f
commit d5f038493a
26 changed files with 189 additions and 188 deletions

View File

@ -104,15 +104,6 @@ class IndirectList
private IndirectListAddressing,
public UIndirectList<T>
{
// Private Member Functions
//- Disallow default bitwise assignment
void operator=(const IndirectList<T>&) = delete;
//- Disallow assignment from UIndirectList
void operator=(const UIndirectList<T>&) = delete;
public:
// Constructors
@ -148,6 +139,12 @@ public:
//- Assignment operator
using UIndirectList<T>::operator=;
//- Disallow default bitwise assignment
void operator=(const IndirectList<T>&) = delete;
//- Disallow assignment from UIndirectList
void operator=(const UIndirectList<T>&) = delete;
};

View File

@ -71,9 +71,6 @@ class dictionaryEntry
void readData(Istream&);
//- Disallow bitwise copy
dictionaryEntry(const dictionary&) = delete;
public:
@ -105,6 +102,9 @@ public:
const dictionaryEntry&
);
//- Disallow bitwise copy
dictionaryEntry(const dictionary&) = delete;
autoPtr<entry> clone(const dictionary& parentDict) const
{
return autoPtr<entry>(new dictionaryEntry(parentDict, *this));

View File

@ -69,9 +69,6 @@ class dictionaryListEntry
//- Returns size of dictionary without FoamFile
static label realSize(const dictionary&);
//- Disallow bitwise copy
dictionaryListEntry(const dictionary&) = delete;
public:
@ -87,6 +84,9 @@ public:
const dictionaryListEntry&
);
//- Disallow bitwise copy
dictionaryListEntry(const dictionary&) = delete;
autoPtr<entry> clone(const dictionary& parentDict) const
{
return autoPtr<entry>(new dictionaryListEntry(parentDict, *this));

View File

@ -77,12 +77,11 @@ class regIOobject
//- Return Istream
Istream& readStream(const bool read = true);
//- Disallow assignment
void operator=(const regIOobject&) = delete;
protected:
// Protected Member Functions
//- Read header, check readOpt flags and read data if necessary.
// Format is set to ASCII if defaultFormat and file format are ASCII
bool readHeaderOk
@ -309,7 +308,11 @@ public:
// Member Operators
//- Assign to IOobject
void operator=(const IOobject&);
//- Disallow default assignment
void operator=(const regIOobject&) = delete;
};

View File

@ -69,12 +69,6 @@ class procLduInterface
label comm_;
// Private Member Functions
//- Disallow construction as copy
procLduInterface(const procLduInterface&) = delete;
public:
friend class LUscalarMatrix;
@ -90,6 +84,9 @@ public:
procLduInterface(Istream& is);
//- Disallow construction as copy
procLduInterface(const procLduInterface&) = delete;
autoPtr<procLduInterface> clone()
{
NotImplemented;

View File

@ -71,12 +71,6 @@ class procLduMatrix
PtrList<procLduInterface> interfaces_;
// Private Member Functions
//- Disallow construction as copy
procLduMatrix(const procLduMatrix&) = delete;
public:
friend class LUscalarMatrix;
@ -93,6 +87,9 @@ public:
procLduMatrix(Istream& is);
//- Disallow construction as copy
procLduMatrix(const procLduMatrix&) = delete;
// Member Functions

View File

@ -50,18 +50,6 @@ class processorCyclicGAMGInterfaceField
:
public processorGAMGInterfaceField
{
// Private Member Functions
//- Disallow default bitwise copy construction
processorCyclicGAMGInterfaceField
(
const processorCyclicGAMGInterfaceField&
) = delete;
//- Disallow default bitwise assignment
void operator=(const processorCyclicGAMGInterfaceField&) = delete;
public:
//- Runtime type information
@ -84,10 +72,22 @@ public:
const int rank
);
//- Disallow default bitwise copy construction
processorCyclicGAMGInterfaceField
(
const processorCyclicGAMGInterfaceField&
) = delete;
// Destructor
virtual ~processorCyclicGAMGInterfaceField();
// Member Operators
//- Disallow default bitwise assignment
void operator=(const processorCyclicGAMGInterfaceField&) = delete;
};

View File

@ -54,15 +54,6 @@ class refCount
int count_;
// Private Member Functions
//- Disallow copy
refCount(const refCount&) = delete;
//- Disallow bitwise assignment
void operator=(const refCount&) = delete;
protected:
// Constructors
@ -73,6 +64,9 @@ protected:
count_(0)
{}
//- Disallow copy
refCount(const refCount&) = delete;
public:
@ -116,6 +110,9 @@ public:
{
count_--;
}
//- Disallow bitwise assignment
void operator=(const refCount&) = delete;
};

View File

@ -51,15 +51,6 @@ class pointBoundaryMesh;
class coupledPointPatch
{
// Private Member Functions
//- Disallow default bitwise copy construction
coupledPointPatch(const coupledPointPatch&) = delete;
//- Disallow default bitwise assignment
void operator=(const coupledPointPatch&) = delete;
protected:
// Protected Member Functions
@ -94,10 +85,18 @@ public:
//- Construct from components
coupledPointPatch(const pointBoundaryMesh& bm);
//- Disallow default bitwise copy construction
coupledPointPatch(const coupledPointPatch&) = delete;
//- Destructor
virtual ~coupledPointPatch();
// Member Operators
//- Disallow default bitwise assignment
void operator=(const coupledPointPatch&) = delete;
};

View File

@ -58,15 +58,6 @@ class cyclicPointPatch
const cyclicPolyPatch& cyclicPolyPatch_;
// Private Member Functions
//- Disallow default bitwise copy construction
cyclicPointPatch(const cyclicPointPatch&) = delete;
//- Disallow default bitwise assignment
void operator=(const cyclicPointPatch&) = delete;
// Demand driven private data
//- Initialise the calculation of the patch geometry
@ -103,6 +94,9 @@ public:
const pointBoundaryMesh& bm
);
//- Disallow default bitwise copy construction
cyclicPointPatch(const cyclicPointPatch&) = delete;
//- Destructor
virtual ~cyclicPointPatch();
@ -139,6 +133,12 @@ public:
// and/or mapping. First index is on this patch, second on the
// neighbour patch.
virtual const edgeList& transformPairs() const;
// Member Operators
//- Disallow default bitwise assignment
void operator=(const cyclicPointPatch&) = delete;
};

View File

@ -87,12 +87,6 @@ class processorPointPatch
virtual void topoChange(PstreamBuffers&);
//- Disallow default bitwise copy construction
processorPointPatch(const processorPointPatch&) = delete;
//- Disallow default bitwise assignment
void operator=(const processorPointPatch&) = delete;
public:
//- Runtime type information
@ -108,6 +102,9 @@ public:
const pointBoundaryMesh& bm
);
//- Disallow default bitwise copy construction
processorPointPatch(const processorPointPatch&) = delete;
//- Destructor
virtual ~processorPointPatch();
@ -153,6 +150,12 @@ public:
//- Return mesh points in the correct order for the receiving side
const labelList& reverseMeshPoints() const;
// Member Operators
//- Disallow default bitwise assignment
void operator=(const processorPointPatch&) = delete;
};

View File

@ -63,11 +63,6 @@ class processorCyclicPointPatch
const processorCyclicPolyPatch& procCycPolyPatch_;
//- Disallow default bitwise copy construction
processorCyclicPointPatch(const processorCyclicPointPatch&) = delete;
//- Disallow default bitwise assignment
void operator=(const processorCyclicPointPatch&) = delete;
public:
@ -84,6 +79,9 @@ public:
const pointBoundaryMesh& bm
);
//- Disallow default bitwise copy construction
processorCyclicPointPatch(const processorCyclicPointPatch&) = delete;
// Destructor
@ -104,6 +102,12 @@ public:
{
return procCycPolyPatch_;
}
// Member Operators
//- Disallow default bitwise assignment
void operator=(const processorCyclicPointPatch&) = delete;
};

View File

@ -61,21 +61,12 @@ class coupledFacePointPatch
const coupledPolyPatch& coupledPolyPatch_;
// Private Member Functions
//- Disallow default bitwise copy construction
coupledFacePointPatch(const coupledFacePointPatch&) = delete;
//- Disallow default bitwise assignment
void operator=(const coupledFacePointPatch&) = delete;
protected:
// Construction of demand-driven data
// Protected Member Functions
//- Calculate mesh points
virtual void calcGeometry(PstreamBuffers&) = 0;
//- Calculate mesh points
virtual void calcGeometry(PstreamBuffers&) = 0;
public:
@ -93,9 +84,19 @@ public:
const pointBoundaryMesh& bm
);
//- Disallow default bitwise copy construction
coupledFacePointPatch(const coupledFacePointPatch&) = delete;
//- Destructor
virtual ~coupledFacePointPatch();
// Member Operators
//- Disallow default bitwise assignment
void operator=(const coupledFacePointPatch&) = delete;
};

View File

@ -132,7 +132,6 @@ private:
//- Have the primitives been cleared
bool clearedPrimitives_;
//- Boundary mesh
mutable polyBoundaryMesh boundary_;
@ -273,7 +272,6 @@ public:
static word meshSubDir;
// Constructors
//- Construct from IOobject

View File

@ -79,10 +79,6 @@ class MeshZones
//- Read if IOobject flags set. Return true if read.
bool read();
//- Disallow default bitwise assignment
void operator=(const MeshZones<ZoneType, MeshType>&) = delete;
//- Create zone map
void calcZoneMap() const;
@ -190,6 +186,9 @@ public:
//- Return reference to ZoneType by name.
ZoneType& operator[](const word&);
//- Disallow default bitwise assignment
void operator=(const MeshZones<ZoneType, MeshType>&) = delete;
// Ostream operator