#include "pair.h" using std::string; pair::pair() : m_right(0.0) { } pair::pair(string s, double x) : m_left(s), m_right(x) { } const string& pair::left() const { return m_left; } string& pair::left() { return m_left; } const double& pair::right() const { return m_right; } double& pair::right() { return m_right; } pair& pair::operator+=(const pair& other) { m_left += other.m_left; m_right += other.m_right; return *this; } pair operator+(const pair& a, const pair& b) { pair p(a); p += b; return p; }