title: overloading *, +, -'operators for vector<double> class
body: <p>I'm writing a Line class to make numerical methods and I want these operators (*, +, -)
  to make my code more readable and easier to understand. </p>
  
    <pre class="lang-cpp prettyprint-override"><code>        #include &lt;vector&gt;
  
          using namespace std;
  
          typedef vector&lt;double&gt; Vector;
  
          class Line : public Vector
          {
          public:
              Line();
              ~Line();
  
              Line operator+(Line);
              Line operator-(Line);
              Line operator*(double);
          };
  
  
          Line Line::operator*(double alfa)
          {
              Line temp;
              int n = size();
              temp.resize(n);
              for (int i = 0; i &lt; n; i++)
              {
                  temp.at(i) = this-&gt;at(i)*alfa;
              }
              return temp;
          }
  
          Line Line::operator+(Line line)
          {
              int n = size();
              Line temp;
              temp.resize(n);
              for (int i = 0; i &lt; n; i++)
              {
                  temp.at(i) = this-&gt;at(i) + line[i];
              }
              return temp;
          }
  
          Line Line::operator-(Line line)
          {
              int n = size();
              Line temp;
              temp.resize(n);
              for (int i = 0; i &lt; n; i++)
              {
                  temp.at(i) = this-&gt;at(i) - line[i];
              }
              return temp;
          }
  
  
          int main()
          {
              return 0;
          }
  </code></pre>
  
  <p>Is it possible to overload such operators from Vector class? should I just make functions (or methods) instead of operators? any other suggestions?</p>
  
  <p>ps1: I'm using Visual Studio 11 as compiler.</p>
  
  <p>ps2: I have not started the project as 'win32 project', it's console application.</p>
  
  <p>I'm geting the following errors:</p>
  
  <pre><code>Error   1   error LNK2019: unresolved external symbol "public: __thiscall Line::Line(void)" (??0Line@@QAE@XZ) referenced in function "public: class Line __thiscall Line::operator*(double)" (??DLine@@QAE?AV0@N@Z) C:\Users\Lucas\Documents\Visual Studio 11\Projects\test\test\test.obj   test
  
  
  Error   2   error LNK2019: unresolved external symbol "public: __thiscall Line::~Line(void)" (??1Line@@QAE@XZ) referenced in function "public: class Line __thiscall Line::operator*(double)" (??DLine@@QAE?AV0@N@Z)    C:\Users\Lucas\Documents\Visual Studio 11\Projects\test\test\test.obj   test
  </code></pre>