Boost C++ Libraries: Ticket #8162: lexical_cast is using math::changesign with long double regardless of whether BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS is defined or not. https://svn.boost.org/trac10/ticket/8162 <p> Line 1399-1400 of <code>boost::lexical_cast</code> looks like this: </p> <pre class="wiki">long double result = std::pow(10.0L, pow_of_10) * mantissa; value = static_cast&lt;T&gt;( has_minus ? (boost::math::changesign)(result) : result); </pre><p> It turns out that this causes problems in the guts of Boost.Math when <code>BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS</code> is defined. This is causing Boost.Test build failures. See for instance <a class="ext-link" href="http://tinyurl.com/af5453h"><span class="icon">​</span>http://tinyurl.com/af5453h</a>, which at the time of writing shows: </p> <pre class="wiki"> "g++" -ftemplate-depth-128 -O0 -fno-inline -Wall -g -ftemplate-depth-1024 -DBOOST_ALL_NO_LIB=1 -DBOOST_TEST_NO_AUTO_LINK=1 -I".." -c -o "/usr/home/jim/boost_rt/trunk/results/boost/bin.v2/libs/xpressive/test/c_traits.test/gcc-4.2.1/debug/link-static/c_traits.o" "../libs/xpressive/test/c_traits.cpp" In file included from ../libs/xpressive/test/./regress.ipp:19, from ../libs/xpressive/test/c_traits.cpp:15: ../boost/math/tools/promotion.hpp: In instantiation of 'boost::math::tools::promote_args&lt;long double, float, float, float, float, float&gt;': ../boost/lexical_cast.hpp:1400: instantiated from here ../boost/math/tools/promotion.hpp:141: error: invalid application of 'sizeof' to incomplete type 'boost::STATIC_ASSERTION_FAILURE&lt;false&gt;' }}} Aside: there is no entry for lexical_cast in libs/maintainers.txt. There should be. </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8162 Trac 1.4.3 Antony Polukhin Sun, 24 Feb 2013 07:07:02 GMT <link>https://svn.boost.org/trac10/ticket/8162#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8162#comment:1</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/83113" title="Add entry for lexical_cast library to maintainers.txt (refs #8162)">[83113]</a>) Add entry for lexical_cast library to maintainers.txt (refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8162" title="#8162: Bugs: lexical_cast is using math::changesign with long double regardless of ... (closed: fixed)">#8162</a>) </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Antony Polukhin</dc:creator> <pubDate>Sun, 24 Feb 2013 13:35:00 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8162#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8162#comment:2</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/83129" title="Do not use long double type in lexical_cast for internal variables if ...">[83129]</a>) Do not use long double type in lexical_cast for internal variables if Boost.Math has no functions for long double (refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8162" title="#8162: Bugs: lexical_cast is using math::changesign with long double regardless of ... (closed: fixed)">#8162</a>) Do not test lexical_cast on long doubles, if Boost.Math does not support long double </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Antony Polukhin</dc:creator> <pubDate>Sun, 24 Mar 2013 14:37:59 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/8162#comment:3 https://svn.boost.org/trac10/ticket/8162#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/83542" title="Merge from trunk: * Fixed incorrect usage of Boost.Math when it does ...">[83542]</a>) Merge from trunk: </p> <ul><li>Fixed incorrect usage of Boost.Math when it does not support long double (fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8162" title="#8162: Bugs: lexical_cast is using math::changesign with long double regardless of ... (closed: fixed)">#8162</a>) </li><li>Fixed ambiguity of boost::lexical_cast functions (fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7421" title="#7421: Bugs: previous way of coupling lexical_cast with std::transform is not working (closed: fixed)">#7421</a>) </li></ul> Ticket