title: A very long boolean array/std::bitset
body: <p>For some C++ code, my logic requires a boolean array containing 4*10^10 indices. I am using the STL container <code>std::bitset</code>. But its implementation as <code>template &lt; size_t N &gt; class bitset;</code> restricts the number of bits to the upper limit of the <code>size_t</code> (unsigned integral type) data type, which is 2^32-1 (or 2^64-1) {<strong>Can someone confirm this as well</strong>}.</p>
  
  <p>I thought of a workaround for this issue by creating an <code>array of bitset</code>, as in <code>bitset&lt;100000000&gt; checkSum[400]</code>;</p>
  
  <p>Is this legal? I am getting the following compilation error (test.cpp is my C++ file)</p>
  
  <pre><code>/tmp/cc0gR0c6.o: In function `__static_initialization_and_destruction_0(int, int)':
  test.cpp:(.text+0x35f): relocation truncated to fit: R_X86_64_32 against `.bss'
  test.cpp:(.text+0x373): relocation truncated to fit: R_X86_64_32 against `.bss'
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>Can this somehow be fixed or is there a better workaround?</p>