title: boost::multiprecision::cpp_int is being copied then deleted every time I try and print it
body: <p>When I print a <code>cpp_int</code> from Boost, it seems that the entire object is copied.</p>
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt;
  #include &lt;boost/multiprecision/cpp_int.hpp&gt;
  using std::cout;
  
  void* operator new(size_t size) {
      void *memory = malloc(size);
      cout &lt;&lt; &quot;New: &quot; &lt;&lt; memory &lt;&lt; &quot; &quot; &lt;&lt; size &lt;&lt; &quot;\n&quot;;
      return memory;
  }
  
  int main() {
      auto u = new boost::multiprecision::cpp_int(&quot;987654321&quot;);
      cout &lt;&lt; &quot;------\n&quot;;
      cout &lt;&lt; *u &lt;&lt; &quot;\n&quot;;
  }
  </code></pre>
  <pre><code>New: 0x23d4e70 32
  ------
  New: 0x23d52b0 31
  987654321
  </code></pre>
  <p>The confusing thing is that the overload for printing is <code>ostream&amp; operator&lt;&lt;(ostream&amp;, const T&amp;)</code>, but passing <code>*u</code> into a function such as <code>template &lt;typename T&gt; void cr(const T&amp;) {}</code> does not show any new memory allocation. I also tried <code>u-&gt;str()</code> but this also causes a 2nd memory allocation.</p>
  <p>I also tried overloading the cout for the <code>cpp_int</code>:</p>
  <pre><code>std::ostream&amp; operator &lt;&lt;(std::ostream&amp; stream, const boost::multiprecision::cpp_int&amp; mpi) {
      return stream &lt;&lt; mpi.str();
  }
  </code></pre>
  <p>but the result was the same. However, I am also surprised that this compiled since I had expected there to already be an overload. My assumption is that I may need to modify something more back-end.</p>
  <p>How can I avoid this? I don't want to be copying and then deleting 30+ bytes every time I want to print a <code>cpp_int</code>.</p>
  <p>If not, switching data type it not out of the question, as long as the interface is similar for minimal refactoring.</p>