title: Overloading the "=" operator or Conversion Constructor?
body: <p>I'm trying to implement a BigInteger class using C++. Currently my implementation looks like this.</p>
  <pre><code>
  #define HEX_SIZE 65536
  #define MAX_SLOT 65535
  #define BASE 16
  
  template &lt;int T&gt;
  class BigInt
  {
   std::vector&lt;uint16_t&gt; digits;
  
      BigInt&lt;T&gt;(unsigned int c)
      {
          unsigned int initSize = T/BASE;
          unsigned int diff =c % HEX_SIZE;
          
          if(diff== 0)
          {
              for(int i=0;i&lt;initSize-1;i++)
              {
                  this-&gt;digits.push_back(0);
              }
              this-&gt;digits.push_back(c);
  
          }else{
              int store = (c - diff)/HEX_SIZE;
              for(int i=0;i&lt;initSize-2;i++)
              {
                  this-&gt;digits.push_back(0);
              }
              this-&gt;digits.push_back(store);
              this-&gt;digits.push_back(c);
          }
      }//32 bit unsigned int parameter.
  }
  </code></pre>
  <p>I'd like it to be able to convert smaller numbers to larger ones, something like this.</p>
  <pre><code>BigInt &lt;512&gt; A (25);
  BigInt &lt;1024&gt; B = A;
  </code></pre>
  <p>I'm very new to OOP and C++, reading around I've seen that overloading the = operator is an option, however I've also seen something called a conversion constructor recommended to implement this functionality. Not sure which to try and implement or even how.</p>