id summary reporter owner description type status milestone component version severity resolution keywords cc 9614 Optional File Creation for boost::interprocess::file_lock Peter LaDow Ion Gaztañaga "An optional overload (default second argument?) for the constructor to create and open the file to use for the file_lock would be very useful. Currently, when creating a file lock, I typically do something like: {{{ std::ofstream tmpf(/path/to/lock/file); tmpf.close(); boost::interprocess:file_lock f_lock(/path/to/lock/file); }}} Say I have a class, such as: {{{ class Foo { public: Foo(); private: boost::interprocess::file_lock f_lock; }; }}} I have to do the following in the constructor: {{{ Foo::Foo() { std::ofstream tmpf(/path/to/lock/file); tmpf.close(); boost::interprocess:file_lock tmp_lock(/path/to/lock/file); f_lock.swap(tmp_lock); } }}} This is cumbersome and limits usefulness in initializer lists. Tweaking the constructor to something like: {{{ file_lock::file_lock(const char *path, bool create = false); }}} Would allow a constructor to do the following: {{{ Foo::Foo() : f_lock(/path/to/file/lock, true) { } }}} " Feature Requests new To Be Determined interprocess Boost 1.54.0 Problem