Boost C++ Libraries: Ticket #2679: boost::uniform_01 constructor https://svn.boost.org/trac10/ticket/2679 <p> Hi, </p> <p> In &lt;boost/random/uniform_01.hpp&gt; </p> <p> 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&lt;base_result&gt;::is_integer ? 1 : 0))) </p> <p> If prototype "uniform_01(base_type rng)" change to "uniform_01(const base_type&amp; rng)", it can just once copy object rng. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2679 Trac 1.4.3 rick68@… Mon, 26 Jan 2009 09:08:22 GMT attachment set https://svn.boost.org/trac10/ticket/2679 https://svn.boost.org/trac10/ticket/2679 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">uniform_01.hpp.diff</span> </li> </ul> <p> Patch </p> Ticket Steven Watanabe Thu, 19 Feb 2009 23:27:42 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/2679#comment:1 https://svn.boost.org/trac10/ticket/2679#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> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/51337" title="Convert uniform_01 to the current distribution interface, dispatching ...">[51337]</a>) Convert uniform_01 to the current distribution interface, dispatching on the first template paramter to retain backwards compatibility. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/599" title="#599: Bugs: uniform_01 copies engine instead of using a reference (closed: fixed)">#599</a>. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/1544" title="#1544: Bugs: uniform_01 w/ref template param causes ref to ref error (closed: fixed)">#1544</a>. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2679" title="#2679: Patches: boost::uniform_01 constructor (closed: fixed)">#2679</a> </p> Ticket