COMP: fix inline friend declarations (gcc-4.8.5)

This commit is contained in:
Mark Olesen 2021-01-27 09:41:49 +01:00
parent 8bda4fadbe
commit aa1e1eb15d
12 changed files with 29 additions and 47 deletions

View File

@ -44,11 +44,7 @@ SourceFiles
namespace Foam namespace Foam
{ {
// Forward declaration of classes // Forward Declarations
class Istream;
class Ostream;
// Forward declaration of friend functions and operators
class magnet; class magnet;
Istream& operator>>(Istream&, magnet&); Istream& operator>>(Istream&, magnet&);
Ostream& operator<<(Ostream&, const magnet&); Ostream& operator<<(Ostream&, const magnet&);

View File

@ -337,14 +337,14 @@ public:
// IOstream Operators // IOstream Operators
//- Read from Istream, discarding existing contents //- Read from Istream, discarding existing contents
inline friend Istream& operator>> <T, SizeMin> friend Istream& operator>> <T, SizeMin>
( (
Istream& is, Istream& is,
DynamicList<T, SizeMin>& rhs DynamicList<T, SizeMin>& rhs
); );
//- Write to Ostream //- Write to Ostream
inline friend Ostream& operator<< <T, SizeMin> friend Ostream& operator<< <T, SizeMin>
( (
Ostream& os, Ostream& os,
const DynamicList<T, SizeMin>& rhs const DynamicList<T, SizeMin>& rhs

View File

@ -54,8 +54,8 @@ template<class Container, class Delimiters> class OutputAdaptor;
template<class Container, class Delimiters> template<class Container, class Delimiters>
inline Ostream& operator<< inline Ostream& operator<<
( (
Ostream&, Ostream& os,
const FlatOutput::OutputAdaptor<Container, Delimiters>& const FlatOutput::OutputAdaptor<Container, Delimiters>& adaptor
); );
@ -187,8 +187,7 @@ public:
// Operators // Operators
//- Ostream Operator //- Ostream Operator
inline friend Ostream& friend Ostream& operator<<
operator<<
( (
Ostream& os, Ostream& os,
const OutputAdaptor<Container, Delimiters>& adaptor const OutputAdaptor<Container, Delimiters>& adaptor

View File

@ -271,14 +271,14 @@ public:
// IOstream Operators // IOstream Operators
//- Read from Istream, discarding existing contents //- Read from Istream, discarding existing contents
inline friend Istream& operator>> <T, SizeMin> friend Istream& operator>> <T, SizeMin>
( (
Istream& is, Istream& is,
DynamicField<T, SizeMin>& rhs DynamicField<T, SizeMin>& rhs
); );
//- Write to Ostream //- Write to Ostream
inline friend Ostream& operator<< <T, SizeMin> friend Ostream& operator<< <T, SizeMin>
( (
Ostream& os, Ostream& os,
const DynamicField<T, SizeMin>& rhs const DynamicField<T, SizeMin>& rhs

View File

@ -48,8 +48,8 @@ namespace Foam
// Forward Declarations // Forward Declarations
class labelledTri; class labelledTri;
Istream& operator>>(Istream&, labelledTri&); inline Istream& operator>>(Istream&, labelledTri&);
Ostream& operator<<(Ostream&, const labelledTri&); inline Ostream& operator<<(Ostream&, const labelledTri&);
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class labelledTri Declaration Class labelledTri Declaration
@ -119,8 +119,8 @@ public:
// IOstream Operators // IOstream Operators
inline friend Istream& operator>>(Istream&, labelledTri&); friend Istream& operator>>(Istream&, labelledTri&);
inline friend Ostream& operator<<(Ostream&, const labelledTri&); friend Ostream& operator<<(Ostream&, const labelledTri&);
}; };

View File

@ -45,7 +45,7 @@ SourceFiles
namespace Foam namespace Foam
{ {
// Forward declarations // Forward Declarations
class objectMap; class objectMap;
inline bool operator==(const objectMap& a, const objectMap& b); inline bool operator==(const objectMap& a, const objectMap& b);

View File

@ -49,13 +49,7 @@ SourceFiles
namespace Foam namespace Foam
{ {
// Forward declaration of classes // Forward Declarations
class Istream;
class Ostream;
// Forward declaration of friend functions and operators
template<class Point, class PointRef> class line; template<class Point, class PointRef> class line;

View File

@ -280,13 +280,13 @@ public:
{ {
if (is.format() == IOstream::ASCII) if (is.format() == IOstream::ASCII)
{ {
return is >> pHit.hit_ >> pHit.point_ >> pHit.index_; is >> pHit.hit_ >> pHit.point_ >> pHit.index_;
} }
else else
{ {
// TODO (2019-08-06): // TODO (2019-08-06):
// cannot properly handle mixed-precision reading // cannot properly handle mixed-precision reading
// owning to bool and Point type. // owing to bool and Point type.
is.read is.read
( (

View File

@ -57,11 +57,9 @@ SourceFiles
namespace Foam namespace Foam
{ {
// Forward declarations // Forward Declarations
class Istream;
class Ostream;
class tetPoints;
class plane; class plane;
class tetPoints;
template<class Point, class PointRef> class tetrahedron; template<class Point, class PointRef> class tetrahedron;
@ -310,7 +308,7 @@ public:
boundBox bounds() const; boundBox bounds() const;
// IOstream operators // IOstream Operators
friend Istream& operator>> <Point, PointRef> friend Istream& operator>> <Point, PointRef>
( (

View File

@ -54,8 +54,6 @@ namespace Foam
{ {
// Forward Declarations // Forward Declarations
class Istream;
class Ostream;
class plane; class plane;
class triPoints; class triPoints;
@ -355,7 +353,7 @@ public:
) const; ) const;
// IOstream operators // IOstream Operators
friend Istream& operator>> <Point, PointRef> friend Istream& operator>> <Point, PointRef>
( (

View File

@ -52,13 +52,11 @@ SourceFiles
namespace Foam namespace Foam
{ {
// Forward declarations // Forward Declarations
class triad; class triad;
class quaternion; class quaternion;
class Istream; inline Istream& operator>>(Istream&, triad&);
class Ostream; inline Ostream& operator<<(Ostream&, const triad&);
Istream& operator>>(Istream&, triad&);
Ostream& operator<<(Ostream&, const triad&);
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class triad Declaration Class triad Declaration
@ -68,7 +66,6 @@ class triad
: :
public Vector<vector> public Vector<vector>
{ {
public: public:
// Constructors // Constructors
@ -160,8 +157,8 @@ public:
// IOstream Operators // IOstream Operators
inline friend Istream& operator>>(Istream&, triad&); friend Istream& operator>>(Istream&, triad&);
inline friend Ostream& operator<<(Ostream&, const triad&); friend Ostream& operator<<(Ostream&, const triad&);
}; };

View File

@ -47,9 +47,9 @@ SourceFiles
namespace Foam namespace Foam
{ {
// Forward declaration of friend functions and operators // Forward Declarations
class STLtriangle; class STLtriangle;
Ostream& operator<<(Ostream& os, const STLtriangle& tri); inline Ostream& operator<<(Ostream& os, const STLtriangle& tri);
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class STLtriangle Declaration Class STLtriangle Declaration
@ -141,10 +141,10 @@ public:
); );
// Ostream operator // Ostream Operator
//- Print triangle contents //- Print triangle contents
inline friend Ostream& operator<<(Ostream& os, const STLtriangle& tri); friend Ostream& operator<<(Ostream& os, const STLtriangle& tri);
}; };