Boost C++ Libraries: Ticket #5666: is_class documented as yielding "true" for unions, but documentation contradicts that https://svn.boost.org/trac10/ticket/5666 <p> The is_class documentation at <a href="http://www.boost.org/doc/libs/1_46_1/libs/type_traits/doc/html/boost_typetraits/reference/is_class.html">http://www.boost.org/doc/libs/1_46_1/libs/type_traits/doc/html/boost_typetraits/reference/is_class.html</a> says </p> <blockquote> <p> "Inherits: If T is a (possibly cv-qualified) class type then inherits from true_type, otherwise inherits from false_type" </p> </blockquote> <p> This means that is_class shall be derived from true_type if T is an union, because an union is a class type. But the "Compiler Compatibility" section contains some really confusing text: </p> <blockquote> <p> "Without (some as yet unspecified) help from the compiler, we cannot distinguish between union and class types, as a result this type will erroneously inherit from true_type for union types." </p> </blockquote> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5666 Trac 1.4.3 Thomas Heller Thu, 30 Jun 2011 21:21:33 GMT <link>https://svn.boost.org/trac10/ticket/5666#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5666#comment:1</guid> <description> <p> Even the cited standard paragraph states this: </p> <p> 3.9.2: "unions, which are classes capable of containing objects of different types at different times, 9.5;" </p> </description> <category>Ticket</category> </item> <item> <author>schaub.johannes@…</author> <pubDate>Thu, 30 Jun 2011 21:24:53 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5666#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5666#comment:2</guid> <description> <p> Also at 9p4: "A union is a class defined with the class-key union; its members are public by default and it holds only one data member at a time (9.5)." and the remaining text of the spec. </p> </description> <category>Ticket</category> </item> <item> <author>Michel MORIN <mimomorin@…></author> <pubDate>Fri, 19 Aug 2011 18:17:55 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/5666 https://svn.boost.org/trac10/ticket/5666 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">is_class_documentation_fix.patch</span> </li> </ul> <p> A patch for <code>is_class.qbk</code>. </p> Ticket Michel MORIN <mimomorin@…> Fri, 19 Aug 2011 18:25:20 GMT owner, type, component, milestone changed https://svn.boost.org/trac10/ticket/5666#comment:3 https://svn.boost.org/trac10/ticket/5666#comment:3 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Matias Capeletto</span> to <span class="trac-author">John Maddock</span> </li> <li><strong>type</strong> <span class="trac-field-old">Bugs</span> → <span class="trac-field-new">Patches</span> </li> <li><strong>component</strong> <span class="trac-field-old">Documentation</span> → <span class="trac-field-new">type_traits</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.48.0</span> </li> </ul> <p> C++0x FDIS explicitly excludes a union type for <code>is_class</code>. I attached a patch to sync with this. </p> Ticket Michel MORIN <mimomorin@…> Sat, 20 Aug 2011 00:56:12 GMT attachment set https://svn.boost.org/trac10/ticket/5666 https://svn.boost.org/trac10/ticket/5666 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">is_empty_documentation_fix.patch</span> </li> </ul> <p> A patch for <code>is_empty.qbk</code>. </p> Ticket Michel MORIN <mimomorin@…> Sat, 20 Aug 2011 00:57:21 GMT attachment set https://svn.boost.org/trac10/ticket/5666 https://svn.boost.org/trac10/ticket/5666 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">intrinsics_comments_fix.patch</span> </li> </ul> <p> A patch for fixing comments in <code>intrinsics.hpp</code>. </p> Ticket Michel MORIN <mimomorin@…> Sat, 20 Aug 2011 00:57:54 GMT <link>https://svn.boost.org/trac10/ticket/5666#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5666#comment:4</guid> <description> <p> Similarly, <code>is_empty.qbk</code> needs to be fixed (a patch attached). I also fixed comments in <code>intrinsics.hpp</code> accordingly. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Sat, 20 Aug 2011 09:02:58 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/5666#comment:5 https://svn.boost.org/trac10/ticket/5666#comment:5 <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/73942" title="Documentation tweaks. Fixes #5666.">[73942]</a>) Documentation tweaks. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5666" title="#5666: Patches: is_class documented as yielding &#34;true&#34; for unions, but documentation ... (closed: fixed)">#5666</a>. </p> Ticket