Opened 14 years ago

Closed 14 years ago

#2679 closed Patches (fixed)

boost::uniform_01 constructor

Reported by: rick68@… Owned by: No-Maintainer
Milestone: Boost 1.38.0 Component: random
Version: Boost 1.37.0 Severity: Optimization
Keywords: Cc: Jens.Maurer@…

Description

Hi,

In <boost/random/uniform_01.hpp>

line42: explicit uniform_01(base_type rng) line43: _rng(rng), line44: _factor(result_type(1) / line45: (result_type((_rng.max)()-(_rng.min)()) + line46: result_type(std::numeric_limits<base_result>::is_integer ? 1 : 0)))

If prototype "uniform_01(base_type rng)" change to "uniform_01(const base_type& rng)", it can just once copy object rng.

Attachments (1)

uniform_01.hpp.diff (1.1 KB ) - added by rick68@… 14 years ago.
Patch

Download all attachments as: .zip

Change History (2)

by rick68@…, 14 years ago

Attachment: uniform_01.hpp.diff added

Patch

comment:1 by Steven Watanabe, 14 years ago

Resolution: fixed
Status: newclosed

(In [51337]) Convert uniform_01 to the current distribution interface, dispatching on the first template paramter to retain backwards compatibility. Fixes #599. Fixes #1544. Fixes #2679

Note: See TracTickets for help on using tickets.