title: boost directory_iterator example - how to list directory files not recursive
body: <p>How should I use <code>directory_iterator</code> to list directory files (not recursive)?</p>
  
  <p>Also what header files / libs should I add/link or other settings I should make? I'm using boost in my project but by some reason <code>directory_iterator</code> is "underclared identifier" while I can use other boost features.</p>
  
  <p><strong>Update</strong> </p>
  
  <p>Another solution:</p>
  
  <pre><code>#include &lt;filesystem&gt;
  #include &lt;boost/filesystem.hpp&gt;
  #include &lt;iostream&gt;
  
  using namespace boost::filesystem;
  
  for (directory_iterator itr(path_ss); itr!=directory_iterator(); ++itr)
  {
      cout &lt;&lt; itr-&gt;path().filename() &lt;&lt; ' '; // display filename only
      if (is_regular_file(itr-&gt;status())) cout &lt;&lt; " [" &lt;&lt; file_size(itr-&gt;path()) &lt;&lt; ']';
      cout &lt;&lt; '\n';
  }
  </code></pre>