Boost C++ Libraries: Ticket #12720: Implement is_floating_point and is_arithmetic for float128 https://svn.boost.org/trac10/ticket/12720 <p> The following program </p> <pre class="wiki">#include &lt;iostream&gt; #include &lt;random&gt; #include &lt;boost/multiprecision/float128.hpp&gt; int main() { unsigned s = std::random_device()(); std::mt19937 g(s); std::uniform_real_distribution&lt;boost::multiprecision::float128&gt; dis; std::cout &lt;&lt; dis(g) &lt;&lt; "\n"; } </pre><p> fails to compile with g++ 6.3.1 due to this static assertion failure </p> <pre class="wiki">/usr/include/c++/6.3.1/bits/random.h:160:2: error: static assertion failed: template argument not a floating point type static_assert(std::is_floating_point&lt;_DInputType&gt;::value, ^~~~~~~~~~~~~ </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12720 Trac 1.4.3 John Maddock Mon, 02 Jan 2017 16:54:32 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/12720#comment:1 https://svn.boost.org/trac10/ticket/12720#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">wontfix</span> </li> </ul> <p> Sorry, no can do: type_traits work on the what kind of type an object is, not how they behave. float128 is a <strong>class type</strong> (and responds true to <code>is_class</code>), it genuinely should not respond true to <code>is_arithmetic</code> etc. </p> <p> You code above should work fine if you use boost::mt19937 etc rather than the std versions. </p> <p> It's probably worth while filing a gcc/libstdc++ bug report as well since the assert they are using could be replaced by one that uses numeric_limits&lt;&gt; to verify a type behaves as a floating point type - and numeric_limits is one trait we are allowed to specialize (and do so). </p> Ticket