title: C++ How can I assign a datatype to a binary sequence?
body: <p>I have a binary sequence. This sequence represents an arbitrary precision integer but as far as the computer is concerned, it's just a binary sequence. I'm working in C++, with the multiprecision library. I only know how to assign <em>values</em> to the arbitrary precision datatype:</p>
  
  <pre><code>mp::cpp_int A = 51684861532215151;
  </code></pre>
  
  <p>How can I take a binary sequence and directly assign it to the datatype mp::cpp_int? I realize I can go through each bit and add 2^<em>bit</em> where ever I hit a <em>1</em>, but I'm trying to avoid doing this.</p>
  
  <hr>
  
  <p>REPLY:</p>
  
  <p>Galik: My compiler (visual studio 2013) isn't liking that for some reason.</p>
  
  <pre><code>mp::cpp_int A = 0b0010011;
  </code></pre>
  
  <p>It keeps putting the red squigly after the first 0.</p>
  
  <p>Also yup, boost multiprecision.</p>