title: one instance of application, platform independent, C++11
body: <p>Is there a platform independent way in C++11 (boost is available) to make sure that only one instance of an application is started at a time? (I'd prefer not to run with the "file and (f)lock" method as it requires platform specific code, but I will do so if there is no better way.)</p>
  
  <p>There is no (simple) other way like an unavailable port that I can use as a criterion in my scenario neither. And yes, I am aware of DOS problems - so no need to point those out.</p>
  
  <p>I found the following similar question suggesting a <a href="https://stackoverflow.com/a/3706960/3963625">solution</a> with boost. 
  The solution has two problems though:</p>
  
  <ul>
  <li>Minor: It seems a call to <code>shared_memory_object::remove("shared_memory");</code> is missing (in the case "the race was won"). But I am not really familiar with <code>boost::interprocess</code>, so maybe I am wrong?!</li>
  <li>Major: If the program crashes the shared memory is still existing and thus the next instance of the program will fail to start.</li>
  </ul>
  
  <p>I also found this <a href="https://stackoverflow.com/q/171213/3963625">question</a>. No answer there that excites me. But it's a C++98 question so maybe with C++11 or boost there is a new/different way now?</p>