Go to the documentation of this file.
24 #ifndef _ORDEREDPAIR_HPP_
25 #define _ORDEREDPAIR_HPP_
51 os <<
"(" << p.
x <<
"," << p.
y <<
")";
58 char open=
'\0', comma=
'\0', close=
'\0';
59 is >> open >> p.
x >> comma >> p.
y >> close;
61 if (open!=
'(' || comma!=
',' || close!=
')')
62 throw std::runtime_error(
"[OrderedPair::operator>>] Unexpected input.");
69 return a.
x==b.
x && a.
y==b.
y;
119 #endif // _ORDEREDPAIR_HPP_
const OrderedPair * begin_
OrderedPairContainerRef(const void *begin, const void *end)
constructor for wrapping array of contiguous data
wrapper class for accessing contiguous data as a container of OrderedPairs; note that it does not own...
const OrderedPair * const_iterator
const_iterator begin() const
OrderedPairContainerRef(const std::vector< T > &v)
template constructor for automatic conversion from vector; e.g.
const OrderedPair & operator[](size_t index) const
std::istream & operator>>(std::istream &is, OrderedPair &p)
OrderedPair(double _x=0, double _y=0)
bool operator==(const OrderedPair &a, const OrderedPair &b)
bool operator!=(const OrderedPair &a, const OrderedPair &b)
std::ostream & operator<<(std::ostream &os, const OrderedPair &p)
const_iterator end() const