Opened 4 years ago

Closed 13 months ago

#10665 closed Bugs (fixed)

boost::uuids::name_generator::operator() is not const, as promised in the documentation

Reported by: lars.rohwedder@… Owned by: James E. King, III
Milestone: Boost 1.66.0 Component: uuid
Version: Boost 1.56.0 Severity: Problem
Keywords: Cc:

Description

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.

Change History (3)

comment:1 Changed 14 months ago by James E. King, III

Owner: changed from Andy Tompkins to James E. King, III

comment:2 Changed 14 months ago by James E. King, III

comment:3 Changed 13 months ago by James E. King, III

Milestone: To Be DeterminedBoost 1.66.0
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.