Boost C++ Libraries: Ticket #8158: atomic_flag default constructor is not trivial https://svn.boost.org/trac10/ticket/8158 <p> The current implementation of atomic_flag has non-trivial default constructor that initializes the flag to the non-signalled state. This contradicts the standard which requires the default constructor to be trivial, leaving the flag uninitialized. The flag should be initialized with the ATOMIC_FLAG_INIT macro, which is not currently provided by Boost.Atomic. </p> <p> The atomic_flag interface should be as close as possible to C++11, which would improve portability. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8158 Trac 1.4.3 Andrey Semashev Sat, 17 May 2014 16:03:26 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/8158#comment:1 https://svn.boost.org/trac10/ticket/8158#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Fixed in git develop and master, will be released in 1.56. </p> <p> The default constructor of atomic_flag cannot be trivial in C++03 because the copy constructor has to be declared private (to prohibit copying). With a C++11 compiler the implementation now defines a constexpr constructor which basically provides the same guarantees as the trivial constructor would have. Also, BOOST_ATOMIC_FLAG_INIT is provided in this case. </p> Ticket