title: Compile-time error while using custom C++ header file - "std_lib_facilities.h"
body: <p>I'm new to C++ and I'm learning using this book - Programming Principles &amp; Practice using C++ by Bjarne Stroustrup, 1st edition. The author uses a header file <code>std_lib_facilities.h</code> (<a href="http://www.stroustrup.com/Programming/std_lib_facilities.h" rel="nofollow">here</a>) for every program - examples, drill or exercises.</p>
  
  <p>I'm trying to solve this question 13 from chapter 4 -</p>
  
  <blockquote>
    <p>Create a program to find all the prime numbers between 1 and 100.
    There is a classic method for doing this, called the "Sieve of
    Eratosthenes." U you don't know that method, get on the web and look
    it up. Write your program using this method.</p>
  </blockquote>
  
  <p>When I try to compile my program (I'm using Visual Studio 2013), here -</p>
  
  <pre><code>// Sieve of Eratosthenes
  
  #include "std_lib_facilities.h"
  
  int main()
  {
      int max = 100, i = 0, j = 0, total = 0;
      vector&lt;bool&gt; primes(max + 1, true);
  
      // Find primes using Sieve of Eratosthenes method
      primes[0] = false;
      primes[1] = false;
      for (i = 0; i &lt;= max; ++i){
          if (primes[i] == true){
              for (j = 2; i * j &lt;= max; ++j){
                  primes[i * j] = false;
              }
          }
      }
  
      // Show primes
      cout &lt;&lt; "\n\nAll prime numbers from 1 to " &lt;&lt; max &lt;&lt; " -\n\n";
      for (i = 0; i &lt; primes.size(); ++i)
          if (primes[i] == true){
              cout &lt;&lt; i &lt;&lt; " ";
              ++total;
          }
      cout &lt;&lt; "\n\nTotal number of prime numbers == " &lt;&lt; total &lt;&lt; "\n\n";
  
      keep_window_open();
      return 0;
  }
  </code></pre>
  
  <p>it shows this error which I'm unable to understand -</p>
  
  <pre><code>1&gt;  13_4exercise.cpp
  1&gt;c:\users\i$hu\documents\visual studio 2013\projects\c++ development\c++ development\13_4exercise.cpp(23): warning C4018: '&lt;' : signed/unsigned mismatch
  1&gt;c:\users\i$hu\documents\visual studio 2013\projects\c++ development\c++ development\std_lib_facilities.h(88): error C2440: 'return' : cannot convert from 'std::_Vb_reference&lt;std::_Wrap_alloc&lt;std::allocator&lt;char32_t&gt;&gt;&gt;' to 'bool &amp;'
  1&gt;          c:\users\i$hu\documents\visual studio 2013\projects\c++ development\c++ development\std_lib_facilities.h(86) : while compiling class template member function 'bool &amp;Vector&lt;bool&gt;::operator [](unsigned int)'
  1&gt;          c:\users\i$hu\documents\visual studio 2013\projects\c++ development\c++ development\13_4exercise.cpp(11) : see reference to function template instantiation 'bool &amp;Vector&lt;bool&gt;::operator [](unsigned int)' being compiled
  1&gt;          c:\users\i$hu\documents\visual studio 2013\projects\c++ development\c++ development\13_4exercise.cpp(8) : see reference to class template instantiation 'Vector&lt;bool&gt;' being compiled
  </code></pre>
  
  <p>What does this error mean and how to resolve this?</p>