Commit f9fe7181 authored by Mark Olesen's avatar Mark Olesen
Browse files

STYLE: consistent use of '= delete' for removed constructors/assignments

- make the purpose more explicit, and reduces some work for the
  compiler as well.
parent 6b6b36af
......@@ -52,11 +52,11 @@ class granularPressureModel
{
// Private member functions
//- Disallow default bitwise copy construct
granularPressureModel(const granularPressureModel&);
//- No copy construct
granularPressureModel(const granularPressureModel&) = delete;
//- Disallow default bitwise assignment
void operator=(const granularPressureModel&);
//- No copy assignment
void operator=(const granularPressureModel&) = delete;
protected:
......
......@@ -147,11 +147,11 @@ class kineticTheoryModel
void correctNut()
{}
//- Disallow default bitwise copy construct
kineticTheoryModel(const kineticTheoryModel&);
//- No copy construct
kineticTheoryModel(const kineticTheoryModel&) = delete;
//- Disallow default bitwise assignment
void operator=(const kineticTheoryModel&);
//- No copy assignment
void operator=(const kineticTheoryModel&) = delete;
public:
......
......@@ -52,11 +52,11 @@ class radialModel
{
// Private member functions
//- Disallow default bitwise copy construct
radialModel(const radialModel&);
//- No copy construct
radialModel(const radialModel&) = delete;
//- Disallow default bitwise assignment
void operator=(const radialModel&);
//- No copy assignment
void operator=(const radialModel&) = delete;
protected:
......
......@@ -54,11 +54,11 @@ class viscosityModel
{
// Private member functions
//- Disallow default bitwise copy construct
viscosityModel(const viscosityModel&);
//- No copy construct
viscosityModel(const viscosityModel&) = delete;
//- Disallow default bitwise assignment
void operator=(const viscosityModel&);
//- No copy assignment
void operator=(const viscosityModel&) = delete;
protected:
......
......@@ -106,11 +106,11 @@ class phasePressureModel
void correctNut()
{}
//- Disallow default bitwise copy construct
phasePressureModel(const phasePressureModel&);
//- No copy construct
phasePressureModel(const phasePressureModel&) = delete;
//- Disallow default bitwise assignment
void operator=(const phasePressureModel&);
//- No copy assignment
void operator=(const phasePressureModel&) = delete;
public:
......
......@@ -81,11 +81,14 @@ class BlendedInterfacialModel
// Private Member Functions
//- Disallow default bitwise copy construct
BlendedInterfacialModel(const BlendedInterfacialModel<modelType>&);
//- No copy construct
BlendedInterfacialModel
(
const BlendedInterfacialModel&
) = delete;
//- Disallow default bitwise assignment
void operator=(const BlendedInterfacialModel<modelType>&);
//- No copy assignment
void operator=(const BlendedInterfacialModel<modelType>&) = delete;
//- Correct coeff/value on fixed flux boundary conditions
template<class GeometricField>
......
......@@ -113,8 +113,10 @@ private:
// Private Member Functions
//- Disallow bitwise copy/assignment
//- No copy construct
dictionaryTokens(const dictionaryTokens&) = delete;
//- No copy assignment
void operator=(const dictionaryTokens&) = delete;
......@@ -181,8 +183,10 @@ class dictionaryTokens::primitive_iterator
// Private Member Functions
//- Disallow bitwise copy/assignment
//- No copy construct
primitive_iterator(const primitive_iterator&) = delete;
//- No copy assignment
void operator=(const primitive_iterator&) = delete;
public:
......@@ -251,8 +255,10 @@ class dictionaryTokens::dictionary_iterator
// Private Member Functions
//- Disallow bitwise copy/assignment
//- No copy construct
dictionary_iterator(const dictionary_iterator&) = delete;
//- No copy assignment
void operator=(const dictionary_iterator&) = delete;
......
......@@ -159,11 +159,11 @@ class router
DynamicList<label>& route
) const;
//- Disallow default bitwise copy construct
router(const router&);
//- No copy construct
router(const router&) = delete;
//- Disallow default bitwise assignment
void operator=(const router&);
//- No copy assignment
void operator=(const router&) = delete;
public:
......
......@@ -91,11 +91,11 @@ class cellSplitter
const Map<labelList>& cellToCells
) const;
//- Disallow default bitwise copy construct
cellSplitter(const cellSplitter&);
//- No copy construct
cellSplitter(const cellSplitter&) = delete;
//- Disallow default bitwise assignment
void operator=(const cellSplitter&);
//- No copy assignment
void operator=(const cellSplitter&) = delete;
public:
......
......@@ -68,11 +68,11 @@ class edgeStats
direction getNormalDir(const twoDPointCorrector*) const;
//- Disallow default bitwise copy construct
edgeStats(const edgeStats&);
//- No copy construct
edgeStats(const edgeStats&) = delete;
//- Disallow default bitwise assignment
void operator=(const edgeStats&);
//- No copy assignment
void operator=(const edgeStats&) = delete;
public:
......
......@@ -74,11 +74,11 @@ class hexBlock
// Private Member Functions
//- Disallow default bitwise copy construct
hexBlock(const hexBlock&);
//- No copy construct
hexBlock(const hexBlock&) = delete;
//- Disallow default bitwise assignment
void operator=(const hexBlock&);
//- No copy assignment
void operator=(const hexBlock&) = delete;
//- Vertex addressing inside the block
inline label vtxLabel(label i, label j, label k) const;
......
......@@ -67,11 +67,11 @@ class hexBlock
// Private Member Functions
//- Disallow default bitwise copy construct
hexBlock(const hexBlock&);
//- No copy construct
hexBlock(const hexBlock&) = delete;
//- Disallow default bitwise assignment
void operator=(const hexBlock&);
//- No copy assignment
void operator=(const hexBlock&) = delete;
//- Vertex addressing inside the block
inline label vtxLabel(label i, label j, label k) const;
......
......@@ -86,10 +86,10 @@ class extrudedMesh
);
//- Disallow default bitwise copy construct
//- No copy construct
extrudedMesh(const extrudedMesh&) = delete;
//- Disallow default bitwise assignment
//- No copy assignment
void operator=(const extrudedMesh&) = delete;
......
......@@ -87,11 +87,11 @@ class extrude2DMesh
//- Find extrusion direction
//void findExtrudeDirection();
//- Disallow default bitwise copy construct
extrude2DMesh(const extrude2DMesh&);
//- No copy construct
extrude2DMesh(const extrude2DMesh&) = delete;
//- Disallow default bitwise assignment
void operator=(const extrude2DMesh&);
//- No copy assignment
void operator=(const extrude2DMesh&) = delete;
public:
......
......@@ -85,11 +85,11 @@ class patchToPoly2DMesh
void createPolyMeshComponents();
//- Disallow default bitwise copy construct
patchToPoly2DMesh(const patchToPoly2DMesh&);
//- No copy construct
patchToPoly2DMesh(const patchToPoly2DMesh&) = delete;
//- Disallow default bitwise assignment
void operator=(const patchToPoly2DMesh&);
//- No copy assignment
void operator=(const patchToPoly2DMesh&) = delete;
public:
......
......@@ -70,11 +70,11 @@ class cv2DControls
// Private Member Functions
//- Disallow default bitwise copy construct
cv2DControls(const cv2DControls&);
//- No copy construct
cv2DControls(const cv2DControls&) = delete;
//- Disallow default bitwise assignment
void operator=(const cv2DControls&);
//- No copy assignment
void operator=(const cv2DControls&) = delete;
public:
......
......@@ -142,11 +142,11 @@ private:
const List<DynamicList<label>>& patchOwners
) const;
//- Disallow default bitwise copy construct
DelaunayMesh(const DelaunayMesh<Triangulation>&);
//- No copy construct
DelaunayMesh(const DelaunayMesh<Triangulation>&) = delete;
//- Disallow default bitwise assignment
void operator=(const DelaunayMesh<Triangulation>&);
//- No copy assignment
void operator=(const DelaunayMesh<Triangulation>&) = delete;
public:
......
......@@ -119,11 +119,14 @@ private:
labelPairHashSet& receivedVertices
);
//- Disallow default bitwise copy construct
DistributedDelaunayMesh(const DistributedDelaunayMesh<Triangulation>&);
//- No copy construct
DistributedDelaunayMesh
(
const DistributedDelaunayMesh&
) = delete;
//- Disallow default bitwise assignment
void operator=(const DistributedDelaunayMesh<Triangulation>&);
//- No copy assignment
void operator=(const DistributedDelaunayMesh<Triangulation>&) = delete;
public:
......
......@@ -193,22 +193,4 @@ void Foam::PrintTable<KeyType, DataType>::print
}
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
template<class KeyType, class DataType>
void Foam::PrintTable<KeyType, DataType>::operator=
(
const PrintTable<KeyType, DataType>& rhs
)
{
// Check for assignment to self
if (this == &rhs)
{
FatalErrorInFunction
<< "Attempted assignment to self"
<< abort(FatalError);
}
}
// ************************************************************************* //
......@@ -82,8 +82,8 @@ class PrintTable
// Private Member Functions
//- Disallow default bitwise assignment
void operator=(const PrintTable<KeyType, DataType>&);
//- No copy assignment
void operator=(const PrintTable<KeyType, DataType>&) = delete;
public:
......@@ -107,7 +107,7 @@ public:
// Member Functions
//- Add an entry (D) to the given key(K)
void add(const KeyType& K, const DataType& D);
inline void add(const KeyType& K, const DataType& D);
//- Print the table
void print
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment