// P-3 MCS 360 due Mon 25 Oct 2010 : poly.h

#ifndef POLY_H
#define POLY_H

#include <list>
#include <string>

template <typename T>
class Poly
{
   public:

      Poly(T c, int d);
      // constructs the monomial c*x^d
      
      std::string to_string();
      // returns a string representation

      Poly operator+(const Poly &other);
      // addition of two polynomials

   private:

      struct Monomial
      {
         T coeff; 
         int deg;
      };
      std::list<Monomial> p;

      void add_monomial(const Monomial m);
      // adds a monomial to the polynomial
};
#include "poly.tc"
#endif

