/usr/include/gmsh/Range.h is in libgmsh-dev 2.8.5+dfsg-1.1+b1.
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 | // Gmsh - Copyright (C) 1997-2014 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to the public mailing list <gmsh@geuz.org>.
#ifndef _RANGE_H_
#define _RANGE_H_
// represents a range of values of the template type
template <class T>
class Range {
private:
T Low;
T High;
public:
Range() {}
Range(const T& low, const T& high) : Low(low), High(high) {}
T low() const { return Low; }
void low(const T& low) { Low = low; }
T high() const { return High; }
void high(const T& high) { High = high; }
int contains(const T& value) const;
int contains(const Range<T> & range) const;
int operator == (const Range<T> &range) const;
};
template<class T>
int Range<T>::contains(const T& value) const
{ return ( (value >= Low) && (value <= High) ); }
template<class T>
int Range<T>::contains(const Range<T>& range) const
{ return ( (range.low() >= Low) && (range.high() <= High) ); }
template<class T>
int Range<T>::operator == (const Range<T>& range) const
{ return ( (range.low() == Low) && (range.high() == High) ); }
#endif
|