mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Tuple2: Remove comparison operators as friends and make non-members.
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -47,20 +47,6 @@ namespace Foam
|
|||||||
template<class Type1, class Type2>
|
template<class Type1, class Type2>
|
||||||
class Tuple2;
|
class Tuple2;
|
||||||
|
|
||||||
template<class Type1, class Type2>
|
|
||||||
inline bool operator==
|
|
||||||
(
|
|
||||||
const Tuple2<Type1, Type2>&,
|
|
||||||
const Tuple2<Type1, Type2>&
|
|
||||||
);
|
|
||||||
|
|
||||||
template<class Type1, class Type2>
|
|
||||||
inline bool operator!=
|
|
||||||
(
|
|
||||||
const Tuple2<Type1, Type2>&,
|
|
||||||
const Tuple2<Type1, Type2>&
|
|
||||||
);
|
|
||||||
|
|
||||||
template<class Type1, class Type2>
|
template<class Type1, class Type2>
|
||||||
inline Istream& operator>>(Istream&, Tuple2<Type1, Type2>&);
|
inline Istream& operator>>(Istream&, Tuple2<Type1, Type2>&);
|
||||||
|
|
||||||
@ -129,27 +115,6 @@ public:
|
|||||||
return s_;
|
return s_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Return reverse pair
|
|
||||||
inline Tuple2<Type2, Type1> reverseTuple2() const
|
|
||||||
{
|
|
||||||
return Tuple2<Type2, Type1>(second(), first());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Friend Operators
|
|
||||||
|
|
||||||
friend bool operator== <Type1, Type2>
|
|
||||||
(
|
|
||||||
const Tuple2<Type1, Type2>& a,
|
|
||||||
const Tuple2<Type1, Type2>& b
|
|
||||||
);
|
|
||||||
|
|
||||||
friend bool operator!= <Type1, Type2>
|
|
||||||
(
|
|
||||||
const Tuple2<Type1, Type2>& a,
|
|
||||||
const Tuple2<Type1, Type2>& b
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// IOstream operators
|
// IOstream operators
|
||||||
|
|
||||||
@ -169,6 +134,14 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//- Return reverse of a tuple2
|
||||||
|
template<class Type1, class Type2>
|
||||||
|
inline Tuple2<Type2, Type1> reverse(const Tuple2<Type1, Type2>& t)
|
||||||
|
{
|
||||||
|
return Tuple2<Type2, Type1>(t.second(), t.first());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type1, class Type2>
|
template<class Type1, class Type2>
|
||||||
inline bool operator==
|
inline bool operator==
|
||||||
(
|
(
|
||||||
|
|||||||
Reference in New Issue
Block a user