Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r74575 - in branches/release: boost boost/type_traits libs/type_traits libs/type_traits/doc libs/type_traits/doc/html libs/type_traits/doc/html/boost_typetraits/reference libs/type_traits/doc/html/index
From: john_at_[hidden]
Date: 2011-09-26 08:19:41


Author: johnmaddock
Date: 2011-09-26 08:19:40 EDT (Mon, 26 Sep 2011)
New Revision: 74575
URL: http://svn.boost.org/trac/boost/changeset/74575

Log:
Merge minor type traits fixes from Trunk.
Properties modified:
   branches/release/boost/type_traits/ (props changed)
   branches/release/boost/type_traits.hpp (props changed)
   branches/release/libs/type_traits/ (props changed)
Text files modified:
   branches/release/boost/type_traits/intrinsics.hpp | 64 +++++++++++++++++++++++++++++++++++++++
   branches/release/libs/type_traits/doc/conditional.qbk | 2
   branches/release/libs/type_traits/doc/html/boost_typetraits/reference/conditional.html | 2
   branches/release/libs/type_traits/doc/html/boost_typetraits/reference/is_union.html | 12 +++++--
   branches/release/libs/type_traits/doc/html/index.html | 2
   branches/release/libs/type_traits/doc/html/index/s11.html | 2
   branches/release/libs/type_traits/doc/html/index/s12.html | 2
   branches/release/libs/type_traits/doc/html/index/s13.html | 2
   branches/release/libs/type_traits/doc/html/index/s14.html | 2
   branches/release/libs/type_traits/doc/is_union.qbk | 10 +++--
   10 files changed, 84 insertions(+), 16 deletions(-)

Modified: branches/release/boost/type_traits/intrinsics.hpp
==============================================================================
--- branches/release/boost/type_traits/intrinsics.hpp (original)
+++ branches/release/boost/type_traits/intrinsics.hpp 2011-09-26 08:19:40 EDT (Mon, 26 Sep 2011)
@@ -1,4 +1,3 @@
-
 // (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
 // Use, modification and distribution are subject to the Boost Software License,
 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@@ -124,6 +123,68 @@
 # define BOOST_HAS_TYPE_TRAITS_INTRINSICS
 #endif
 
+#if defined(BOOST_CLANG) && defined(__has_feature)
+# include <boost/type_traits/is_same.hpp>
+# include <boost/type_traits/is_reference.hpp>
+# include <boost/type_traits/is_volatile.hpp>
+
+# if __has_feature(is_union)
+# define BOOST_IS_UNION(T) __is_union(T)
+# endif
+# if __has_feature(is_pod) && defined(_LIBCPP_VERSION)
+# define BOOST_IS_POD(T) __is_pod(T)
+# endif
+# if __has_feature(is_empty) && defined(_LIBCPP_VERSION)
+# define BOOST_IS_EMPTY(T) __is_empty(T)
+# endif
+# if __has_feature(has_trivial_constructor)
+# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) __has_trivial_constructor(T)
+# endif
+# if __has_feature(has_trivial_copy)
+# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) && !is_reference<T>::value && !is_volatile<T>::value)
+# endif
+# if __has_feature(has_trivial_assign)
+# define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && !is_volatile<T>::value)
+# endif
+# if __has_feature(has_trivial_destructor)
+# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T)
+# endif
+# if __has_feature(has_nothrow_constructor)
+# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) __has_nothrow_constructor(T)
+# endif
+# if __has_feature(has_nothrow_copy)
+# define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy(T) && !is_volatile<T>::value && !is_reference<T>::value)
+# endif
+# if __has_feature(has_nothrow_assign)
+# define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) && !is_volatile<T>::value)
+# endif
+# if __has_feature(has_virtual_destructor)
+# define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T)
+# endif
+# if __has_feature(is_abstract)
+# define BOOST_IS_ABSTRACT(T) __is_abstract(T)
+# endif
+# if __has_feature(is_base_of)
+# define BOOST_IS_BASE_OF(T,U) (__is_base_of(T,U) && !is_same<T,U>::value)
+# endif
+# if __has_feature(is_class)
+# define BOOST_IS_CLASS(T) __is_class(T)
+# endif
+# if __has_feature(is_convertible_to)
+# include <boost/type_traits/is_abstract.hpp>
+# define BOOST_IS_CONVERTIBLE(T,U) (__is_convertible_to(T,U) && !::boost::is_abstract<U>::value)
+# endif
+# if __has_feature(is_enum)
+# define BOOST_IS_ENUM(T) __is_enum(T)
+# endif
+# if __has_feature(is_polymorphic)
+# define BOOST_IS_POLYMORPHIC(T) __is_polymorphic(T)
+# endif
+# define BOOST_ALIGNMENT_OF(T) __alignof(T)
+
+# define BOOST_HAS_TYPE_TRAITS_INTRINSICS
+#endif
+
 #if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3) && !defined(__GCCXML__)))
 # include <boost/type_traits/is_same.hpp>
 # include <boost/type_traits/is_reference.hpp>
@@ -224,3 +285,4 @@
 
 
 
+

Modified: branches/release/libs/type_traits/doc/conditional.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/conditional.qbk (original)
+++ branches/release/libs/type_traits/doc/conditional.qbk 2011-09-26 08:19:40 EDT (Mon, 26 Sep 2011)
@@ -16,7 +16,7 @@
       template <bool B, class T, class U> struct __conditional;
     }
 
-If B is true, the member typedef type shall equal T. If B is false, the member typedef type shall equal F.
+If B is true, the member typedef type shall equal T. If B is false, the member typedef type shall equal U.
 
 This trait is really just an alias for `boost::mpl::if_c`.
 

Modified: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/conditional.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/conditional.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/conditional.html 2011-09-26 08:19:40 EDT (Mon, 26 Sep 2011)
@@ -37,7 +37,7 @@
 </pre>
 <p>
         If B is true, the member typedef type shall equal T. If B is false, the member
- typedef type shall equal F.
+ typedef type shall equal U.
       </p>
 <p>
         This trait is really just an alias for <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">if_c</span></code>.

Modified: branches/release/libs/type_traits/doc/html/boost_typetraits/reference/is_union.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/boost_typetraits/reference/is_union.html (original)
+++ branches/release/libs/type_traits/doc/html/boost_typetraits/reference/is_union.html 2011-09-26 08:19:40 EDT (Mon, 26 Sep 2011)
@@ -62,20 +62,24 @@
 <p>
         <span class="bold"><strong>Examples:</strong></span>
       </p>
+<p>
+ Given <code class="computeroutput"><span class="keyword">union</span> <span class="identifier">my_union</span>
+ <span class="special">{};</span></code> then:
+ </p>
 <div class="blockquote"><blockquote class="blockquote"><p>
- <code class="computeroutput"><span class="identifier">is_union</span><span class="special">&lt;</span><span class="keyword">void</span><span class="special">&gt;</span></code>
+ <code class="computeroutput"><span class="identifier">is_union</span><span class="special">&lt;</span><span class="identifier">my_union</span><span class="special">&gt;</span></code>
           inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
         </p></blockquote></div>
 <div class="blockquote"><blockquote class="blockquote"><p>
- <code class="computeroutput"><span class="identifier">is_union</span><span class="special">&lt;</span><span class="keyword">const</span> <span class="keyword">void</span><span class="special">&gt;::</span><span class="identifier">type</span></code>
+ <code class="computeroutput"><span class="identifier">is_union</span><span class="special">&lt;</span><span class="keyword">const</span> <span class="identifier">my_union</span><span class="special">&gt;::</span><span class="identifier">type</span></code>
           is the type <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
         </p></blockquote></div>
 <div class="blockquote"><blockquote class="blockquote"><p>
- <code class="computeroutput"><span class="identifier">is_union</span><span class="special">&lt;</span><span class="keyword">void</span><span class="special">&gt;::</span><span class="identifier">value</span></code> is an integral constant expression
+ <code class="computeroutput"><span class="identifier">is_union</span><span class="special">&lt;</span><span class="identifier">my_union</span><span class="special">&gt;::</span><span class="identifier">value</span></code> is an integral constant expression
           that evaluates to <span class="emphasis"><em>true</em></span>.
         </p></blockquote></div>
 <div class="blockquote"><blockquote class="blockquote"><p>
- <code class="computeroutput"><span class="identifier">is_union</span><span class="special">&lt;</span><span class="keyword">void</span><span class="special">*&gt;::</span><span class="identifier">value</span></code> is an integral constant expression
+ <code class="computeroutput"><span class="identifier">is_union</span><span class="special">&lt;</span><span class="identifier">my_union</span><span class="special">*&gt;::</span><span class="identifier">value</span></code> is an integral constant expression
           that evaluates to <span class="emphasis"><em>false</em></span>.
         </p></blockquote></div>
 <div class="blockquote"><blockquote class="blockquote"><p>

Modified: branches/release/libs/type_traits/doc/html/index.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/index.html (original)
+++ branches/release/libs/type_traits/doc/html/index.html 2011-09-26 08:19:40 EDT (Mon, 26 Sep 2011)
@@ -30,7 +30,7 @@
       Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert
       Ramey and Jeremy Siek</p></div>
 <div><div class="legalnotice">
-<a name="id893499"></a><p>
+<a name="id1003484"></a><p>
         Distributed under the Boost Software License, Version 1.0. (See accompanying
         file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
       </p>

Modified: branches/release/libs/type_traits/doc/html/index/s11.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/index/s11.html (original)
+++ branches/release/libs/type_traits/doc/html/index/s11.html 2011-09-26 08:19:40 EDT (Mon, 26 Sep 2011)
@@ -24,7 +24,7 @@
 </div>
 <div class="section">
 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id967562"></a>Class Index</h2></div></div></div>
+<a name="id1076316"></a>Class Index</h2></div></div></div>
 <p><a class="link" href="s11.html#idx_id_0">A</a> <a class="link" href="s11.html#idx_id_2">C</a> <a class="link" href="s11.html#idx_id_3">D</a> <a class="link" href="s11.html#idx_id_4">E</a> <a class="link" href="s11.html#idx_id_5">F</a> <a class="link" href="s11.html#idx_id_6">H</a> <a class="link" href="s11.html#idx_id_7">I</a> <a class="link" href="s11.html#idx_id_8">M</a> <a class="link" href="s11.html#idx_id_9">P</a> <a class="link" href="s11.html#idx_id_10">R</a> <a class="link" href="s11.html#idx_id_11">T</a></p>
 <div class="variablelist"><dl>
 <dt>

Modified: branches/release/libs/type_traits/doc/html/index/s12.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/index/s12.html (original)
+++ branches/release/libs/type_traits/doc/html/index/s12.html 2011-09-26 08:19:40 EDT (Mon, 26 Sep 2011)
@@ -24,7 +24,7 @@
 </div>
 <div class="section">
 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id968602"></a>Typedef Index</h2></div></div></div>
+<a name="id1077356"></a>Typedef Index</h2></div></div></div>
 <p><a class="link" href="s12.html#idx_id_18">F</a> <a class="link" href="s12.html#idx_id_23">R</a> <a class="link" href="s12.html#idx_id_24">T</a></p>
 <div class="variablelist"><dl>
 <dt>

Modified: branches/release/libs/type_traits/doc/html/index/s13.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/index/s13.html (original)
+++ branches/release/libs/type_traits/doc/html/index/s13.html 2011-09-26 08:19:40 EDT (Mon, 26 Sep 2011)
@@ -24,7 +24,7 @@
 </div>
 <div class="section">
 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id968712"></a>Macro Index</h2></div></div></div>
+<a name="id1077466"></a>Macro Index</h2></div></div></div>
 <p><a class="link" href="s13.html#idx_id_27">B</a></p>
 <div class="variablelist"><dl>
 <dt>

Modified: branches/release/libs/type_traits/doc/html/index/s14.html
==============================================================================
--- branches/release/libs/type_traits/doc/html/index/s14.html (original)
+++ branches/release/libs/type_traits/doc/html/index/s14.html 2011-09-26 08:19:40 EDT (Mon, 26 Sep 2011)
@@ -23,7 +23,7 @@
 </div>
 <div class="section">
 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id969254"></a>Index</h2></div></div></div>
+<a name="id1078008"></a>Index</h2></div></div></div>
 <p><a class="link" href="s14.html#idx_id_39">A</a> <a class="link" href="s14.html#idx_id_40">B</a> <a class="link" href="s14.html#idx_id_41">C</a> <a class="link" href="s14.html#idx_id_42">D</a> <a class="link" href="s14.html#idx_id_43">E</a> <a class="link" href="s14.html#idx_id_44">F</a> <a class="link" href="s14.html#idx_id_45">H</a> <a class="link" href="s14.html#idx_id_46">I</a> <a class="link" href="s14.html#idx_id_47">M</a> <a class="link" href="s14.html#idx_id_48">P</a> <a class="link" href="s14.html#idx_id_49">R</a> <a class="link" href="s14.html#idx_id_50">T</a> <a class="link" href="s14.html#idx_id_51">U</a></p>
 <div class="variablelist"><dl>
 <dt>

Modified: branches/release/libs/type_traits/doc/is_union.qbk
==============================================================================
--- branches/release/libs/type_traits/doc/is_union.qbk (original)
+++ branches/release/libs/type_traits/doc/is_union.qbk 2011-09-26 08:19:40 EDT (Mon, 26 Sep 2011)
@@ -30,14 +30,16 @@
 
 __examples
 
-[:`is_union<void>` inherits from `__true_type`.]
+Given `union my_union {};` then:
 
-[:`is_union<const void>::type` is the type `__true_type`.]
+[:`is_union<my_union>` inherits from `__true_type`.]
 
-[:`is_union<void>::value` is an integral constant
+[:`is_union<const my_union>::type` is the type `__true_type`.]
+
+[:`is_union<my_union>::value` is an integral constant
 expression that evaluates to /true/.]
 
-[:`is_union<void*>::value` is an integral constant
+[:`is_union<my_union*>::value` is an integral constant
 expression that evaluates to /false/.]
 
 [:`is_union<T>::value_type` is the type `bool`.]


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk