Boost C++ Libraries: Ticket #1068: Mersenne twister disables streaming for Visual C++ https://svn.boost.org/trac10/ticket/1068 <p> boost/mersenne_twister.hpp disables the streamable concept because boost config machinery says that vc 7.1/8 cannot handle member template friends. This appears not to be the case. </p> <p> To work around it, I do the following: </p> <p> <em> This hack is necessary because boost thinks that Visual C++ still </em> cannot handle member function templates <em> It is needed to make mersenne_twister streamable #include &lt;boost/config.hpp&gt; #if defined(BOOST_MSVC) &amp;&amp; defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS) # undef BOOST_NO_MEMBER_TEMPLATE_FRIENDS # define FINCAD_BOOST_RNG_HACK #endif </em></p> <p> #include &lt;boost/random/mersenne_twister.hpp&gt; </p> <p> #ifdef FINCAD_BOOST_RNG_HACK # define BOOST_NO_MEMBER_TEMPLATE_FRIENDS # undef FINCAD_BOOST_RNG_HACK #endif </p> <p> I don't know how you would fix it for the twister. It really sounds like a config machinery issue but it affects the mersenne twister code negatively. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1068 Trac 1.4.3 Richard Webb <richard.webb@…> Mon, 24 Dec 2007 00:40:16 GMT <link>https://svn.boost.org/trac10/ticket/1068#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1068#comment:1</guid> <description> <p> This also seems to be the case for uniform_int - removing the </p> <pre class="wiki">#if !defined(BOOST_NO_OPERATORS_IN_NAMESPACE) &amp;&amp; !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS) </pre><p> around the streaming operators in uniform_int.hpp allows me to stream a uniform_int in and out of a std::stringstream in both VC7.1/VC8. </p> <p> I haven't tried doing this with any other Random classes yet - might be worth a try to see what happens though. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Clow</dc:creator> <pubDate>Sat, 09 Feb 2008 01:10:29 GMT</pubDate> <title>owner set https://svn.boost.org/trac10/ticket/1068#comment:2 https://svn.boost.org/trac10/ticket/1068#comment:2 <ul> <li><strong>owner</strong> set to <span class="trac-author">No-Maintainer</span> </li> </ul> Ticket Steven Watanabe Mon, 23 Feb 2009 15:48:31 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/1068#comment:3 https://svn.boost.org/trac10/ticket/1068#comment:3 <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/51413" title="Enable stream operators on msvc. Fixes #1068. Fixes #1691">[51413]</a>) Enable stream operators on msvc. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/1068" title="#1068: Bugs: Mersenne twister disables streaming for Visual C++ (closed: fixed)">#1068</a>. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/1691" title="#1691: Bugs: [Random] Brokem MSVC workaround (closed: fixed)">#1691</a> </p> Ticket