21#include "BDSException.hh"
51 for (G4int i : {0, 1})
69 {
throw BDSException(
"BDSTwoVector::operator[]> index outside array");}
77 {
throw BDSException(
"BDSTwoVector::operator[]> index outside array");}
82 inline const T&
x()
const {
return values[0];}
83 inline const T&
y()
const {
return values[1];}
88 {out <<
"(" << v.
values[0] <<
", " << v.
values[1] <<
")";
return out;}
General exception with possible name of object and message.
Simple two vector that's templated so the right type can be used.
BDSTwoVector(const BDSTwoVector &other)
Copy constructor.
BDSTwoVector(T x, T y)
Alternate constructor.
friend std::ostream & operator<<(std::ostream &out, BDSTwoVector const &v)
Output stream.
T & operator[](const G4int index)
Access / set a single element.
BDSTwoVector()
Default constructor.
BDSTwoVector & operator=(const BDSTwoVector &rhs)
Assignment operator.
const T & y() const
Accessor by name.
const T & x() const
Accessor by name.
T values[2]
Member data - x,y.