Fix some typos in docs.

Added stricter tests.
All merged from Trunk.

[SVN r54207]
This commit is contained in:
John Maddock
2009-06-22 12:18:04 +00:00
parent afe1661308
commit 96cbc09229
32 changed files with 213 additions and 43 deletions

View File

@@ -56,7 +56,7 @@
method available to them.
</p>
<a name="boost_typetraits.background.type_traits"></a><h5>
<a name="id777348"></a>
<a name="id777154"></a>
<a class="link" href="background.html#boost_typetraits.background.type_traits">Type Traits</a>
</h5>
<p>
@@ -84,7 +84,7 @@
given.
</p>
<a name="boost_typetraits.background.implementation"></a><h5>
<a name="id777412"></a>
<a name="id777217"></a>
<a class="link" href="background.html#boost_typetraits.background.implementation">Implementation</a>
</h5>
<p>
@@ -174,7 +174,7 @@
in the default template.
</p>
<a name="boost_typetraits.background.optimized_copy"></a><h5>
<a name="id786717"></a>
<a name="id777954"></a>
<a class="link" href="background.html#boost_typetraits.background.optimized_copy">Optimized copy</a>
</h5>
<p>
@@ -247,7 +247,7 @@
otherwise it will call the "slow but safe version".
</p>
<a name="boost_typetraits.background.was_it_worth_it_"></a><h5>
<a name="id787064"></a>
<a name="id778301"></a>
<a class="link" href="background.html#boost_typetraits.background.was_it_worth_it_">Was it worth it?</a>
</h5>
<p>
@@ -280,7 +280,7 @@
</li>
</ul></div>
<div class="table">
<a name="id787101"></a><p class="title"><b>Table<EFBFBD>1.1.<2E>Time taken to copy 1000 elements using `copy&lt;const
<a name="id778338"></a><p class="title"><b>Table<EFBFBD>1.1.<2E>Time taken to copy 1000 elements using `copy&lt;const
T*, T*&gt;` (times in micro-seconds)</b></p>
<div class="table-contents"><table class="table" summary="Time taken to copy 1000 elements using `copy&lt;const
T*, T*&gt;` (times in micro-seconds)">
@@ -379,7 +379,7 @@
</table></div>
</div>
<br class="table-break"><a name="boost_typetraits.background.pair_of_references"></a><h5>
<a name="id787239"></a>
<a name="id778476"></a>
<a class="link" href="background.html#boost_typetraits.background.pair_of_references">Pair of References</a>
</h5>
<p>
@@ -416,7 +416,7 @@
to hold non-reference types, references, and constant references:
</p>
<div class="table">
<a name="id787500"></a><p class="title"><b>Table<EFBFBD>1.2.<2E>Required Constructor Argument Types</b></p>
<a name="id782108"></a><p class="title"><b>Table<EFBFBD>1.2.<2E>Required Constructor Argument Types</b></p>
<div class="table-contents"><table class="table" summary="Required Constructor Argument Types">
<colgroup>
<col>
@@ -481,7 +481,7 @@
adds a reference to its type, unless it is already a reference.
</p>
<div class="table">
<a name="id787604"></a><p class="title"><b>Table<EFBFBD>1.3.<2E>Using add_reference to synthesize the correct constructor
<a name="id782211"></a><p class="title"><b>Table<EFBFBD>1.3.<2E>Using add_reference to synthesize the correct constructor
type</b></p>
<div class="table-contents"><table class="table" summary="Using add_reference to synthesize the correct constructor
type">
@@ -598,7 +598,7 @@
easier to maintain and easier to understand.
</p>
<a name="boost_typetraits.background.conclusion"></a><h5>
<a name="id788062"></a>
<a name="id782669"></a>
<a class="link" href="background.html#boost_typetraits.background.conclusion">Conclusion</a>
</h5>
<p>
@@ -611,7 +611,7 @@
can be optimal as well as generic.
</p>
<a name="boost_typetraits.background.acknowledgements"></a><h5>
<a name="id788079"></a>
<a name="id782686"></a>
<a class="link" href="background.html#boost_typetraits.background.acknowledgements">Acknowledgements</a>
</h5>
<p>
@@ -619,7 +619,7 @@
comments when preparing this article.
</p>
<a name="background.references"></a><a name="boost_typetraits.background.references"></a><h5>
<a name="id788099"></a>
<a name="id782707"></a>
<a class="link" href="background.html#boost_typetraits.background.references">References</a>
</h5>
<div class="orderedlist"><ol type="1">

View File

@@ -91,7 +91,7 @@
<span class="keyword">struct</span> <a class="link" href="../reference/remove_volatile.html" title="remove_volatile">remove_volatile</a><span class="special">;</span>
</pre>
<a name="boost_typetraits.category.transform.broken_compiler_workarounds_"></a><h5>
<a name="id792437"></a>
<a name="id785406"></a>
<a class="link" href="transform.html#boost_typetraits.category.transform.broken_compiler_workarounds_">Broken
Compiler Workarounds:</a>
</h5>

View File

@@ -71,7 +71,7 @@
of the following macros:
</p>
<div class="table">
<a name="id793988"></a><p class="title"><b>Table<EFBFBD>1.4.<2E>Macros for Compiler Intrinsics</b></p>
<a name="id788322"></a><p class="title"><b>Table<EFBFBD>1.4.<2E>Macros for Compiler Intrinsics</b></p>
<div class="table-contents"><table class="table" summary="Macros for Compiler Intrinsics">
<colgroup>
<col>

View File

@@ -53,7 +53,7 @@
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
</p>
<div class="table">
<a name="id799679"></a><p class="title"><b>Table<EFBFBD>1.5.<2E>Examples</b></p>
<a name="id793672"></a><p class="title"><b>Table<EFBFBD>1.5.<2E>Examples</b></p>
<div class="table-contents"><table class="table" summary="Examples">
<colgroup>
<col>

View File

@@ -54,7 +54,7 @@
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
</p>
<div class="table">
<a name="id800151"></a><p class="title"><b>Table<EFBFBD>1.6.<2E>Examples</b></p>
<a name="id794144"></a><p class="title"><b>Table<EFBFBD>1.6.<2E>Examples</b></p>
<div class="table-contents"><table class="table" summary="Examples">
<colgroup>
<col>

View File

@@ -56,7 +56,7 @@
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
</p>
<div class="table">
<a name="id800674"></a><p class="title"><b>Table<EFBFBD>1.7.<2E>Examples</b></p>
<a name="id794667"></a><p class="title"><b>Table<EFBFBD>1.7.<2E>Examples</b></p>
<div class="table-contents"><table class="table" summary="Examples">
<colgroup>
<col>

View File

@@ -53,7 +53,7 @@
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
</p>
<div class="table">
<a name="id801691"></a><p class="title"><b>Table<EFBFBD>1.8.<2E>Examples</b></p>
<a name="id795138"></a><p class="title"><b>Table<EFBFBD>1.8.<2E>Examples</b></p>
<div class="table-contents"><table class="table" summary="Examples">
<colgroup>
<col>

View File

@@ -53,7 +53,7 @@
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
</p>
<div class="table">
<a name="id802156"></a><p class="title"><b>Table<EFBFBD>1.9.<2E>Examples</b></p>
<a name="id795602"></a><p class="title"><b>Table<EFBFBD>1.9.<2E>Examples</b></p>
<div class="table-contents"><table class="table" summary="Examples">
<colgroup>
<col>

View File

@@ -48,7 +48,7 @@
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
</p>
<div class="table">
<a name="id803401"></a><p class="title"><b>Table<EFBFBD>1.10.<2E>Examples</b></p>
<a name="id798009"></a><p class="title"><b>Table<EFBFBD>1.10.<2E>Examples</b></p>
<div class="table-contents"><table class="table" summary="Examples">
<colgroup>
<col>

View File

@@ -49,7 +49,7 @@
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
</p>
<div class="table">
<a name="id804980"></a><p class="title"><b>Table<EFBFBD>1.11.<2E>Examples</b></p>
<a name="id799588"></a><p class="title"><b>Table<EFBFBD>1.11.<2E>Examples</b></p>
<div class="table-contents"><table class="table" summary="Examples">
<colgroup>
<col>

View File

@@ -59,7 +59,7 @@
</p></td></tr>
</table></div>
<div class="table">
<a name="id805342"></a><p class="title"><b>Table<EFBFBD>1.12.<2E>Function Traits Members</b></p>
<a name="id799949"></a><p class="title"><b>Table<EFBFBD>1.12.<2E>Function Traits Members</b></p>
<div class="table-contents"><table class="table" summary="Function Traits Members">
<colgroup>
<col>
@@ -122,7 +122,7 @@
</table></div>
</div>
<br class="table-break"><div class="table">
<a name="id805554"></a><p class="title"><b>Table<EFBFBD>1.13.<2E>Examples</b></p>
<a name="id800161"></a><p class="title"><b>Table<EFBFBD>1.13.<2E>Examples</b></p>
<div class="table-contents"><table class="table" summary="Examples">
<colgroup>
<col>

View File

@@ -49,7 +49,7 @@
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
</p>
<div class="table">
<a name="id811485"></a><p class="title"><b>Table<EFBFBD>1.14.<2E>Examples</b></p>
<a name="id806434"></a><p class="title"><b>Table<EFBFBD>1.14.<2E>Examples</b></p>
<div class="table-contents"><table class="table" summary="Examples">
<colgroup>
<col>

View File

@@ -132,7 +132,7 @@
<p>
</p>
<p>
<code class="computeroutput"><span class="identifier">is_base_of</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">value_type</span></code> is the type <code class="computeroutput"><span class="keyword">bool</span></code>.
<code class="computeroutput"><span class="identifier">is_base_of</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">value_type</span></code> is the type <code class="computeroutput"><span class="keyword">bool</span></code>.
</p>
<p>
</p>

View File

@@ -139,7 +139,7 @@
<p>
</p>
<p>
<code class="computeroutput"><span class="identifier">is_convertible</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;::</span><span class="identifier">value</span></code> is an integral constant expression
<code class="computeroutput"><span class="identifier">is_convertible</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</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>
<p>
@@ -149,7 +149,7 @@
<p>
</p>
<p>
<code class="computeroutput"><span class="identifier">is_convertible</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">value_type</span></code> is the type <code class="computeroutput"><span class="keyword">bool</span></code>.
<code class="computeroutput"><span class="identifier">is_convertible</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">value_type</span></code> is the type <code class="computeroutput"><span class="keyword">bool</span></code>.
</p>
<p>
</p>

View File

@@ -100,7 +100,7 @@
<p>
</p>
<p>
<code class="computeroutput"><span class="identifier">is_same</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">value_type</span></code> is the type <code class="computeroutput"><span class="keyword">bool</span></code>.
<code class="computeroutput"><span class="identifier">is_same</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">value_type</span></code> is the type <code class="computeroutput"><span class="keyword">bool</span></code>.
</p>
<p>
</p>

View File

@@ -54,7 +54,7 @@
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
</p>
<div class="table">
<a name="id832332"></a><p class="title"><b>Table<EFBFBD>1.15.<2E>Examples</b></p>
<a name="id826670"></a><p class="title"><b>Table<EFBFBD>1.15.<2E>Examples</b></p>
<div class="table-contents"><table class="table" summary="Examples">
<colgroup>
<col>

View File

@@ -54,7 +54,7 @@
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
</p>
<div class="table">
<a name="id832807"></a><p class="title"><b>Table<EFBFBD>1.16.<2E>Examples</b></p>
<a name="id827146"></a><p class="title"><b>Table<EFBFBD>1.16.<2E>Examples</b></p>
<div class="table-contents"><table class="table" summary="Examples">
<colgroup>
<col>

View File

@@ -51,7 +51,7 @@
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
</p>
<div class="table">
<a name="id834495"></a><p class="title"><b>Table<EFBFBD>1.17.<2E>Examples</b></p>
<a name="id827663"></a><p class="title"><b>Table<EFBFBD>1.17.<2E>Examples</b></p>
<div class="table-contents"><table class="table" summary="Examples">
<colgroup>
<col>

View File

@@ -54,7 +54,7 @@
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
</p>
<div class="table">
<a name="id835530"></a><p class="title"><b>Table<EFBFBD>1.18.<2E>Examples</b></p>
<a name="id829254"></a><p class="title"><b>Table<EFBFBD>1.18.<2E>Examples</b></p>
<div class="table-contents"><table class="table" summary="Examples">
<colgroup>
<col>

View File

@@ -53,7 +53,7 @@
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
</p>
<div class="table">
<a name="id836066"></a><p class="title"><b>Table<EFBFBD>1.19.<2E>Examples</b></p>
<a name="id829790"></a><p class="title"><b>Table<EFBFBD>1.19.<2E>Examples</b></p>
<div class="table-contents"><table class="table" summary="Examples">
<colgroup>
<col>

View File

@@ -53,7 +53,7 @@
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
</p>
<div class="table">
<a name="id837136"></a><p class="title"><b>Table<EFBFBD>1.20.<2E>Examples</b></p>
<a name="id830313"></a><p class="title"><b>Table<EFBFBD>1.20.<2E>Examples</b></p>
<div class="table-contents"><table class="table" summary="Examples">
<colgroup>
<col>

View File

@@ -54,7 +54,7 @@
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
</p>
<div class="table">
<a name="id837658"></a><p class="title"><b>Table<EFBFBD>1.21.<2E>Examples</b></p>
<a name="id830835"></a><p class="title"><b>Table<EFBFBD>1.21.<2E>Examples</b></p>
<div class="table-contents"><table class="table" summary="Examples">
<colgroup>
<col>

View File

@@ -53,7 +53,7 @@
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
</p>
<div class="table">
<a name="id838205"></a><p class="title"><b>Table<EFBFBD>1.22.<2E>Examples</b></p>
<a name="id832817"></a><p class="title"><b>Table<EFBFBD>1.22.<2E>Examples</b></p>
<div class="table-contents"><table class="table" summary="Examples">
<colgroup>
<col>

View File

@@ -53,7 +53,7 @@
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
</p>
<div class="table">
<a name="id838710"></a><p class="title"><b>Table<EFBFBD>1.23.<2E>Examples</b></p>
<a name="id833322"></a><p class="title"><b>Table<EFBFBD>1.23.<2E>Examples</b></p>
<div class="table-contents"><table class="table" summary="Examples">
<colgroup>
<col>

View File

@@ -53,7 +53,7 @@
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
</p>
<div class="table">
<a name="id840525"></a><p class="title"><b>Table<EFBFBD>1.24.<2E>Examples</b></p>
<a name="id833771"></a><p class="title"><b>Table<EFBFBD>1.24.<2E>Examples</b></p>
<div class="table-contents"><table class="table" summary="Examples">
<colgroup>
<col>

View File

@@ -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="id777199"></a><p>
<a name="id777005"></a><p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
@@ -163,7 +163,7 @@
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"><p><small>Last revised: February 21, 2008 at 13:51:18 +0000</small></p></td>
<td align="left"><p><small>Last revised: March 30, 2009 at 18:02:46 +0100</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>

View File

@@ -48,7 +48,8 @@ expression that evaluates to /true/.]
[:`is_base_of<Base, Base>::value` is an integral constant
expression that evaluates to /true/: a class is regarded as it's own base.]
[:`is_base_of<T>::value_type` is the type `bool`.]
[:`is_base_of<T, T>::value_type` is the type `bool`.]
[endsect]

View File

@@ -57,10 +57,11 @@ expression that evaluates to /false/: the conversion would require a `const_cast
[:`is_convertible<int const&, long>::value` is an integral constant
expression that evaluates to /true/.]
[:`is_convertible<int>::value` is an integral constant
[:`is_convertible<int, int>::value` is an integral constant
expression that evaluates to /false/.]
[:`is_convertible<T>::value_type` is the type `bool`.]
[:`is_convertible<T, T>::value_type` is the type `bool`.]
[endsect]

View File

@@ -32,7 +32,8 @@ expression that evaluates to /false/.]
[:`is_same<int&, int>::value` is an integral constant
expression that evaluates to /false/.]
[:`is_same<T>::value_type` is the type `bool`.]
[:`is_same<T, T>::value_type` is the type `bool`.]
[endsect]

View File

@@ -0,0 +1,125 @@
// (C) Copyright Thorsten Ottosen 2009.
// Use, modification and distribution are subject to 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)
#include "test.hpp"
#include "check_integral_constant.hpp"
#ifdef TEST_STD
# include <type_traits>
# include <boost/type_traits/type_with_alignment.hpp> // max_align and long_long_type
#else
# include <boost/type_traits/alignment_of.hpp>
# include <boost/type_traits/aligned_storage.hpp>
# include <boost/type_traits/is_pod.hpp>
#endif
namespace
{
template< unsigned N, unsigned Alignment >
struct alignment_implementation1
{
boost::detail::aligned_storage::aligned_storage_imp<N,Alignment> type;
const void* address() const { return this; }
};
template< unsigned N, unsigned Alignment >
struct alignment_implementation2 :
#ifndef __BORLANDC__
private
#else
public
#endif
boost::detail::aligned_storage::aligned_storage_imp<N,Alignment>
{
typedef boost::detail::aligned_storage::aligned_storage_imp<N,Alignment> type;
const void* address() const { return static_cast<const type*>(this)->address(); }
};
template< unsigned N, class T >
const void* get_address1()
{
alignment_implementation1<N*sizeof(T), tt::alignment_of<T>::value> imp1;
return imp1.address();
}
template< unsigned N, class T >
const void* get_address2()
{
alignment_implementation2<N*sizeof(T), tt::alignment_of<T>::value> imp2;
return imp2.address();
}
template< class T >
void check()
{
const void* addr1 = get_address1<0,T>();
const void* addr2 = get_address2<0,T>();
//
// @remark: only the empty case differs
//
BOOST_CHECK( addr1 != addr2 );
addr1 = get_address1<1,T>();
addr2 = get_address2<1,T>();
BOOST_CHECK( addr1 == addr2 );
addr1 = get_address1<2,T>();
addr2 = get_address2<2,T>();
BOOST_CHECK( addr1 == addr2 );
addr1 = get_address1<3,T>();
addr2 = get_address2<3,T>();
BOOST_CHECK( addr1 == addr2 );
addr1 = get_address1<4,T>();
addr2 = get_address2<4,T>();
BOOST_CHECK( addr1 == addr2 );
addr1 = get_address1<17,T>();
addr2 = get_address2<17,T>();
BOOST_CHECK( addr1 == addr2 );
addr1 = get_address1<32,T>();
addr2 = get_address2<32,T>();
BOOST_CHECK( addr1 == addr2 );
}
}
TT_TEST_BEGIN(type_with_empty_alignment_buffer)
check<char>();
check<short>();
check<int>();
check<long>();
check<float>();
check<double>();
check<long double>();
#ifdef BOOST_HAS_MS_INT64
check<__int64>();
#endif
check<int(*)(int)>();
check<int*>();
check<VB>();
check<VD>();
check<enum_UDT>();
check<mf2>();
check<POD_UDT>();
check<empty_UDT>();
check<union_UDT>();
check<boost::detail::max_align>();
TT_TEST_END

View File

@@ -66,6 +66,9 @@ void check(const T&)
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
BOOST_CHECK(::tt::is_pod<t3>::value == true);
#endif
BOOST_CHECK(as3.address() == &as3);
const t3 as4 = { 0, };
BOOST_CHECK(as4.address() == static_cast<const void*>(&as4));
#endif
}

View File

@@ -0,0 +1,39 @@
// Copyright 2009 Alexander Nasonov.
// 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)
// Test bug 99776 'enum UIntEnum { value = UINT_MAX } is promoted to int'
// http://lab.msdn.microsoft.com/ProductFeedback/viewfeedback.aspx?feedbackid=22b0a6b7-120f-4ca0-9136-fa1b25b26efe
//
// Intel 9.0.028 for Windows has a similar problem:
// https://premier.intel.com/IssueDetail.aspx?IssueID=365073
#include <boost/type_traits/promote.hpp>
#include <climits>
#include <boost/static_assert.hpp>
#include <boost/type_traits/is_same.hpp>
#include "promote_util.hpp"
enum UIntEnum { UIntEnum_max = UINT_MAX };
template<class T>
void assert_is_uint(T)
{
BOOST_STATIC_ASSERT((boost::is_same<T, unsigned int>::value));
}
void test_promote_to_uint()
{
assert_is_uint(+UIntEnum_max);
test_cv< UIntEnum, unsigned int >();
}
int main()
{
return 0;
}