title: reading until user enters blank line
body: <p>Suppose I want to read lines from the console and put those into a container until the user enters a blank line. I do not want that blank line ending up in my container, though. I can think of five different solutions:</p>
  
  <p>a) break from loop</p>
  
  <pre><code>std::vector&lt;std::string&gt; container;
  for (; ;)
  {
      std::string line = get_input();
      if (line.empty()) break;
      container.push_back(line);
  }
  </code></pre>
  
  <p>b) read before loop and inside loop</p>
  
  <pre><code>std::vector&lt;std::string&gt; container;
  std::string line = get_input();
  while (!line.empty())
  {
      container.push_back(line);
      line = get_input();
  }
  </code></pre>
  
  <p>c) read as part of loop condition, assignment version</p>
  
  <pre><code>std::vector&lt;std::string&gt; container;
  std::string line;
  while (!(line = get_input()).empty())
  {
      container.push_back(line);
  }
  </code></pre>
  
  <p>d) read as part of loop condition, sequence version</p>
  
  <pre><code>std::vector&lt;std::string&gt; container;
  std::string line;
  while (line = get_input(), !line.empty())
  {
      container.push_back(line);
  }
  </code></pre>
  
  <p>e) read too much, remove it after loop</p>
  
  <pre><code>std::vector&lt;std::string&gt; container;
  std::string line;
  do
  {
      line = get_input();
      container.push_back(line);
  }
  while (!line.empty());
  container.pop_back();
  </code></pre>
  
  <p>So, which solution would you prefer, and why? Which would be the easiest to understand for a beginner?</p>