From 31bb52a34b0b5807b79bd7487fb545c9719a0784 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 26 Jan 2004 12:17:57 +0000 Subject: [PATCH] Added extra test cases for unbounded arrays. Added new is_abstract test case. Updated docs. [SVN r21963] --- index.html | 99 +++++++++++++++------------- test/Jamfile | 1 + test/remove_bounds_test.cpp | 6 ++ test/tricky_incomplete_type_test.cpp | 8 +++ 4 files changed, 70 insertions(+), 44 deletions(-) diff --git a/index.html b/index.html index 92d62db..1657756 100644 --- a/index.html +++ b/index.html @@ -298,20 +298,20 @@   - ::boost::alignment_of<T>::value - + ::boost::alignment_of<T>::value +

Identifies the alignment requirements of T. Actually returns a value that is only guaranteed to be a multiple of the actual alignment requirements of T.

T must be a complete type.

-   -   +   +       - ::boost::is_empty<T>::value - + ::boost::is_empty<T>::value +

True if T is an empty struct or class. If the compiler implements the "zero sized empty base classes" optimisation, then is_empty will correctly guess whether T is empty. Relies upon is_class to determine whether T is a class @@ -319,9 +319,9 @@

T must be a complete type.

-

10p5

+

10p5

-

Relies on the compiler +

Relies on the compiler implementing zero sized empty base classes in order to detect empty classes.

Can not be used with incomplete types.

@@ -334,47 +334,58 @@   - ::boost::is_const<T>::value - Evaluates to true only if T is + ::boost::is_const<T>::value + Evaluates to true only if T is top-level const-qualified. -

3.9.3

+

3.9.3

-   +       - ::boost::is_volatile<T>::value - Evaluates to true only if T is + ::boost::is_volatile<T>::value + Evaluates to true only if T is volatile-qualified. -

3.9.3

+

3.9.3

-   +     + + + ::boost::is_abstract<T>::value + Evaluates true only if T is + abstract class. + 10.3 + Compiler must support DR337 (as Jan + 2004: GCC 3.4,
+       VC++ 7.1, Intel C++ 7, Comeau 4.3.2). + +   - ::boost::is_polymorphic<T>::value - Evaluates to true only if T is a + ::boost::is_polymorphic<T>::value + Evaluates to true only if T is a polymorphic type.

T must be a complete type.

- 10.3 - Requires knowledge of the compilers + 10.3 + Requires knowledge of the compilers ABI, does actually seem to work with the majority of compilers though.     - ::boost::is_pod<T>::value - Evaluates to true only if T is a + ::boost::is_pod<T>::value + Evaluates to true only if T is a cv-qualified POD type.

T must be a complete type.

-

3.9p10

+

3.9p10

9p4

- Without some (as yet unspecified) + Without some (as yet unspecified) help from the compiler, is_pod will never report that a class or struct is a POD; this is always safe, if possibly sub-optimal.

If the compiler does not support partial-specialization of class templates, then this template can not @@ -384,11 +395,11 @@   - ::boost::has_trivial_constructor<T>::value - True if T has a trivial default + ::boost::has_trivial_constructor<T>::value + True if T has a trivial default constructor. - 12.1p5 -

Without some (as yet + 12.1p5 +

Without some (as yet unspecified) help from the compiler, has_trivial_constructor will never report that a class or struct has a trivial constructor; this is always safe, if possibly sub-optimal.

@@ -399,13 +410,13 @@   - ::boost::has_trivial_copy<T>::value - True if T has a trivial copy + ::boost::has_trivial_copy<T>::value + True if T has a trivial copy constructor.

T must be a complete type.

- 12.8p6 -

Without some (as yet + 12.8p6 +

Without some (as yet unspecified) help from the compiler, has_trivial_copy will never report that a class or struct has a trivial copy constructor; this is always safe, if possibly sub-optimal.

@@ -416,13 +427,13 @@   - ::boost::has_trivial_assign<T>::value - True if T has a trivial assignment + ::boost::has_trivial_assign<T>::value + True if T has a trivial assignment operator.

T must be a complete type.

- 12.8p11 -

Without some (as yet + 12.8p11 +

Without some (as yet unspecified) help from the compiler, has_trivial_assign will never report that a class or struct has a trivial assignment operator; this is always safe, if possibly sub-optimal.

@@ -433,12 +444,12 @@   - ::boost::has_trivial_destructor<T>::value - True if T has a trivial destructor. + ::boost::has_trivial_destructor<T>::value + True if T has a trivial destructor.

T must be a complete type.

- 12.4p3 -

Without some (as yet + 12.4p3 +

Without some (as yet unspecified) help from the compiler, has_trivial_destructor will never report that a class or struct has a trivial destructor; this is always safe, if possibly sub-optimal.

@@ -449,13 +460,13 @@   - ::boost::is_stateless<T>::value - True if T is stateless, meaning + ::boost::is_stateless<T>::value + True if T is stateless, meaning that T has no storage and its constructors and destructors are trivial.

T must be a complete type.

-   -

Without some (as yet +   +

Without some (as yet unspecified) help from the compiler, is_stateless will never report that a class or struct is_stateless; this is always safe, if possibly sub-optimal.

diff --git a/test/Jamfile b/test/Jamfile index 5658d8f..dcfd359 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -45,6 +45,7 @@ test-suite type_traits : [ type-traits-run has_trivial_constr_test.cpp ] [ type-traits-run has_trivial_copy_test.cpp ] [ type-traits-run has_trivial_destructor_test.cpp ] +[ type-traits-run is_abstract_test.cpp ] [ type-traits-run is_arithmetic_test.cpp ] [ type-traits-run is_array_test.cpp ] [ type-traits-run is_base_and_derived_test.cpp ] diff --git a/test/remove_bounds_test.cpp b/test/remove_bounds_test.cpp index bd35907..e910bc2 100644 --- a/test/remove_bounds_test.cpp +++ b/test/remove_bounds_test.cpp @@ -25,6 +25,9 @@ BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_10, ::boost::remove_bounds, const*, BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_11, ::boost::remove_bounds, volatile*, volatile*) BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_12, ::boost::remove_bounds, const[2][3], const[3]) BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_13, ::boost::remove_bounds, (&)[2], (&)[2]) +BOOST_DECL_TRANSFORM_TEST3(remove_bounds_test_14, ::boost::remove_bounds, []) +BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_15, ::boost::remove_bounds, const [], const) +BOOST_DECL_TRANSFORM_TEST(remove_bounds_test_16, ::boost::remove_bounds, const[][3], const[3]) TT_TEST_BEGIN(remove_bounds) @@ -41,6 +44,9 @@ TT_TEST_BEGIN(remove_bounds) remove_bounds_test_11(); remove_bounds_test_12(); remove_bounds_test_13(); + remove_bounds_test_14(); + remove_bounds_test_15(); + remove_bounds_test_16(); TT_TEST_END diff --git a/test/tricky_incomplete_type_test.cpp b/test/tricky_incomplete_type_test.cpp index ba9a87b..bb66bfa 100644 --- a/test/tricky_incomplete_type_test.cpp +++ b/test/tricky_incomplete_type_test.cpp @@ -18,6 +18,14 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_compound::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_enum::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array::value, true); TT_TEST_END