Skip to content
Snippets Groups Projects
Commit 97bac477 authored by laurence's avatar laurence
Browse files

ENH: Tuple2: Remove comparison operators as friends and make non-members.

parent 0efac64b
Branches
Tags
No related merge requests found
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -47,20 +47,6 @@ namespace Foam
template<class Type1, class Type2>
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>
inline Istream& operator>>(Istream&, Tuple2<Type1, Type2>&);
......@@ -129,27 +115,6 @@ public:
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
......@@ -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>
inline bool operator==
(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment