Boost C++ Libraries: Ticket #10267: boost::enable_if_c incorrect result on IBM xlC compiler https://svn.boost.org/trac10/ticket/10267 <p> Getting unexpected results when using boost::enable_if_c with boost::is_same on the IBM xlC, while Sun Studio and gcc yield the correct result: </p> <p> Test program test.cpp: </p> <pre class="wiki">#include &lt;boost/utility/enable_if.hpp&gt; #include &lt;boost/type_traits/is_same.hpp&gt; #include &lt;iostream&gt; template&lt;typename Key, class Enable = void&gt; struct not_bool { static const bool value = false; }; template&lt;typename Key&gt; struct not_bool&lt;Key, typename boost::enable_if_c&lt; !boost::is_same&lt;Key, bool&gt;::value&gt;::type&gt; { static const bool value = true; }; int main(int argc, char **argv) { std::cout &lt;&lt; not_bool&lt;bool&gt;::value &lt;&lt; std::endl; std::cout &lt;&lt; not_bool&lt;unsigned long&gt;::value &lt;&lt; std::endl; return 0; } </pre><p> Using xlC: </p> <pre class="wiki">$ xlC_r -qversion IBM XL C/C++ for AIX, V11.1 (5724-X13) Version: 11.01.0000.0010 $ xlC_r test.cpp -o test $ ./test 0 0 </pre><p> Using Sun Studio: </p> <pre class="wiki">$ CC -V CC: Sun C++ 5.10 SunOS_sparc Patch 128228-25 2013/02/20 $ CC test.cpp -o test $ ./test 0 1 </pre><p> Using gcc: </p> <pre class="wiki">$ g++ -v gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) $ g++ test.cpp -o test $ ./test 0 1 </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10267 Trac 1.4.3 viboes Sat, 02 Aug 2014 14:59:28 GMT component changed; owner set https://svn.boost.org/trac10/ticket/10267#comment:1 https://svn.boost.org/trac10/ticket/10267#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">No-Maintainer</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">utility</span> </li> </ul> Ticket Steven Watanabe Fri, 27 Feb 2015 16:12:56 GMT <link>https://svn.boost.org/trac10/ticket/10267#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10267#comment:2</guid> <description> <p> This looks like a compiler bug. In any case, I highly doubt that there's any way to work around this in boost::enable_if_c. Does it work without the "!"? What about if you use enable_if instead of enable_if_c? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrey Semashev</dc:creator> <pubDate>Sat, 08 Jul 2017 20:28:26 GMT</pubDate> <title>owner, status, component changed; resolution set https://svn.boost.org/trac10/ticket/10267#comment:3 https://svn.boost.org/trac10/ticket/10267#comment:3 <ul> <li><strong>owner</strong> changed from <span class="trac-author">No-Maintainer</span> to <span class="trac-author">Peter Dimov</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>component</strong> <span class="trac-field-old">utility</span> → <span class="trac-field-new">core</span> </li> </ul> <p> I agree with Steven's comment and given there was no response in 2 years I'm closing the ticket. </p> Ticket