Boost C++ Libraries: Ticket #2788: boost::uniform_01<> template parameter mistake https://svn.boost.org/trac10/ticket/2788 <p> Hi, </p> <p> In &lt;boost/random/uniform_01.hpp&gt; (<a class="changeset" href="https://svn.boost.org/trac10/changeset/51337" title="Convert uniform_01 to the current distribution interface, dispatching ...">r51337</a>) </p> <p> line183: template&lt;class <a class="missing wiki">UniformRandomNumberGenerator</a> = double, class <a class="missing wiki">RealType</a> = double&gt; </p> <p> <a class="missing wiki">UniformRandomNumberGenerator</a> can't use "double" to be default type. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2788 Trac 1.4.3 rick68@… Sat, 21 Feb 2009 12:40:28 GMT <link>https://svn.boost.org/trac10/ticket/2788#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2788#comment:1</guid> <description> <p> Hi, </p> <p> I confuse old "<a class="missing wiki">UniformRandomNumberGenerator</a>" and your new "<a class="missing wiki">UniformRandomNumberGenerato</a>". I tried in my test code. </p> <hr /> <p> #include &lt;boost/random.hpp&gt; </p> <p> int main(void) { </p> <blockquote> <p> boost::uniform_01&lt;boost::mt19937&gt; rng; return 0; </p> </blockquote> <p> } </p> <hr /> <p> It's can't compile success. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Sat, 21 Feb 2009 16:08:27 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/2788#comment:2 https://svn.boost.org/trac10/ticket/2788#comment:2 <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">invalid</span> </li> </ul> <p> Yes. That's expected. The code shouldn't have compiled before my changes either. </p> <pre class="wiki">#include &lt;boost/random.hpp&gt; int main(void) { boost::uniform_01&lt;boost::mt19937&gt; rng; // illegal--no default constructor boost::mt19937 rng; // ok. Old implementation. Copies rng. boost::uniform_01&lt;boost::mt19937&gt; dist(rng); double x = dist(); // ok. Modification of old implementation. // stores a reference to rng. boost::uniform_01&lt;boost::mt19937&amp;&gt; dist(rng); double x = dist(); // ok. new implementation boost::uniform_01&lt;&gt; dist; double x = dist(rng); return 0; } </pre> Ticket