title: How does boost::filesystem::unique_path() resolve the need in mkstemp analogue in C++?
body: <p>An old <a href="https://svn.boost.org/trac/boost/ticket/590" rel="nofollow noreferrer">feature request</a> for Boost was requesting a feature similar to <a href="http://pubs.opengroup.org/onlinepubs/009695399/functions/mkstemp.html" rel="nofollow noreferrer">mkstemp</a> POSIX function to be available in Boost.Filesystem. The issue is long closed as fixed, with the comment</p>
  
  <blockquote>
    <p>The unique_path() function in Version 3 addresses the problem.</p>
  </blockquote>
  
  <p>But I fail to see how <code>unique_path</code> resolves the problem. It's basically the same as <a href="http://en.cppreference.com/w/cpp/io/c/tmpnam" rel="nofollow noreferrer">tmpnam</a>: after the name has been generated and before actual file is created, another program may have created its file with the same name.</p>
  
  <p>So how is it supposed to address the need in <code>mkstemp</code>?</p>