[Boost-bugs] [Boost C++ Libraries] #10665: boost::uuids::name_generator::operator() is not const, as promised in the documentation

Subject: [Boost-bugs] [Boost C++ Libraries] #10665: boost::uuids::name_generator::operator() is not const, as promised in the documentation
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-10-16 10:00:41


#10665: boost::uuids::name_generator::operator() is not const, as promised in the
documentation
------------------------------+-----------------------
 Reporter: lars.rohwedder@… | Owner: atompkins
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: uuid
  Version: Boost 1.56.0 | Severity: Problem
 Keywords: |
------------------------------+-----------------------
 The uuids::name_generator holds an internal state (detail::sha1 sha),
 which is resetted on every operator() call, hence the operator() cannot be
 const.

 So the generators aren't reentrant and cannot be shared between threads.
 :-(

 Solution:

 Make the state a local variable in the operator(). So the operator() can
 be const (as documentation promises) and the class becomes reentrant.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/10665>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:17 UTC