diff --git a/src/OpenFOAM/containers/Bits/bitSet/bitSet.H b/src/OpenFOAM/containers/Bits/bitSet/bitSet.H index 8f2cfae003..f823baaa9e 100644 --- a/src/OpenFOAM/containers/Bits/bitSet/bitSet.H +++ b/src/OpenFOAM/containers/Bits/bitSet/bitSet.H @@ -510,19 +510,6 @@ public: return *this; } - friend Ostream& operator<< - ( - Ostream& os, - const InfoProxy& info - ); - - friend Ostream& operator<< - ( - Ostream& os, - const bitSet& bitset - ); - - // Housekeeping //- Identical to toc() @@ -533,6 +520,10 @@ public: // Global Operators +// +Ostream& operator<<(Ostream& os, const InfoProxy& info); +Ostream& operator<<(Ostream& os, const bitSet& bitset); + //- Bitwise-AND of two bitsets. // See bitSet::operator&= for more details. diff --git a/src/OpenFOAM/containers/Bits/bitSet/bitSetIO.C b/src/OpenFOAM/containers/Bits/bitSet/bitSetIO.C index f3b03da8f7..b8cee2c871 100644 --- a/src/OpenFOAM/containers/Bits/bitSet/bitSetIO.C +++ b/src/OpenFOAM/containers/Bits/bitSet/bitSetIO.C @@ -107,7 +107,7 @@ void Foam::bitSet::writeEntry } -// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Ostream Operators * * * * * * * * * * * * * * // Foam::Ostream& Foam::operator<<(Ostream& os, const bitSet& bitset) { diff --git a/src/OpenFOAM/containers/PtrLists/PtrDynList/PtrDynListI.H b/src/OpenFOAM/containers/PtrLists/PtrDynList/PtrDynListI.H index a1eaf65c37..159068a43d 100644 --- a/src/OpenFOAM/containers/PtrLists/PtrDynList/PtrDynListI.H +++ b/src/OpenFOAM/containers/PtrLists/PtrDynList/PtrDynListI.H @@ -197,7 +197,6 @@ inline void Foam::PtrDynList::shrink() PtrList::resize(capacity_); PtrList::size(nextFree); } - return *this; } diff --git a/src/OpenFOAM/db/IOstreams/Fstreams/IFstream.C b/src/OpenFOAM/db/IOstreams/Fstreams/IFstream.C index 9bada0e9a9..01ac53a98f 100644 --- a/src/OpenFOAM/db/IOstreams/Fstreams/IFstream.C +++ b/src/OpenFOAM/db/IOstreams/Fstreams/IFstream.C @@ -170,7 +170,7 @@ void Foam::IFstream::rewind() { gzPtr = dynamic_cast(allocatedPtr_); } - catch (std::bad_cast) + catch (std::bad_cast&) { gzPtr = nullptr; } diff --git a/src/OpenFOAM/db/typeInfo/typeInfo.H b/src/OpenFOAM/db/typeInfo/typeInfo.H index 71155aeb8f..c29d7713c9 100644 --- a/src/OpenFOAM/db/typeInfo/typeInfo.H +++ b/src/OpenFOAM/db/typeInfo/typeInfo.H @@ -88,7 +88,7 @@ inline To& dynamicCast(From& r) { return dynamic_cast(r); } - catch (std::bad_cast) + catch (std::bad_cast&) { FatalErrorInFunction << "Attempt to cast type " << typeid(r).name() @@ -109,7 +109,7 @@ inline To& refCast(From& r) { return dynamic_cast(r); } - catch (std::bad_cast) + catch (std::bad_cast&) { FatalErrorInFunction << "Attempt to cast type " << r.type() diff --git a/src/finiteArea/faMesh/faBoundaryMesh/faBoundaryMesh.H b/src/finiteArea/faMesh/faBoundaryMesh/faBoundaryMesh.H index f0973e950e..bf7580c20c 100644 --- a/src/finiteArea/faMesh/faBoundaryMesh/faBoundaryMesh.H +++ b/src/finiteArea/faMesh/faBoundaryMesh/faBoundaryMesh.H @@ -55,6 +55,8 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // class faMesh; +class faBoundaryMesh; +Ostream& operator<<(Ostream&, const faBoundaryMesh&); /*---------------------------------------------------------------------------*\ Class faBoundaryMesh Declaration diff --git a/src/finiteArea/faMesh/faPatches/faPatch/faPatch.H b/src/finiteArea/faMesh/faPatches/faPatch/faPatch.H index 5043eb7032..0071540831 100644 --- a/src/finiteArea/faMesh/faPatches/faPatch/faPatch.H +++ b/src/finiteArea/faMesh/faPatches/faPatch/faPatch.H @@ -56,6 +56,8 @@ namespace Foam { class faBoundaryMesh; +class faPatch; +Ostream& operator<<(Ostream&, const faPatch&); /*---------------------------------------------------------------------------*\ Class faPatch Declaration @@ -91,10 +93,10 @@ private: // Private Member Functions - //- Disallow construct as copy + //- No copy construct faPatch(const faPatch&) = delete; - //- Disallow assignment + //- No copy assignment void operator=(const faPatch&) = delete; diff --git a/src/finiteVolume/cfdTools/general/solutionControl/loopControl/loopControl.H b/src/finiteVolume/cfdTools/general/solutionControl/loopControl/loopControl.H index 39f3abd1ee..2190a00502 100644 --- a/src/finiteVolume/cfdTools/general/solutionControl/loopControl/loopControl.H +++ b/src/finiteVolume/cfdTools/general/solutionControl/loopControl/loopControl.H @@ -104,12 +104,13 @@ class loopControl //- Execute specified function names bool checkConverged() const; - //- Disallow default bitwise copy construct + //- No copy construct loopControl(const loopControl&) = delete; - //- Disallow default bitwise assignment + //- No copy assignment void operator=(const loopControl&) = delete; + protected: // Protected data @@ -206,18 +207,15 @@ public: // } // \endcode bool loop(); - - - // IOstream operators - - //- Write name and state (on/off, index/total) to Ostream - friend Ostream& operator<<(Ostream& os, const loopControl& ctrl); - }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +//- Write name and state (on/off, index/total) to Ostream +Ostream& operator<<(Ostream& os, const loopControl& ctrl); + + } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.H b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.H index 521ef99879..3078ae8477 100644 --- a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.H +++ b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.H @@ -149,8 +149,8 @@ private: //- Construct reaction thermo void setThermo(const HashPtrTable& thermoDatabase); - //- Disallow default bitwise assignment - void operator=(const Reaction&); + //- No copy assignment + void operator=(const Reaction&) = delete; //- Return new reaction ID for un-named reactions label getNewReactionID(); @@ -244,7 +244,6 @@ public: // Access - inline word& name(); inline const word& name() const; // - Access to basic components of the reaction diff --git a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/ReactionI.H b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/ReactionI.H index 55287cbfd6..8c4793101b 100644 --- a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/ReactionI.H +++ b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/ReactionI.H @@ -32,13 +32,6 @@ namespace Foam // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template -inline word& Reaction::name() -{ - return name_; -} - - template inline const word& Reaction::name() const {