/usr/include/NTL/pair.h is in libntl-dev 6.2.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | #ifndef NTL_pair__H
#define NTL_pair__H
#include <NTL/tools.h>
// pair templates
NTL_OPEN_NNS
template<class S, class T>
class Pair {
public:
S a;
T b;
Pair() { }
Pair(const Pair<S,T>& x) : a(x.a), b(x.b) { }
Pair(const S& x, const T& y) : a(x), b(y) { }
Pair<S,T>& operator=(const Pair<S,T>& x) { a = x.a; b = x.b; return *this; }
~Pair() { }
};
template<class S, class T>
inline Pair<S,T> cons(const S& x, const T& y) { return Pair<S,T>(x, y); }
template<class S, class T>
inline long operator==(const Pair<S,T>& x, const Pair<S,T>& y)
{ return x.a == y.a && x.b == y.b; }
template<class S, class T>
inline long operator!=(const Pair<S,T>& x, const Pair<S,T>& y)
{ return !(x == y); }
template<class S, class T>
NTL_SNS istream& operator>>(NTL_SNS istream& s, Pair<S,T>& x)
{
long c;
if (!s) Error("bad pair input");
c = s.peek();
while (IsWhiteSpace(c)) {
s.get();
c = s.peek();
}
if (c != '[')
Error("bad pair input");
s.get();
if (!(s >> x.a))
Error("bad pair input");
if (!(s >> x.b))
Error("bad pair input");
c = s.peek();
while (IsWhiteSpace(c)) {
s.get();
c = s.peek();
}
if (c != ']')
Error("bad pair input");
s.get();
return s;
}
template<class S, class T>
NTL_SNS ostream& operator<<(NTL_SNS ostream& s, const Pair<S,T>& x)
{
return s << "[" << x.a << " " << x.b << "]";
}
NTL_CLOSE_NNS
#endif
|