Opened 8 years ago

Closed 5 years 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 by James E. King, III, 5 years ago

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

comment:2 by James E. King, III, 5 years ago

comment:3 by James E. King, III, 5 years ago

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