diff --git a/changes pending.txt b/changes pending.txt new file mode 100644 index 0000000..7ad0639 --- /dev/null +++ b/changes pending.txt @@ -0,0 +1,97 @@ +* = PR requests not yet applied to 'develop' branch + +ANY +~~~ + +Missing mpl/if.hpp https://github.com/boostorg/any/pull/4 DM + +DETAIL +------ + +Remove unnecessary include for deprecated ice_xxx.hpp header: https://github.com/boostorg/detail/pull/6 DM +Remove dependency on deprecated type_trait headers: https://github.com/boostorg/detail/pull/8 D + +FOREACH +~~~~~~~ + +Relies on conversion from integral_constant* to mpl::bool_* +https://github.com/boostorg/foreach/pull/3 DM + +FUNCTION +-------- + +Removed dependencies on ice_xxx.hpp headers: https://github.com/boostorg/function/pull/5 DM +Use ! operator directly rather than boost::mpl::not with Boost supported compilers: +https://github.com/boostorg/function/pull/8 DM + +FUSION +------ + +Deprecated header usage: https://github.com/boostorg/fusion/pull/77 DM + +FUNCTION_TYPES +-------------- + +Removed dependency on deprecated template_arity_spec.hpp: https://github.com/boostorg/function_types/pull/2 DM +Remove use of deprecated header: https://github.com/boostorg/function_types/pull/4 DM + +GRAPH +~~~~~ + +* Needs to remove ice_or usage: https://github.com/boostorg/graph/pull/30 + +ITERATOR +~~~~~~~~ + +* is_lvalue_iterator.hpp needs to include mpl/bool.hpp +https://github.com/boostorg/iterator/pull/11 DM +* Removed reliance on deprecated type traits headers: https://github.com/boostorg/iterator/pull/14 DM + +LAMBDA +~~~~~~ + +Missing includes: +ice.hpp see https://github.com/boostorg/lambda/pull/3 DM +Lots of headers: https://github.com/boostorg/lambda/pull/4 DM +Changes for type_traits Version2: https://github.com/boostorg/lambda/pull/9 DM + +LEXICAL_CAST +~~~~~~~~~~~ +missing is_float.hpp in converter_numeric.hpp https://github.com/boostorg/lexical_cast/pull/8 DM +Use mpl instead of ice_ functionality: https://github.com/boostorg/lexical_cast/pull/11 DM +Change to use operators rather than mpl equivalents for constant boolean values, in the replacements +eliminating dependency on deprecated type_traits headers: +https://github.com/boostorg/lexical_cast/pull/15 DM + + +PYTHON +------ + +deprecated header usage: https://github.com/boostorg/python/pull/23 DM + +RANDOM +~~~~~~ + +Missing #includes: https://github.com/boostorg/random/pull/13 DM + +RANGE +----- + +Remove dependency on type traits ice_xxx.hpp headers, which are deprecated: +https://github.com/boostorg/range/pull/27 DM +Use operator || rather than boost::mpl::or_ for constant boolean expression: +https://github.com/boostorg/range/pull/31 D + +TEST +---- + +Add needed MPL header file: +https://github.com/boostorg/test/pull/58 DM + +VARIANT +------- + +Removed reliance on deprecated type_traits header: https://github.com/boostorg/variant/pull/12 DM + +Unexplained new failures +~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/doc/add_const.qbk b/doc/add_const.qbk index ec8ed1d..c90cb9d 100644 --- a/doc/add_const.qbk +++ b/doc/add_const.qbk @@ -17,10 +17,6 @@ __type The same type as `T const` for all `T`. __std_ref 3.9.3. -__compat If the compiler does not support partial specialization of class-templates -then this template will compile, but the member `type` will always be the same as -type `T` except where __transform_workaround have been applied. - __header ` #include ` or ` #include ` [table Examples @@ -37,5 +33,7 @@ __header ` #include ` or ` #include ` or ` #include ` [table Examples @@ -37,5 +33,7 @@ __header ` #include ` or ` #include ` or ` #include ` [table Examples @@ -43,5 +39,7 @@ __header ` #include ` or ` #include ] +[all_compilers] + [endsect] diff --git a/doc/add_pointer.qbk b/doc/add_pointer.qbk index 55ea0aa..9c8dc77 100644 --- a/doc/add_pointer.qbk +++ b/doc/add_pointer.qbk @@ -16,15 +16,11 @@ __type The same type as `remove_reference::type*`. The rationale for this template -is that it produces the same type as `TYPEOF(&t)`, +is that it produces the same type as `decltype(&t)`, where `t` is an object of type `T`. __std_ref 8.3.1. -__compat If the compiler does not support partial specialization of class-templates -then this template will compile, but the member `type` will always be the same as -type `T` except where __transform_workaround have been applied. - __header ` #include ` or ` #include ` [table Examples @@ -41,5 +37,7 @@ __header ` #include ` or ` #include ` or ` #include ` [table Examples @@ -43,5 +39,7 @@ __header ` #include ` or ` #include ` or ` #include ` [table Examples @@ -46,5 +41,7 @@ __header ` #include ` or ` #include ] +__compat In the absence of rvalue-reference support this trait has no effect. + [endsect] diff --git a/doc/add_volatile.qbk b/doc/add_volatile.qbk index 1157088..206d7b5 100644 --- a/doc/add_volatile.qbk +++ b/doc/add_volatile.qbk @@ -17,10 +17,6 @@ __type The same type as `T volatile` for all `T`. __std_ref 3.9.3. -__compat If the compiler does not support partial specialization of class-templates -then this template will compile, but the member `type` will always be the same as -type `T` except where __transform_workaround have been applied. - __header ` #include ` or ` #include ` [table Examples @@ -37,5 +33,7 @@ __header ` #include ` or ` #include ` or ` #include ` namespace boost { - template struct __common_type; + template struct common_type; } -__common_type is a traits class used to deduce a type common to a several types, useful as the return type of functions +`common_type` is a traits class used to deduce a type common to a several types, useful as the return type of functions operating on multiple input types such as in mixed-mode arithmetic.. The nested typedef `::type` could be defined as follows: - template + template struct common_type; - template - struct common_type { - typedef typename __common_type::type, V...>::type type; + template + struct common_type { + typedef typename common_type::type, V...>::type type; + }; + + template <> + struct common_type<> { }; template struct common_type { - typedef T type; + typedef typename __decay::type type; }; template struct common_type { - typedef decltype(__declval() ? __declval() : __declval()) type; + typedef typename __decay< + decltype( __declval()? + __declval::type>(): + __declval::type>() ) + >::type type; }; All parameter types must be complete. This trait is permitted to be specialized by a user if at least one template parameter is a user-defined type. [*Note:] Such specializations are required when only explicit conversions -are desired among the __common_type arguments. +are desired among the `common_type` arguments. -Note that when the compiler does not support variadic templates (and the macro BOOST_NO_VARIADIC_TEMPLATES is defined) -then the maximum number of template arguments is 3. +Note that when the compiler does not support variadic templates (and the macro `BOOST_NO_CXX11_VARIADIC_TEMPLATES` is defined) +then the maximum number of template arguments is 9. -[h4 Configuration macros] - -When the compiler does not support static assertions then the user can select the way static assertions are reported. Define - -* BOOST_COMMON_TYPE_USES_STATIC_ASSERT: define it if you want to use Boost.StaticAssert -* BOOST_COMMON_TYPE_USES_MPL_ASSERT: define it if you want to use Boost.MPL static assertions - -The default behavior is to use mpl assertions in this case, but setting BOOST_COMMON_TYPE_USES_STATIC_ASSERT may reduce -compile times and header dependencies somewhat. - -Depending on the static assertion used you will have an hint of the failing assertion either through the symbol or through the text. - -When possible common_type is implemented using `decltype`. Otherwise when BOOST_COMMON_TYPE_DONT_USE_TYPEOF is not defined -it uses Boost.TypeOf. - [h4 Tutorial] -In a nutshell, __common_type is a trait that takes 1 or more types, and returns a type which +In a nutshell, `common_type` is a trait that takes 1 or more types, and returns a type which all of the types will convert to. The default definition demands this conversion be implicit. However the trait can be specialized for user-defined types which want to limit their inter-type conversions to explicit, -and yet still want to interoperate with the __common_type facility. +and yet still want to interoperate with the `common_type` facility. [*Example:] template - complex::type> + complex::type> operator+(complex, complex); -In the above example, "mixed-mode" complex arithmetic is allowed. The return type is described by __common_type. +In the above example, "mixed-mode" complex arithmetic is allowed. The return type is described by `common_type`. For example the resulting type of adding a `complex` and `complex` might be a `complex`. Here is how someone might produce a variadic comparison function: template - typename __common_type::type + typename common_type::type min(T... t); This is a very useful and broadly applicable utility. @@ -97,17 +87,17 @@ This is a very useful and broadly applicable utility. Another choice for the author of the preceding operator could be template - typename __common_type, complex >::type + typename common_type, complex >::type operator+(complex, complex); -As the default definition of __common_type demands the conversion be implicit, we need to specialize the trait for complex types as follows. +As the default definition of `common_type` demands the conversion be implicit, we need to specialize the trait for complex types as follows. template - struct __common_type, complex > { - typedef complex< __common_type > type; + struct common_type, complex > { + typedef complex< common_type > type; }; -[h4 How important is the order of the common_type<> template arguments?] +[h4 How important is the order of the `common_type<>` template arguments?] The order of the template parameters is important. @@ -164,7 +154,7 @@ Clients wanting to ask `common_type` in any order and get the same resu This is needed as the specialization of `common_type` is not be used implicitly for `common_type`. -[h4 Can the common_type of two types be a third type?] +[h4 Can the `common_type` of two types be a third type?] Given the preceding example, one might expect `common_type::type` to be `C` without any intervention from the user. But the default `common_type<>` implementation doesn't grant that. It is intended that clients who wish for `common_type` @@ -183,7 +173,7 @@ to be well defined to define it themselves: Now this client can ask for `common_type`. -[h4 How common_type behaves with pointers?] +[h4 How does `common_type` behave with pointers?] Consider @@ -209,17 +199,17 @@ But in the absence of a motivating use cases, we prefer not to add more than the Of course the user can always make this specialization. -[h4 Can you explain the pros/cons of common_type against Boost.Typeof?] +[h4 Can you explain the pros/cons of `common_type` against Boost.Typeof?] -Even if they appear to be close, `__common_type` and `typeof` have +Even if they appear to be close, `common_type` and `typeof` have different purposes. You use `typeof` to get the type of an expression, while -you use __common_type to set explicitly the type returned of a template -function. Both are complementary, and indeed __common_type is equivalent to -`decltype(__declval() ? __declval() : __declval())` +you use `common_type` to set explicitly the type returned of a template +function. Both are complementary, and indeed `common_type` is approximately equivalent to +`decltype(__declval() ? __declval() : __declval())`. -__common_type is also similar to promote_args in boost/math/tools/promotion.hpp, -though it is not exactly the same as promote_args either. __common_type::type simply represents the result of some -operation on T1 and T2, and defaults to the type obtained by putting T1 and T2 into a conditional statement. +`common_type` is also similar to `promote_args` in `boost/math/tools/promotion.hpp`, +though it is not exactly the same as `promote_args` either. `common_type::type` simply represents the result of some +operation on `T1` and `T2`, and defaults to the type obtained by putting `T1` and `T2` into a conditional statement. It is meant to be customizable (via specialization) if this default is not appropriate. diff --git a/doc/conditional.qbk b/doc/conditional.qbk index edb7645..ae6e80f 100644 --- a/doc/conditional.qbk +++ b/doc/conditional.qbk @@ -18,7 +18,5 @@ __header ` #include ` or ` #include + struct copy_cv + { + typedef __below type; + }; + +__type [^T /cv/], where /cv/ are the cv-qualifiers of `U`. + +__header ` #include ` or ` #include ` + +[table Examples + +[ [Expression] [Result Type]] + +[[`copy_cv::type`][`int`]] + +[[`copy_cv::type`][`int const`]] + +[[`copy_cv::type`][`int const`]] + +[[`copy_cv::type`][`int const volatile`]] + +[[`copy_cv::type`] [`int&`]] + +[[`copy_cv::type`] [`int* volatile`]] + +] + +[endsect] + diff --git a/doc/decay.qbk b/doc/decay.qbk index f921cdb..aa30a0a 100644 --- a/doc/decay.qbk +++ b/doc/decay.qbk @@ -36,5 +36,7 @@ __header ` #include ` or ` #include + typename add_rvalue_reference::type declval() noexcept; // as unevaluated operand -With the provision of decltype, late-specified return types, and default template-arguments for function templates a -new generation of SFINAE patterns will emerge to at least partially compensate the lack of concepts on the C++0x timescale. -Using this technique, it is sometimes necessary to obtain an object of a known type in a non-using context, e.g. given the declaration +__std_ref C++11 20.2.4 [declval]. - template - T&& declval(); // not used - -as part of the function template declaration +__header ` #include ` or ` #include ` - template - decltype(static_cast(declval())) convert(From&&); - -or as part of a class template definition - - template class result_of; - - template - struct result_of - { - typedef decltype(declval()(declval()...)) type; - }; - -The role of the function template declval() is a transformation of a type T into a value without using or evaluating this function. -The name is supposed to direct the reader's attention to the fact that the expression `declval()` is an lvalue if and only if -T is an lvalue-reference, otherwise an rvalue. To extend the domain of this function we can do a bit better by changing its declaration to - - template - typename std::add_rvalue_reference::type declval(); // not used - -which ensures that we can also use cv void as template parameter. The careful reader might have noticed that `declval()` -already exists under the name create() as part of the definition of the semantics of the type trait is_convertible in the C++0x standard. - -The provision of a new library component that allows the production of values in unevaluated expressions is considered -important to realize constrained templates in C++0x where concepts are not available. -This extremely light-weight function is expected to be part of the daily tool-box of the C++0x programmer. +The function template `declval` is used when a value of a certain type is required in +a type computation context. For example, the type of the result of adding an `int` and +a `float` can be obtained with the expression `decltype( declval() + declval() )`. [endsect] - - -[/=================] -[section:reference Reference ] -[/=================] - -`#include ` - - namespace boost { - - template - typename add_rvalue_reference::type declval() noexcept; // as unevaluated operand - - } // namespace boost - - -The library provides the function template declval to simplify the definition of expressions which occur as unevaluated operands. - - template - typename add_rvalue_reference::type declval(); - -[*Remarks:] If this function is used, the program is ill-formed. - -[*Remarks:] The template parameter T of declval may be an incomplete type. - -[*Example:] - - template - decltype(static_cast(declval())) convert(From&&); - -Declares a function template convert which only participates in overloading if the type From can be explicitly converted to type To. - -[endsect] - -[/===============] -[section History] -[/===============] - -[heading boost 1.50] - -Fixes: - -* [@http://svn.boost.org/trac/boost/ticket/6570 #6570] Adding noexcept to boost::declval. - - -[endsect] - - - - diff --git a/doc/extent.qbk b/doc/extent.qbk index 6b3a8cc..43002ef 100644 --- a/doc/extent.qbk +++ b/doc/extent.qbk @@ -44,5 +44,7 @@ expression that evaluates to /0/: `boost::array` is a class type and [*not an ar [:`extent::value_type` is the type `std::size_t`.] +[all_compilers] + [endsect] diff --git a/doc/floating_point_promotion.qbk b/doc/floating_point_promotion.qbk index bbbdc7a..ab3858c 100644 --- a/doc/floating_point_promotion.qbk +++ b/doc/floating_point_promotion.qbk @@ -33,5 +33,7 @@ __header ` #include ` or ` #incl ] +[all_compilers] + [endsect] diff --git a/doc/function_traits.qbk b/doc/function_traits.qbk index 1d2b364..54a2e0d 100644 --- a/doc/function_traits.qbk +++ b/doc/function_traits.qbk @@ -52,5 +52,7 @@ type use __remove_pointer.] ] +[all_compilers] + [endsect] diff --git a/doc/has_bit_and.qbk b/doc/has_bit_and.qbk index 4892125..bf91a7c 100644 --- a/doc/has_bit_and.qbk +++ b/doc/has_bit_and.qbk @@ -44,9 +44,7 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. +[has_binary_operator_compat] [*Known issues:] diff --git a/doc/has_bit_and_assign.qbk b/doc/has_bit_and_assign.qbk index 382b345..200f8ae 100644 --- a/doc/has_bit_and_assign.qbk +++ b/doc/has_bit_and_assign.qbk @@ -28,6 +28,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_bit_and_assign::value_type` is the type `bool`.] @@ -44,10 +46,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether binary `operator&=` is public or not: diff --git a/doc/has_bit_or.qbk b/doc/has_bit_or.qbk index 30bdaf8..4ec707d 100644 --- a/doc/has_bit_or.qbk +++ b/doc/has_bit_or.qbk @@ -28,6 +28,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_bit_or::value_type` is the type `bool`.] @@ -44,10 +46,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether binary `operator|` is public or not: diff --git a/doc/has_bit_or_assign.qbk b/doc/has_bit_or_assign.qbk index 7eb37f2..9f07d47 100644 --- a/doc/has_bit_or_assign.qbk +++ b/doc/has_bit_or_assign.qbk @@ -28,6 +28,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_bit_or_assign::value_type` is the type `bool`.] @@ -44,10 +46,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether binary `operator|=` is public or not: diff --git a/doc/has_bit_xor.qbk b/doc/has_bit_xor.qbk index 874cf42..8018beb 100644 --- a/doc/has_bit_xor.qbk +++ b/doc/has_bit_xor.qbk @@ -28,6 +28,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_bit_xor::value_type` is the type `bool`.] @@ -44,10 +46,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether binary `operator^` is public or not: diff --git a/doc/has_bit_xor_assign.qbk b/doc/has_bit_xor_assign.qbk index 4e503ba..9791c27 100644 --- a/doc/has_bit_xor_assign.qbk +++ b/doc/has_bit_xor_assign.qbk @@ -28,6 +28,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_bit_xor_assign::value_type` is the type `bool`.] @@ -44,10 +46,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether binary `operator^=` is public or not: diff --git a/doc/has_complement.qbk b/doc/has_complement.qbk index c02760b..f6b567b 100644 --- a/doc/has_complement.qbk +++ b/doc/has_complement.qbk @@ -27,6 +27,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_complement::value_type` is the type `bool`.] @@ -46,10 +48,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether prefix `operator~` is public or not: diff --git a/doc/has_dereference.qbk b/doc/has_dereference.qbk index 5e729da..49b8fea 100644 --- a/doc/has_dereference.qbk +++ b/doc/has_dereference.qbk @@ -27,6 +27,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_dereference::value_type` is the type `bool`.] @@ -49,10 +51,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether prefix `operator*` is public or not: diff --git a/doc/has_divides.qbk b/doc/has_divides.qbk index 8c614b0..9a758ec 100644 --- a/doc/has_divides.qbk +++ b/doc/has_divides.qbk @@ -28,6 +28,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_divides::value_type` is the type `bool`.] @@ -46,10 +48,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether binary `operator/` is public or not: diff --git a/doc/has_divides_assign.qbk b/doc/has_divides_assign.qbk index 393da41..7968b8f 100644 --- a/doc/has_divides_assign.qbk +++ b/doc/has_divides_assign.qbk @@ -28,6 +28,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_divides_assign::value_type` is the type `bool`.] @@ -46,10 +48,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether binary `operator/=` is public or not: diff --git a/doc/has_equal_to.qbk b/doc/has_equal_to.qbk index 78203d3..d33e790 100644 --- a/doc/has_equal_to.qbk +++ b/doc/has_equal_to.qbk @@ -28,6 +28,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_equal_to::value_type` is the type `bool`.] @@ -46,10 +48,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether binary `operator==` is public or not: diff --git a/doc/has_greater.qbk b/doc/has_greater.qbk index b9be45f..d344420 100644 --- a/doc/has_greater.qbk +++ b/doc/has_greater.qbk @@ -28,6 +28,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_greater::value_type` is the type `bool`.] @@ -46,10 +48,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether binary `operator>` is public or not: diff --git a/doc/has_greater_equal.qbk b/doc/has_greater_equal.qbk index 9ea1cae..bed5042 100644 --- a/doc/has_greater_equal.qbk +++ b/doc/has_greater_equal.qbk @@ -28,6 +28,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_greater_equal::value_type` is the type `bool`.] @@ -46,10 +48,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether binary `operator>=` is public or not: diff --git a/doc/has_left_shift.qbk b/doc/has_left_shift.qbk index fa43945..b807a36 100644 --- a/doc/has_left_shift.qbk +++ b/doc/has_left_shift.qbk @@ -28,6 +28,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_left_shift::value_type` is the type `bool`.] @@ -47,10 +49,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether binary `operator<<` is public or not: diff --git a/doc/has_left_shift_assign.qbk b/doc/has_left_shift_assign.qbk index 1981e91..fcfa92a 100644 --- a/doc/has_left_shift_assign.qbk +++ b/doc/has_left_shift_assign.qbk @@ -28,6 +28,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_left_shift_assign::value_type` is the type `bool`.] @@ -44,10 +46,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether binary `operator<<=` is public or not: diff --git a/doc/has_less.qbk b/doc/has_less.qbk index 9dbf26d..daa81cb 100644 --- a/doc/has_less.qbk +++ b/doc/has_less.qbk @@ -28,6 +28,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_less::value_type` is the type `bool`.] @@ -46,10 +48,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether binary `operator<` is public or not: diff --git a/doc/has_less_equal.qbk b/doc/has_less_equal.qbk index 832e888..6ee213e 100644 --- a/doc/has_less_equal.qbk +++ b/doc/has_less_equal.qbk @@ -28,6 +28,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_less_equal::value_type` is the type `bool`.] @@ -46,10 +48,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether binary `operator<=` is public or not: diff --git a/doc/has_logical_and.qbk b/doc/has_logical_and.qbk index 1dfad18..62f2672 100644 --- a/doc/has_logical_and.qbk +++ b/doc/has_logical_and.qbk @@ -28,6 +28,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_logical_and::value_type` is the type `bool`.] @@ -45,10 +47,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether binary `operator&&` is public or not: diff --git a/doc/has_logical_not.qbk b/doc/has_logical_not.qbk index 58fbf3a..2eec31c 100644 --- a/doc/has_logical_not.qbk +++ b/doc/has_logical_not.qbk @@ -27,6 +27,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_logical_not::value_type` is the type `bool`.] @@ -45,10 +47,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether prefix `operator!` is public or not: diff --git a/doc/has_logical_or.qbk b/doc/has_logical_or.qbk index 29affa6..9bf2fd2 100644 --- a/doc/has_logical_or.qbk +++ b/doc/has_logical_or.qbk @@ -28,6 +28,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_logical_or::value_type` is the type `bool`.] @@ -45,10 +47,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether binary `operator||` is public or not: diff --git a/doc/has_minus.qbk b/doc/has_minus.qbk index fdf4d9a..06141ce 100644 --- a/doc/has_minus.qbk +++ b/doc/has_minus.qbk @@ -28,6 +28,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_minus::value_type` is the type `bool`.] @@ -46,10 +48,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether binary `operator-` is public or not: diff --git a/doc/has_minus_assign.qbk b/doc/has_minus_assign.qbk index cbb4cba..cb39468 100644 --- a/doc/has_minus_assign.qbk +++ b/doc/has_minus_assign.qbk @@ -28,6 +28,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_minus_assign::value_type` is the type `bool`.] @@ -46,10 +48,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether binary `operator-=` is public or not: diff --git a/doc/has_modulus.qbk b/doc/has_modulus.qbk index 589f3b1..5f1384e 100644 --- a/doc/has_modulus.qbk +++ b/doc/has_modulus.qbk @@ -28,6 +28,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_modulus::value_type` is the type `bool`.] @@ -44,10 +46,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether binary `operator%` is public or not: diff --git a/doc/has_modulus_assign.qbk b/doc/has_modulus_assign.qbk index 4441a70..636a250 100644 --- a/doc/has_modulus_assign.qbk +++ b/doc/has_modulus_assign.qbk @@ -28,6 +28,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_modulus_assign::value_type` is the type `bool`.] @@ -44,10 +46,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether binary `operator%=` is public or not: diff --git a/doc/has_multiplies.qbk b/doc/has_multiplies.qbk index 9eaea40..fed1e65 100644 --- a/doc/has_multiplies.qbk +++ b/doc/has_multiplies.qbk @@ -28,6 +28,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_multiplies::value_type` is the type `bool`.] @@ -46,10 +48,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether binary `operator*` is public or not: diff --git a/doc/has_multiplies_assign.qbk b/doc/has_multiplies_assign.qbk index 91b45e9..7bd67ad 100644 --- a/doc/has_multiplies_assign.qbk +++ b/doc/has_multiplies_assign.qbk @@ -28,6 +28,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_multiplies_assign::value_type` is the type `bool`.] @@ -46,10 +48,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether binary `operator*=` is public or not: diff --git a/doc/has_negate.qbk b/doc/has_negate.qbk index 15ea477..e25c1d3 100644 --- a/doc/has_negate.qbk +++ b/doc/has_negate.qbk @@ -27,6 +27,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_negate::value_type` is the type `bool`.] @@ -45,10 +47,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether prefix `operator-` is public or not: diff --git a/doc/has_new_operator.qbk b/doc/has_new_operator.qbk index 72e0d4c..a40c34e 100644 --- a/doc/has_new_operator.qbk +++ b/doc/has_new_operator.qbk @@ -12,9 +12,7 @@ __inherit If T is a (possibly cv-qualified) type with an overloaded new-operator then inherits from __true_type, otherwise inherits from __false_type. -__compat Not usable with compilers that do not support "substitution failure is not an error" -(in which case BOOST_NO_SFINAE will be defined), also known to be broken with -the Borland/Codegear compiler. +[has_binary_operator_compat] Also known to be broken with the Borland/Codegear compilers. __std_ref 12.5. diff --git a/doc/has_not_equal_to.qbk b/doc/has_not_equal_to.qbk index 36626c5..83a857e 100644 --- a/doc/has_not_equal_to.qbk +++ b/doc/has_not_equal_to.qbk @@ -28,6 +28,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_not_equal_to::value_type` is the type `bool`.] @@ -46,10 +48,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether binary `operator!=` is public or not: diff --git a/doc/has_nothrow_assign.qbk b/doc/has_nothrow_assign.qbk index f71eb5c..c80a6d3 100644 --- a/doc/has_nothrow_assign.qbk +++ b/doc/has_nothrow_assign.qbk @@ -14,14 +14,11 @@ __inherit If T is a (possibly cv-qualified) type with a non-throwing assignment- then inherits from __true_type, otherwise inherits from __false_type. Type `T` must be a complete type. -__compat If the compiler does not support partial-specialization of class -templates, then this template can not be used with function types. - -Without some (as yet unspecified) help from the compiler, -`has_nothrow_assign` will never report that a class or struct has a -non-throwing assignment-operator; this is always safe, if possibly sub-optimal. -Currently (May 2005) only Visual C++ 8 has the necessary compiler support to ensure that this -trait "just works". +__compat Either requires C++11 `noexcept` and `decltype` or else some (unspecified) help from the compiler. +Currently (June 2015) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, +Intel-11.0, and Codegear and all recent GCC versions have the necessary compiler __intrinsics to ensure that this +trait "just works". You may test to see if the necessary support is available +by checking to see if `defined(BOOST_HAS_NOTHROW_CONSTRUCTOR) || (!defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_CXX11_NOEXCEPT))` is true. __header ` #include ` or ` #include ` diff --git a/doc/has_nothrow_constructor.qbk b/doc/has_nothrow_constructor.qbk index e8945cf..8295ad9 100644 --- a/doc/has_nothrow_constructor.qbk +++ b/doc/has_nothrow_constructor.qbk @@ -19,16 +19,11 @@ must be a complete type. These two traits are synonyms for each other. -__compat If the compiler does not support partial-specialization of class -templates, then this template can not be used with function types. - -Without some (unspecified) help from the compiler, -`has_nothrow_constructor` will never report that a class or struct has a -non-throwing default-constructor; this is always safe, if possibly sub-optimal. -Currently (May 2011) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, -Intel-11.0, and Codegear have the necessary compiler __intrinsics to ensure that this -trait "just works". You may also test to see if the necessary __intrinsics are available -by checking to see if the macro `BOOST_HAS_NOTHROW_CONSTRUCTOR` is defined. +__compat Either requires C++11 `noexcept` and `decltype` or else some (unspecified) help from the compiler. +Currently (June 2015) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, +Intel-11.0, and Codegear and all recent GCC versions have the necessary compiler __intrinsics to ensure that this +trait "just works". You may test to see if the necessary support is available +by checking to see if `defined(BOOST_HAS_NOTHROW_CONSTRUCTOR) || (!defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_CXX11_NOEXCEPT))` is true. __header ` #include ` or ` #include ` diff --git a/doc/has_nothrow_copy.qbk b/doc/has_nothrow_copy.qbk index c00a5a3..28c251e 100644 --- a/doc/has_nothrow_copy.qbk +++ b/doc/has_nothrow_copy.qbk @@ -19,16 +19,11 @@ must be a complete type. These two traits are synonyms for each other. -__compat If the compiler does not support partial-specialization of class -templates, then this template can not be used with function types. - -Without some (as yet unspecified) help from the compiler, -`has_nothrow_copy` will never report that a class or struct has a -non-throwing copy-constructor; this is always safe, if possibly sub-optimal. -Currently (May 2011) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, -Intel-11.0, and Codegear have the necessary compiler __intrinsics to ensure that this -trait "just works". You may also test to see if the necessary __intrinsics are available -by checking to see if the macro `BOOST_HAS_NOTHROW_COPY` is defined. +__compat Either requires C++11 `noexcept` and `decltype` or else some (unspecified) help from the compiler. +Currently (June 2015) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, +Intel-11.0, and Codegear and all recent GCC versions have the necessary compiler __intrinsics to ensure that this +trait "just works". You may test to see if the necessary support is available +by checking to see if `defined(BOOST_HAS_NOTHROW_COPY) || (!defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_CXX11_NOEXCEPT))` is true. __header ` #include ` or ` #include ` diff --git a/doc/has_nothrow_destruct.qbk b/doc/has_nothrow_destruct.qbk new file mode 100644 index 0000000..3d865c1 --- /dev/null +++ b/doc/has_nothrow_destruct.qbk @@ -0,0 +1,29 @@ +[/ + Copyright 2015 John Maddock. + 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). +] + +[section:has_nothrow_destruct has_nothrow_destructor] + + template + struct has_nothrow_destructor : public __tof {}; + +__inherit If T is a (possibly cv-qualified) type with a non-throwing destructor +then inherits from __true_type, otherwise inherits from __false_type. Type `T` +must be a complete type. + +__compat Either requires C++11 `noexcept` and `decltype` or else some (unspecified) help from the compiler. +You may test to see if the necessary support is available +by checking to see if `!defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_CXX11_NOEXCEPT)` is true. + +__header ` #include ` or ` #include ` + +[note +Note that destructors are assumed to be non-throwing unless they are explicitly marked otherwise with a `throw(something)` specification. +This is in line with the C++11 standard. +] + +[endsect] + diff --git a/doc/has_plus.qbk b/doc/has_plus.qbk index 1dc790b..48f4281 100644 --- a/doc/has_plus.qbk +++ b/doc/has_plus.qbk @@ -28,6 +28,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_plus::value_type` is the type `bool`.] @@ -46,10 +48,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether binary `operator+` is public or not: diff --git a/doc/has_plus_assign.qbk b/doc/has_plus_assign.qbk index be279e0..400ec43 100644 --- a/doc/has_plus_assign.qbk +++ b/doc/has_plus_assign.qbk @@ -28,6 +28,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_plus_assign::value_type` is the type `bool`.] @@ -46,10 +48,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether binary `operator+=` is public or not: diff --git a/doc/has_post_decrement.qbk b/doc/has_post_decrement.qbk index a3e8780..2b76d3f 100644 --- a/doc/has_post_decrement.qbk +++ b/doc/has_post_decrement.qbk @@ -27,6 +27,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_post_decrement::value_type` is the type `bool`.] @@ -47,10 +49,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether postfix `operator--` is public or not: diff --git a/doc/has_post_increment.qbk b/doc/has_post_increment.qbk index ddd93eb..06121ec 100644 --- a/doc/has_post_increment.qbk +++ b/doc/has_post_increment.qbk @@ -27,6 +27,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_post_increment::value_type` is the type `bool`.] @@ -47,10 +49,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether postfix `operator++` is public or not: diff --git a/doc/has_pre_decrement.qbk b/doc/has_pre_decrement.qbk index 5393d71..b239388 100644 --- a/doc/has_pre_decrement.qbk +++ b/doc/has_pre_decrement.qbk @@ -27,6 +27,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_pre_decrement::value_type` is the type `bool`.] @@ -47,10 +49,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether prefix `operator--` is public or not: diff --git a/doc/has_pre_increment.qbk b/doc/has_pre_increment.qbk index 74ef843..4008692 100644 --- a/doc/has_pre_increment.qbk +++ b/doc/has_pre_increment.qbk @@ -27,6 +27,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_pre_increment::value_type` is the type `bool`.] @@ -47,10 +49,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether prefix `operator++` is public or not: diff --git a/doc/has_right_shift.qbk b/doc/has_right_shift.qbk index 7c342ff..dee8852 100644 --- a/doc/has_right_shift.qbk +++ b/doc/has_right_shift.qbk @@ -28,6 +28,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_right_shift::value_type` is the type `bool`.] @@ -47,10 +49,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether binary `operator>>` is public or not: diff --git a/doc/has_right_shift_assign.qbk b/doc/has_right_shift_assign.qbk index 4538d20..d45dea5 100644 --- a/doc/has_right_shift_assign.qbk +++ b/doc/has_right_shift_assign.qbk @@ -28,6 +28,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_right_shift_assign::value_type` is the type `bool`.] @@ -44,10 +46,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether binary `operator>>=` is public or not: diff --git a/doc/has_trivial_assign.qbk b/doc/has_trivial_assign.qbk index 5ecfc0e..30fa560 100644 --- a/doc/has_trivial_assign.qbk +++ b/doc/has_trivial_assign.qbk @@ -16,13 +16,12 @@ If a type has a trivial assignment-operator then the operator has the same effec as copying the bits of one object to the other: calls to the operator can be safely replaced with a call to `memcpy`. -__compat If the compiler does not support partial-specialization of class -templates, then this template can not be used with function types. - -Without some (as yet unspecified) help from the compiler, +__compat Without some (as yet unspecified) help from the compiler, has_trivial_assign will never report that a user-defined class or struct has a -trivial constructor; this is always safe, if possibly sub-optimal. -Currently (May 2011) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, +trivial constructor; this is always safe, if possibly sub-optimal. In order to +correctly handle deleted or private assignment operators, the compiler must also +support C++11's `decltype`. +Currently (May 2015) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear have the necessary compiler __intrinsics to ensure that this trait "just works". You may also test to see if the necessary __intrinsics are available by checking to see if the macro `BOOST_HAS_TRIVIAL_ASSIGN` is defined. diff --git a/doc/has_trivial_constructor.qbk b/doc/has_trivial_constructor.qbk index 6bf7529..cf964c4 100644 --- a/doc/has_trivial_constructor.qbk +++ b/doc/has_trivial_constructor.qbk @@ -24,13 +24,12 @@ to omit a call to a single trivial-constructor call is of no benefit whatsoever. However, if loops and/or exception handling code can also be omitted, then some benefit in terms of code size and speed can be obtained. -__compat If the compiler does not support partial-specialization of class -templates, then this template can not be used with function types. - -Without some (as yet unspecified) help from the compiler, +__compat Without some (as yet unspecified) help from the compiler, has_trivial_constructor will never report that a user-defined class or struct has a trivial constructor; this is always safe, if possibly sub-optimal. -Currently (May 2011) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, +In addition, in order to correctly handle private or deleted default-constructors then +C++11's `deltype` is required. +Currently (May 2015) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear have the necessary compiler __intrinsics to ensure that this trait "just works". You may also test to see if the necessary __intrinsics are available by checking to see if the macro `BOOST_HAS_TRIVIAL_CONSTRUCTOR` is defined. diff --git a/doc/has_trivial_copy.qbk b/doc/has_trivial_copy.qbk index 42019e4..084374b 100644 --- a/doc/has_trivial_copy.qbk +++ b/doc/has_trivial_copy.qbk @@ -22,13 +22,12 @@ If a type has a trivial copy-constructor then the constructor has the same effec as copying the bits of one object to the other: calls to the constructor can be safely replaced with a call to `memcpy`. -__compat If the compiler does not support partial-specialization of class -templates, then this template can not be used with function types. - -Without some (as yet unspecified) help from the compiler, +__compat Without some (as yet unspecified) help from the compiler, has_trivial_copy will never report that a user-defined class or struct has a trivial constructor; this is always safe, if possibly sub-optimal. -Currently (May 2011) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, +In addition, in order to correctly handle deleted or private copy-constructors +then C++11's `dectype` is required. +Currently (May 2015) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear have the necessary compiler __intrinsics to ensure that this trait "just works". You may also test to see if the necessary __intrinsics are available by checking to see if the macro `BOOST_HAS_TRIVIAL_COPY` is defined. diff --git a/doc/has_trivial_destructor.qbk b/doc/has_trivial_destructor.qbk index 166c092..051edf3 100644 --- a/doc/has_trivial_destructor.qbk +++ b/doc/has_trivial_destructor.qbk @@ -18,13 +18,12 @@ to omit a call to a single trivial-constructor call is of no benefit whatsoever. However, if loops and/or exception handling code can also be omitted, then some benefit in terms of code size and speed can be obtained. -__compat If the compiler does not support partial-specialization of class -templates, then this template can not be used with function types. - -Without some (as yet unspecified) help from the compiler, +__compat Without some (as yet unspecified) help from the compiler, has_trivial_destructor will never report that a user-defined class or struct has a trivial destructor; this is always safe, if possibly sub-optimal. -Currently (May 2011) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, +In addition, in order to correctly handle deleted or private destructors then +support for C++11's `decltype` is required. +Currently (June 2015) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear have the necessary compiler __intrinsics to ensure that this trait "just works". You may also test to see if the necessary __intrinsics are available by checking to see if the macro `BOOST_HAS_TRIVIAL_DESTRUCTOR` is defined. diff --git a/doc/has_trivial_move_assign.qbk b/doc/has_trivial_move_assign.qbk index 0fe04ce..373d5f0 100644 --- a/doc/has_trivial_move_assign.qbk +++ b/doc/has_trivial_move_assign.qbk @@ -17,14 +17,14 @@ If a type has a trivial move assignment-operator then the operator has the same as copying the bits of one object to the other: calls to the operator can be safely replaced with a call to `memcpy`. -__compat If the compiler does not support partial-specialization of class -templates, then this template can not be used with function types. - -Without some (as yet unspecified) help from the compiler, +__compat Without some (as yet unspecified) help from the compiler, has_trivial_move_assign will never report that a user-defined class or struct has a -trivial constructor; this is always safe, if possibly sub-optimal. -Currently (February 2013) compilers have no necessary __intrinsics to ensure that this -trait "just works". You may also test to see if the necessary __intrinsics are available +trivial move assign; this is always safe, if possibly sub-optimal. +In addition, in order to correctly handle private or deleted move assignment +operators then c++11's `decltype` is required. +Currently (June 2015) compilers that have the necessary __intrinsics to ensure that this +trait "just works" include Clang, GCC-5.1 and MSVC-12.0. +You may also test to see if the necessary __intrinsics are available by checking to see if the macro `BOOST_HAS_TRIVIAL_MOVE_ASSIGN` is defined. diff --git a/doc/has_trivial_move_constructor.qbk b/doc/has_trivial_move_constructor.qbk index 11b22c6..92d6bb7 100644 --- a/doc/has_trivial_move_constructor.qbk +++ b/doc/has_trivial_move_constructor.qbk @@ -18,14 +18,14 @@ If a type has a trivial move-constructor then the constructor has the same effec as copying the bits of one object to the other: calls to the constructor can be safely replaced with a call to `memcpy`. -__compat If the compiler does not support partial-specialization of class -templates, then this template can not be used with function types. - -Without some (as yet unspecified) help from the compiler, +__compat Without some (as yet unspecified) help from the compiler, has_trivial_move_constructor will never report that a user-defined class or struct has a trivial constructor; this is always safe, if possibly sub-optimal. -Currently (February 2013) compilers have no necessary __intrinsics to ensure that this -trait "just works". You may also test to see if the necessary __intrinsics are available +In addition C++11's `decltype` is required to correctly support deleted or private +move constructors. +Currently (June 2015) compilers that have the necessary __intrinsics to ensure that this +trait "just works" include Clang, GCC-5.1, and MSVC-12.0. +You may also test to see if the necessary __intrinsics are available by checking to see if the macro `BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR` is defined. diff --git a/doc/has_unary_minus.qbk b/doc/has_unary_minus.qbk index 4758ba3..9ba7988 100644 --- a/doc/has_unary_minus.qbk +++ b/doc/has_unary_minus.qbk @@ -27,6 +27,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_unary_minus::value_type` is the type `bool`.] @@ -45,10 +47,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether prefix `operator-` is public or not: diff --git a/doc/has_unary_plus.qbk b/doc/has_unary_plus.qbk index 43540ec..6540164 100644 --- a/doc/has_unary_plus.qbk +++ b/doc/has_unary_plus.qbk @@ -27,6 +27,8 @@ If `Ret=void`, the return type is checked to be exactly `void`. __header `#include ` or `#include ` or `#include ` +[has_binary_operator_compat] + __examples [:`has_unary_plus::value_type` is the type `bool`.] @@ -45,10 +47,6 @@ __examples [*See also:] [link boost_typetraits.category.value_traits.operators Operator Type Traits] -[*Limitation:] - -* Requires a compiler with working SFINAE. - [*Known issues:] * This trait cannot detect whether prefix `operator+` is public or not: diff --git a/doc/has_virtual_destructor.qbk b/doc/has_virtual_destructor.qbk index 5bc3e65..d7fb8bf 100644 --- a/doc/has_virtual_destructor.qbk +++ b/doc/has_virtual_destructor.qbk @@ -12,14 +12,13 @@ __inherit If T is a (possibly cv-qualified) type with a virtual destructor then inherits from __true_type, otherwise inherits from __false_type. -__compat This trait is provided for completeness, since it's part of the -Technical Report on C++ Library Extensions. However, there is currently no -way to portably implement this trait. The default version provided +__compat There is currently no +way to portably implement this trait: the default version always inherits from __false_type, and has to be explicitly specialized for types with virtual destructors unless the compiler used has compiler __intrinsics that enable the trait to do the right thing: -Currently (May 2011) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, -Intel-11.0, and Codegear have the necessary compiler __intrinsics to ensure that this +Currently (June 2015) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, +Intel-11.0, plus Codegear and Clang have the necessary compiler __intrinsics to ensure that this trait "just works". You may also test to see if the necessary __intrinsics are available by checking to see if the macro `BOOST_HAS_VIRTUAL_DESTRUCTOR` is defined. diff --git a/doc/history.qbk b/doc/history.qbk index 0d35f97..45abeef 100644 --- a/doc/history.qbk +++ b/doc/history.qbk @@ -7,6 +7,13 @@ [section:history History] +[h4 Boost 1.60.0 ???] + +* Refactored traits to depend only on Boost.Config. Greatly simplified code to improve readability and remove workarounds for old compilers no longer supported. +* Fix __decay to follow C++11 semantics, see [@https://svn.boost.org/trac/boost/ticket/7760 #7760]. +* Added a number of new traits __is_assignable, __is_default_constructible, __is_constructible and __is_destructible required to fix bugs in a number of other traits, +see for example [@https://svn.boost.org/trac/boost/ticket/7760 #11324]. + [h4 Boost 1.58.0] * Fixed issue with CUDA on Clang compiler see [@https://svn.boost.org/trac/boost/ticket/10694 #10694]. diff --git a/doc/html/boost_typetraits/background.html b/doc/html/boost_typetraits/background.html index 382fc9c..e899ee9 100644 --- a/doc/html/boost_typetraits/background.html +++ b/doc/html/boost_typetraits/background.html @@ -3,7 +3,7 @@ Background and Tutorial - + diff --git a/doc/html/boost_typetraits/category.html b/doc/html/boost_typetraits/category.html index be4500b..04d4586 100644 --- a/doc/html/boost_typetraits/category.html +++ b/doc/html/boost_typetraits/category.html @@ -3,7 +3,7 @@ Type Traits by Category - + @@ -26,7 +26,7 @@ -
+
Type Traits that Describe the Properties of a Type
diff --git a/doc/html/boost_typetraits/category/alignment.html b/doc/html/boost_typetraits/category/alignment.html index 544a76c..6111ce8 100644 --- a/doc/html/boost_typetraits/category/alignment.html +++ b/doc/html/boost_typetraits/category/alignment.html @@ -3,7 +3,7 @@ Synthesizing Types with Specific Alignments - + diff --git a/doc/html/boost_typetraits/category/function.html b/doc/html/boost_typetraits/category/function.html index c1557ef..ab141c6 100644 --- a/doc/html/boost_typetraits/category/function.html +++ b/doc/html/boost_typetraits/category/function.html @@ -3,7 +3,7 @@ Decomposing Function Types - + diff --git a/doc/html/boost_typetraits/category/transform.html b/doc/html/boost_typetraits/category/transform.html index 7972dd9..7437ec2 100644 --- a/doc/html/boost_typetraits/category/transform.html +++ b/doc/html/boost_typetraits/category/transform.html @@ -3,7 +3,7 @@ Type Traits that Transform One Type to Another - + @@ -63,6 +63,9 @@ template <class... T> struct common_type; +template <class T, class U> +struct copy_cv; + template <class T> struct decay; @@ -101,63 +104,10 @@ template <class T> struct remove_volatile; + +template <class T> +struct type_identity; -
- - Broken - Compiler Workarounds: -
-

- For all of these templates support for partial specialization of class templates - is required to correctly implement the transformation. On the other hand, - practice shows that many of the templates from this category are very useful, - and often essential for implementing some generic libraries. Lack of these - templates is often one of the major limiting factors in porting those libraries - to compilers that do not yet support this language feature. As some of these - compilers are going to be around for a while, and at least one of them is - very wide-spread, it was decided that the library should provide workarounds - where possible. -

-

- The basic idea behind the workaround is to manually define full specializations - of all type transformation templates for all fundamental types, and all their - 1st and 2nd rank cv-[un]qualified derivative pointer types, and to provide - a user-level macro that will define all the explicit specializations needed - for any user-defined type T. -

-

- The first part guarantees the successful compilation of something like this: -

-
BOOST_STATIC_ASSERT((is_same<char, remove_reference<char&>::type>::value));
-BOOST_STATIC_ASSERT((is_same<char const, remove_reference<char const&>::type>::value));
-BOOST_STATIC_ASSERT((is_same<char volatile, remove_reference<char volatile&>::type>::value));
-BOOST_STATIC_ASSERT((is_same<char const volatile, remove_reference<char const volatile&>::type>::value));
-BOOST_STATIC_ASSERT((is_same<char*, remove_reference<char*&>::type>::value));
-BOOST_STATIC_ASSERT((is_same<char const*, remove_reference<char const*&>::type>::value));
-...
-BOOST_STATIC_ASSERT((is_same<char const volatile* const volatile* const volatile, remove_reference<char const volatile* const volatile* const volatile&>::type>::value));
-
-

- and the second part provides the library's users with a mechanism to make - the above code work not only for char, - int or other built-in type, - but for their own types as well: -

-
namespace myspace{
-   struct MyClass {};
-}
-// declare this at global scope:
-BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(myspace::MyClass)
-// transformations on myspace::MyClass now work:
-BOOST_STATIC_ASSERT((is_same<myspace::MyClass, remove_reference<myspace::MyClass&>::type>::value));
-BOOST_STATIC_ASSERT((is_same<myspace::MyClass, remove_const<myspace::MyClass const>::type>::value));
-// etc.
-
-

- Note that the macro BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION evaluates - to nothing on those compilers that do support - partial specialization. -

diff --git a/doc/html/boost_typetraits/category/value_traits.html b/doc/html/boost_typetraits/category/value_traits.html index 6c3a25a..e87c3e2 100644 --- a/doc/html/boost_typetraits/category/value_traits.html +++ b/doc/html/boost_typetraits/category/value_traits.html @@ -3,7 +3,7 @@ Type Traits that Describe the Properties of a Type - + @@ -27,7 +27,7 @@ Type Traits that Describe the Properties of a Type -
+
Categorizing a Type
General diff --git a/doc/html/boost_typetraits/category/value_traits/operators.html b/doc/html/boost_typetraits/category/value_traits/operators.html index 8d4fca2..3f6139c 100644 --- a/doc/html/boost_typetraits/category/value_traits/operators.html +++ b/doc/html/boost_typetraits/category/value_traits/operators.html @@ -3,7 +3,7 @@ Operator Type Traits - + diff --git a/doc/html/boost_typetraits/category/value_traits/primary.html b/doc/html/boost_typetraits/category/value_traits/primary.html index a37f5a2..93a6895 100644 --- a/doc/html/boost_typetraits/category/value_traits/primary.html +++ b/doc/html/boost_typetraits/category/value_traits/primary.html @@ -3,7 +3,7 @@ Categorizing a Type - + diff --git a/doc/html/boost_typetraits/category/value_traits/properties.html b/doc/html/boost_typetraits/category/value_traits/properties.html index ad4ece9..6e527d1 100644 --- a/doc/html/boost_typetraits/category/value_traits/properties.html +++ b/doc/html/boost_typetraits/category/value_traits/properties.html @@ -3,7 +3,7 @@ General Type Properties - + @@ -54,6 +54,9 @@ template <class T> struct has_nothrow_copy_constructor; +template <class T> +struct has_nothrow_destructor; + template <class T> struct has_trivial_assign; @@ -78,12 +81,33 @@ template <class T> struct is_abstract; +template <class T, class U> +struct is_assignable; + +template <class T> +struct is_copy_constructible; + +template <class T> +struct is_copy_assignable; + +template <class T, class... Args> +struct is_constructible; + +template <class T> +struct is_default_constructible; + +template <class T> +struct is_destructible; + template <class T> struct is_const; template <class T> struct is_empty; +template <class T> +struct is_final; + template <class T> struct is_stateless; diff --git a/doc/html/boost_typetraits/category/value_traits/relate.html b/doc/html/boost_typetraits/category/value_traits/relate.html index db2affc..6c5fa61 100644 --- a/doc/html/boost_typetraits/category/value_traits/relate.html +++ b/doc/html/boost_typetraits/category/value_traits/relate.html @@ -3,7 +3,7 @@ Relationships Between Two Types - + diff --git a/doc/html/boost_typetraits/credits.html b/doc/html/boost_typetraits/credits.html index 83e45d3..741b632 100644 --- a/doc/html/boost_typetraits/credits.html +++ b/doc/html/boost_typetraits/credits.html @@ -3,7 +3,7 @@ Credits - + diff --git a/doc/html/boost_typetraits/examples.html b/doc/html/boost_typetraits/examples.html index 952a267..7d6145b 100644 --- a/doc/html/boost_typetraits/examples.html +++ b/doc/html/boost_typetraits/examples.html @@ -3,7 +3,7 @@ Examples - + @@ -26,7 +26,7 @@ -
+
An Optimized Version of std::copy
An Optimised Version diff --git a/doc/html/boost_typetraits/examples/copy.html b/doc/html/boost_typetraits/examples/copy.html index 9de576a..da2e8be 100644 --- a/doc/html/boost_typetraits/examples/copy.html +++ b/doc/html/boost_typetraits/examples/copy.html @@ -3,7 +3,7 @@ An Optimized Version of std::copy - + diff --git a/doc/html/boost_typetraits/examples/destruct.html b/doc/html/boost_typetraits/examples/destruct.html index 12e7d92..35f1748 100644 --- a/doc/html/boost_typetraits/examples/destruct.html +++ b/doc/html/boost_typetraits/examples/destruct.html @@ -3,7 +3,7 @@ An Example that Omits Destructor Calls For Types with Trivial Destructors - + diff --git a/doc/html/boost_typetraits/examples/fill.html b/doc/html/boost_typetraits/examples/fill.html index eebd6fd..db6ef0a 100644 --- a/doc/html/boost_typetraits/examples/fill.html +++ b/doc/html/boost_typetraits/examples/fill.html @@ -3,7 +3,7 @@ An Optimised Version of std::fill - + diff --git a/doc/html/boost_typetraits/examples/improved_min.html b/doc/html/boost_typetraits/examples/improved_min.html index 613dcf1..f50e885 100644 --- a/doc/html/boost_typetraits/examples/improved_min.html +++ b/doc/html/boost_typetraits/examples/improved_min.html @@ -3,7 +3,7 @@ Improving std::min with common_type - + diff --git a/doc/html/boost_typetraits/examples/iter.html b/doc/html/boost_typetraits/examples/iter.html index 06b3077..0c1eb29 100644 --- a/doc/html/boost_typetraits/examples/iter.html +++ b/doc/html/boost_typetraits/examples/iter.html @@ -3,7 +3,7 @@ An improved Version of std::iter_swap - + diff --git a/doc/html/boost_typetraits/examples/to_double.html b/doc/html/boost_typetraits/examples/to_double.html index bed2ea6..ae5ff19 100644 --- a/doc/html/boost_typetraits/examples/to_double.html +++ b/doc/html/boost_typetraits/examples/to_double.html @@ -3,7 +3,7 @@ Convert Numeric Types and Enums to double - + diff --git a/doc/html/boost_typetraits/history.html b/doc/html/boost_typetraits/history.html index 363d9cd..9a7e09a 100644 --- a/doc/html/boost_typetraits/history.html +++ b/doc/html/boost_typetraits/history.html @@ -3,7 +3,7 @@ History - + @@ -28,6 +28,29 @@
+ Boost + 1.60.0 ??? +
+
    +
  • + Refactored traits to depend only on Boost.Config. Greatly simplified code + to improve readability and remove workarounds for old compilers no longer + supported. +
  • +
  • + Fix decay to follow + C++11 semantics, see #7760. +
  • +
  • + Added a number of new traits is_assignable, + is_default_constructible, + is_constructible + and is_destructible + required to fix bugs in a number of other traits, see for example #11324. +
  • +
+
+ Boost 1.58.0
@@ -42,7 +65,7 @@
- + Boost 1.57.0
@@ -56,7 +79,7 @@
- + Boost 1.56.0
@@ -65,7 +88,7 @@ #9474.
- + Boost 1.55.0
@@ -73,7 +96,7 @@ Added new trait is_copy_constructible.
- + Boost 1.54.0
@@ -84,7 +107,7 @@ has_trivial_move_constructor.
- + Boost 1.47.0
@@ -99,7 +122,7 @@
- + Boost 1.45.0
@@ -116,7 +139,7 @@
- + Boost 1.44.0
@@ -133,7 +156,7 @@
- + Boost 1.42.0
diff --git a/doc/html/boost_typetraits/intrinsics.html b/doc/html/boost_typetraits/intrinsics.html index 483202f..b291783 100644 --- a/doc/html/boost_typetraits/intrinsics.html +++ b/doc/html/boost_typetraits/intrinsics.html @@ -3,7 +3,7 @@ Support for Compiler Intrinsics - + @@ -47,6 +47,12 @@
  • is_pod
  • +
  • + is_nothrow_move_assignable +
  • +
  • + is_nothrow_move_constructible +
  • has_trivial_constructor
  • @@ -90,6 +96,9 @@
  • is_polymorphic
  • +
  • + is_virtual_base_of +
  • The following traits classes are dependent on one or more of the above: @@ -117,197 +126,17 @@

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/html/boost_typetraits/intro.html b/doc/html/boost_typetraits/intro.html index d500603..133c6c1 100644 --- a/doc/html/boost_typetraits/intro.html +++ b/doc/html/boost_typetraits/intro.html @@ -3,7 +3,7 @@ Introduction - + diff --git a/doc/html/boost_typetraits/mpl.html b/doc/html/boost_typetraits/mpl.html index 7ed2dc2..a5764fa 100644 --- a/doc/html/boost_typetraits/mpl.html +++ b/doc/html/boost_typetraits/mpl.html @@ -3,7 +3,7 @@ MPL Interoperability - + @@ -29,18 +29,15 @@

    All the value based traits in this library conform to MPL's requirements for an Integral - Constant type: that includes a number of rather intrusive workarounds - for broken compilers. + Constant type.

    - Purely as an implementation detail, this means that true_type - inherits from boost::mpl::true_, - false_type - inherits from boost::mpl::false_, - and integral_constant<T, - v> - inherits from boost::mpl::integral_c<T,v> - (provided T is not bool) + Please note that these types no longer inherit from mpl::true_ or + mpl::false_ etc, and the library will no longer + implicitly include any MPL header. However there is an implicit conversion + from integral_constant to the + corresponding MPL types, therefore tag-dispatching that uses MPL types in function + overloads will still work as before.

    - BOOST_IS_UNION(T) + BOOST_ALIGNMENT_OF(T)

    - Should evaluate to true if T is a union type + Should evaluate to the alignment requirements of type T

    -

    - BOOST_IS_POD(T) -

    -
    -

    - Should evaluate to true if T is a POD type -

    -
    -

    - BOOST_IS_EMPTY(T) -

    -
    -

    - Should evaluate to true if T is an empty struct or union -

    -
    -

    - BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) -

    -
    -

    - Should evaluate to true if the default constructor for T is trivial - (i.e. has no effect) -

    -
    -

    - BOOST_HAS_TRIVIAL_COPY(T) -

    -
    -

    - Should evaluate to true if T has a trivial copy constructor (and - can therefore be replaced by a call to memcpy) -

    -
    -

    - BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T) -

    -
    -

    - Should evaluate to true if T has a trivial move constructor (and - can therefore be replaced by a call to memcpy) -

    -
    -

    - BOOST_HAS_TRIVIAL_ASSIGN(T) -

    -
    -

    - Should evaluate to true if T has a trivial assignment operator (and - can therefore be replaced by a call to memcpy) -

    -
    -

    - BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T) -

    -
    -

    - Should evaluate to true if T has a trivial move assignment operator - (and can therefore be replaced by a call to memcpy) -

    -
    -

    - BOOST_HAS_TRIVIAL_DESTRUCTOR(T) -

    -
    -

    - Should evaluate to true if T has a trivial destructor (i.e. ~T() - has no effect) -

    -
    -

    - BOOST_HAS_NOTHROW_CONSTRUCTOR(T) -

    -
    -

    - Should evaluate to true if T - x; - can not throw -

    -
    -

    - BOOST_HAS_NOTHROW_COPY(T) -

    -
    -

    - Should evaluate to true if T(t) can not throw -

    -
    -

    - BOOST_HAS_NOTHROW_ASSIGN(T) -

    -
    -

    - Should evaluate to true if T - t, - u; - t = - u can not throw -

    -
    -

    - BOOST_HAS_VIRTUAL_DESTRUCTOR(T) -

    -
    -

    - Should evaluate to true T has a virtual destructor -

    -
    -

    - BOOST_IS_NOTHROW_MOVE_ASSIGN(T) -

    -
    -

    - Should evaluate to true T has a non-throwing move assign operator. -

    -
    -

    - BOOST_IS_NOTHROW_MOVE_CONSTRUCT(T) -

    -
    -

    - Should evaluate to true T has a non-throwing move constructor. -

    -

    BOOST_IS_ABSTRACT(T) @@ -356,6 +185,18 @@

    +

    + BOOST_IS_EMPTY(T) +

    +
    +

    + Should evaluate to true if T is an empty struct or union +

    +

    BOOST_IS_ENUM(T) @@ -368,6 +209,43 @@

    +

    + BOOST_IS_FINAL(T) +

    +
    +

    + Should evaluate to true if T is a class type declared with the final + specifier +

    +
    +

    + BOOST_IS_NOTHROW_MOVE_ASSIGN(T) +

    +
    +

    + Should evaluate to true T has a non-throwing move assign operator. +

    +
    +

    + BOOST_IS_NOTHROW_MOVE_CONSTRUCT(T) +

    +
    +

    + Should evaluate to true T has a non-throwing move constructor. +

    +

    BOOST_IS_POLYMORPHIC(T) @@ -382,25 +260,156 @@

    - BOOST_ALIGNMENT_OF(T) + BOOST_IS_POD(T)

    - Should evaluate to the alignment requirements of type T + Should evaluate to true if T is a POD type

    - BOOST_IS_FINAL(T) + BOOST_IS_UNION(T)

    - Should evaluate to true if T is a class type declared with the final - specifier + Should evaluate to true if T is a union type +

    +
    +

    + BOOST_HAS_NOTHROW_ASSIGN(T) +

    +
    +

    + Should evaluate to true if T + t, + u; + t = + u can not throw +

    +
    +

    + BOOST_HAS_NOTHROW_CONSTRUCTOR(T) +

    +
    +

    + Should evaluate to true if T + x; + can not throw +

    +
    +

    + BOOST_HAS_NOTHROW_COPY(T) +

    +
    +

    + Should evaluate to true if T(t) can not throw +

    +
    +

    + BOOST_HAS_TRIVIAL_ASSIGN(T) +

    +
    +

    + Should evaluate to true if T has a trivial assignment operator (and + can therefore be replaced by a call to memcpy) +

    +
    +

    + BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) +

    +
    +

    + Should evaluate to true if the default constructor for T is trivial + (i.e. has no effect) +

    +
    +

    + BOOST_HAS_TRIVIAL_COPY(T) +

    +
    +

    + Should evaluate to true if T has a trivial copy constructor (and + can therefore be replaced by a call to memcpy) +

    +
    +

    + BOOST_HAS_TRIVIAL_DESTRUCTOR(T) +

    +
    +

    + Should evaluate to true if T has a trivial destructor (i.e. ~T() + has no effect) +

    +
    +

    + BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T) +

    +
    +

    + Should evaluate to true if T has a trivial move constructor (and + can therefore be replaced by a call to memcpy) +

    +
    +

    + BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T) +

    +
    +

    + Should evaluate to true if T has a trivial move assignment operator + (and can therefore be replaced by a call to memcpy) +

    +
    +

    + BOOST_HAS_VIRTUAL_DESTRUCTOR(T) +

    +
    +

    + Should evaluate to true T has a virtual destructor

    diff --git a/doc/html/boost_typetraits/reference.html b/doc/html/boost_typetraits/reference.html index c6686d2..f1cfab2 100644 --- a/doc/html/boost_typetraits/reference.html +++ b/doc/html/boost_typetraits/reference.html @@ -3,7 +3,7 @@ Alphabetical Reference - + @@ -26,7 +26,7 @@ - diff --git a/doc/html/boost_typetraits/reference/add_const.html b/doc/html/boost_typetraits/reference/add_const.html index 2cca9f6..9f84ce4 100644 --- a/doc/html/boost_typetraits/reference/add_const.html +++ b/doc/html/boost_typetraits/reference/add_const.html @@ -3,7 +3,7 @@ add_const - + @@ -39,14 +39,6 @@

    C++ Standard Reference: 3.9.3.

    -

    - Compiler Compatibility: If the compiler - does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T - except where compiler - workarounds have been applied. -

    Header: #include <boost/type_traits/add_const.hpp> @@ -124,7 +116,10 @@

    -
    +

    + Compiler Compatibility: All current compilers + are supported by this trait. +

    diff --git a/doc/html/boost_typetraits/reference/add_cv.html b/doc/html/boost_typetraits/reference/add_cv.html index f056537..2c6ef38 100644 --- a/doc/html/boost_typetraits/reference/add_cv.html +++ b/doc/html/boost_typetraits/reference/add_cv.html @@ -3,7 +3,7 @@ add_cv - + @@ -40,14 +40,6 @@

    C++ Standard Reference: 3.9.3.

    -

    - Compiler Compatibility: If the compiler - does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T - except where compiler - workarounds have been applied. -

    Header: #include <boost/type_traits/add_cv.hpp> @@ -127,7 +119,10 @@

    -
    +

    + Compiler Compatibility: All current compilers + are supported by this trait. +

    diff --git a/doc/html/boost_typetraits/reference/add_lvalue_reference.html b/doc/html/boost_typetraits/reference/add_lvalue_reference.html index 6b8e2c8..0665fdc 100644 --- a/doc/html/boost_typetraits/reference/add_lvalue_reference.html +++ b/doc/html/boost_typetraits/reference/add_lvalue_reference.html @@ -3,7 +3,7 @@ add_lvalue_reference - + @@ -44,14 +44,6 @@

    C++ Standard Reference: 20.7.6.2.

    -

    - Compiler Compatibility: If the compiler - does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T - except where compiler - workarounds have been applied. -

    Header: #include <boost/type_traits/add_lvalue_reference.hpp> @@ -153,7 +145,10 @@

    -
    +

    + Compiler Compatibility: All current compilers + are supported by this trait. +

    diff --git a/doc/html/boost_typetraits/reference/add_pointer.html b/doc/html/boost_typetraits/reference/add_pointer.html index 92df6bf..a775a5e 100644 --- a/doc/html/boost_typetraits/reference/add_pointer.html +++ b/doc/html/boost_typetraits/reference/add_pointer.html @@ -3,7 +3,7 @@ add_pointer - + @@ -36,20 +36,12 @@ type: The same type as remove_reference<T>::type*.

    - The rationale for this template is that it produces the same type as TYPEOF(&t), where + The rationale for this template is that it produces the same type as decltype(&t), where t is an object of type T.

    C++ Standard Reference: 8.3.1.

    -

    - Compiler Compatibility: If the compiler - does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T - except where compiler - workarounds have been applied. -

    Header: #include <boost/type_traits/add_pointer.hpp> @@ -126,7 +118,10 @@

    -
    +

    + Compiler Compatibility: All current compilers + are supported by this trait. +

    diff --git a/doc/html/boost_typetraits/reference/add_reference.html b/doc/html/boost_typetraits/reference/add_reference.html index f3e2e67..7023d53 100644 --- a/doc/html/boost_typetraits/reference/add_reference.html +++ b/doc/html/boost_typetraits/reference/add_reference.html @@ -3,7 +3,7 @@ add_reference - + @@ -51,14 +51,6 @@

    C++ Standard Reference: 8.3.2.

    -

    - Compiler Compatibility: If the compiler - does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T - except where compiler - workarounds have been applied. -

    Header: #include <boost/type_traits/add_reference.hpp> @@ -135,7 +127,10 @@

    -
    +

    + Compiler Compatibility: All current compilers + are supported by this trait. +

    diff --git a/doc/html/boost_typetraits/reference/add_rvalue_reference.html b/doc/html/boost_typetraits/reference/add_rvalue_reference.html index 2560748..2f148a9 100644 --- a/doc/html/boost_typetraits/reference/add_rvalue_reference.html +++ b/doc/html/boost_typetraits/reference/add_rvalue_reference.html @@ -3,7 +3,7 @@ add_rvalue_reference - + @@ -44,12 +44,6 @@

    C++ Standard Reference: 20.7.6.2.

    -

    - Compiler Compatibility: If the compiler - does not support partial specialization of class-templates and rvalue references - then this template will compile, but the member type - will always be the same as type T. -

    Header: #include <boost/type_traits/add_rvalue_reference.hpp> @@ -151,7 +145,10 @@

    -
    +

    + Compiler Compatibility: In the absence of + rvalue-reference support this trait has no effect. +

    diff --git a/doc/html/boost_typetraits/reference/add_volatile.html b/doc/html/boost_typetraits/reference/add_volatile.html index 04e9c05..d935768 100644 --- a/doc/html/boost_typetraits/reference/add_volatile.html +++ b/doc/html/boost_typetraits/reference/add_volatile.html @@ -3,7 +3,7 @@ add_volatile - + @@ -39,14 +39,6 @@

    C++ Standard Reference: 3.9.3.

    -

    - Compiler Compatibility: If the compiler - does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T - except where compiler - workarounds have been applied. -

    Header: #include <boost/type_traits/add_volatile.hpp> @@ -125,7 +117,10 @@

    -
    +

    + Compiler Compatibility: All current compilers + are supported by this trait. +

    diff --git a/doc/html/boost_typetraits/reference/aligned_storage.html b/doc/html/boost_typetraits/reference/aligned_storage.html index 4189362..27fb394 100644 --- a/doc/html/boost_typetraits/reference/aligned_storage.html +++ b/doc/html/boost_typetraits/reference/aligned_storage.html @@ -3,7 +3,7 @@ aligned_storage - + diff --git a/doc/html/boost_typetraits/reference/alignment_of.html b/doc/html/boost_typetraits/reference/alignment_of.html index 8bd65cc..d365b22 100644 --- a/doc/html/boost_typetraits/reference/alignment_of.html +++ b/doc/html/boost_typetraits/reference/alignment_of.html @@ -3,7 +3,7 @@ alignment_of - + diff --git a/doc/html/boost_typetraits/reference/common_type.html b/doc/html/boost_typetraits/reference/common_type.html index ccf9756..6c78990 100644 --- a/doc/html/boost_typetraits/reference/common_type.html +++ b/doc/html/boost_typetraits/reference/common_type.html @@ -3,11 +3,11 @@ common_type - + - +
    @@ -20,7 +20,7 @@

    -PrevUpHomeNext +PrevUpHomeNext

    @@ -32,115 +32,92 @@ or #include <boost/type_traits.hpp>

    namespace boost {
    -  template <class ...T>  struct common_type;
    +  template <class... T> struct common_type;
     }
     

    - common_type - is a traits class used to deduce a type common to a several types, useful - as the return type of functions operating on multiple input types such as - in mixed-mode arithmetic.. + common_type is a traits class + used to deduce a type common to a several types, useful as the return type + of functions operating on multiple input types such as in mixed-mode arithmetic..

    The nested typedef ::type could be defined as follows:

    -
    template <class ...T>
    +
    template <class... T>
     struct common_type;
     
    -template <class T, class U, class ...V>
    -struct common_type<T,U,...V> {
    -    typedef typename common_type<typename common_type<T, U>::type, V...>::type type;
    +template <class T, class U, class... V>
    +struct common_type<T, U, V...> {
    +    typedef typename common_type<typename common_type<T, U>::type, V...>::type type;
    +};
    +
    +template <>
    +struct common_type<> {
     };
     
     template <class T>
     struct common_type<T> {
    -    typedef T type;
    +    typedef typename decay<T>::type type;
     };
     
     template <class T, class U>
     struct common_type<T, U> {
    -    typedef decltype(declval<bool>() ? declval<T>() : declval<U>()) type;
    +    typedef typename decay<
    +        decltype( declval<bool>()?
    +            declval<typename decay<T>::type>():
    +            declval<typename decay<U>::type>() )
    +    >::type type;
     };
     

    All parameter types must be complete. This trait is permitted to be specialized by a user if at least one template parameter is a user-defined type. Note: Such specializations are required when only - explicit conversions are desired among the common_type + explicit conversions are desired among the common_type arguments.

    Note that when the compiler does not support variadic templates (and the - macro BOOST_NO_VARIADIC_TEMPLATES is defined) then the maximum number of - template arguments is 3. + macro BOOST_NO_CXX11_VARIADIC_TEMPLATES + is defined) then the maximum number of template arguments is 9.

    - Configuration - macros -
    -

    - When the compiler does not support static assertions then the user can select - the way static assertions are reported. Define -

    -
      -
    • - BOOST_COMMON_TYPE_USES_STATIC_ASSERT: define it if you want to use Boost.StaticAssert -
    • -
    • - BOOST_COMMON_TYPE_USES_MPL_ASSERT: define it if you want to use Boost.MPL - static assertions -
    • -
    -

    - The default behavior is to use mpl assertions in this case, but setting BOOST_COMMON_TYPE_USES_STATIC_ASSERT - may reduce compile times and header dependencies somewhat. -

    -

    - Depending on the static assertion used you will have an hint of the failing - assertion either through the symbol or through the text. -

    -

    - When possible common_type is implemented using decltype. - Otherwise when BOOST_COMMON_TYPE_DONT_USE_TYPEOF is not defined it uses Boost.TypeOf. -

    -
    - Tutorial

    - In a nutshell, common_type + In a nutshell, common_type is a trait that takes 1 or more types, and returns a type which all of the types will convert to. The default definition demands this conversion be implicit. However the trait can be specialized for user-defined types which want to limit their inter-type conversions to explicit, and yet still want - to interoperate with the common_type + to interoperate with the common_type facility.

    Example:

    template <class T, class U>
    -complex<typename common_type<T, U>::type>
    +complex<typename common_type<T, U>::type>
     operator+(complex<T>, complex<U>);
     

    In the above example, "mixed-mode" complex arithmetic is allowed. - The return type is described by common_type. + The return type is described by common_type. For example the resulting type of adding a complex<float> and complex<double> might be a complex<double>.

    Here is how someone might produce a variadic comparison function:

    template <class ...T>
    -typename common_type<T...>::type
    +typename common_type<T...>::type
     min(T... t);
     

    This is a very useful and broadly applicable utility.

    - + How to get the common type of types with explicit conversions?
    @@ -148,23 +125,23 @@ Another choice for the author of the preceding operator could be

    template <class T, class U>
    -typename common_type<complex<T>, complex<U> >::type
    +typename common_type<complex<T>, complex<U> >::type
     operator+(complex<T>, complex<U>);
     

    - As the default definition of common_type + As the default definition of common_type demands the conversion be implicit, we need to specialize the trait for complex types as follows.

    template <class T, class U>
    -struct common_type<complex<T>, complex<U> > {
    -    typedef complex< common_type<T, U> > type;
    +struct common_type<complex<T>, complex<U> > {
    +    typedef complex< common_type<T, U> > type;
     };
     
    - - How - important is the order of the common_type<> template arguments? + + How + important is the order of the common_type<> template arguments?

    The order of the template parameters is important. @@ -242,9 +219,10 @@ A>.

    - - Can - the common_type of two types be a third type? + + Can + the common_type of two types + be a third type?

    Given the preceding example, one might expect common_type<A,B>::type to be C @@ -269,9 +247,10 @@ B>.

    - - How - common_type behaves with pointers? + + How + does common_type behave with + pointers?

    Consider @@ -305,26 +284,32 @@ Of course the user can always make this specialization.

    - - Can - you explain the pros/cons of common_type against Boost.Typeof? + + Can + you explain the pros/cons of common_type + against Boost.Typeof?

    - Even if they appear to be close, common_type + Even if they appear to be close, common_type and typeof have different purposes. You use typeof - to get the type of an expression, while you use common_type + to get the type of an expression, while you use common_type to set explicitly the type returned of a template function. Both are complementary, - and indeed common_type - is equivalent to decltype(declval<bool>() ? declval<T>() - : declval<U>()) + and indeed common_type is + approximately equivalent to decltype(declval<bool>() + ? declval<T>() + : declval<U>()).

    - common_type - is also similar to promote_args<class ...T> in boost/math/tools/promotion.hpp, - though it is not exactly the same as promote_args either. common_type<T1, - T2>::type simply represents the result of some operation on T1 and T2, - and defaults to the type obtained by putting T1 and T2 into a conditional + common_type is also similar + to promote_args<class ...T> in + boost/math/tools/promotion.hpp, though + it is not exactly the same as promote_args + either. common_type<T1, T2>::type + simply represents the result of some operation on T1 + and T2, and defaults to the + type obtained by putting T1 + and T2 into a conditional statement.

    @@ -346,7 +331,7 @@


    -PrevUpHomeNext +PrevUpHomeNext
    diff --git a/doc/html/boost_typetraits/reference/common_type_hpp.html b/doc/html/boost_typetraits/reference/common_type_hpp.html deleted file mode 100644 index 52059cf..0000000 --- a/doc/html/boost_typetraits/reference/common_type_hpp.html +++ /dev/null @@ -1,117 +0,0 @@ - - - -common_type - - - - - - - - - - - - - - - -
    Boost C++ LibrariesHomeLibrariesPeopleFAQMore
    -
    -
    -PrevUpHomeNext -
    -
    - -

    - #include <boost/type_traits/common_type.hpp> -

    -
    namespace boost {
    -  template <class ...T>  struct common_type;
    -}
    -
    -

    - common_type - is a traits class used to deduce a type common to a several types, useful - as the return type of functions operating on multiple input types such as - in mixed-mode arithmetic.. -

    -

    - The nested typedef ::type - could be defined as follows: -

    -
    template <class ...T>
    -struct common_type;
    -
    -template <class T, class U, class ...V>
    -struct common_type<T,U,...V> {
    -    typedef typename __common_type__<typename __common_type__<T, U>::type, V...>::type type;
    -};
    -
    -template <class T>
    -struct common_type<T> {
    -    typedef T type;
    -};
    -
    -template <class T, class U>
    -struct common_type<T, U> {
    -    typedef decltype(__declval__<bool>() ? __declval__<T>() : __declval__<U>()) type;
    -};
    -
    -

    - All parameter types must be complete. This trait is permitted to be specialized - by a user if at least one template parameter is a user-defined type. Note: Such specializations are required when only - explicit conversions are desired among the common_type - arguments. -

    -
    - - Configuration - macros -
    -

    - When the compiler does not support static assertions then the user can select - the way static assertions are reported. Define -

    -
      -
    • - BOOST_COMMON_TYPE_USES_STATIC_ASSERT: define it if you want to use Boost.StaticAssert -
    • -
    • - BOOST_COMMON_TYPE_USES_MPL_ASSERT: define it if you want to use Boost.MPL - static asertions -
    • -
    -

    - The default behavior is to use mpl assertions in this case, but setting BOOST_COMMON_TYPE_USES_STATIC_ASSERT - may reduce compile times and header dependencies somewhat. -

    -

    - Depending on the static assertion used you will have an hint of the failing - assertion either through the symbol or through the text. -

    -

    - When possible common_type is implemented using decltype. - Otherwise when BOOST_COMMON_TYPE_DONT_USE_TYPEOF is not defined it uses Boost.TypeOf. -

    -
    - - - -
    -
    -
    -PrevUpHomeNext -
    - - diff --git a/doc/html/boost_typetraits/reference/conditional.html b/doc/html/boost_typetraits/reference/conditional.html index bb13895..7c7577c 100644 --- a/doc/html/boost_typetraits/reference/conditional.html +++ b/doc/html/boost_typetraits/reference/conditional.html @@ -3,7 +3,7 @@ conditional - + @@ -39,9 +39,6 @@ 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. -

    diff --git a/doc/html/boost_typetraits/reference/copy_cv.html b/doc/html/boost_typetraits/reference/copy_cv.html new file mode 100644 index 0000000..de91732 --- /dev/null +++ b/doc/html/boost_typetraits/reference/copy_cv.html @@ -0,0 +1,163 @@ + + + +copy_cv + + + + + + + + +
    + + + + + + +
    Boost C++ LibrariesHomeLibrariesPeopleFAQMore
    +
    +
    +PrevUpHomeNext +
    +
    + +
    template <class T, class U>
    +struct copy_cv
    +{
    +   typedef see-below type;
    +};
    +
    +

    + type: T cv, + where cv are the cv-qualifiers of U. +

    +

    + Header: #include + <boost/type_traits/copy_cv.hpp> + or #include <boost/type_traits.hpp> +

    +
    +

    Table 1.17. Examples

    +
    ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +

    + Expression +

    +
    +

    + Result Type +

    +
    +

    + copy_cv<int, void>::type +

    +
    +

    + int +

    +
    +

    + copy_cv<int const, void>::type +

    +
    +

    + int const +

    +
    +

    + copy_cv<int, void const>::type +

    +
    +

    + int const +

    +
    +

    + copy_cv<int volatile, void + const>::type +

    +
    +

    + int const + volatile +

    +
    +

    + copy_cv<int&, + void const>::type +

    +
    +

    + int& +

    +
    +

    + copy_cv<int*, + void volatile>::type +

    +
    +

    + int* + volatile +

    +
    +
    +
    +
    + + + +
    +
    +
    +PrevUpHomeNext +
    + + diff --git a/doc/html/boost_typetraits/reference/decay.html b/doc/html/boost_typetraits/reference/decay.html index 42a8f99..fbbe632 100644 --- a/doc/html/boost_typetraits/reference/decay.html +++ b/doc/html/boost_typetraits/reference/decay.html @@ -3,11 +3,11 @@ decay - + - - + + @@ -20,7 +20,7 @@

    -PrevUpHomeNext +PrevUpHomeNext

    @@ -48,7 +48,7 @@ or #include <boost/type_traits.hpp>

    -

    Table 1.17. Examples

    +

    Table 1.18. Examples

    @@ -130,7 +130,10 @@
    -
    +

    + Compiler Compatibility: All current compilers + are supported by this trait. +

    @@ -146,7 +149,7 @@

    -PrevUpHomeNext +PrevUpHomeNext
    diff --git a/doc/html/boost_typetraits/reference/declval.html b/doc/html/boost_typetraits/reference/declval.html new file mode 100644 index 0000000..77983cc --- /dev/null +++ b/doc/html/boost_typetraits/reference/declval.html @@ -0,0 +1,66 @@ + + + +declval + + + + + + + + + + + + + + + +
    Boost C++ LibrariesHomeLibrariesPeopleFAQMore
    +
    +
    +PrevUpHomeNext +
    +
    + +
    template <class T>
    +typename add_rvalue_reference<T>::type declval() noexcept; // as unevaluated operand
    +
    +

    + C++ Standard Reference: C++11 20.2.4 [declval]. +

    +

    + Header: #include + <boost/type_traits/declval.hpp> + or #include <boost/type_traits.hpp> +

    +

    + The function template declval + is used when a value of a certain type is required in a type computation + context. For example, the type of the result of adding an int + and a float can be obtained + with the expression decltype( declval<int>() + + declval<float>() ). +

    +
    + + + +
    +
    +
    +PrevUpHomeNext +
    + + diff --git a/doc/html/boost_typetraits/reference/extent.html b/doc/html/boost_typetraits/reference/extent.html index e0e7c0c..97f4600 100644 --- a/doc/html/boost_typetraits/reference/extent.html +++ b/doc/html/boost_typetraits/reference/extent.html @@ -3,10 +3,10 @@ extent - + - + @@ -20,7 +20,7 @@
    -PrevUpHomeNext +PrevUpHomeNext

    @@ -88,6 +88,10 @@

    extent<T>::value_type is the type std::size_t.

    +

    + Compiler Compatibility: All current compilers + are supported by this trait. +

    @@ -103,7 +107,7 @@

    -PrevUpHomeNext +PrevUpHomeNext
    diff --git a/doc/html/boost_typetraits/reference/floating_point_promotion.html b/doc/html/boost_typetraits/reference/floating_point_promotion.html index 625b906..afab9d8 100644 --- a/doc/html/boost_typetraits/reference/floating_point_promotion.html +++ b/doc/html/boost_typetraits/reference/floating_point_promotion.html @@ -3,7 +3,7 @@ floating_point_promotion - + @@ -48,7 +48,7 @@ or #include <boost/type_traits.hpp>

    -

    Table 1.18. Examples

    +

    Table 1.19. Examples

    @@ -107,7 +107,10 @@
    -
    +

    + Compiler Compatibility: All current compilers + are supported by this trait. +

    diff --git a/doc/html/boost_typetraits/reference/function_traits.html b/doc/html/boost_typetraits/reference/function_traits.html index 57a44dc..77ea0a9 100644 --- a/doc/html/boost_typetraits/reference/function_traits.html +++ b/doc/html/boost_typetraits/reference/function_traits.html @@ -3,7 +3,7 @@ function_traits - + @@ -59,7 +59,7 @@

    -

    Table 1.19. Function Traits Members

    +

    Table 1.20. Function Traits Members

    @@ -122,7 +122,7 @@

    -

    Table 1.20. Examples

    +

    Table 1.21. Examples

    @@ -263,7 +263,10 @@
    -
    +

    + Compiler Compatibility: All current compilers + are supported by this trait. +

    diff --git a/doc/html/boost_typetraits/reference/has_bit_and.html b/doc/html/boost_typetraits/reference/has_bit_and.html index 437ff52..d6ba60e 100644 --- a/doc/html/boost_typetraits/reference/has_bit_and.html +++ b/doc/html/boost_typetraits/reference/has_bit_and.html @@ -3,7 +3,7 @@ has_bit_and - + @@ -100,11 +100,10 @@ Type Traits

    - Limitation: + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this.

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_bit_and_assign.html b/doc/html/boost_typetraits/reference/has_bit_and_assign.html index 0a42a4d..d913cb5 100644 --- a/doc/html/boost_typetraits/reference/has_bit_and_assign.html +++ b/doc/html/boost_typetraits/reference/has_bit_and_assign.html @@ -3,7 +3,7 @@ has_bit_and_assign - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -99,12 +104,6 @@ See also:Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_bit_or.html b/doc/html/boost_typetraits/reference/has_bit_or.html index cc00936..89cd8dc 100644 --- a/doc/html/boost_typetraits/reference/has_bit_or.html +++ b/doc/html/boost_typetraits/reference/has_bit_or.html @@ -3,7 +3,7 @@ has_bit_or - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -99,12 +104,6 @@ See also:Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_bit_or_assign.html b/doc/html/boost_typetraits/reference/has_bit_or_assign.html index 62fd3ad..4f93a5e 100644 --- a/doc/html/boost_typetraits/reference/has_bit_or_assign.html +++ b/doc/html/boost_typetraits/reference/has_bit_or_assign.html @@ -3,7 +3,7 @@ has_bit_or_assign - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -99,12 +104,6 @@ See also:Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_bit_xor.html b/doc/html/boost_typetraits/reference/has_bit_xor.html index c497d91..80463de 100644 --- a/doc/html/boost_typetraits/reference/has_bit_xor.html +++ b/doc/html/boost_typetraits/reference/has_bit_xor.html @@ -3,7 +3,7 @@ has_bit_xor - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -99,12 +104,6 @@ See also:Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_bit_xor_assign.html b/doc/html/boost_typetraits/reference/has_bit_xor_assign.html index 65f8266..a6fe0b3 100644 --- a/doc/html/boost_typetraits/reference/has_bit_xor_assign.html +++ b/doc/html/boost_typetraits/reference/has_bit_xor_assign.html @@ -3,7 +3,7 @@ has_bit_xor_assign - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -99,12 +104,6 @@ See also:Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_complement.html b/doc/html/boost_typetraits/reference/has_complement.html index ed98dc6..07c6a32 100644 --- a/doc/html/boost_typetraits/reference/has_complement.html +++ b/doc/html/boost_typetraits/reference/has_complement.html @@ -3,7 +3,7 @@ has_complement - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -108,12 +113,6 @@ See also:Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_dereference.html b/doc/html/boost_typetraits/reference/has_dereference.html index 2e53a9f..3e63bbe 100644 --- a/doc/html/boost_typetraits/reference/has_dereference.html +++ b/doc/html/boost_typetraits/reference/has_dereference.html @@ -3,7 +3,7 @@ has_dereference - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -117,12 +122,6 @@ See also:Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_divides.html b/doc/html/boost_typetraits/reference/has_divides.html index 61678ff..4b7b851 100644 --- a/doc/html/boost_typetraits/reference/has_divides.html +++ b/doc/html/boost_typetraits/reference/has_divides.html @@ -3,7 +3,7 @@ has_divides - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -105,12 +110,6 @@ See also:Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_divides_assign.html b/doc/html/boost_typetraits/reference/has_divides_assign.html index bc0ed0b..b843a3f 100644 --- a/doc/html/boost_typetraits/reference/has_divides_assign.html +++ b/doc/html/boost_typetraits/reference/has_divides_assign.html @@ -3,7 +3,7 @@ has_divides_assign - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -105,12 +110,6 @@ See also:Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_equal_to.html b/doc/html/boost_typetraits/reference/has_equal_to.html index 951ff6c..5afe3de 100644 --- a/doc/html/boost_typetraits/reference/has_equal_to.html +++ b/doc/html/boost_typetraits/reference/has_equal_to.html @@ -3,7 +3,7 @@ has_equal_to - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -104,12 +109,6 @@ See also:Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_greater.html b/doc/html/boost_typetraits/reference/has_greater.html index 88b8a77..ac426f6 100644 --- a/doc/html/boost_typetraits/reference/has_greater.html +++ b/doc/html/boost_typetraits/reference/has_greater.html @@ -3,7 +3,7 @@ has_greater - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -104,12 +109,6 @@ See also:Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_greater_equal.html b/doc/html/boost_typetraits/reference/has_greater_equal.html index bcb1d0d..1a1621a 100644 --- a/doc/html/boost_typetraits/reference/has_greater_equal.html +++ b/doc/html/boost_typetraits/reference/has_greater_equal.html @@ -3,7 +3,7 @@ has_greater_equal - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -104,12 +109,6 @@ See also:Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_left_shift.html b/doc/html/boost_typetraits/reference/has_left_shift.html index a58ca0b..83166b3 100644 --- a/doc/html/boost_typetraits/reference/has_left_shift.html +++ b/doc/html/boost_typetraits/reference/has_left_shift.html @@ -3,7 +3,7 @@ has_left_shift - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -111,12 +116,6 @@ See also:Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_left_shift_assign.html b/doc/html/boost_typetraits/reference/has_left_shift_assign.html index a166840..7ff5107 100644 --- a/doc/html/boost_typetraits/reference/has_left_shift_assign.html +++ b/doc/html/boost_typetraits/reference/has_left_shift_assign.html @@ -3,7 +3,7 @@ has_left_shift_assign - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -99,12 +104,6 @@ See also:Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_less.html b/doc/html/boost_typetraits/reference/has_less.html index 6c52a3f..9bf9414 100644 --- a/doc/html/boost_typetraits/reference/has_less.html +++ b/doc/html/boost_typetraits/reference/has_less.html @@ -3,7 +3,7 @@ has_less - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -104,12 +109,6 @@ See also:Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_less_equal.html b/doc/html/boost_typetraits/reference/has_less_equal.html index d4046b1..7c7cb81 100644 --- a/doc/html/boost_typetraits/reference/has_less_equal.html +++ b/doc/html/boost_typetraits/reference/has_less_equal.html @@ -3,7 +3,7 @@ has_less_equal - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -104,12 +109,6 @@ See also:Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_logical_and.html b/doc/html/boost_typetraits/reference/has_logical_and.html index 7b214b7..fc71cd5 100644 --- a/doc/html/boost_typetraits/reference/has_logical_and.html +++ b/doc/html/boost_typetraits/reference/has_logical_and.html @@ -3,7 +3,7 @@ has_logical_and - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -102,12 +107,6 @@ See also:Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_logical_not.html b/doc/html/boost_typetraits/reference/has_logical_not.html index 6ba872f..56fe3a8 100644 --- a/doc/html/boost_typetraits/reference/has_logical_not.html +++ b/doc/html/boost_typetraits/reference/has_logical_not.html @@ -3,7 +3,7 @@ has_logical_not - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -104,12 +109,6 @@ See also:Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_logical_or.html b/doc/html/boost_typetraits/reference/has_logical_or.html index d94fc7e..2196395 100644 --- a/doc/html/boost_typetraits/reference/has_logical_or.html +++ b/doc/html/boost_typetraits/reference/has_logical_or.html @@ -3,7 +3,7 @@ has_logical_or - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -102,12 +107,6 @@ See also:Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_minus.html b/doc/html/boost_typetraits/reference/has_minus.html index 00e5357..db0b1a9 100644 --- a/doc/html/boost_typetraits/reference/has_minus.html +++ b/doc/html/boost_typetraits/reference/has_minus.html @@ -3,7 +3,7 @@ has_minus - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -105,12 +110,6 @@ See also:Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_minus_assign.html b/doc/html/boost_typetraits/reference/has_minus_assign.html index 6d47474..f78699d 100644 --- a/doc/html/boost_typetraits/reference/has_minus_assign.html +++ b/doc/html/boost_typetraits/reference/has_minus_assign.html @@ -3,7 +3,7 @@ has_minus_assign - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -105,12 +110,6 @@ See also:Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_modulus.html b/doc/html/boost_typetraits/reference/has_modulus.html index a8fe63e..3a9a322 100644 --- a/doc/html/boost_typetraits/reference/has_modulus.html +++ b/doc/html/boost_typetraits/reference/has_modulus.html @@ -3,7 +3,7 @@ has_modulus - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -98,12 +103,6 @@ See also:Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_modulus_assign.html b/doc/html/boost_typetraits/reference/has_modulus_assign.html index bc3474e..0468489 100644 --- a/doc/html/boost_typetraits/reference/has_modulus_assign.html +++ b/doc/html/boost_typetraits/reference/has_modulus_assign.html @@ -3,7 +3,7 @@ has_modulus_assign - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -98,12 +103,6 @@ See also:Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_multiplies.html b/doc/html/boost_typetraits/reference/has_multiplies.html index 66291fb..456f941 100644 --- a/doc/html/boost_typetraits/reference/has_multiplies.html +++ b/doc/html/boost_typetraits/reference/has_multiplies.html @@ -3,7 +3,7 @@ has_multiplies - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -105,12 +110,6 @@ See also:Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_multiplies_assign.html b/doc/html/boost_typetraits/reference/has_multiplies_assign.html index 33c6fee..8089c33 100644 --- a/doc/html/boost_typetraits/reference/has_multiplies_assign.html +++ b/doc/html/boost_typetraits/reference/has_multiplies_assign.html @@ -3,7 +3,7 @@ has_multiplies_assign - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -105,12 +110,6 @@ See also:Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_negate.html b/doc/html/boost_typetraits/reference/has_negate.html index 2197a49..1ff940a 100644 --- a/doc/html/boost_typetraits/reference/has_negate.html +++ b/doc/html/boost_typetraits/reference/has_negate.html @@ -3,7 +3,7 @@ has_negate - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -104,12 +109,6 @@ See also:Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_new_operator.html b/doc/html/boost_typetraits/reference/has_new_operator.html index fbe80bc..7999fc2 100644 --- a/doc/html/boost_typetraits/reference/has_new_operator.html +++ b/doc/html/boost_typetraits/reference/has_new_operator.html @@ -3,7 +3,7 @@ has_new_operator - + @@ -35,10 +35,9 @@ otherwise inherits from false_type.

    - Compiler Compatibility: Not usable with - compilers that do not support "substitution failure is not an error" - (in which case BOOST_NO_SFINAE will be defined), also known to be broken - with the Borland/Codegear compiler. + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. Also known to be broken with the Borland/Codegear compilers.

    C++ Standard Reference: 12.5. diff --git a/doc/html/boost_typetraits/reference/has_no_throw_def_cons.html b/doc/html/boost_typetraits/reference/has_no_throw_def_cons.html index da0e154..89d8916 100644 --- a/doc/html/boost_typetraits/reference/has_no_throw_def_cons.html +++ b/doc/html/boost_typetraits/reference/has_no_throw_def_cons.html @@ -3,7 +3,7 @@ has_nothrow_default_constructor - + diff --git a/doc/html/boost_typetraits/reference/has_not_equal_to.html b/doc/html/boost_typetraits/reference/has_not_equal_to.html index d2d6639..60ec945 100644 --- a/doc/html/boost_typetraits/reference/has_not_equal_to.html +++ b/doc/html/boost_typetraits/reference/has_not_equal_to.html @@ -3,7 +3,7 @@ has_not_equal_to - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -104,12 +109,6 @@ See also:Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_nothrow_assign.html b/doc/html/boost_typetraits/reference/has_nothrow_assign.html index 216b5cd..c01d51f 100644 --- a/doc/html/boost_typetraits/reference/has_nothrow_assign.html +++ b/doc/html/boost_typetraits/reference/has_nothrow_assign.html @@ -3,7 +3,7 @@ has_nothrow_assign - + @@ -37,16 +37,15 @@ type.

    - Compiler Compatibility: If the compiler - does not support partial-specialization of class templates, then this template - can not be used with function types. -

    -

    - Without some (as yet unspecified) help from the compiler, has_nothrow_assign - will never report that a class or struct has a non-throwing assignment-operator; - this is always safe, if possibly sub-optimal. Currently (May 2005) only Visual - C++ 8 has the necessary compiler support to ensure that this trait "just - works". + Compiler Compatibility: Either requires + C++11 noexcept and decltype or else some (unspecified) help from + the compiler. Currently (June 2015) compilers more recent than Visual C++ + 8, GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear and all recent GCC versions + have the necessary compiler intrinsics + to ensure that this trait "just works". You may test to see if + the necessary support is available by checking to see if defined(BOOST_HAS_NOTHROW_CONSTRUCTOR) || (!defined(BOOST_NO_CXX11_DECLTYPE) + && !defined(BOOST_NO_CXX11_NOEXCEPT)) + is true.

    Header: #include diff --git a/doc/html/boost_typetraits/reference/has_nothrow_constructor.html b/doc/html/boost_typetraits/reference/has_nothrow_constructor.html index 7d6888a..fb55aca 100644 --- a/doc/html/boost_typetraits/reference/has_nothrow_constructor.html +++ b/doc/html/boost_typetraits/reference/has_nothrow_constructor.html @@ -3,7 +3,7 @@ has_nothrow_constructor - + @@ -43,20 +43,15 @@ These two traits are synonyms for each other.

    - Compiler Compatibility: If the compiler - does not support partial-specialization of class templates, then this template - can not be used with function types. -

    -

    - Without some (unspecified) help from the compiler, has_nothrow_constructor - will never report that a class or struct has a non-throwing default-constructor; - this is always safe, if possibly sub-optimal. Currently (May 2011) compilers - more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear + Compiler Compatibility: Either requires + C++11 noexcept and decltype or else some (unspecified) help from + the compiler. Currently (June 2015) compilers more recent than Visual C++ + 8, GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear and all recent GCC versions have the necessary compiler intrinsics - to ensure that this trait "just works". You may also test to see - if the necessary intrinsics - are available by checking to see if the macro BOOST_HAS_NOTHROW_CONSTRUCTOR - is defined. + to ensure that this trait "just works". You may test to see if + the necessary support is available by checking to see if defined(BOOST_HAS_NOTHROW_CONSTRUCTOR) || (!defined(BOOST_NO_CXX11_DECLTYPE) + && !defined(BOOST_NO_CXX11_NOEXCEPT)) + is true.

    Header: #include diff --git a/doc/html/boost_typetraits/reference/has_nothrow_copy.html b/doc/html/boost_typetraits/reference/has_nothrow_copy.html index 9469d97..1ffa425 100644 --- a/doc/html/boost_typetraits/reference/has_nothrow_copy.html +++ b/doc/html/boost_typetraits/reference/has_nothrow_copy.html @@ -3,11 +3,11 @@ has_nothrow_copy - + - +

    @@ -20,7 +20,7 @@

    -PrevUpHomeNext +PrevUpHomeNext

    @@ -43,20 +43,15 @@ These two traits are synonyms for each other.

    - Compiler Compatibility: If the compiler - does not support partial-specialization of class templates, then this template - can not be used with function types. -

    -

    - Without some (as yet unspecified) help from the compiler, has_nothrow_copy - will never report that a class or struct has a non-throwing copy-constructor; - this is always safe, if possibly sub-optimal. Currently (May 2011) compilers - more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear + Compiler Compatibility: Either requires + C++11 noexcept and decltype or else some (unspecified) help from + the compiler. Currently (June 2015) compilers more recent than Visual C++ + 8, GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear and all recent GCC versions have the necessary compiler intrinsics - to ensure that this trait "just works". You may also test to see - if the necessary intrinsics - are available by checking to see if the macro BOOST_HAS_NOTHROW_COPY - is defined. + to ensure that this trait "just works". You may test to see if + the necessary support is available by checking to see if defined(BOOST_HAS_NOTHROW_COPY) || (!defined(BOOST_NO_CXX11_DECLTYPE) + && !defined(BOOST_NO_CXX11_NOEXCEPT)) + is true.

    Header: #include @@ -78,7 +73,7 @@


    -PrevUpHomeNext +PrevUpHomeNext
    diff --git a/doc/html/boost_typetraits/reference/has_nothrow_cp_cons.html b/doc/html/boost_typetraits/reference/has_nothrow_cp_cons.html index e61218f..5ca8144 100644 --- a/doc/html/boost_typetraits/reference/has_nothrow_cp_cons.html +++ b/doc/html/boost_typetraits/reference/has_nothrow_cp_cons.html @@ -3,10 +3,10 @@ has_nothrow_copy_constructor - + - + @@ -20,7 +20,7 @@
    -PrevUpHomeNext +PrevUpHomeNext

    @@ -44,7 +44,7 @@
    -PrevUpHomeNext +PrevUpHomeNext
    diff --git a/doc/html/boost_typetraits/reference/has_nothrow_destruct.html b/doc/html/boost_typetraits/reference/has_nothrow_destruct.html new file mode 100644 index 0000000..d4e6d97 --- /dev/null +++ b/doc/html/boost_typetraits/reference/has_nothrow_destruct.html @@ -0,0 +1,79 @@ + + + +has_nothrow_destructor + + + + + + + + + + + + + + + +
    Boost C++ LibrariesHomeLibrariesPeopleFAQMore
    +
    +
    +PrevUpHomeNext +
    +
    + +
    template <class T>
    +struct has_nothrow_destructor : public true_type-or-false_type {};
    +
    +

    + Inherits: If T is a (possibly cv-qualified) + type with a non-throwing destructor then inherits from true_type, + otherwise inherits from false_type. + Type T must be a complete + type. +

    +

    + Compiler Compatibility: Either requires + C++11 noexcept and decltype or else some (unspecified) help from + the compiler. You may test to see if the necessary support is available by + checking to see if !defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_CXX11_NOEXCEPT) is true. +

    +

    + Header: #include + <boost/type_traits/has_nothrow_copy.hpp> + or #include <boost/type_traits.hpp> +

    +
    + + + + + +
    [Note]Note

    + Note that destructors are assumed to be non-throwing unless they are explicitly + marked otherwise with a throw(something) specification. This is in line with the + C++11 standard. +

    +
    + + + +
    +
    +
    +PrevUpHomeNext +
    + + diff --git a/doc/html/boost_typetraits/reference/has_plus.html b/doc/html/boost_typetraits/reference/has_plus.html index 3ad53a6..946261d 100644 --- a/doc/html/boost_typetraits/reference/has_plus.html +++ b/doc/html/boost_typetraits/reference/has_plus.html @@ -3,7 +3,7 @@ has_plus - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -105,12 +110,6 @@ See also: Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_plus_assign.html b/doc/html/boost_typetraits/reference/has_plus_assign.html index f71aaef..d47688d 100644 --- a/doc/html/boost_typetraits/reference/has_plus_assign.html +++ b/doc/html/boost_typetraits/reference/has_plus_assign.html @@ -3,7 +3,7 @@ has_plus_assign - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -105,12 +110,6 @@ See also: Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_post_decrement.html b/doc/html/boost_typetraits/reference/has_post_decrement.html index 95b11cf..6b43ff9 100644 --- a/doc/html/boost_typetraits/reference/has_post_decrement.html +++ b/doc/html/boost_typetraits/reference/has_post_decrement.html @@ -3,7 +3,7 @@ has_post_decrement - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -112,12 +117,6 @@ See also: Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_post_increment.html b/doc/html/boost_typetraits/reference/has_post_increment.html index 12bb3be..3ee62a5 100644 --- a/doc/html/boost_typetraits/reference/has_post_increment.html +++ b/doc/html/boost_typetraits/reference/has_post_increment.html @@ -3,7 +3,7 @@ has_post_increment - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -112,12 +117,6 @@ See also: Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_pre_decrement.html b/doc/html/boost_typetraits/reference/has_pre_decrement.html index 136e45c..0f18539 100644 --- a/doc/html/boost_typetraits/reference/has_pre_decrement.html +++ b/doc/html/boost_typetraits/reference/has_pre_decrement.html @@ -3,7 +3,7 @@ has_pre_decrement - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -112,12 +117,6 @@ See also: Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_pre_increment.html b/doc/html/boost_typetraits/reference/has_pre_increment.html index 0fa3d89..e361bca 100644 --- a/doc/html/boost_typetraits/reference/has_pre_increment.html +++ b/doc/html/boost_typetraits/reference/has_pre_increment.html @@ -3,7 +3,7 @@ has_pre_increment - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -112,12 +117,6 @@ See also: Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_right_shift.html b/doc/html/boost_typetraits/reference/has_right_shift.html index 5100148..9961fff 100644 --- a/doc/html/boost_typetraits/reference/has_right_shift.html +++ b/doc/html/boost_typetraits/reference/has_right_shift.html @@ -3,7 +3,7 @@ has_right_shift - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -111,12 +116,6 @@ See also: Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_right_shift_assign.html b/doc/html/boost_typetraits/reference/has_right_shift_assign.html index 51bdfe8..fceeead 100644 --- a/doc/html/boost_typetraits/reference/has_right_shift_assign.html +++ b/doc/html/boost_typetraits/reference/has_right_shift_assign.html @@ -3,7 +3,7 @@ has_right_shift_assign - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -103,12 +108,6 @@ See also: Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_trivial_assign.html b/doc/html/boost_typetraits/reference/has_trivial_assign.html index 0e67677..e11e420 100644 --- a/doc/html/boost_typetraits/reference/has_trivial_assign.html +++ b/doc/html/boost_typetraits/reference/has_trivial_assign.html @@ -3,7 +3,7 @@ has_trivial_assign - + @@ -40,15 +40,12 @@ can be safely replaced with a call to memcpy.

    - Compiler Compatibility: If the compiler - does not support partial-specialization of class templates, then this template - can not be used with function types. -

    -

    - Without some (as yet unspecified) help from the compiler, has_trivial_assign - will never report that a user-defined class or struct has a trivial constructor; - this is always safe, if possibly sub-optimal. Currently (May 2011) compilers - more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear + Compiler Compatibility: Without some (as + yet unspecified) help from the compiler, has_trivial_assign will never report + that a user-defined class or struct has a trivial constructor; this is always + safe, if possibly sub-optimal. In order to correctly handle deleted or private + assignment operators, the compiler must also support C++11's decltype. Currently (May 2015) compilers more + recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear have the necessary compiler intrinsics to ensure that this trait "just works". You may also test to see if the necessary intrinsics diff --git a/doc/html/boost_typetraits/reference/has_trivial_constructor.html b/doc/html/boost_typetraits/reference/has_trivial_constructor.html index 83dd4b6..34666a5 100644 --- a/doc/html/boost_typetraits/reference/has_trivial_constructor.html +++ b/doc/html/boost_typetraits/reference/has_trivial_constructor.html @@ -3,7 +3,7 @@ has_trivial_constructor - + @@ -48,16 +48,13 @@ some benefit in terms of code size and speed can be obtained.

    - Compiler Compatibility: If the compiler - does not support partial-specialization of class templates, then this template - can not be used with function types. -

    -

    - Without some (as yet unspecified) help from the compiler, has_trivial_constructor - will never report that a user-defined class or struct has a trivial constructor; - this is always safe, if possibly sub-optimal. Currently (May 2011) compilers - more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear - have the necessary compiler intrinsics + Compiler Compatibility: Without some (as + yet unspecified) help from the compiler, has_trivial_constructor will never + report that a user-defined class or struct has a trivial constructor; this + is always safe, if possibly sub-optimal. In addition, in order to correctly + handle private or deleted default-constructors then C++11's deltype is required. Currently (May 2015) + compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, Intel-11.0, + and Codegear have the necessary compiler intrinsics to ensure that this trait "just works". You may also test to see if the necessary intrinsics are available by checking to see if the macro BOOST_HAS_TRIVIAL_CONSTRUCTOR diff --git a/doc/html/boost_typetraits/reference/has_trivial_copy.html b/doc/html/boost_typetraits/reference/has_trivial_copy.html index 294c819..85c3f8e 100644 --- a/doc/html/boost_typetraits/reference/has_trivial_copy.html +++ b/doc/html/boost_typetraits/reference/has_trivial_copy.html @@ -3,7 +3,7 @@ has_trivial_copy - + @@ -46,19 +46,17 @@ can be safely replaced with a call to memcpy.

    - Compiler Compatibility: If the compiler - does not support partial-specialization of class templates, then this template - can not be used with function types. -

    -

    - Without some (as yet unspecified) help from the compiler, has_trivial_copy - will never report that a user-defined class or struct has a trivial constructor; - this is always safe, if possibly sub-optimal. Currently (May 2011) compilers - more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear - have the necessary compiler intrinsics - to ensure that this trait "just works". You may also test to see - if the necessary intrinsics - are available by checking to see if the macro BOOST_HAS_TRIVIAL_COPY + Compiler Compatibility: Without some (as + yet unspecified) help from the compiler, has_trivial_copy will never report + that a user-defined class or struct has a trivial constructor; this is always + safe, if possibly sub-optimal. In addition, in order to correctly handle + deleted or private copy-constructors then C++11's dectype + is required. Currently (May 2015) compilers more recent than Visual C++ 8, + GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear have the necessary compiler + intrinsics to ensure that + this trait "just works". You may also test to see if the necessary + intrinsics are available + by checking to see if the macro BOOST_HAS_TRIVIAL_COPY is defined.

    diff --git a/doc/html/boost_typetraits/reference/has_trivial_cp_cons.html b/doc/html/boost_typetraits/reference/has_trivial_cp_cons.html index 5b17e14..776ce04 100644 --- a/doc/html/boost_typetraits/reference/has_trivial_cp_cons.html +++ b/doc/html/boost_typetraits/reference/has_trivial_cp_cons.html @@ -3,7 +3,7 @@ has_trivial_copy_constructor - + diff --git a/doc/html/boost_typetraits/reference/has_trivial_def_cons.html b/doc/html/boost_typetraits/reference/has_trivial_def_cons.html index fd4e627..3e01244 100644 --- a/doc/html/boost_typetraits/reference/has_trivial_def_cons.html +++ b/doc/html/boost_typetraits/reference/has_trivial_def_cons.html @@ -3,7 +3,7 @@ has_trivial_default_constructor - + diff --git a/doc/html/boost_typetraits/reference/has_trivial_destructor.html b/doc/html/boost_typetraits/reference/has_trivial_destructor.html index 0b23769..26b44ab 100644 --- a/doc/html/boost_typetraits/reference/has_trivial_destructor.html +++ b/doc/html/boost_typetraits/reference/has_trivial_destructor.html @@ -3,7 +3,7 @@ has_trivial_destructor - + @@ -42,16 +42,13 @@ some benefit in terms of code size and speed can be obtained.

    - Compiler Compatibility: If the compiler - does not support partial-specialization of class templates, then this template - can not be used with function types. -

    -

    - Without some (as yet unspecified) help from the compiler, has_trivial_destructor - will never report that a user-defined class or struct has a trivial destructor; - this is always safe, if possibly sub-optimal. Currently (May 2011) compilers - more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear - have the necessary compiler intrinsics + Compiler Compatibility: Without some (as + yet unspecified) help from the compiler, has_trivial_destructor will never + report that a user-defined class or struct has a trivial destructor; this + is always safe, if possibly sub-optimal. In addition, in order to correctly + handle deleted or private destructors then support for C++11's decltype is required. Currently (June 2015) + compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, Intel-11.0, + and Codegear have the necessary compiler intrinsics to ensure that this trait "just works". You may also test to see if the necessary intrinsics are available by checking to see if the macro BOOST_HAS_TRIVIAL_DESTRUCTOR diff --git a/doc/html/boost_typetraits/reference/has_trivial_move_assign.html b/doc/html/boost_typetraits/reference/has_trivial_move_assign.html index 43bef34..93dc7ae 100644 --- a/doc/html/boost_typetraits/reference/has_trivial_move_assign.html +++ b/doc/html/boost_typetraits/reference/has_trivial_move_assign.html @@ -3,7 +3,7 @@ has_trivial_move_assign - + @@ -40,17 +40,14 @@ operator can be safely replaced with a call to memcpy.

    - Compiler Compatibility: If the compiler - does not support partial-specialization of class templates, then this template - can not be used with function types. -

    -

    - Without some (as yet unspecified) help from the compiler, has_trivial_move_assign - will never report that a user-defined class or struct has a trivial constructor; - this is always safe, if possibly sub-optimal. Currently (February 2013) compilers - have no necessary intrinsics - to ensure that this trait "just works". You may also test to see - if the necessary intrinsics + Compiler Compatibility: Without some (as + yet unspecified) help from the compiler, has_trivial_move_assign will never + report that a user-defined class or struct has a trivial move assign; this + is always safe, if possibly sub-optimal. In addition, in order to correctly + handle private or deleted move assignment operators then c++11's decltype is required. Currently (June 2015) + compilers that have the necessary intrinsics + to ensure that this trait "just works" include Clang, GCC-5.1 and + MSVC-12.0. You may also test to see if the necessary intrinsics are available by checking to see if the macro BOOST_HAS_TRIVIAL_MOVE_ASSIGN is defined.

    diff --git a/doc/html/boost_typetraits/reference/has_trivial_move_constructor.html b/doc/html/boost_typetraits/reference/has_trivial_move_constructor.html index bf9ad39..e0e5d3a 100644 --- a/doc/html/boost_typetraits/reference/has_trivial_move_constructor.html +++ b/doc/html/boost_typetraits/reference/has_trivial_move_constructor.html @@ -3,7 +3,7 @@ has_trivial_move_constructor - + @@ -40,17 +40,14 @@ can be safely replaced with a call to memcpy.

    - Compiler Compatibility: If the compiler - does not support partial-specialization of class templates, then this template - can not be used with function types. -

    -

    - Without some (as yet unspecified) help from the compiler, has_trivial_move_constructor - will never report that a user-defined class or struct has a trivial constructor; - this is always safe, if possibly sub-optimal. Currently (February 2013) compilers - have no necessary intrinsics - to ensure that this trait "just works". You may also test to see - if the necessary intrinsics + Compiler Compatibility: Without some (as + yet unspecified) help from the compiler, has_trivial_move_constructor will + never report that a user-defined class or struct has a trivial constructor; + this is always safe, if possibly sub-optimal. In addition C++11's decltype is required to correctly support + deleted or private move constructors. Currently (June 2015) compilers that + have the necessary intrinsics + to ensure that this trait "just works" include Clang, GCC-5.1, + and MSVC-12.0. You may also test to see if the necessary intrinsics are available by checking to see if the macro BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR is defined.

    diff --git a/doc/html/boost_typetraits/reference/has_unary_minus.html b/doc/html/boost_typetraits/reference/has_unary_minus.html index 55c9e56..081295d 100644 --- a/doc/html/boost_typetraits/reference/has_unary_minus.html +++ b/doc/html/boost_typetraits/reference/has_unary_minus.html @@ -3,7 +3,7 @@ has_unary_minus - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -104,12 +109,6 @@ See also: Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_unary_plus.html b/doc/html/boost_typetraits/reference/has_unary_plus.html index 8adbc28..d32e6c8 100644 --- a/doc/html/boost_typetraits/reference/has_unary_plus.html +++ b/doc/html/boost_typetraits/reference/has_unary_plus.html @@ -3,7 +3,7 @@ has_unary_plus - + @@ -62,6 +62,11 @@ or #include <boost/type_traits/has_operator.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: Requires working + SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers + do not support this. +

    Examples:

    @@ -104,12 +109,6 @@ See also: Operator Type Traits

    -

    - Limitation: -

    -
    • - Requires a compiler with working SFINAE. -

    Known issues:

    diff --git a/doc/html/boost_typetraits/reference/has_virtual_destructor.html b/doc/html/boost_typetraits/reference/has_virtual_destructor.html index 3d22d23..4abb29d 100644 --- a/doc/html/boost_typetraits/reference/has_virtual_destructor.html +++ b/doc/html/boost_typetraits/reference/has_virtual_destructor.html @@ -3,7 +3,7 @@ has_virtual_destructor - + @@ -35,15 +35,14 @@ otherwise inherits from false_type.

    - Compiler Compatibility: This trait is provided - for completeness, since it's part of the Technical Report on C++ Library - Extensions. However, there is currently no way to portably implement this - trait. The default version provided always inherits from false_type, + Compiler Compatibility: There is currently + no way to portably implement this trait: the default version always inherits + from false_type, and has to be explicitly specialized for types with virtual destructors unless the compiler used has compiler intrinsics - that enable the trait to do the right thing: Currently (May 2011) compilers - more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear - have the necessary compiler intrinsics + that enable the trait to do the right thing: Currently (June 2015) compilers + more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, Intel-11.0, plus + Codegear and Clang have the necessary compiler intrinsics to ensure that this trait "just works". You may also test to see if the necessary intrinsics are available by checking to see if the macro BOOST_HAS_VIRTUAL_DESTRUCTOR diff --git a/doc/html/boost_typetraits/reference/integral_constant.html b/doc/html/boost_typetraits/reference/integral_constant.html index 5975481..8eb28b4 100644 --- a/doc/html/boost_typetraits/reference/integral_constant.html +++ b/doc/html/boost_typetraits/reference/integral_constant.html @@ -3,7 +3,7 @@ integral_constant - + @@ -32,6 +32,7 @@ typedef integral_constant<T, val> type; typedef T value_type; static const T value = val; + constexpr operator T()const; }; typedef integral_constant<bool, true> true_type; diff --git a/doc/html/boost_typetraits/reference/integral_promotion.html b/doc/html/boost_typetraits/reference/integral_promotion.html index 00ca9ca..ca664ba 100644 --- a/doc/html/boost_typetraits/reference/integral_promotion.html +++ b/doc/html/boost_typetraits/reference/integral_promotion.html @@ -3,7 +3,7 @@ integral_promotion - + @@ -49,7 +49,7 @@ or #include <boost/type_traits.hpp>

    -

    Table 1.21. Examples

    +

    Table 1.22. Examples

    diff --git a/doc/html/boost_typetraits/reference/is_abstract.html b/doc/html/boost_typetraits/reference/is_abstract.html index 8b6e041..e0a1887 100644 --- a/doc/html/boost_typetraits/reference/is_abstract.html +++ b/doc/html/boost_typetraits/reference/is_abstract.html @@ -3,7 +3,7 @@ is_abstract - + diff --git a/doc/html/boost_typetraits/reference/is_arithmetic.html b/doc/html/boost_typetraits/reference/is_arithmetic.html index 2e3d523..83cfdd2 100644 --- a/doc/html/boost_typetraits/reference/is_arithmetic.html +++ b/doc/html/boost_typetraits/reference/is_arithmetic.html @@ -3,7 +3,7 @@ is_arithmetic - + diff --git a/doc/html/boost_typetraits/reference/is_array.html b/doc/html/boost_typetraits/reference/is_array.html index d98ec40..78741ae 100644 --- a/doc/html/boost_typetraits/reference/is_array.html +++ b/doc/html/boost_typetraits/reference/is_array.html @@ -3,11 +3,11 @@ is_array - + - +
    @@ -20,7 +20,7 @@

    -PrevUpHomeNext +PrevUpHomeNext

    @@ -43,9 +43,8 @@ or #include <boost/type_traits.hpp>

    - Compiler Compatibility: If the compiler - does not support partial-specialization of class templates, then this template - can give the wrong result with function types. + Compiler Compatibility: All current compilers + are supported by this trait.

    Examples: @@ -78,7 +77,7 @@


    -PrevUpHomeNext +PrevUpHomeNext
    diff --git a/doc/html/boost_typetraits/reference/is_assignable.html b/doc/html/boost_typetraits/reference/is_assignable.html new file mode 100644 index 0000000..acadda6 --- /dev/null +++ b/doc/html/boost_typetraits/reference/is_assignable.html @@ -0,0 +1,92 @@ + + + +is_assignable + + + + + + + + + + + + + + + +
    Boost C++ LibrariesHomeLibrariesPeopleFAQMore
    +
    +
    +PrevUpHomeNext +
    +
    + +
    template <class T, class U>
    +struct is_assignable : public true_type-or-false_type {};
    +
    +

    + Inherits: If std::declval<T>() + = std::declval<U>() + then inherits from true_type, + otherwise from __flase_type. Type T + must be a complete type. +

    +

    + Note that this trait is somewhat tricky to use correctly: for example: +

    +
    is_assignable<int, int>::value
    +
    +

    + is false since std::declval<int>() + is an xvalue which can not be assigned to! +

    +

    + If you're intention is to check for copy-assignment from some type U then + use: +

    +
    is_assignable<T&, const U&>::value
    +
    +

    + If you're intention is to check for move-assignment then use: +

    +
    is_assignable<T&, U&&>::value
    +
    +

    + or simply: +

    +
    is_assignable<T&, U>::value
    +
    +

    + Compiler Compatibility: Requires the C++11 + features decltype and SFINAE-expressions + for full support. +

    +

    + Header: #include + <boost/type_traits/is_assignable.hpp> + or #include <boost/type_traits.hpp> +

    +
    + + + +
    +
    +
    +PrevUpHomeNext +
    + + diff --git a/doc/html/boost_typetraits/reference/is_base_of.html b/doc/html/boost_typetraits/reference/is_base_of.html index 3c91f8d..de2e639 100644 --- a/doc/html/boost_typetraits/reference/is_base_of.html +++ b/doc/html/boost_typetraits/reference/is_base_of.html @@ -3,10 +3,10 @@ is_base_of - + - + @@ -20,7 +20,7 @@
    -PrevUpHomeNext +PrevUpHomeNext

    @@ -57,15 +57,8 @@ or #include <boost/type_traits.hpp>

    - Compiler Compatibility: If the compiler - does not support partial-specialization of class templates, then this template - can not be used with function types. There are some older compilers which - will produce compiler errors if Base - is a private base class of Derived, - or if Base is an ambiguous - base of Derived. These compilers - include Borland C++, older versions of Sun Forte C++, Digital Mars C++, and - older versions of EDG based compilers. + Compiler Compatibility: All current compilers + are supported by this trait.

    Examples: @@ -108,7 +101,7 @@


    -PrevUpHomeNext +PrevUpHomeNext
    diff --git a/doc/html/boost_typetraits/reference/is_class.html b/doc/html/boost_typetraits/reference/is_class.html index c0533c3..480364a 100644 --- a/doc/html/boost_typetraits/reference/is_class.html +++ b/doc/html/boost_typetraits/reference/is_class.html @@ -3,7 +3,7 @@ is_class - + @@ -43,16 +43,11 @@ or #include <boost/type_traits.hpp>

    - Compiler Compatibility: 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. See also is_union. - Currently (May 2011) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills - 6.0, Intel-11.0, and Codegear have the necessary compiler intrinsics - to ensure that this trait "just works". You may also test to see - if the necessary intrinsics - are available by checking to see if the macro BOOST_IS_CLASS - is defined. + Compiler Compatibility: This trait works + correctly for almost all current compilers (as of June 2015), with just a + minority of older compilers not correctly detecting all the corner cases. + You can check the macro BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION + which is defined to 1 when the class works correctly in all cases.

    Examples: diff --git a/doc/html/boost_typetraits/reference/is_complex.html b/doc/html/boost_typetraits/reference/is_complex.html index 89aacae..684b36c 100644 --- a/doc/html/boost_typetraits/reference/is_complex.html +++ b/doc/html/boost_typetraits/reference/is_complex.html @@ -3,7 +3,7 @@ is_complex - + @@ -38,6 +38,10 @@

    C++ Standard Reference: 26.2.

    +

    + Compiler Compatibility: All current compilers + are supported by this trait. +

    Header: #include <boost/type_traits/is_complex.hpp> diff --git a/doc/html/boost_typetraits/reference/is_compound.html b/doc/html/boost_typetraits/reference/is_compound.html index 9c044f3..41d9dde 100644 --- a/doc/html/boost_typetraits/reference/is_compound.html +++ b/doc/html/boost_typetraits/reference/is_compound.html @@ -3,7 +3,7 @@ is_compound - + @@ -38,6 +38,10 @@

    C++ Standard Reference: 3.9.2.

    +

    + Compiler Compatibility: All current compilers + are supported by this trait. +

    Header: #include <boost/type_traits/is_compound.hpp> diff --git a/doc/html/boost_typetraits/reference/is_const.html b/doc/html/boost_typetraits/reference/is_const.html index 21f2b64..d5142bf 100644 --- a/doc/html/boost_typetraits/reference/is_const.html +++ b/doc/html/boost_typetraits/reference/is_const.html @@ -3,11 +3,11 @@ is_const - + - + @@ -20,7 +20,7 @@


    -PrevUpHomeNext +PrevUpHomeNext

    @@ -42,6 +42,10 @@ <boost/type_traits/is_const.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: All current compilers + are supported by this trait. +

    Examples:

    @@ -87,7 +91,7 @@
    -PrevUpHomeNext +PrevUpHomeNext
    diff --git a/doc/html/boost_typetraits/reference/is_constructible.html b/doc/html/boost_typetraits/reference/is_constructible.html new file mode 100644 index 0000000..c9fe383 --- /dev/null +++ b/doc/html/boost_typetraits/reference/is_constructible.html @@ -0,0 +1,98 @@ + + + +is_constructible + + + + + + + + + + + + + + + +
    Boost C++ LibrariesHomeLibrariesPeopleFAQMore
    +
    +
    +PrevUpHomeNext +
    +
    + +
    template <class T, class... Args>
    +struct is_constructible : public true_type-or-false_type {};
    +
    +

    + Inherits: If T + can be constructed from Args, + then inherits from true_type, + otherwise inherits from false_type. + Type T must be a complete + type. +

    +

    + Formally the trait answers the question, is the expression: +

    +
    T t(std::declval<Args>()...);
    +
    +

    + valid? +

    +

    + There are a number of important special cases for this trait: +

    +
    is_constructible<T>::value
    +
    +

    + Indicates whether T is default + constructible, while: +

    +
    is_constructible<T, const T&>::value
    +
    +

    + Indicates whether T is copy-constructible, + and: +

    +
    is_constructible<T, T>::value
    +
    +

    + Indicates whether T is move-constructible. +

    +

    + Compiler Compatibility: This trait requires + the C++11 features decltype + variadic templates and SFINAE-expression support for full support. While + there is some fallback code for cases where this is not the case, the trait + should really be considered broken in that case. +

    +

    + Header: #include + <boost/type_traits/is_copy_constructible.hpp> + or #include <boost/type_traits.hpp> +

    +
    + + + +
    +
    +
    +PrevUpHomeNext +
    + + diff --git a/doc/html/boost_typetraits/reference/is_convertible.html b/doc/html/boost_typetraits/reference/is_convertible.html index 102609c..497748b 100644 --- a/doc/html/boost_typetraits/reference/is_convertible.html +++ b/doc/html/boost_typetraits/reference/is_convertible.html @@ -3,11 +3,11 @@ is_convertible - + - - + + @@ -20,7 +20,7 @@

    -PrevUpHomeNext +PrevUpHomeNext

    @@ -69,12 +69,8 @@ C++ Standard Reference: 4 and 8.5.

    - Compiler Compatibility: This template is - currently broken with Borland C++ Builder 5 (and earlier), for constructor-based - conversions, and for the Metrowerks 7 (and earlier) compiler in all cases. - If the compiler does not support is_abstract, - then the template parameter To - must not be an abstract type. + Compiler Compatibility: All current compilers + are supported by this trait.

    Header: #include @@ -127,7 +123,7 @@


    -PrevUpHomeNext +PrevUpHomeNext
    diff --git a/doc/html/boost_typetraits/reference/is_copy_assignable.html b/doc/html/boost_typetraits/reference/is_copy_assignable.html index 4294d78..83f3f3d 100644 --- a/doc/html/boost_typetraits/reference/is_copy_assignable.html +++ b/doc/html/boost_typetraits/reference/is_copy_assignable.html @@ -3,11 +3,11 @@ is_copy_assignable - + - - + + @@ -20,7 +20,7 @@

    -PrevUpHomeNext +PrevUpHomeNext

    @@ -47,9 +47,9 @@ boost::noncopyable and is not marked with BOOST_MOVABLE_BUT_NOT_COPYABLE(T).

    - Compiler Compatibility: If the compiler - does not support partial-specialization of class templates, then this template - can not be used. + Compiler Compatibility: Requires the C++11 + features decltype and SFINAE-expressions + for full support.

    If your compiler does not support C++11 deleted functions (= delete) @@ -100,7 +100,7 @@


    -PrevUpHomeNext +PrevUpHomeNext
    diff --git a/doc/html/boost_typetraits/reference/is_copy_constructible.html b/doc/html/boost_typetraits/reference/is_copy_constructible.html index 4acb9bf..aa9782f 100644 --- a/doc/html/boost_typetraits/reference/is_copy_constructible.html +++ b/doc/html/boost_typetraits/reference/is_copy_constructible.html @@ -3,11 +3,11 @@ is_copy_constructible - + - - + + @@ -20,7 +20,7 @@

    -PrevUpHomeNext +PrevUpHomeNext

    @@ -45,9 +45,9 @@ boost::noncopyable and does not marked with BOOST_MOVABLE_BUT_NOT_COPYABLE(T).

    - Compiler Compatibility: If the compiler - does not support partial-specialization of class templates, then this template - can not be used. + Compiler Compatibility: This trait requires + the C++11 features decltype + and SFINAE-expression support for full support.

    If your compiler does not support C++11 deleted functions (= delete) @@ -56,7 +56,8 @@ that class is noncopyable.

    - Trait does not care about access modifiers, so if you see errors like this: + The trait does not care about access modifiers, so if you see errors like + this:

    'T::T(const T&)' is private
     boost/type_traits/is_copy_constructible.hpp:68:5: error: within this context
    @@ -97,7 +98,7 @@
     
     
    -PrevUpHomeNext +PrevUpHomeNext
    diff --git a/doc/html/boost_typetraits/reference/is_default_constructible.html b/doc/html/boost_typetraits/reference/is_default_constructible.html new file mode 100644 index 0000000..f275007 --- /dev/null +++ b/doc/html/boost_typetraits/reference/is_default_constructible.html @@ -0,0 +1,68 @@ + + + +is_default_constructible + + + + + + + + + + + + + + + +
    Boost C++ LibrariesHomeLibrariesPeopleFAQMore
    +
    +
    +PrevUpHomeNext +
    +
    + +
    template <class T>
    +struct is_default_constructible : public true_type-or-false_type {};
    +
    +

    + Inherits: If T + can be default-constructed then inherits from true_type, + otherwise inherits from false_type. + Type T must be a complete + type. +

    +

    + Compiler Compatibility: This trait requires + the C++11 feature decltype support + for full support. While there is some fallback code for cases where this + is not the case, the trait should really be considered broken in that case. +

    +

    + Header: #include + <boost/type_traits/is_copy_constructible.hpp> + or #include <boost/type_traits.hpp> +

    +
    + + + +
    +
    +
    +PrevUpHomeNext +
    + + diff --git a/doc/html/boost_typetraits/reference/is_destructible.html b/doc/html/boost_typetraits/reference/is_destructible.html new file mode 100644 index 0000000..dcbcd66 --- /dev/null +++ b/doc/html/boost_typetraits/reference/is_destructible.html @@ -0,0 +1,69 @@ + + + +is_destructible + + + + + + + + + + + + + + + +
    Boost C++ LibrariesHomeLibrariesPeopleFAQMore
    +
    +
    +PrevUpHomeNext +
    +
    + +
    template <class T>
    +struct is_destructible : public true_type-or-false_type {};
    +
    +

    + Inherits: If T + does not have its destructor deleted then inherits from true_type, + otherwise inherits from false_type. + Type T must be a complete + type. +

    +

    + Compiler Compatibility: This trait requires + the C++11 features decltype + and SFINAE-expression support for full support. While there is some fallback + code for cases where this is not the case, the trait should really be considered + broken in that case. +

    +

    + Header: #include + <boost/type_traits/is_copy_constructible.hpp> + or #include <boost/type_traits.hpp> +

    +
    + + + +
    +
    +
    +PrevUpHomeNext +
    + + diff --git a/doc/html/boost_typetraits/reference/is_empty.html b/doc/html/boost_typetraits/reference/is_empty.html index aa8fb86..fbff564 100644 --- a/doc/html/boost_typetraits/reference/is_empty.html +++ b/doc/html/boost_typetraits/reference/is_empty.html @@ -3,10 +3,10 @@ is_empty - + - + @@ -20,7 +20,7 @@
    -PrevUpHomeNext +PrevUpHomeNext

    @@ -59,13 +59,6 @@

    Can not be used with incomplete types.

    -

    - Can not be used with union types, until is_union can be made to work. -

    -

    - If the compiler does not support partial-specialization of class templates, - then this template can not be used with abstract types. -

    Examples:

    @@ -103,7 +96,7 @@
    -PrevUpHomeNext +PrevUpHomeNext
    diff --git a/doc/html/boost_typetraits/reference/is_enum.html b/doc/html/boost_typetraits/reference/is_enum.html index bbc3cbd..cfa1e46 100644 --- a/doc/html/boost_typetraits/reference/is_enum.html +++ b/doc/html/boost_typetraits/reference/is_enum.html @@ -3,7 +3,7 @@ is_enum - + @@ -43,11 +43,8 @@ or #include <boost/type_traits.hpp>

    - Compiler Compatibility: Requires a correctly - functioning is_convertible - template; this means that is_enum is currently broken under Borland C++ Builder - 5, and for the Metrowerks compiler prior to version 8, other compilers should - handle this template just fine. + Compiler Compatibility: All current compilers + are supported by this trait.

    Examples: diff --git a/doc/html/boost_typetraits/reference/is_final.html b/doc/html/boost_typetraits/reference/is_final.html index 13cf7db..cd40fb2 100644 --- a/doc/html/boost_typetraits/reference/is_final.html +++ b/doc/html/boost_typetraits/reference/is_final.html @@ -3,7 +3,7 @@ is_final - + @@ -45,11 +45,12 @@ never inherit from true_type, unless the user explicitly specializes the template for their user-defined final class types, or unless the compiler supplies some unspecified intrinsic - that implements this functionality. Currently (Aug 2014) compilers more recent - than GCC-4.7, and Clang have the necessary compiler intrinsics - to ensure that this trait "just works". You may also test to see - if the necessary intrinsics - are available by checking to see if the macro BOOST_IS_FINAL + that implements this functionality. Currently (June 2015) compilers more + recent than GCC-4.7, Oracle-12.4, and Clang have the necessary compiler + intrinsics to ensure that + this trait "just works". You may also test to see if the necessary + intrinsics are available + by checking to see if the macro BOOST_IS_FINAL is defined.

    diff --git a/doc/html/boost_typetraits/reference/is_floating_point.html b/doc/html/boost_typetraits/reference/is_floating_point.html index 4dcd393..2335462 100644 --- a/doc/html/boost_typetraits/reference/is_floating_point.html +++ b/doc/html/boost_typetraits/reference/is_floating_point.html @@ -3,7 +3,7 @@ is_floating_point - + @@ -37,6 +37,10 @@

    C++ Standard Reference: 3.9.1p8.

    +

    + Compiler Compatibility: All current compilers + are supported by this trait. +

    Header: #include <boost/type_traits/is_floating_point.hpp> diff --git a/doc/html/boost_typetraits/reference/is_function.html b/doc/html/boost_typetraits/reference/is_function.html index 195334e..0f24871 100644 --- a/doc/html/boost_typetraits/reference/is_function.html +++ b/doc/html/boost_typetraits/reference/is_function.html @@ -3,7 +3,7 @@ is_function - + @@ -43,6 +43,10 @@

    C++ Standard Reference: 3.9.2p1 and 8.3.5.

    +

    + Compiler Compatibility: All current compilers + are supported by this trait. +

    Header: #include <boost/type_traits/is_function.hpp> diff --git a/doc/html/boost_typetraits/reference/is_fundamental.html b/doc/html/boost_typetraits/reference/is_fundamental.html index 180b4c8..e074caa 100644 --- a/doc/html/boost_typetraits/reference/is_fundamental.html +++ b/doc/html/boost_typetraits/reference/is_fundamental.html @@ -3,7 +3,7 @@ is_fundamental - + @@ -41,6 +41,10 @@

    C++ Standard Reference: 3.9.1.

    +

    + Compiler Compatibility: All current compilers + are supported by this trait. +

    Header: #include <boost/type_traits/is_fundamental.hpp> diff --git a/doc/html/boost_typetraits/reference/is_integral.html b/doc/html/boost_typetraits/reference/is_integral.html index 7569e5b..bdbb7a2 100644 --- a/doc/html/boost_typetraits/reference/is_integral.html +++ b/doc/html/boost_typetraits/reference/is_integral.html @@ -3,7 +3,7 @@ is_integral - + @@ -37,6 +37,10 @@

    C++ Standard Reference: 3.9.1p7.

    +

    + Compiler Compatibility: All current compilers + are supported by this trait. +

    Header: #include <boost/type_traits/is_integral.hpp> diff --git a/doc/html/boost_typetraits/reference/is_lvalue_reference.html b/doc/html/boost_typetraits/reference/is_lvalue_reference.html index 0e975fe..56c51dc 100644 --- a/doc/html/boost_typetraits/reference/is_lvalue_reference.html +++ b/doc/html/boost_typetraits/reference/is_lvalue_reference.html @@ -3,7 +3,7 @@ is_lvalue_reference - + @@ -38,10 +38,8 @@ C++ Standard Reference: 3.9.2 and 8.3.2.

    - Compiler Compatibility: If the compiler - does not support partial-specialization of class templates, then this template - may report the wrong result for function types, and for types that are both - const and volatile qualified. + Compiler Compatibility: All current compilers + are supported by this trait.

    Header: #include diff --git a/doc/html/boost_typetraits/reference/is_member_function_pointer.html b/doc/html/boost_typetraits/reference/is_member_function_pointer.html index 195bb82..15ece40 100644 --- a/doc/html/boost_typetraits/reference/is_member_function_pointer.html +++ b/doc/html/boost_typetraits/reference/is_member_function_pointer.html @@ -3,7 +3,7 @@ is_member_function_pointer - + @@ -37,6 +37,10 @@

    C++ Standard Reference: 3.9.2 and 8.3.3.

    +

    + Compiler Compatibility: All current compilers + are supported by this trait. +

    Header: #include <boost/type_traits/is_member_function_pointer.hpp> diff --git a/doc/html/boost_typetraits/reference/is_member_object_pointer.html b/doc/html/boost_typetraits/reference/is_member_object_pointer.html index bafae49..b046242 100644 --- a/doc/html/boost_typetraits/reference/is_member_object_pointer.html +++ b/doc/html/boost_typetraits/reference/is_member_object_pointer.html @@ -3,7 +3,7 @@ is_member_object_pointer - + @@ -37,6 +37,10 @@

    C++ Standard Reference: 3.9.2 and 8.3.3.

    +

    + Compiler Compatibility: All current compilers + are supported by this trait. +

    Header: #include <boost/type_traits/is_member_object_pointer.hpp> diff --git a/doc/html/boost_typetraits/reference/is_member_pointer.html b/doc/html/boost_typetraits/reference/is_member_pointer.html index 75064c3..0ed4032 100644 --- a/doc/html/boost_typetraits/reference/is_member_pointer.html +++ b/doc/html/boost_typetraits/reference/is_member_pointer.html @@ -3,7 +3,7 @@ is_member_pointer - + @@ -38,6 +38,10 @@

    C++ Standard Reference: 3.9.2 and 8.3.3.

    +

    + Compiler Compatibility: All current compilers + are supported by this trait. +

    Header: #include <boost/type_traits/is_member_pointer.hpp> diff --git a/doc/html/boost_typetraits/reference/is_nothrow_move_assignable.html b/doc/html/boost_typetraits/reference/is_nothrow_move_assignable.html index 29b804f..48da178 100644 --- a/doc/html/boost_typetraits/reference/is_nothrow_move_assignable.html +++ b/doc/html/boost_typetraits/reference/is_nothrow_move_assignable.html @@ -3,7 +3,7 @@ is_nothrow_move_assignable - + @@ -53,9 +53,9 @@ Without some (C++11 noexcept shall work correctly) help from the compiler, is_nothrow_move_assignable will never report that a class or struct has a non-throwing assignment-operator; - this is always safe, if possibly sub-optimal. Currently (February 2013) Clang - and GCC 4.7 have the necessary compiler support to ensure that this trait - "just works". + this is always safe, if possibly sub-optimal. Currently (June 2015) MSVC-12.0, + Clang and GCC 4.7 have the necessary compiler support to ensure that this + trait "just works".

    Header: #include diff --git a/doc/html/boost_typetraits/reference/is_nothrow_move_constructible.html b/doc/html/boost_typetraits/reference/is_nothrow_move_constructible.html index 741400e..1ae4dc1 100644 --- a/doc/html/boost_typetraits/reference/is_nothrow_move_constructible.html +++ b/doc/html/boost_typetraits/reference/is_nothrow_move_constructible.html @@ -3,7 +3,7 @@ is_nothrow_move_constructible - + @@ -43,17 +43,12 @@ is a variable of type T).

    - Compiler Compatibility: If the compiler - does not support partial-specialization of class templates, then this template - can not be used with function types. -

    -

    - Without some (C++11 noexcept shall work correctly) help from the compiler, - is_nothrow_move_constructible + Compiler Compatibility: Without some (C++11 + noexcept shall work correctly) help from the compiler, is_nothrow_move_constructible will never report that a class or struct has a non-throwing copy-constructor; - this is always safe, if possibly sub-optimal. Currently (February 2013) Clang - and GCC 4.7 have the necessary compiler support to ensure that this trait - "just works". + this is always safe, if possibly sub-optimal. Currently (February 2013) MSVC-12.0, + Clang and GCC 4.7 have the necessary compiler support to ensure that this + trait "just works".

    Header: #include diff --git a/doc/html/boost_typetraits/reference/is_object.html b/doc/html/boost_typetraits/reference/is_object.html index f8970d1..bb2fdc1 100644 --- a/doc/html/boost_typetraits/reference/is_object.html +++ b/doc/html/boost_typetraits/reference/is_object.html @@ -3,7 +3,7 @@ is_object - + @@ -38,6 +38,10 @@

    C++ Standard Reference: 3.9p9.

    +

    + Compiler Compatibility: All current compilers + are supported by this trait. +

    Header: #include <boost/type_traits/is_object.hpp> diff --git a/doc/html/boost_typetraits/reference/is_pod.html b/doc/html/boost_typetraits/reference/is_pod.html index ff39861..320a5a9 100644 --- a/doc/html/boost_typetraits/reference/is_pod.html +++ b/doc/html/boost_typetraits/reference/is_pod.html @@ -3,7 +3,7 @@ is_pod - + @@ -48,19 +48,14 @@ that POD's are also aggregates, see 8.5.1).

    - Compiler Compatibility: If the compiler - does not support partial-specialization of class templates, then this template - can not be used with function types. -

    -

    - 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. Currently (May 2011) compilers more recent than Visual C++ 8, - GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear have the necessary compiler - intrinsics to ensure that - this trait "just works". You may also test to see if the necessary - intrinsics are available - by checking to see if the macro BOOST_IS_POD + Compiler Compatibility: 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. Currently + (June 2015) compilers more recent than Visual C++ 8, Clang-3, GCC-4.3, Greenhills + 6.0, Intel-11.0, and Codegear have the necessary compiler intrinsics + to ensure that this trait "just works". You may also test to see + if the necessary intrinsics + are available by checking to see if the macro BOOST_IS_POD is defined.

    diff --git a/doc/html/boost_typetraits/reference/is_pointer.html b/doc/html/boost_typetraits/reference/is_pointer.html index 102754c..54afdb5 100644 --- a/doc/html/boost_typetraits/reference/is_pointer.html +++ b/doc/html/boost_typetraits/reference/is_pointer.html @@ -3,7 +3,7 @@ is_pointer - + @@ -43,6 +43,10 @@ <boost/type_traits/is_pointer.hpp> or #include <boost/type_traits.hpp>

    +

    + Compiler Compatibility: All current compilers + are supported by this trait. +

    Examples:

    diff --git a/doc/html/boost_typetraits/reference/is_polymorphic.html b/doc/html/boost_typetraits/reference/is_polymorphic.html index 0bfd770..4bba0ad 100644 --- a/doc/html/boost_typetraits/reference/is_polymorphic.html +++ b/doc/html/boost_typetraits/reference/is_polymorphic.html @@ -3,7 +3,7 @@ is_polymorphic - + diff --git a/doc/html/boost_typetraits/reference/is_reference.html b/doc/html/boost_typetraits/reference/is_reference.html index af0fe80..3a626c7 100644 --- a/doc/html/boost_typetraits/reference/is_reference.html +++ b/doc/html/boost_typetraits/reference/is_reference.html @@ -3,7 +3,7 @@ is_reference - + @@ -38,10 +38,8 @@ C++ Standard Reference: 3.9.2 and 8.3.2.

    - Compiler Compatibility: If the compiler - does not support partial-specialization of class templates, then this template - may report the wrong result for function types, and for types that are both - const and volatile qualified. + Compiler Compatibility: All current compilers + are supported by this trait.

    Header: #include diff --git a/doc/html/boost_typetraits/reference/is_rvalue_reference.html b/doc/html/boost_typetraits/reference/is_rvalue_reference.html index a4acb63..03efcd4 100644 --- a/doc/html/boost_typetraits/reference/is_rvalue_reference.html +++ b/doc/html/boost_typetraits/reference/is_rvalue_reference.html @@ -3,7 +3,7 @@ is_rvalue_reference - + @@ -38,10 +38,8 @@ C++ Standard Reference: 3.9.2 and 8.3.2.

    - Compiler Compatibility: If the compiler - does not support partial-specialization of class templates, then this template - may report the wrong result for function types, and for types that are both - const and volatile qualified. + Compiler Compatibility: All current compilers + are supported by this trait.

    Header: #include diff --git a/doc/html/boost_typetraits/reference/is_same.html b/doc/html/boost_typetraits/reference/is_same.html index c2f7e6f..41e2ba5 100644 --- a/doc/html/boost_typetraits/reference/is_same.html +++ b/doc/html/boost_typetraits/reference/is_same.html @@ -3,7 +3,7 @@ is_same - + @@ -40,9 +40,8 @@ or #include <boost/type_traits.hpp>

    - Compiler Compatibility: If the compiler - does not support partial-specialization of class templates, then this template - can not be used with abstract, incomplete or function types. + Compiler Compatibility: All current compilers + are supported by this trait.

    Examples: diff --git a/doc/html/boost_typetraits/reference/is_scalar.html b/doc/html/boost_typetraits/reference/is_scalar.html index 8ddb7bc..86f733d 100644 --- a/doc/html/boost_typetraits/reference/is_scalar.html +++ b/doc/html/boost_typetraits/reference/is_scalar.html @@ -3,7 +3,7 @@ is_scalar - + @@ -45,9 +45,8 @@ or #include <boost/type_traits.hpp>

    - Compiler Compatibility: If the compiler - does not support partial-specialization of class templates, then this template - can not be used with function types. + Compiler Compatibility: All current compilers + are supported by this trait.

    Examples: diff --git a/doc/html/boost_typetraits/reference/is_signed.html b/doc/html/boost_typetraits/reference/is_signed.html index 356a18a..b443e2a 100644 --- a/doc/html/boost_typetraits/reference/is_signed.html +++ b/doc/html/boost_typetraits/reference/is_signed.html @@ -3,7 +3,7 @@ is_signed - + @@ -38,6 +38,10 @@

    C++ Standard Reference: 3.9.1, 7.2.

    +

    + Compiler Compatibility: All current compilers + are supported by this trait. +

    Header: #include <boost/type_traits/is_signed.hpp> diff --git a/doc/html/boost_typetraits/reference/is_stateless.html b/doc/html/boost_typetraits/reference/is_stateless.html index 11286c7..b207dcf 100644 --- a/doc/html/boost_typetraits/reference/is_stateless.html +++ b/doc/html/boost_typetraits/reference/is_stateless.html @@ -3,7 +3,7 @@ is_stateless - + @@ -58,17 +58,12 @@ or #include <boost/type_traits.hpp>

    - Compiler Compatibility: If the compiler - does not support partial-specialization of class templates, then this template - can not be used with function types. -

    -

    - 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. Currently (May 2011) compilers more recent than Visual - C++ 8, GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear have the necessary - compiler intrinsics to - ensure that this trait "just works". + Compiler Compatibility: 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. + Currently (June 2015) compilers more recent than Visual C++ 8, Clang, GCC-4.3, + Greenhills 6.0, Intel-11.0, and Codegear have the necessary compiler intrinsics to ensure that this + trait "just works".

    diff --git a/doc/html/boost_typetraits/reference/is_union.html b/doc/html/boost_typetraits/reference/is_union.html index 3d0fca4..eb03217 100644 --- a/doc/html/boost_typetraits/reference/is_union.html +++ b/doc/html/boost_typetraits/reference/is_union.html @@ -3,7 +3,7 @@ is_union - + @@ -46,9 +46,9 @@ inherit from true_type, unless the user explicitly specializes the template for their user-defined union types, or unless the compiler supplies some unspecified intrinsic that - implements this functionality. Currently (May 2011) compilers more recent - than Visual C++ 8, GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear have - the necessary compiler intrinsics + implements this functionality. Currently (June 2015) compilers more recent + than Visual C++ 8, clang, GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear + have the necessary compiler intrinsics to ensure that this trait "just works". You may also test to see if the necessary intrinsics are available by checking to see if the macro BOOST_IS_UNION diff --git a/doc/html/boost_typetraits/reference/is_unsigned.html b/doc/html/boost_typetraits/reference/is_unsigned.html index 099fca2..4c706d7 100644 --- a/doc/html/boost_typetraits/reference/is_unsigned.html +++ b/doc/html/boost_typetraits/reference/is_unsigned.html @@ -3,7 +3,7 @@ is_unsigned - + @@ -38,6 +38,10 @@

    C++ Standard Reference: 3.9.1, 7.2.

    +

    + Compiler Compatibility: All current compilers + are supported by this trait. +

    Header: #include <boost/type_traits/is_unsigned.hpp> diff --git a/doc/html/boost_typetraits/reference/is_virtual_base_of.html b/doc/html/boost_typetraits/reference/is_virtual_base_of.html index aa6e636..7d1f9dd 100644 --- a/doc/html/boost_typetraits/reference/is_virtual_base_of.html +++ b/doc/html/boost_typetraits/reference/is_virtual_base_of.html @@ -3,7 +3,7 @@ is_virtual_base_of - + @@ -46,9 +46,8 @@ or #include <boost/type_traits.hpp>

    - Compiler Compatibility: this trait also - requires a working is_base_of - trait. + Compiler Compatibility: All current compilers + are supported by this trait.

    @@ -58,7 +57,8 @@

    There are a small number of cases where it's simply not possible for this trait to work, and where attempting to instantiate the trait will cause - compiler errors (see bug report #3730). + compiler errors (see bug reports #3730 + and 11323). Further more the issues may well be compiler specific. In this situation the user should supply a full specialization of the trait to work around the problem. diff --git a/doc/html/boost_typetraits/reference/is_void.html b/doc/html/boost_typetraits/reference/is_void.html index 2af083b..819d96c 100644 --- a/doc/html/boost_typetraits/reference/is_void.html +++ b/doc/html/boost_typetraits/reference/is_void.html @@ -3,7 +3,7 @@ is_void - + @@ -37,6 +37,10 @@

    C++ Standard Reference: 3.9.1p9.

    +

    + Compiler Compatibility: All current compilers + are supported by this trait. +

    Header: #include <boost/type_traits/is_void.hpp> diff --git a/doc/html/boost_typetraits/reference/is_volatile.html b/doc/html/boost_typetraits/reference/is_volatile.html index 125183e..9d3c19a 100644 --- a/doc/html/boost_typetraits/reference/is_volatile.html +++ b/doc/html/boost_typetraits/reference/is_volatile.html @@ -3,7 +3,7 @@ is_volatile - + @@ -37,6 +37,10 @@

    C++ Standard Reference: 3.9.3.

    +

    + Compiler Compatibility: All current compilers + are supported by this trait. +

    Header: #include <boost/type_traits/is_volatile.hpp> diff --git a/doc/html/boost_typetraits/reference/make_signed.html b/doc/html/boost_typetraits/reference/make_signed.html index 2789bd7..2baa3af 100644 --- a/doc/html/boost_typetraits/reference/make_signed.html +++ b/doc/html/boost_typetraits/reference/make_signed.html @@ -3,7 +3,7 @@ make_signed - + @@ -48,13 +48,17 @@

    C++ Standard Reference: 3.9.1.

    +

    + Compiler Compatibility: All current compilers + are supported by this trait. +

    Header: #include <boost/type_traits/make_signed.hpp> or #include <boost/type_traits.hpp>

    -

    Table 1.22. Examples

    +

    Table 1.23. Examples

    diff --git a/doc/html/boost_typetraits/reference/make_unsigned.html b/doc/html/boost_typetraits/reference/make_unsigned.html index dd4be40..914cacf 100644 --- a/doc/html/boost_typetraits/reference/make_unsigned.html +++ b/doc/html/boost_typetraits/reference/make_unsigned.html @@ -3,7 +3,7 @@ make_unsigned - + @@ -48,13 +48,17 @@

    C++ Standard Reference: 3.9.1.

    +

    + Compiler Compatibility: All current compilers + are supported by this trait. +

    Header: #include <boost/type_traits/make_unsigned.hpp> or #include <boost/type_traits.hpp>

    -

    Table 1.23. Examples

    +

    Table 1.24. Examples

    diff --git a/doc/html/boost_typetraits/reference/promote.html b/doc/html/boost_typetraits/reference/promote.html index 1904391..69a600b 100644 --- a/doc/html/boost_typetraits/reference/promote.html +++ b/doc/html/boost_typetraits/reference/promote.html @@ -3,7 +3,7 @@ promote - + @@ -45,13 +45,17 @@ C++ Standard Reference: 4.5 except 4.5/3 (integral bit-field) and 4.6.

    +

    + Compiler Compatibility: All current compilers + are supported by this trait. +

    Header: #include <boost/type_traits/promote.hpp> or #include <boost/type_traits.hpp>

    -

    Table 1.24. Examples

    +

    Table 1.25. Examples

    diff --git a/doc/html/boost_typetraits/reference/rank.html b/doc/html/boost_typetraits/reference/rank.html index 5e37c60..875e73a 100644 --- a/doc/html/boost_typetraits/reference/rank.html +++ b/doc/html/boost_typetraits/reference/rank.html @@ -3,7 +3,7 @@ rank - + @@ -39,6 +39,10 @@ If T is not a (built-in) array type, then RANK(T) is zero.

    +

    + Compiler Compatibility: All current compilers + are supported by this trait. +

    Header: #include <boost/type_traits/rank.hpp> diff --git a/doc/html/boost_typetraits/reference/remove_all_extents.html b/doc/html/boost_typetraits/reference/remove_all_extents.html index f0fe5d9..3b844e9 100644 --- a/doc/html/boost_typetraits/reference/remove_all_extents.html +++ b/doc/html/boost_typetraits/reference/remove_all_extents.html @@ -3,7 +3,7 @@ remove_all_extents - + @@ -41,12 +41,8 @@ C++ Standard Reference: 8.3.4.

    - Compiler Compatibility: If the compiler - does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T - except where compiler - workarounds have been applied. + Compiler Compatibility: All current compilers + are supported by this trait.

    Header: #include @@ -54,7 +50,7 @@ or #include <boost/type_traits.hpp>

    -

    Table 1.25. Examples

    +

    Table 1.26. Examples

    diff --git a/doc/html/boost_typetraits/reference/remove_const.html b/doc/html/boost_typetraits/reference/remove_const.html index 09df670..77753f1 100644 --- a/doc/html/boost_typetraits/reference/remove_const.html +++ b/doc/html/boost_typetraits/reference/remove_const.html @@ -3,7 +3,7 @@ remove_const - + @@ -40,12 +40,8 @@ C++ Standard Reference: 3.9.3.

    - Compiler Compatibility: If the compiler - does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T - except where compiler - workarounds have been applied. + Compiler Compatibility: All current compilers + are supported by this trait.

    Header: #include @@ -53,7 +49,7 @@ or #include <boost/type_traits.hpp>

    -

    Table 1.26. Examples

    +

    Table 1.27. Examples

    diff --git a/doc/html/boost_typetraits/reference/remove_cv.html b/doc/html/boost_typetraits/reference/remove_cv.html index ba35d2a..91ac299 100644 --- a/doc/html/boost_typetraits/reference/remove_cv.html +++ b/doc/html/boost_typetraits/reference/remove_cv.html @@ -3,7 +3,7 @@ remove_cv - + @@ -40,12 +40,8 @@ C++ Standard Reference: 3.9.3.

    - Compiler Compatibility: If the compiler - does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T - except where compiler - workarounds have been applied. + Compiler Compatibility: All current compilers + are supported by this trait.

    Header: #include @@ -53,7 +49,7 @@ or #include <boost/type_traits.hpp>

    -

    Table 1.27. Examples

    +

    Table 1.28. Examples

    diff --git a/doc/html/boost_typetraits/reference/remove_extent.html b/doc/html/boost_typetraits/reference/remove_extent.html index 41ab8da..05ffeff 100644 --- a/doc/html/boost_typetraits/reference/remove_extent.html +++ b/doc/html/boost_typetraits/reference/remove_extent.html @@ -3,7 +3,7 @@ remove_extent - + @@ -41,12 +41,8 @@ C++ Standard Reference: 8.3.4.

    - Compiler Compatibility: If the compiler - does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T - except where compiler - workarounds have been applied. + Compiler Compatibility: All current compilers + are supported by this trait.

    Header: #include @@ -54,7 +50,7 @@ or #include <boost/type_traits.hpp>

    -

    Table 1.28. Examples

    +

    Table 1.29. Examples

    diff --git a/doc/html/boost_typetraits/reference/remove_pointer.html b/doc/html/boost_typetraits/reference/remove_pointer.html index 2bbfb0d..bf2d59f 100644 --- a/doc/html/boost_typetraits/reference/remove_pointer.html +++ b/doc/html/boost_typetraits/reference/remove_pointer.html @@ -3,7 +3,7 @@ remove_pointer - + @@ -42,12 +42,8 @@ C++ Standard Reference: 8.3.1.

    - Compiler Compatibility: If the compiler - does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T - except where compiler - workarounds have been applied. + Compiler Compatibility: All current compilers + are supported by this trait.

    Header: #include @@ -55,7 +51,7 @@ or #include <boost/type_traits.hpp>

    -

    Table 1.29. Examples

    +

    Table 1.30. Examples

    diff --git a/doc/html/boost_typetraits/reference/remove_reference.html b/doc/html/boost_typetraits/reference/remove_reference.html index 2bd3304..37caa50 100644 --- a/doc/html/boost_typetraits/reference/remove_reference.html +++ b/doc/html/boost_typetraits/reference/remove_reference.html @@ -3,7 +3,7 @@ remove_reference - + @@ -40,12 +40,8 @@ C++ Standard Reference: 8.3.2.

    - Compiler Compatibility: If the compiler - does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T - except where compiler - workarounds have been applied. + Compiler Compatibility: All current compilers + are supported by this trait.

    Header: #include @@ -53,7 +49,7 @@ or #include <boost/type_traits.hpp>

    -

    Table 1.30. Examples

    +

    Table 1.31. Examples

    diff --git a/doc/html/boost_typetraits/reference/remove_volatile.html b/doc/html/boost_typetraits/reference/remove_volatile.html index 02e5a36..155fb13 100644 --- a/doc/html/boost_typetraits/reference/remove_volatile.html +++ b/doc/html/boost_typetraits/reference/remove_volatile.html @@ -3,11 +3,11 @@ remove_volatile - + - +
    @@ -20,7 +20,7 @@

    -PrevUpHomeNext +PrevUpHomeNext

    @@ -40,12 +40,8 @@ C++ Standard Reference: 3.9.3.

    - Compiler Compatibility: If the compiler - does not support partial specialization of class-templates then this template - will compile, but the member type - will always be the same as type T - except where compiler - workarounds have been applied. + Compiler Compatibility: All current compilers + are supported by this trait.

    Header: #include @@ -53,7 +49,7 @@ or #include <boost/type_traits.hpp>

    -

    Table 1.31. Examples

    +

    Table 1.32. Examples

    @@ -155,7 +151,7 @@

    -PrevUpHomeNext +PrevUpHomeNext
    diff --git a/doc/html/boost_typetraits/reference/type_identity.html b/doc/html/boost_typetraits/reference/type_identity.html new file mode 100644 index 0000000..d22ea1d --- /dev/null +++ b/doc/html/boost_typetraits/reference/type_identity.html @@ -0,0 +1,119 @@ + + + +type_identity + + + + + + + + + + + + + + + +
    Boost C++ LibrariesHomeLibrariesPeopleFAQMore
    +
    +
    +PrevUpHomeNext +
    +
    + +
    template <class T>
    +struct type_identity
    +{
    +   typedef T type;
    +};
    +
    +

    + Header: #include + <boost/type_traits/type_identity.hpp> + or #include <boost/type_traits.hpp> +

    +
    +

    Table 1.33. Examples

    +
    ++++ + + + + + + + + + + + + + + + + + + +
    +

    + Expression +

    +
    +

    + Result Type +

    +
    +

    + type_identity<int>::type +

    +
    +

    + int +

    +
    +

    + type_identity<int&>::type +

    +
    +

    + int& +

    +
    +

    + type_identity<int* const&>::type +

    +
    +

    + int* + const& +

    +
    +
    +
    +
    + + + +
    +
    +
    +PrevUpHomeNext +
    + + diff --git a/doc/html/boost_typetraits/reference/type_with_alignment.html b/doc/html/boost_typetraits/reference/type_with_alignment.html index 8c1810e..67156e5 100644 --- a/doc/html/boost_typetraits/reference/type_with_alignment.html +++ b/doc/html/boost_typetraits/reference/type_with_alignment.html @@ -3,10 +3,10 @@ type_with_alignment - + - + @@ -20,7 +20,7 @@


    -PrevUpHomeNext +PrevUpHomeNext

    @@ -56,7 +56,7 @@
    -PrevUpHomeNext +PrevUpHomeNext
    diff --git a/doc/html/boost_typetraits/user_defined.html b/doc/html/boost_typetraits/user_defined.html index 902a5fe..c975157 100644 --- a/doc/html/boost_typetraits/user_defined.html +++ b/doc/html/boost_typetraits/user_defined.html @@ -3,7 +3,7 @@ User Defined Specializations - + diff --git a/doc/html/index.html b/doc/html/index.html index 106f026..e4aedc8 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -3,7 +3,7 @@ Chapter 1. Boost.TypeTraits - + @@ -39,7 +39,7 @@

    -Class Index

    +Class Index

    A C D E F H I M N O P R T

    diff --git a/doc/html/index/s12.html b/doc/html/index/s12.html index b0d9b57..03377cc 100644 --- a/doc/html/index/s12.html +++ b/doc/html/index/s12.html @@ -3,7 +3,7 @@ Typedef Index - + @@ -24,28 +24,18 @@

    -Typedef Index

    -

    A F R T

    +Typedef Index

    +

    F R T V

    -A -
    -
    -
    -F +F
    -R +R
    • @@ -66,12 +56,22 @@
    -T +T
    +
    +V +
    +
    diff --git a/doc/html/index/s13.html b/doc/html/index/s13.html index 91c0605..d0133d9 100644 --- a/doc/html/index/s13.html +++ b/doc/html/index/s13.html @@ -3,7 +3,7 @@ Macro Index - + @@ -24,11 +24,11 @@

    -Macro Index

    -

    B

    +Macro Index
    +

    B

    -B +B
    +
  • +

    BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION

    + +
  • diff --git a/doc/html/index/s14.html b/doc/html/index/s14.html index 125a982..c0640fc 100644 --- a/doc/html/index/s14.html +++ b/doc/html/index/s14.html @@ -3,7 +3,7 @@ Index - + @@ -23,11 +23,11 @@

    -Index

    -

    A B C D E F H I M N O P R T U

    +Index
    +

    A B C D E F H I M N O P R T U V

    -A +A
    -B +B
    +
  • +

    BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION

    + +
  • -C +C
    -
    -D +D
    • decay

    • @@ -281,7 +267,7 @@
    -E +E
    • extent

      @@ -291,7 +277,7 @@
    -F +F
    • @@ -308,7 +294,7 @@
    -H +H
    • @@ -529,7 +515,10 @@
  • has_new_operator

  • -
  • has_nothrow_assign

  • +
  • +

    has_nothrow_assign

    + +
  • has_nothrow_constructor

  • -I +I
    -M +M
    -N +N
    -O +O
    -P +P
    -R +R
    -T +T
    -U +U
    +
    +V +
    +
    diff --git a/doc/integral_constant.qbk b/doc/integral_constant.qbk index 58403cf..663ff08 100644 --- a/doc/integral_constant.qbk +++ b/doc/integral_constant.qbk @@ -12,6 +12,7 @@ typedef integral_constant type; typedef T value_type; static const T value = val; + constexpr operator T()const; }; typedef integral_constant true_type; diff --git a/doc/intrinsics.qbk b/doc/intrinsics.qbk index c02e5c8..c824a1f 100644 --- a/doc/intrinsics.qbk +++ b/doc/intrinsics.qbk @@ -20,6 +20,8 @@ for all types * __is_final * __is_union * __is_pod +* __is_nothrow_move_assignable +* __is_nothrow_move_constructible * __has_trivial_constructor * __has_trivial_copy * __has_trivial_move_constructor @@ -37,6 +39,7 @@ the compilers we know about: * __is_empty * __is_polymorphic +* __is_virtual_base_of The following traits classes are dependent on one or more of the above: @@ -48,30 +51,30 @@ The hooks for compiler-intrinsic support are defined in a matter of defining one of more of the following macros: [table Macros for Compiler Intrinsics - [[BOOST_IS_UNION(T)][Should evaluate to true if T is a union type]] - [[BOOST_IS_POD(T)][Should evaluate to true if T is a POD type]] - [[BOOST_IS_EMPTY(T)][Should evaluate to true if T is an empty struct or union]] - [[BOOST_HAS_TRIVIAL_CONSTRUCTOR(T)][Should evaluate to true if the default constructor for T is trivial (i.e. has no effect)]] - [[BOOST_HAS_TRIVIAL_COPY(T)][Should evaluate to true if T has a trivial copy constructor (and can therefore be replaced by a call to memcpy)]] - [[BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T)][Should evaluate to true if T has a trivial move constructor (and can therefore be replaced by a call to memcpy)]] - [[BOOST_HAS_TRIVIAL_ASSIGN(T)][Should evaluate to true if T has a trivial assignment operator (and can therefore be replaced by a call to memcpy)]] - [[BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T)][Should evaluate to true if T has a trivial move assignment operator (and can therefore be replaced by a call to memcpy)]] - [[BOOST_HAS_TRIVIAL_DESTRUCTOR(T)][Should evaluate to true if T has a trivial destructor (i.e. ~T() has no effect)]] - [[BOOST_HAS_NOTHROW_CONSTRUCTOR(T)][Should evaluate to true if `T x;` can not throw]] - [[BOOST_HAS_NOTHROW_COPY(T)][Should evaluate to true if `T(t)` can not throw]] - [[BOOST_HAS_NOTHROW_ASSIGN(T)][Should evaluate to true if `T t, u; t = u` can not throw]] - [[BOOST_HAS_VIRTUAL_DESTRUCTOR(T)][Should evaluate to true T has a virtual destructor]] - [[BOOST_IS_NOTHROW_MOVE_ASSIGN(T)][Should evaluate to true T has a non-throwing move assign operator.]] - [[BOOST_IS_NOTHROW_MOVE_CONSTRUCT(T)][Should evaluate to true T has a non-throwing move constructor.]] - + [[BOOST_ALIGNMENT_OF(T)][Should evaluate to the alignment requirements of type T]] [[BOOST_IS_ABSTRACT(T)][Should evaluate to true if T is an abstract type]] [[BOOST_IS_BASE_OF(T,U)][Should evaluate to true if T is a base class of U]] [[BOOST_IS_CLASS(T)][Should evaluate to true if T is a class type]] [[BOOST_IS_CONVERTIBLE(T,U)][Should evaluate to true if T is convertible to U]] + [[BOOST_IS_EMPTY(T)][Should evaluate to true if T is an empty struct or union]] [[BOOST_IS_ENUM(T)][Should evaluate to true is T is an enum]] - [[BOOST_IS_POLYMORPHIC(T)][Should evaluate to true if T is a polymorphic type]] - [[BOOST_ALIGNMENT_OF(T)][Should evaluate to the alignment requirements of type T]] [[BOOST_IS_FINAL(T)][Should evaluate to true if T is a class type declared with the final specifier]] + [[BOOST_IS_NOTHROW_MOVE_ASSIGN(T)][Should evaluate to true T has a non-throwing move assign operator.]] + [[BOOST_IS_NOTHROW_MOVE_CONSTRUCT(T)][Should evaluate to true T has a non-throwing move constructor.]] + [[BOOST_IS_POLYMORPHIC(T)][Should evaluate to true if T is a polymorphic type]] + [[BOOST_IS_POD(T)][Should evaluate to true if T is a POD type]] + [[BOOST_IS_UNION(T)][Should evaluate to true if T is a union type]] + [[BOOST_HAS_NOTHROW_ASSIGN(T)][Should evaluate to true if `T t, u; t = u` can not throw]] + [[BOOST_HAS_NOTHROW_CONSTRUCTOR(T)][Should evaluate to true if `T x;` can not throw]] + [[BOOST_HAS_NOTHROW_COPY(T)][Should evaluate to true if `T(t)` can not throw]] + [[BOOST_HAS_TRIVIAL_ASSIGN(T)][Should evaluate to true if T has a trivial assignment operator (and can therefore be replaced by a call to memcpy)]] + [[BOOST_HAS_TRIVIAL_CONSTRUCTOR(T)][Should evaluate to true if the default constructor for T is trivial (i.e. has no effect)]] + [[BOOST_HAS_TRIVIAL_COPY(T)][Should evaluate to true if T has a trivial copy constructor (and can therefore be replaced by a call to memcpy)]] + [[BOOST_HAS_TRIVIAL_DESTRUCTOR(T)][Should evaluate to true if T has a trivial destructor (i.e. ~T() has no effect)]] + [[BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T)][Should evaluate to true if T has a trivial move constructor (and can therefore be replaced by a call to memcpy)]] + [[BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T)][Should evaluate to true if T has a trivial move assignment operator (and can therefore be replaced by a call to memcpy)]] + [[BOOST_HAS_VIRTUAL_DESTRUCTOR(T)][Should evaluate to true T has a virtual destructor]] + ] diff --git a/doc/is_array.qbk b/doc/is_array.qbk index be384f3..c8a4543 100644 --- a/doc/is_array.qbk +++ b/doc/is_array.qbk @@ -16,9 +16,7 @@ __std_ref 3.9.2 and 8.3.4. __header ` #include ` or ` #include ` -__compat If the compiler does not support -partial-specialization of class templates, then this template -can give the wrong result with function types. +[all_compilers] __examples diff --git a/doc/is_assignable.qbk b/doc/is_assignable.qbk new file mode 100644 index 0000000..fe4089e --- /dev/null +++ b/doc/is_assignable.qbk @@ -0,0 +1,40 @@ +[/ + Copyright 2015 John Maddock. + 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). +] + +[section:is_assignable is_assignable] + + template + struct is_assignable : public __tof {}; + +__inherit If `std::declval() = std::declval()` then inherits from __true_type, +otherwise from __flase_type. Type `T` must be a complete type. + +Note that this trait is somewhat tricky to use correctly: for example: + + is_assignable::value + +is `false` since `std::declval()` is an ['xvalue] which can not be assigned to! + +If you're intention is to check for copy-assignment from some type U then use: + + is_assignable::value + +If you're intention is to check for move-assignment then use: + + is_assignable::value + +or simply: + + is_assignable::value + + +__compat Requires the C++11 features `decltype` and SFINAE-expressions for full support. + +__header ` #include ` or ` #include ` + +[endsect] + diff --git a/doc/is_base_of.qbk b/doc/is_base_of.qbk index 78712b3..c65eb9a 100644 --- a/doc/is_base_of.qbk +++ b/doc/is_base_of.qbk @@ -28,11 +28,7 @@ __std_ref 10. __header ` #include ` or ` #include ` -__compat If the compiler does not support partial-specialization of class templates, -then this template can not be used with function types. There are some older compilers -which will produce compiler errors if `Base` is a private base class of `Derived`, or if -`Base` is an ambiguous base of `Derived`. These compilers include Borland C++, older -versions of Sun Forte C++, Digital Mars C++, and older versions of EDG based compilers. +[all_compilers] __examples diff --git a/doc/is_class.qbk b/doc/is_class.qbk index 1e7879e..f5d56cb 100644 --- a/doc/is_class.qbk +++ b/doc/is_class.qbk @@ -16,13 +16,9 @@ __std_ref 3.9.2 and 9.2. __header ` #include ` or ` #include ` -__compat 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. See also __is_union. -Currently (May 2011) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, -Intel-11.0, and Codegear have the necessary compiler __intrinsics to ensure that this -trait "just works". You may also test to see if the necessary __intrinsics are available -by checking to see if the macro `BOOST_IS_CLASS` is defined. +__compat This trait works correctly for almost all current compilers (as of June 2015), with just a minority +of older compilers not correctly detecting all the corner cases. You can check the macro `BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION` +which is defined to 1 when the class works correctly in all cases. __examples diff --git a/doc/is_complex.qbk b/doc/is_complex.qbk index 0c4f981..5646910 100644 --- a/doc/is_complex.qbk +++ b/doc/is_complex.qbk @@ -15,6 +15,8 @@ some type `U`), otherwise false. __std_ref 26.2. +[all_compilers] + __header ` #include ` or ` #include ` [endsect] diff --git a/doc/is_compound.qbk b/doc/is_compound.qbk index 392efd5..80e9f27 100644 --- a/doc/is_compound.qbk +++ b/doc/is_compound.qbk @@ -15,6 +15,8 @@ a compound type (see also __is_fundamental). __std_ref 3.9.2. +[all_compilers] + __header ` #include ` or ` #include ` __examples diff --git a/doc/is_const.qbk b/doc/is_const.qbk index ed3acaa..5853274 100644 --- a/doc/is_const.qbk +++ b/doc/is_const.qbk @@ -17,6 +17,8 @@ __std_ref 3.9.3. __header ` #include ` or ` #include ` +[all_compilers] + __examples [:`is_const` inherits from `__true_type`.] diff --git a/doc/is_constructible.qbk b/doc/is_constructible.qbk new file mode 100644 index 0000000..b301a25 --- /dev/null +++ b/doc/is_constructible.qbk @@ -0,0 +1,44 @@ +[/ + Copyright 2015 John Maddock. + 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). +] + +[section:is_constructible is_constructible] + + template + struct is_constructible : public __tof {}; + +__inherit If `T` can be constructed from `Args`, +then inherits from __true_type, otherwise inherits from __false_type. Type `T` +must be a complete type. + +Formally the trait answers the question, is the expression: + + T t(std::declval()...); + +valid? + +There are a number of important special cases for this trait: + + is_constructible::value + +Indicates whether `T` is default constructible, while: + + is_constructible::value + +Indicates whether `T` is copy-constructible, and: + + is_constructible::value + +Indicates whether `T` is move-constructible. + + +__compat This trait requires the C++11 features `decltype` variadic templates and SFINAE-expression support for full support. +While there is some fallback code for cases where this is not the case, the trait should really be considered broken in that case. + +__header ` #include ` or ` #include ` + +[endsect] + diff --git a/doc/is_convertible.qbk b/doc/is_convertible.qbk index cbaf2fb..63305cb 100644 --- a/doc/is_convertible.qbk +++ b/doc/is_convertible.qbk @@ -35,10 +35,7 @@ for example: __std_ref 4 and 8.5. -__compat This template is currently broken with Borland C++ Builder 5 (and earlier), -for constructor-based conversions, and for the Metrowerks 7 (and earlier) -compiler in all cases. If the compiler does not support `__is_abstract`, then the -template parameter `To` must not be an abstract type. +[all_compilers] __header ` #include ` or ` #include ` diff --git a/doc/is_copy_assignable.qbk b/doc/is_copy_assignable.qbk index e1de31a..5555441 100644 --- a/doc/is_copy_assignable.qbk +++ b/doc/is_copy_assignable.qbk @@ -19,8 +19,7 @@ In other words, inherits from __true_type only if copy assignment of `T` from `c marked with `= delete`, `T` does not derives from `boost::noncopyable` and is not marked with `BOOST_MOVABLE_BUT_NOT_COPYABLE(T)`. -__compat If the compiler does not support partial-specialization of class -templates, then this template can not be used. +__compat Requires the C++11 features `decltype` and SFINAE-expressions for full support. If your compiler does not support C++11 deleted functions (`= delete`) or does not support SFINAE for the deleted assignments, then derive your classes from `boost::noncopyable` or diff --git a/doc/is_copy_constructible.qbk b/doc/is_copy_constructible.qbk index 0168f27..12a7d6d 100644 --- a/doc/is_copy_constructible.qbk +++ b/doc/is_copy_constructible.qbk @@ -19,14 +19,13 @@ In other words, inherits from __true_type only if copy constructor of `T` not marked with `= delete`, `T` does not derives from `boost::noncopyable` and does not marked with `BOOST_MOVABLE_BUT_NOT_COPYABLE(T)`. -__compat If the compiler does not support partial-specialization of class -templates, then this template can not be used. +__compat This trait requires the C++11 features `decltype` and SFINAE-expression support for full support. If your compiler does not support C++11 deleted functions (`= delete`) or does not support SFINAE for the deleted constructors, then derive your classes from `boost::noncopyable` or mark them with `BOOST_MOVABLE_BUT_NOT_COPYABLE(T)` to show that class is noncopyable. -Trait does not care about access modifiers, so if you see errors like this: +The trait does not care about access modifiers, so if you see errors like this: 'T::T(const T&)' is private boost/type_traits/is_copy_constructible.hpp:68:5: error: within this context diff --git a/doc/is_default_constructible.qbk b/doc/is_default_constructible.qbk new file mode 100644 index 0000000..94caf25 --- /dev/null +++ b/doc/is_default_constructible.qbk @@ -0,0 +1,23 @@ +[/ + Copyright 2015 John Maddock. + 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). +] + +[section:is_default_constructible is_default_constructible] + + template + struct is_default_constructible : public __tof {}; + +__inherit If `T` can be default-constructed +then inherits from __true_type, otherwise inherits from __false_type. Type `T` +must be a complete type. + +__compat This trait requires the C++11 feature `decltype` support for full support. +While there is some fallback code for cases where this is not the case, the trait should really be considered broken in that case. + +__header ` #include ` or ` #include ` + +[endsect] + diff --git a/doc/is_destructible.qbk b/doc/is_destructible.qbk new file mode 100644 index 0000000..335b245 --- /dev/null +++ b/doc/is_destructible.qbk @@ -0,0 +1,23 @@ +[/ + Copyright 2015 John Maddock. + 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). +] + +[section:is_destructible is_destructible] + + template + struct is_destructible : public __tof {}; + +__inherit If `T` does not have its destructor deleted +then inherits from __true_type, otherwise inherits from __false_type. Type `T` +must be a complete type. + +__compat This trait requires the C++11 features `decltype` and SFINAE-expression support for full support. +While there is some fallback code for cases where this is not the case, the trait should really be considered broken in that case. + +__header ` #include ` or ` #include ` + +[endsect] + diff --git a/doc/is_empty.qbk b/doc/is_empty.qbk index e89e9a4..029a300 100644 --- a/doc/is_empty.qbk +++ b/doc/is_empty.qbk @@ -24,11 +24,6 @@ by checking to see if the macro BOOST_IS_EMPTY is defined. Can not be used with incomplete types. -Can not be used with union types, until is_union can be made to work. - -If the compiler does not support partial-specialization of class templates, -then this template can not be used with abstract types. - __examples [:Given: `struct empty_class {};` ] diff --git a/doc/is_enum.qbk b/doc/is_enum.qbk index d937fa6..f31617d 100644 --- a/doc/is_enum.qbk +++ b/doc/is_enum.qbk @@ -16,10 +16,7 @@ __std_ref 3.9.2 and 7.2. __header ` #include ` or ` #include ` -__compat Requires a correctly functioning __is_convertible template; - this means that is_enum is currently broken under Borland C++ Builder 5, - and for the Metrowerks compiler prior to version 8, other compilers - should handle this template just fine. +[all_compilers] __examples diff --git a/doc/is_final.qbk b/doc/is_final.qbk index 6f3e326..e0b5f65 100644 --- a/doc/is_final.qbk +++ b/doc/is_final.qbk @@ -20,7 +20,7 @@ class types declared with the final specifier using only standard C++, as a result this type will never inherit from __true_type, unless the user explicitly specializes the template for their user-defined final class types, or unless the compiler supplies some unspecified intrinsic that implements this functionality. -Currently (Aug 2014) compilers more recent than GCC-4.7, and Clang +Currently (June 2015) compilers more recent than GCC-4.7, Oracle-12.4, and Clang have the necessary compiler __intrinsics to ensure that this trait "just works". You may also test to see if the necessary __intrinsics are available by checking to see if the macro `BOOST_IS_FINAL` is defined. diff --git a/doc/is_floating_point.qbk b/doc/is_floating_point.qbk index 43f043b..22d4b0b 100644 --- a/doc/is_floating_point.qbk +++ b/doc/is_floating_point.qbk @@ -14,6 +14,8 @@ otherwise inherits from __false_type. __std_ref 3.9.1p8. +[all_compilers] + __header ` #include ` or ` #include ` __examples diff --git a/doc/is_function.qbk b/doc/is_function.qbk index c9cbae1..9c3c91e 100644 --- a/doc/is_function.qbk +++ b/doc/is_function.qbk @@ -21,6 +21,8 @@ __is_reference respectively: __std_ref 3.9.2p1 and 8.3.5. +[all_compilers] + __header ` #include ` or ` #include ` __examples diff --git a/doc/is_fundamental.qbk b/doc/is_fundamental.qbk index 8e4b4b0..da71a8c 100644 --- a/doc/is_fundamental.qbk +++ b/doc/is_fundamental.qbk @@ -15,6 +15,8 @@ point and void types (see also __is_integral, __is_floating_point and __is_void) __std_ref 3.9.1. +[all_compilers] + __header ` #include ` or ` #include ` __examples diff --git a/doc/is_integral.qbk b/doc/is_integral.qbk index 5d4add2..b26275b 100644 --- a/doc/is_integral.qbk +++ b/doc/is_integral.qbk @@ -14,6 +14,8 @@ otherwise inherits from __false_type. __std_ref 3.9.1p7. +[all_compilers] + __header ` #include ` or ` #include ` __examples diff --git a/doc/is_lvalue_reference.qbk b/doc/is_lvalue_reference.qbk index bd5349c..7e3390e 100644 --- a/doc/is_lvalue_reference.qbk +++ b/doc/is_lvalue_reference.qbk @@ -15,10 +15,7 @@ otherwise inherits from __false_type. __std_ref 3.9.2 and 8.3.2. -__compat If the compiler does not -support partial-specialization of class templates, -then this template may report the wrong result for function types, -and for types that are both const and volatile qualified. +[all_compilers] __header ` #include ` or ` #include ` diff --git a/doc/is_member_function_pointer.qbk b/doc/is_member_function_pointer.qbk index 673b306..5f485ea 100644 --- a/doc/is_member_function_pointer.qbk +++ b/doc/is_member_function_pointer.qbk @@ -15,6 +15,8 @@ otherwise inherits from __false_type. __std_ref 3.9.2 and 8.3.3. +[all_compilers] + __header ` #include ` or ` #include ` __examples diff --git a/doc/is_member_object_pointer.qbk b/doc/is_member_object_pointer.qbk index 87510a9..75a8fbd 100644 --- a/doc/is_member_object_pointer.qbk +++ b/doc/is_member_object_pointer.qbk @@ -15,6 +15,8 @@ otherwise inherits from __false_type. __std_ref 3.9.2 and 8.3.3. +[all_compilers] + __header ` #include ` or ` #include ` __examples diff --git a/doc/is_member_pointer.qbk b/doc/is_member_pointer.qbk index f45372f..3122e7f 100644 --- a/doc/is_member_pointer.qbk +++ b/doc/is_member_pointer.qbk @@ -16,6 +16,8 @@ otherwise inherits from __false_type. __std_ref 3.9.2 and 8.3.3. +[all_compilers] + __header ` #include ` or ` #include ` __examples diff --git a/doc/is_nothrow_move_assignable.qbk b/doc/is_nothrow_move_assignable.qbk index 5e0edb9..782f2c4 100644 --- a/doc/is_nothrow_move_assignable.qbk +++ b/doc/is_nothrow_move_assignable.qbk @@ -25,7 +25,7 @@ templates, then this template can not be used with function types. Without some (C++11 noexcept shall work correctly) help from the compiler, `is_nothrow_move_assignable` will never report that a class or struct has a non-throwing assignment-operator; this is always safe, if possibly sub-optimal. -Currently (February 2013) Clang and GCC 4.7 have the necessary compiler support to ensure that this +Currently (June 2015) MSVC-12.0, Clang and GCC 4.7 have the necessary compiler support to ensure that this trait "just works". __header ` #include ` or ` #include ` diff --git a/doc/is_nothrow_move_constructible.qbk b/doc/is_nothrow_move_constructible.qbk index 863054b..533f4fc 100644 --- a/doc/is_nothrow_move_constructible.qbk +++ b/doc/is_nothrow_move_constructible.qbk @@ -19,13 +19,10 @@ must be a complete type. In other words, inherits from __true_type only if expression `T(std::move(variable1))` won't throw (`variable1` is a variable of type `T`). -__compat If the compiler does not support partial-specialization of class -templates, then this template can not be used with function types. - -Without some (C++11 noexcept shall work correctly) help from the compiler, +__compat Without some (C++11 noexcept shall work correctly) help from the compiler, `is_nothrow_move_constructible` will never report that a class or struct has a non-throwing copy-constructor; this is always safe, if possibly sub-optimal. -Currently (February 2013) Clang and GCC 4.7 have the necessary compiler support to ensure that this +Currently (February 2013) MSVC-12.0, Clang and GCC 4.7 have the necessary compiler support to ensure that this trait "just works". __header ` #include ` or ` #include ` diff --git a/doc/is_object.qbk b/doc/is_object.qbk index 4f14c44..8d9e85c 100644 --- a/doc/is_object.qbk +++ b/doc/is_object.qbk @@ -16,6 +16,8 @@ references, void, and function types. __std_ref 3.9p9. +[all_compilers] + __header ` #include ` or ` #include ` __examples diff --git a/doc/is_pod.qbk b/doc/is_pod.qbk index 1c36dc7..43aff17 100644 --- a/doc/is_pod.qbk +++ b/doc/is_pod.qbk @@ -23,13 +23,10 @@ still a POD, as is an array of PODs. __std_ref 3.9p10 and 9p4 (Note that POD's are also aggregates, see 8.5.1). -__compat If the compiler does not support partial-specialization -of class templates, then this template can not be used with function types. - -Without some (as yet unspecified) help from the compiler, is_pod will +__compat 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. -Currently (May 2011) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, +Currently (June 2015) compilers more recent than Visual C++ 8, Clang-3, GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear have the necessary compiler __intrinsics to ensure that this trait "just works". You may also test to see if the necessary __intrinsics are available by checking to see if the macro `BOOST_IS_POD` is defined. diff --git a/doc/is_pointer.qbk b/doc/is_pointer.qbk index da57229..2afa4c3 100644 --- a/doc/is_pointer.qbk +++ b/doc/is_pointer.qbk @@ -17,6 +17,8 @@ __std_ref 3.9.2p2 and 8.3.1. __header ` #include ` or ` #include ` +[all_compilers] + __examples [:`is_pointer` inherits from `__true_type`.] diff --git a/doc/is_reference.qbk b/doc/is_reference.qbk index baf6bf4..253846b 100644 --- a/doc/is_reference.qbk +++ b/doc/is_reference.qbk @@ -15,10 +15,7 @@ otherwise inherits from __false_type. __std_ref 3.9.2 and 8.3.2. -__compat If the compiler does not -support partial-specialization of class templates, -then this template may report the wrong result for function types, -and for types that are both const and volatile qualified. +[all_compilers] __header ` #include ` or ` #include ` diff --git a/doc/is_rvalue_reference.qbk b/doc/is_rvalue_reference.qbk index edf0964..975e156 100644 --- a/doc/is_rvalue_reference.qbk +++ b/doc/is_rvalue_reference.qbk @@ -15,10 +15,7 @@ otherwise inherits from __false_type. __std_ref 3.9.2 and 8.3.2. -__compat If the compiler does not -support partial-specialization of class templates, -then this template may report the wrong result for function types, -and for types that are both const and volatile qualified. +[all_compilers] __header ` #include ` or ` #include ` diff --git a/doc/is_same.qbk b/doc/is_same.qbk index d054988..ed931c1 100644 --- a/doc/is_same.qbk +++ b/doc/is_same.qbk @@ -14,8 +14,8 @@ __true_type, otherwise inherits from __false_type. __header ` #include ` or ` #include ` -__compat If the compiler does not support partial-specialization of class templates, -then this template can not be used with abstract, incomplete or function types. +[all_compilers] + __examples diff --git a/doc/is_scalar.qbk b/doc/is_scalar.qbk index 4ec966c..745f483 100644 --- a/doc/is_scalar.qbk +++ b/doc/is_scalar.qbk @@ -17,8 +17,7 @@ __std_ref 3.9p10. __header ` #include ` or ` #include ` -__compat If the compiler does not support partial-specialization of class templates, -then this template can not be used with function types. +[all_compilers] __examples diff --git a/doc/is_signed.qbk b/doc/is_signed.qbk index 8d43c91..64d7184 100644 --- a/doc/is_signed.qbk +++ b/doc/is_signed.qbk @@ -16,6 +16,8 @@ otherwise inherits from __false_type. __std_ref 3.9.1, 7.2. +[all_compilers] + __header ` #include ` or ` #include ` __examples diff --git a/doc/is_stateless.qbk b/doc/is_stateless.qbk index d2de82f..58f460d 100644 --- a/doc/is_stateless.qbk +++ b/doc/is_stateless.qbk @@ -28,13 +28,10 @@ __std_ref 3.9p10. __header ` #include ` or ` #include ` -__compat If the compiler does not support partial-specialization of class templates, -then this template can not be used with function types. - -Without some (as yet unspecified) help from the compiler, is_stateless will never +__compat 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. -Currently (May 2011) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, +Currently (June 2015) compilers more recent than Visual C++ 8, Clang, GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear have the necessary compiler __intrinsics to ensure that this trait "just works". diff --git a/doc/is_union.qbk b/doc/is_union.qbk index e8203b7..c21ca22 100644 --- a/doc/is_union.qbk +++ b/doc/is_union.qbk @@ -20,7 +20,7 @@ compiler, we cannot distinguish between union and class types using only standar as a result this type will never inherit from __true_type, unless the user explicitly specializes the template for their user-defined union types, or unless the compiler supplies some unspecified intrinsic that implements this functionality. -Currently (May 2011) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, +Currently (June 2015) compilers more recent than Visual C++ 8, clang, GCC-4.3, Greenhills 6.0, Intel-11.0, and Codegear have the necessary compiler __intrinsics to ensure that this trait "just works". You may also test to see if the necessary __intrinsics are available by checking to see if the macro `BOOST_IS_UNION` is defined. diff --git a/doc/is_unsigned.qbk b/doc/is_unsigned.qbk index adf1926..a6366ae 100644 --- a/doc/is_unsigned.qbk +++ b/doc/is_unsigned.qbk @@ -16,6 +16,8 @@ otherwise inherits from __false_type. __std_ref 3.9.1, 7.2. +[all_compilers] + __header ` #include ` or ` #include ` __examples diff --git a/doc/is_virtual_base_of.qbk b/doc/is_virtual_base_of.qbk index e229bc5..0c52d57 100644 --- a/doc/is_virtual_base_of.qbk +++ b/doc/is_virtual_base_of.qbk @@ -18,12 +18,13 @@ __std_ref 10. __header ` #include ` or ` #include ` -__compat this trait also requires a working __is_base_of trait. +[all_compilers] [note There are a small number of cases where it's simply not possible for this trait to work, and -where attempting to instantiate the trait will cause compiler errors (see bug report -[@https://svn.boost.org/trac/boost/ticket/3730 #3730]). Further more the issues may well +where attempting to instantiate the trait will cause compiler errors (see bug reports +[@https://svn.boost.org/trac/boost/ticket/3730 #3730] and [@https://svn.boost.org/trac/boost/ticket/11323 11323]). +Further more the issues may well be compiler specific. In this situation the user should supply a full specialization of the trait to work around the problem.] diff --git a/doc/is_void.qbk b/doc/is_void.qbk index b99e586..7415371 100644 --- a/doc/is_void.qbk +++ b/doc/is_void.qbk @@ -14,6 +14,8 @@ otherwise inherits from __false_type. __std_ref 3.9.1p9. +[all_compilers] + __header ` #include ` or ` #include ` __examples diff --git a/doc/is_volatile.qbk b/doc/is_volatile.qbk index 4ce311a..f835100 100644 --- a/doc/is_volatile.qbk +++ b/doc/is_volatile.qbk @@ -14,6 +14,8 @@ otherwise inherits from __false_type. __std_ref 3.9.3. +[all_compilers] + __header ` #include ` or ` #include ` __examples diff --git a/doc/make_signed.qbk b/doc/make_signed.qbk index 87fa3ac..cba7b19 100644 --- a/doc/make_signed.qbk +++ b/doc/make_signed.qbk @@ -26,6 +26,8 @@ bool. __std_ref 3.9.1. +[all_compilers] + __header ` #include ` or ` #include ` [table Examples diff --git a/doc/make_unsigned.qbk b/doc/make_unsigned.qbk index cd9bd76..2e6cb41 100644 --- a/doc/make_unsigned.qbk +++ b/doc/make_unsigned.qbk @@ -26,6 +26,8 @@ bool. __std_ref 3.9.1. +[all_compilers] + __header ` #include ` or ` #include ` [table Examples diff --git a/doc/mpl.qbk b/doc/mpl.qbk index cc023d6..8b49206 100644 --- a/doc/mpl.qbk +++ b/doc/mpl.qbk @@ -8,13 +8,12 @@ [section:mpl MPL Interoperability] All the value based traits in this library conform to MPL's requirements -for an [@../../../../libs/mpl/doc/refmanual/integral-constant.html Integral Constant type]: that includes a number of rather intrusive -workarounds for broken compilers. +for an [@../../../../libs/mpl/doc/refmanual/integral-constant.html Integral Constant type]. -Purely as an implementation detail, this -means that `__true_type` inherits from [@../../../../libs/mpl/doc/refmanual/bool.html `boost::mpl::true_`], `__false_type` inherits -from [@../../../../libs/mpl/doc/refmanual/bool.html `boost::mpl::false_`], and `__integral_constant` inherits from -[@../../../../libs/mpl/doc/refmanual/integral-c.html `boost::mpl::integral_c`] (provided `T` is not `bool`) +Please note that these types no longer inherit from `mpl::true_` or `mpl::false_` etc, and the library +will no longer implicitly include any MPL header. However there is an implicit conversion from +`integral_constant` to the corresponding MPL types, therefore tag-dispatching that uses MPL types +in function overloads will still work as before. [endsect] diff --git a/doc/promote.qbk b/doc/promote.qbk index 3ed5c6f..0ce8370 100644 --- a/doc/promote.qbk +++ b/doc/promote.qbk @@ -20,6 +20,8 @@ __integral_promotion and __floating_point_promotion. __std_ref 4.5 except 4.5/3 (integral bit-field) and 4.6. +[all_compilers] + __header ` #include ` or ` #include ` [table Examples diff --git a/doc/rank.qbk b/doc/rank.qbk index 984a604..4268635 100644 --- a/doc/rank.qbk +++ b/doc/rank.qbk @@ -14,6 +14,8 @@ where `RANK(T)` is the number of array dimensions in type `T`. If `T` is not a (built-in) array type, then `RANK(T)` is zero. +[all_compilers] + __header ` #include ` or ` #include ` __examples diff --git a/doc/remove_all_extents.qbk b/doc/remove_all_extents.qbk index 3ab9899..be9d309 100644 --- a/doc/remove_all_extents.qbk +++ b/doc/remove_all_extents.qbk @@ -18,9 +18,7 @@ leaves `T` unchanged. __std_ref 8.3.4. -__compat If the compiler does not support partial specialization of class-templates -then this template will compile, but the member `type` will always be the same as -type `T` except where __transform_workaround have been applied. +[all_compilers] __header ` #include ` or ` #include ` diff --git a/doc/remove_const.qbk b/doc/remove_const.qbk index 9e24aa5..ea3b7e1 100644 --- a/doc/remove_const.qbk +++ b/doc/remove_const.qbk @@ -17,9 +17,7 @@ __type The same type as `T`, but with any /top level/ const-qualifier removed. __std_ref 3.9.3. -__compat If the compiler does not support partial specialization of class-templates -then this template will compile, but the member `type` will always be the same as -type `T` except where __transform_workaround have been applied. +[all_compilers] __header ` #include ` or ` #include ` diff --git a/doc/remove_cv.qbk b/doc/remove_cv.qbk index 23c342c..c7a296b 100644 --- a/doc/remove_cv.qbk +++ b/doc/remove_cv.qbk @@ -17,9 +17,7 @@ __type The same type as `T`, but with any /top level/ cv-qualifiers removed. __std_ref 3.9.3. -__compat If the compiler does not support partial specialization of class-templates -then this template will compile, but the member `type` will always be the same as -type `T` except where __transform_workaround have been applied. +[all_compilers] __header ` #include ` or ` #include ` diff --git a/doc/remove_extent.qbk b/doc/remove_extent.qbk index 445af02..fe5f3f1 100644 --- a/doc/remove_extent.qbk +++ b/doc/remove_extent.qbk @@ -18,9 +18,7 @@ otherwise leaves `T` unchanged. __std_ref 8.3.4. -__compat If the compiler does not support partial specialization of class-templates -then this template will compile, but the member `type` will always be the same as -type `T` except where __transform_workaround have been applied. +[all_compilers] __header ` #include ` or ` #include ` diff --git a/doc/remove_pointer.qbk b/doc/remove_pointer.qbk index 0504252..7f0af89 100644 --- a/doc/remove_pointer.qbk +++ b/doc/remove_pointer.qbk @@ -18,9 +18,7 @@ removing the pointer decoration would result in an invalid type. __std_ref 8.3.1. -__compat If the compiler does not support partial specialization of class-templates -then this template will compile, but the member `type` will always be the same as -type `T` except where __transform_workaround have been applied. +[all_compilers] __header ` #include ` or ` #include ` diff --git a/doc/remove_reference.qbk b/doc/remove_reference.qbk index 1ed0b96..a8af148 100644 --- a/doc/remove_reference.qbk +++ b/doc/remove_reference.qbk @@ -17,9 +17,7 @@ __type The same type as `T`, but with any reference modifier removed. __std_ref 8.3.2. -__compat If the compiler does not support partial specialization of class-templates -then this template will compile, but the member `type` will always be the same as -type `T` except where __transform_workaround have been applied. +[all_compilers] __header ` #include ` or ` #include ` diff --git a/doc/remove_volatile.qbk b/doc/remove_volatile.qbk index e63beb6..822661e 100644 --- a/doc/remove_volatile.qbk +++ b/doc/remove_volatile.qbk @@ -17,9 +17,7 @@ __type The same type as `T`, but with any /top level/ volatile-qualifier removed __std_ref 3.9.3. -__compat If the compiler does not support partial specialization of class-templates -then this template will compile, but the member `type` will always be the same as -type `T` except where __transform_workaround have been applied. +[all_compilers] __header ` #include ` or ` #include ` diff --git a/doc/transform_traits.qbk b/doc/transform_traits.qbk index 980ebe4..fee3932 100644 --- a/doc/transform_traits.qbk +++ b/doc/transform_traits.qbk @@ -41,6 +41,9 @@ result of applying the transformation to the template argument `T`. template struct __common_type; + template + struct __copy_cv; + template struct __decay; @@ -80,51 +83,8 @@ result of applying the transformation to the template argument `T`. template struct __remove_volatile; -[h4 Broken Compiler Workarounds:] - -For all of these templates support for partial specialization of class templates is -required to correctly implement the transformation. -On the other hand, practice shows that many of the templates from this -category are very useful, and often essential for implementing some -generic libraries. Lack of these templates is often one of the major -limiting factors in porting those libraries to compilers that do not yet -support this language feature. As some of these compilers are going to be -around for a while, and at least one of them is very wide-spread, -it was decided that the library should provide workarounds where possible. - -The basic idea behind the workaround is to manually define full -specializations of all type transformation templates for all fundamental types, -and all their 1st and 2nd rank cv-[un]qualified derivative pointer types, and to -provide a user-level macro that will define all the explicit specializations needed -for any user-defined type T. - -The first part guarantees the successful compilation of something like this: - - BOOST_STATIC_ASSERT((is_same::type>::value)); - BOOST_STATIC_ASSERT((is_same::type>::value)); - BOOST_STATIC_ASSERT((is_same::type>::value)); - BOOST_STATIC_ASSERT((is_same::type>::value)); - BOOST_STATIC_ASSERT((is_same::type>::value)); - BOOST_STATIC_ASSERT((is_same::type>::value)); - ... - BOOST_STATIC_ASSERT((is_same::type>::value)); - -and the second part provides the library's users with a mechanism to make the -above code work not only for `char`, `int` or other built-in type, -but for their own types as well: - - namespace myspace{ - struct MyClass {}; - } - // declare this at global scope: - BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(myspace::MyClass) - // transformations on myspace::MyClass now work: - BOOST_STATIC_ASSERT((is_same::type>::value)); - BOOST_STATIC_ASSERT((is_same::type>::value)); - // etc. - -Note that the macro BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION evaluates -to nothing on those compilers that *do* support partial specialization. + template + struct __type_identity; [endsect] diff --git a/doc/type_identity.qbk b/doc/type_identity.qbk new file mode 100644 index 0000000..975653d --- /dev/null +++ b/doc/type_identity.qbk @@ -0,0 +1,31 @@ +[/ + Copyright 2015 Peter Dimov. + 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). +] + +[section:type_identity type_identity] + + template + struct type_identity + { + typedef T type; + }; + +__header ` #include ` or ` #include ` + +[table Examples + +[ [Expression] [Result Type]] + +[[`type_identity::type`][`int`]] + +[[`type_identity::type`] [`int&`]] + +[[`type_identity::type`] [`int* const&`]] + +] + +[endsect] + diff --git a/doc/type_traits.qbk b/doc/type_traits.qbk index 3965809..8a914a4 100644 --- a/doc/type_traits.qbk +++ b/doc/type_traits.qbk @@ -68,8 +68,12 @@ [def __extent [link boost_typetraits.reference.extent extent]] [def __is_empty [link boost_typetraits.reference.is_empty is_empty]] [def __is_const [link boost_typetraits.reference.is_const is_const]] +[def __is_assignable [link boost_typetraits.reference.is_assignable is_assignable]] [def __is_copy_constructible [link boost_typetraits.reference.is_copy_constructible is_copy_constructible]] [def __is_copy_assignable [link boost_typetraits.reference.is_copy_assignable is_copy_assignable]] +[def __is_constructible [link boost_typetraits.reference.is_constructible is_constructible]] +[def __is_default_constructible [link boost_typetraits.reference.is_default_constructible is_default_constructible]] +[def __is_destructible [link boost_typetraits.reference.is_destructible is_destructible]] [def __is_volatile [link boost_typetraits.reference.is_volatile is_volatile]] [def __is_abstract [link boost_typetraits.reference.is_abstract is_abstract]] [def __is_polymorphic [link boost_typetraits.reference.is_polymorphic is_polymorphic]] @@ -92,6 +96,7 @@ [def __has_nothrow_copy [link boost_typetraits.reference.has_nothrow_copy has_nothrow_copy]] [def __has_nothrow_default_constructor [link boost_typetraits.reference.has_nothrow_constructor has_nothrow_default_constructor]] [def __has_nothrow_copy_constructor [link boost_typetraits.reference.has_nothrow_copy has_nothrow_copy_constructor]] +[def __has_nothrow_destructor [link boost_typetraits.reference.has_nothrow_destruct has_nothrow_destructor]] [def __is_nothrow_move_constructible [link boost_typetraits.reference.is_nothrow_move_constructible is_nothrow_move_constructible]] [def __has_nothrow_assign [link boost_typetraits.reference.has_nothrow_assign has_nothrow_assign]] [def __is_nothrow_move_assignable [link boost_typetraits.reference.is_nothrow_move_assignable is_nothrow_move_assignable]] @@ -132,6 +137,15 @@ [def __decay [link boost_typetraits.reference.decay decay]] [def __is_complex [link boost_typetraits.reference.is_complex is_complex]] +[def __copy_cv [link boost_typetraits.reference.copy_cv copy_cv]] +[def __type_identity [link boost_typetraits.reference.type_identity type_identity]] +[def __declval [link boost_typetraits.reference.declval declval]] + +[def __compat [*Compiler Compatibility:]] +[template all_compilers[] __compat All current compilers are supported by this trait.] +[template has_binary_operator_compat[] __compat Requires working SFINAE (i.e. BOOST_NO_SFINAE is not set). Only a minority of rather old compilers do not support this.] + + A printer-friendly [@http://sourceforge.net/projects/boost/files/boost-docs/ PDF version of this manual is also available]. @@ -183,7 +197,9 @@ that is the result of the transformation. [include alignment_of.qbk] [include conditional.qbk] [include common_type.qbk] +[include copy_cv.qbk] [include decay.qbk] +[include declval.qbk] [include extent.qbk] [include floating_point_promotion.qbk] [include function_traits.qbk] @@ -220,6 +236,7 @@ that is the result of the transformation. [include has_nothrow_assign.qbk] [include has_nothrow_constructor.qbk] [include has_nothrow_copy.qbk] +[include has_nothrow_destruct.qbk] [section:has_nothrow_cp_cons has_nothrow_copy_constructor] See __has_nothrow_copy. [endsect] @@ -256,14 +273,18 @@ See __has_trivial_constructor. [include is_abstract.qbk] [include is_arithmetic.qbk] [include is_array.qbk] +[include is_assignable.qbk] [include is_base_of.qbk] [include is_class.qbk] [include is_complex.qbk] [include is_compound.qbk] [include is_const.qbk] +[include is_constructible.qbk] [include is_convertible.qbk] -[include is_copy_constructible.qbk] [include is_copy_assignable.qbk] +[include is_copy_constructible.qbk] +[include is_default_constructible.qbk] +[include is_destructible.qbk] [include is_empty.qbk] [include is_enum.qbk] [include is_final.qbk] @@ -306,6 +327,7 @@ See __has_trivial_constructor. [include remove_pointer.qbk] [include remove_reference.qbk] [include remove_volatile.qbk] +[include type_identity.qbk] [include type_with_alignment.qbk] [endsect] diff --git a/doc/value_traits.qbk b/doc/value_traits.qbk index e3b6c85..5f667aa 100644 --- a/doc/value_traits.qbk +++ b/doc/value_traits.qbk @@ -126,6 +126,9 @@ The following templates describe the general properties of a type. template struct __has_nothrow_copy_constructor; + template + struct __has_nothrow_destructor; + template struct __has_trivial_assign; @@ -150,12 +153,33 @@ The following templates describe the general properties of a type. template struct __is_abstract; + template + struct __is_assignable; + + template + struct __is_copy_constructible; + + template + struct __is_copy_assignable; + + template + struct __is_constructible; + + template + struct __is_default_constructible; + + template + struct __is_destructible; + template struct __is_const; template struct __is_empty; + template + struct __is_final; + template struct __is_stateless; diff --git a/include/boost/aligned_storage.hpp b/include/boost/aligned_storage.hpp index b5455f0..f400fa9 100644 --- a/include/boost/aligned_storage.hpp +++ b/include/boost/aligned_storage.hpp @@ -13,131 +13,6 @@ #ifndef BOOST_ALIGNED_STORAGE_HPP #define BOOST_ALIGNED_STORAGE_HPP -#include // for std::size_t - -#include "boost/config.hpp" -#include "boost/detail/workaround.hpp" -#include "boost/type_traits/alignment_of.hpp" -#include "boost/type_traits/type_with_alignment.hpp" -#include "boost/type_traits/is_pod.hpp" - -#include "boost/mpl/eval_if.hpp" -#include "boost/mpl/identity.hpp" - -#include "boost/type_traits/detail/bool_trait_def.hpp" - -namespace boost { - -namespace detail { namespace aligned_storage { - -BOOST_STATIC_CONSTANT( - std::size_t - , alignment_of_max_align = ::boost::alignment_of::value - ); - -// -// To be TR1 conforming this must be a POD type: -// -template < - std::size_t size_ - , std::size_t alignment_ -> -struct aligned_storage_imp -{ - union data_t - { - char buf[size_]; - - typename ::boost::mpl::eval_if_c< - alignment_ == std::size_t(-1) - , ::boost::mpl::identity< ::boost::detail::max_align > - , ::boost::type_with_alignment - >::type align_; - } data_; - void* address() const { return const_cast(this); } -}; - -template< std::size_t alignment_ > -struct aligned_storage_imp<0u,alignment_> -{ - /* intentionally empty */ - void* address() const { return 0; } -}; - -}} // namespace detail::aligned_storage - -template < - std::size_t size_ - , std::size_t alignment_ = std::size_t(-1) -> -class aligned_storage : -#ifndef __BORLANDC__ - private -#else - public -#endif - ::boost::detail::aligned_storage::aligned_storage_imp -{ - -public: // constants - - typedef ::boost::detail::aligned_storage::aligned_storage_imp type; - - BOOST_STATIC_CONSTANT( - std::size_t - , size = size_ - ); - BOOST_STATIC_CONSTANT( - std::size_t - , alignment = ( - alignment_ == std::size_t(-1) - ? ::boost::detail::aligned_storage::alignment_of_max_align - : alignment_ - ) - ); - -private: // noncopyable - - aligned_storage(const aligned_storage&); - aligned_storage& operator=(const aligned_storage&); - -public: // structors - - aligned_storage() - { - } - - ~aligned_storage() - { - } - -public: // accessors - - void* address() - { - return static_cast(this)->address(); - } - - const void* address() const - { - return static_cast(this)->address(); - } -}; - -// -// Make sure that is_pod recognises aligned_storage<>::type -// as a POD (Note that aligned_storage<> itself is not a POD): -// -template -struct is_pod< ::boost::detail::aligned_storage::aligned_storage_imp > - BOOST_TT_AUX_BOOL_C_BASE(true) -{ - BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(true) -}; - - -} // namespace boost - -#include "boost/type_traits/detail/bool_trait_undef.hpp" +#include #endif // BOOST_ALIGNED_STORAGE_HPP diff --git a/include/boost/type_traits.hpp b/include/boost/type_traits.hpp index 398c687..57680f8 100644 --- a/include/boost/type_traits.hpp +++ b/include/boost/type_traits.hpp @@ -21,39 +21,87 @@ #include "boost/type_traits/alignment_of.hpp" #include "boost/type_traits/common_type.hpp" #include "boost/type_traits/conditional.hpp" +#include "boost/type_traits/copy_cv.hpp" #include "boost/type_traits/decay.hpp" +#include "boost/type_traits/declval.hpp" #include "boost/type_traits/extent.hpp" #include "boost/type_traits/floating_point_promotion.hpp" #include "boost/type_traits/function_traits.hpp" + +#include "boost/type_traits/has_bit_and.hpp" +#include "boost/type_traits/has_bit_and_assign.hpp" +#include "boost/type_traits/has_bit_or.hpp" +#include "boost/type_traits/has_bit_or_assign.hpp" +#include "boost/type_traits/has_bit_xor.hpp" +#include "boost/type_traits/has_bit_xor_assign.hpp" +#include "boost/type_traits/has_complement.hpp" +#include "boost/type_traits/has_dereference.hpp" +#include "boost/type_traits/has_divides.hpp" +#include "boost/type_traits/has_divides_assign.hpp" +#include "boost/type_traits/has_equal_to.hpp" +#include "boost/type_traits/has_greater.hpp" +#include "boost/type_traits/has_greater_equal.hpp" +#include "boost/type_traits/has_left_shift.hpp" +#include "boost/type_traits/has_left_shift_assign.hpp" +#include "boost/type_traits/has_less.hpp" +#include "boost/type_traits/has_less_equal.hpp" +#include "boost/type_traits/has_logical_and.hpp" +#include "boost/type_traits/has_logical_not.hpp" +#include "boost/type_traits/has_logical_or.hpp" +#include "boost/type_traits/has_minus.hpp" +#include "boost/type_traits/has_minus_assign.hpp" +#include "boost/type_traits/has_modulus.hpp" +#include "boost/type_traits/has_modulus_assign.hpp" +#include "boost/type_traits/has_multiplies.hpp" +#include "boost/type_traits/has_multiplies_assign.hpp" +#include "boost/type_traits/has_negate.hpp" #if !defined(__BORLANDC__) && !defined(__CUDACC__) #include "boost/type_traits/has_new_operator.hpp" #endif +#include "boost/type_traits/has_not_equal_to.hpp" #include "boost/type_traits/has_nothrow_assign.hpp" #include "boost/type_traits/has_nothrow_constructor.hpp" #include "boost/type_traits/has_nothrow_copy.hpp" #include "boost/type_traits/has_nothrow_destructor.hpp" -#include +#include "boost/type_traits/has_plus.hpp" +#include "boost/type_traits/has_plus_assign.hpp" +#include "boost/type_traits/has_post_decrement.hpp" +#include "boost/type_traits/has_post_increment.hpp" +#include "boost/type_traits/has_pre_decrement.hpp" +#include "boost/type_traits/has_pre_increment.hpp" +#include "boost/type_traits/has_right_shift.hpp" +#include "boost/type_traits/has_right_shift_assign.hpp" #include "boost/type_traits/has_trivial_assign.hpp" #include "boost/type_traits/has_trivial_constructor.hpp" #include "boost/type_traits/has_trivial_copy.hpp" #include "boost/type_traits/has_trivial_destructor.hpp" #include "boost/type_traits/has_trivial_move_assign.hpp" #include "boost/type_traits/has_trivial_move_constructor.hpp" +#include "boost/type_traits/has_unary_minus.hpp" +#include "boost/type_traits/has_unary_plus.hpp" #include "boost/type_traits/has_virtual_destructor.hpp" + +#include "boost/type_traits/integral_constant.hpp" + #include "boost/type_traits/is_abstract.hpp" #include "boost/type_traits/is_arithmetic.hpp" #include "boost/type_traits/is_array.hpp" +#include "boost/type_traits/is_assignable.hpp" #include "boost/type_traits/is_base_and_derived.hpp" #include "boost/type_traits/is_base_of.hpp" #include "boost/type_traits/is_class.hpp" -#include +#include "boost/type_traits/is_complex.hpp" #include "boost/type_traits/is_compound.hpp" #include "boost/type_traits/is_const.hpp" +#include "boost/type_traits/is_constructible.hpp" #include "boost/type_traits/is_convertible.hpp" -#include "boost/type_traits/is_copy_constructible.hpp" #include "boost/type_traits/is_copy_assignable.hpp" +#include "boost/type_traits/is_copy_constructible.hpp" +#include "boost/type_traits/is_default_constructible.hpp" +#include "boost/type_traits/is_destructible.hpp" #include "boost/type_traits/is_empty.hpp" #include "boost/type_traits/is_enum.hpp" +#include "boost/type_traits/is_final.hpp" #include "boost/type_traits/is_float.hpp" #include "boost/type_traits/is_floating_point.hpp" #include "boost/type_traits/is_function.hpp" @@ -67,36 +115,36 @@ #include "boost/type_traits/is_nothrow_move_constructible.hpp" #include "boost/type_traits/is_object.hpp" #include "boost/type_traits/is_pod.hpp" -#include "boost/type_traits/is_polymorphic.hpp" #include "boost/type_traits/is_pointer.hpp" +#include "boost/type_traits/is_polymorphic.hpp" #include "boost/type_traits/is_reference.hpp" #include "boost/type_traits/is_rvalue_reference.hpp" -#include "boost/type_traits/is_signed.hpp" #include "boost/type_traits/is_same.hpp" #include "boost/type_traits/is_scalar.hpp" +#include "boost/type_traits/is_signed.hpp" #include "boost/type_traits/is_stateless.hpp" #include "boost/type_traits/is_union.hpp" #include "boost/type_traits/is_unsigned.hpp" -#include "boost/type_traits/is_void.hpp" #include "boost/type_traits/is_virtual_base_of.hpp" +#include "boost/type_traits/is_void.hpp" #include "boost/type_traits/is_volatile.hpp" -#include -#include +#include "boost/type_traits/make_signed.hpp" +#include "boost/type_traits/make_unsigned.hpp" #include "boost/type_traits/rank.hpp" -#include "boost/type_traits/remove_bounds.hpp" -#include "boost/type_traits/remove_extent.hpp" #include "boost/type_traits/remove_all_extents.hpp" +#include "boost/type_traits/remove_bounds.hpp" #include "boost/type_traits/remove_const.hpp" #include "boost/type_traits/remove_cv.hpp" +#include "boost/type_traits/remove_extent.hpp" #include "boost/type_traits/remove_pointer.hpp" #include "boost/type_traits/remove_reference.hpp" #include "boost/type_traits/remove_volatile.hpp" +#include "boost/type_traits/type_identity.hpp" #include "boost/type_traits/type_with_alignment.hpp" + #if !(defined(__sgi) && defined(__EDG_VERSION__) && (__EDG_VERSION__ == 238)) #include "boost/type_traits/integral_promotion.hpp" #include "boost/type_traits/promote.hpp" #endif -#include "boost/type_traits/ice.hpp" - #endif // BOOST_TYPE_TRAITS_HPP diff --git a/include/boost/type_traits/add_const.hpp b/include/boost/type_traits/add_const.hpp index 0a27f8a..a9fb781 100644 --- a/include/boost/type_traits/add_const.hpp +++ b/include/boost/type_traits/add_const.hpp @@ -10,10 +10,7 @@ #ifndef BOOST_TT_ADD_CONST_HPP_INCLUDED #define BOOST_TT_ADD_CONST_HPP_INCLUDED -#include - -// should be the last #include -#include +#include namespace boost { @@ -30,16 +27,20 @@ namespace boost { # pragma warning(disable:4181) // warning C4181: qualifier applied to reference type ignored #endif -BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_const,T,T const) + template struct add_const + { + typedef T const type; + }; #if defined(BOOST_MSVC) # pragma warning(pop) #endif -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,add_const,T&,T&) + template struct add_const + { + typedef T& type; + }; } // namespace boost -#include - #endif // BOOST_TT_ADD_CONST_HPP_INCLUDED diff --git a/include/boost/type_traits/add_cv.hpp b/include/boost/type_traits/add_cv.hpp index 66625c6..e62ddee 100644 --- a/include/boost/type_traits/add_cv.hpp +++ b/include/boost/type_traits/add_cv.hpp @@ -13,9 +13,6 @@ #include -// should be the last #include -#include - namespace boost { // * convert a type T to a const volatile type - add_cv @@ -31,16 +28,14 @@ namespace boost { # pragma warning(disable:4181) // warning C4181: qualifier applied to reference type ignored #endif -BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_cv,T,T const volatile) +template struct add_cv{ typedef T const volatile type; }; #if defined(BOOST_MSVC) # pragma warning(pop) #endif -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,add_cv,T&,T&) +template struct add_cv{ typedef T& type; }; } // namespace boost -#include - #endif // BOOST_TT_ADD_CV_HPP_INCLUDED diff --git a/include/boost/type_traits/add_lvalue_reference.hpp b/include/boost/type_traits/add_lvalue_reference.hpp index 1d75794..41851a1 100644 --- a/include/boost/type_traits/add_lvalue_reference.hpp +++ b/include/boost/type_traits/add_lvalue_reference.hpp @@ -8,19 +8,20 @@ #include -// should be the last #include -#include - namespace boost{ -BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_lvalue_reference,T,typename boost::add_reference::type) +template struct add_lvalue_reference +{ + typedef typename boost::add_reference::type type; +}; #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,add_lvalue_reference,T&&,T&) +template struct add_lvalue_reference +{ + typedef T& type; +}; #endif } -#include - #endif // BOOST_TYPE_TRAITS_EXT_ADD_LVALUE_REFERENCE__HPP diff --git a/include/boost/type_traits/add_pointer.hpp b/include/boost/type_traits/add_pointer.hpp index 3e0e481..745f63a 100644 --- a/include/boost/type_traits/add_pointer.hpp +++ b/include/boost/type_traits/add_pointer.hpp @@ -11,13 +11,8 @@ #include -// should be the last #include -#include - namespace boost { -namespace detail { - #if defined(__BORLANDC__) && (__BORLANDC__ < 0x5A0) // // For some reason this implementation stops Borlands compiler @@ -25,27 +20,27 @@ namespace detail { // to arrays for some reason though (shrug...) (JM 20021104) // template -struct add_pointer_impl +struct add_pointer { typedef T* type; }; template -struct add_pointer_impl +struct add_pointer { typedef T* type; }; template -struct add_pointer_impl +struct add_pointer { typedef T* type; }; template -struct add_pointer_impl +struct add_pointer { typedef T* type; }; template -struct add_pointer_impl +struct add_pointer { typedef T* type; }; @@ -53,7 +48,7 @@ struct add_pointer_impl #else template -struct add_pointer_impl +struct add_pointer { typedef typename remove_reference::type no_ref_type; typedef no_ref_type* type; @@ -61,12 +56,6 @@ struct add_pointer_impl #endif -} // namespace detail - -BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_pointer,T,typename boost::detail::add_pointer_impl::type) - } // namespace boost -#include - #endif // BOOST_TT_ADD_POINTER_HPP_INCLUDED diff --git a/include/boost/type_traits/add_reference.hpp b/include/boost/type_traits/add_reference.hpp index 5e3efca..526f259 100644 --- a/include/boost/type_traits/add_reference.hpp +++ b/include/boost/type_traits/add_reference.hpp @@ -9,13 +9,9 @@ #ifndef BOOST_TT_ADD_REFERENCE_HPP_INCLUDED #define BOOST_TT_ADD_REFERENCE_HPP_INCLUDED -#include #include #include -// should be the last #include -#include - namespace boost { namespace detail { @@ -26,47 +22,38 @@ namespace detail { // template -struct add_reference_rvalue_layer +struct add_reference_impl { typedef T& type; }; #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES template -struct add_reference_rvalue_layer +struct add_reference_impl { typedef T&& type; }; #endif -template -struct add_reference_impl -{ - typedef typename add_reference_rvalue_layer::type type; -}; - -BOOST_TT_AUX_TYPE_TRAIT_IMPL_PARTIAL_SPEC1_1(typename T,add_reference,T&,T&) - -// these full specialisations are always required: -BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1(add_reference,void,void) -#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1(add_reference,void const,void const) -BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1(add_reference,void volatile,void volatile) -BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1(add_reference,void const volatile,void const volatile) -#endif - } // namespace detail -BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_reference,T,typename boost::detail::add_reference_impl::type) +template struct add_reference +{ + typedef typename boost::detail::add_reference_impl::type type; +}; +template struct add_reference +{ + typedef T& type; +}; -// agurt, 07/mar/03: workaround Borland's ill-formed sensitivity to an additional -// level of indirection, here -#if BOOST_WORKAROUND(__BORLANDC__, < 0x600) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,add_reference,T&,T&) +// these full specialisations are always required: +template <> struct add_reference { typedef void type; }; +#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS +template <> struct add_reference { typedef void type; }; +template <> struct add_reference { typedef void type; }; +template <> struct add_reference { typedef void type; }; #endif } // namespace boost -#include - #endif // BOOST_TT_ADD_REFERENCE_HPP_INCLUDED diff --git a/include/boost/type_traits/add_rvalue_reference.hpp b/include/boost/type_traits/add_rvalue_reference.hpp index 242716f..44ead34 100644 --- a/include/boost/type_traits/add_rvalue_reference.hpp +++ b/include/boost/type_traits/add_rvalue_reference.hpp @@ -15,9 +15,6 @@ #include #include -// should be the last #include -#include - //----------------------------------------------------------------------------// // // // C++03 implementation of // @@ -56,11 +53,12 @@ namespace type_traits_detail { } -BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_rvalue_reference,T,typename boost::type_traits_detail::add_rvalue_reference_imp::type) +template struct add_rvalue_reference +{ + typedef typename boost::type_traits_detail::add_rvalue_reference_imp::type type; +}; } // namespace boost -#include - #endif // BOOST_TYPE_TRAITS_EXT_ADD_RVALUE_REFERENCE__HPP diff --git a/include/boost/type_traits/add_volatile.hpp b/include/boost/type_traits/add_volatile.hpp index 86b5297..24f515c 100644 --- a/include/boost/type_traits/add_volatile.hpp +++ b/include/boost/type_traits/add_volatile.hpp @@ -12,9 +12,6 @@ #include -// should be the last #include -#include - namespace boost { // * convert a type T to volatile type - add_volatile @@ -30,16 +27,14 @@ namespace boost { # pragma warning(disable:4181) // warning C4181: qualifier applied to reference type ignored #endif -BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_volatile,T,T volatile) +template struct add_volatile{ typedef T volatile type; }; #if defined(BOOST_MSVC) # pragma warning(pop) #endif -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,add_volatile,T&,T&) +template struct add_volatile{ typedef T& type; }; } // namespace boost -#include - #endif // BOOST_TT_ADD_VOLATILE_HPP_INCLUDED diff --git a/include/boost/type_traits/aligned_storage.hpp b/include/boost/type_traits/aligned_storage.hpp old mode 100755 new mode 100644 index 5420f26..09f0c6b --- a/include/boost/type_traits/aligned_storage.hpp +++ b/include/boost/type_traits/aligned_storage.hpp @@ -1,13 +1,138 @@ - -// Copyright (C) John Maddock 2005. -// 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). +//----------------------------------------------------------------------------- +// boost aligned_storage.hpp header file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- // -// See http://www.boost.org/libs/type_traits for most recent version including documentation. +// Copyright (c) 2002-2003 +// Eric Friedman, Itay Maman +// +// 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) -#ifndef BOOST_TT_ALIGNED_STORAGE_HPP_INCLUDED -# define BOOST_TT_ALIGNED_STORAGE_HPP_INCLUDED -# include -#endif // BOOST_TT_ALIGNED_STORAGE_HPP_INCLUDED +#ifndef BOOST_TT_ALIGNED_STORAGE_HPP +#define BOOST_TT_ALIGNED_STORAGE_HPP +#include // for std::size_t + +#include "boost/config.hpp" +#include "boost/detail/workaround.hpp" +#include "boost/type_traits/alignment_of.hpp" +#include "boost/type_traits/type_with_alignment.hpp" +#include "boost/type_traits/is_pod.hpp" +#include "boost/type_traits/conditional.hpp" + +namespace boost { + +namespace detail { namespace aligned_storage { + +BOOST_STATIC_CONSTANT( + std::size_t + , alignment_of_max_align = ::boost::alignment_of::value + ); + +// +// To be TR1 conforming this must be a POD type: +// +template < + std::size_t size_ + , std::size_t alignment_ +> +struct aligned_storage_imp +{ + union data_t + { + char buf[size_]; + + typename ::boost::type_with_alignment::type align_; + } data_; + void* address() const { return const_cast(this); } +}; +template +struct aligned_storage_imp +{ + union data_t + { + char buf[size]; + ::boost::detail::max_align align_; + } data_; + void* address() const { return const_cast(this); } +}; + +template< std::size_t alignment_ > +struct aligned_storage_imp<0u,alignment_> +{ + /* intentionally empty */ + void* address() const { return 0; } +}; + +}} // namespace detail::aligned_storage + +template < + std::size_t size_ + , std::size_t alignment_ = std::size_t(-1) +> +class aligned_storage : +#ifndef __BORLANDC__ + private +#else + public +#endif + ::boost::detail::aligned_storage::aligned_storage_imp +{ + +public: // constants + + typedef ::boost::detail::aligned_storage::aligned_storage_imp type; + + BOOST_STATIC_CONSTANT( + std::size_t + , size = size_ + ); + BOOST_STATIC_CONSTANT( + std::size_t + , alignment = ( + alignment_ == std::size_t(-1) + ? ::boost::detail::aligned_storage::alignment_of_max_align + : alignment_ + ) + ); + +private: // noncopyable + + aligned_storage(const aligned_storage&); + aligned_storage& operator=(const aligned_storage&); + +public: // structors + + aligned_storage() + { + } + + ~aligned_storage() + { + } + +public: // accessors + + void* address() + { + return static_cast(this)->address(); + } + + const void* address() const + { + return static_cast(this)->address(); + } +}; + +// +// Make sure that is_pod recognises aligned_storage<>::type +// as a POD (Note that aligned_storage<> itself is not a POD): +// +template +struct is_pod< ::boost::detail::aligned_storage::aligned_storage_imp > : public true_type{}; + +} // namespace boost + +#endif // BOOST_ALIGNED_STORAGE_HPP diff --git a/include/boost/type_traits/alignment_of.hpp b/include/boost/type_traits/alignment_of.hpp index 31a5f38..7d960e3 100644 --- a/include/boost/type_traits/alignment_of.hpp +++ b/include/boost/type_traits/alignment_of.hpp @@ -13,8 +13,7 @@ #include #include -// should be the last #include -#include +#include #ifdef BOOST_MSVC # pragma warning(push) @@ -86,29 +85,25 @@ struct alignment_of_impl } // namespace detail -BOOST_TT_AUX_SIZE_T_TRAIT_DEF1(alignment_of,T,::boost::detail::alignment_of_impl::value) +template struct alignment_of : public integral_constant::value>{}; // references have to be treated specially, assume // that a reference is just a special pointer: -template -struct alignment_of - : public alignment_of -{ -}; +template struct alignment_of : public alignment_of{}; + #ifdef __BORLANDC__ // long double gives an incorrect value of 10 (!) // unless we do this... struct long_double_wrapper{ long double ld; }; -template<> struct alignment_of - : public alignment_of{}; +template<> struct alignment_of : public alignment_of{}; #endif // void has to be treated specially: -BOOST_TT_AUX_SIZE_T_TRAIT_SPEC1(alignment_of,void,0) +template<> struct alignment_of : integral_constant{}; #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_SIZE_T_TRAIT_SPEC1(alignment_of,void const,0) -BOOST_TT_AUX_SIZE_T_TRAIT_SPEC1(alignment_of,void volatile,0) -BOOST_TT_AUX_SIZE_T_TRAIT_SPEC1(alignment_of,void const volatile,0) +template<> struct alignment_of : integral_constant{}; +template<> struct alignment_of : integral_constant{}; +template<> struct alignment_of : integral_constant{}; #endif } // namespace boost @@ -120,7 +115,5 @@ BOOST_TT_AUX_SIZE_T_TRAIT_SPEC1(alignment_of,void const volatile,0) # pragma warning(pop) #endif -#include - #endif // BOOST_TT_ALIGNMENT_OF_HPP_INCLUDED diff --git a/include/boost/type_traits/broken_compiler_spec.hpp b/include/boost/type_traits/broken_compiler_spec.hpp index 3a13273..030840f 100644 --- a/include/boost/type_traits/broken_compiler_spec.hpp +++ b/include/boost/type_traits/broken_compiler_spec.hpp @@ -1,14 +1,21 @@ -// Copyright 2001-2003 Aleksey Gurtovoy. +// (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 // http://www.boost.org/LICENSE_1_0.txt). // // See http://www.boost.org/libs/type_traits for most recent version including documentation. -#ifndef BOOST_TT_BROKEN_COMPILER_SPEC_HPP_INCLUDED -#define BOOST_TT_BROKEN_COMPILER_SPEC_HPP_INCLUDED - -#include +#ifndef BOOST_TT_BROKEN_SPEC_HPP_INCLUDED +#define BOOST_TT_BROKEN_SPEC_HPP_INCLUDED +// +// This header is deprecated and no longer used by type_traits: +// +#if defined(__GNUC__) || defined(_MSC_VER) +# pragma message("NOTE: Use of this header (boost/type_traits/broken_compiler_spec.hpp) is deprecated") #endif + +#endif // BOOST_TT_CONFIG_HPP_INCLUDED + + diff --git a/include/boost/type_traits/common_type.hpp b/include/boost/type_traits/common_type.hpp index b52ff16..5c4303b 100644 --- a/include/boost/type_traits/common_type.hpp +++ b/include/boost/type_traits/common_type.hpp @@ -1,157 +1,144 @@ -// common_type.hpp ---------------------------------------------------------// - -// Copyright 2008 Howard Hinnant -// Copyright 2008 Beman Dawes +#ifndef BOOST_TYPE_TRAITS_COMMON_TYPE_HPP_INCLUDED +#define BOOST_TYPE_TRAITS_COMMON_TYPE_HPP_INCLUDED +// +// Copyright 2015 Peter Dimov +// // Distributed under the Boost Software License, Version 1.0. -// See http://www.boost.org/LICENSE_1_0.txt - -#ifndef BOOST_TYPE_TRAITS_COMMON_TYPE_HPP -#define BOOST_TYPE_TRAITS_COMMON_TYPE_HPP +// See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt +// #include +#include +#include -#if defined(__SUNPRO_CC) && !defined(BOOST_COMMON_TYPE_DONT_USE_TYPEOF) -# define BOOST_COMMON_TYPE_DONT_USE_TYPEOF -#endif -#if defined(__IBMCPP__) && !defined(BOOST_COMMON_TYPE_DONT_USE_TYPEOF) -# define BOOST_COMMON_TYPE_DONT_USE_TYPEOF +#if defined(BOOST_NO_CXX11_DECLTYPE) +#include #endif -//----------------------------------------------------------------------------// -#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_COMMON_TYPE_ARITY) -#define BOOST_COMMON_TYPE_ARITY 3 +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) +#include #endif -//----------------------------------------------------------------------------// -#if defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_COMMON_TYPE_DONT_USE_TYPEOF) -#include // boost wonders never cease! -#endif +namespace boost +{ -//----------------------------------------------------------------------------// -#ifndef BOOST_NO_CXX11_STATIC_ASSERT -#define BOOST_COMMON_TYPE_STATIC_ASSERT(CND, MSG, TYPES) static_assert(CND,MSG) -#elif defined(BOOST_COMMON_TYPE_USES_MPL_ASSERT) -#include -#include -#define BOOST_COMMON_TYPE_STATIC_ASSERT(CND, MSG, TYPES) \ - BOOST_MPL_ASSERT_MSG(boost::mpl::bool_< (CND) >::type::value, MSG, TYPES) -#else -#include -#define BOOST_COMMON_TYPE_STATIC_ASSERT(CND, MSG, TYPES) BOOST_STATIC_ASSERT(CND) -#endif +// variadic common_type -#if !defined(BOOST_NO_CXX11_STATIC_ASSERT) || !defined(BOOST_COMMON_TYPE_USES_MPL_ASSERT) -#define BOOST_COMMON_TYPE_MUST_BE_A_COMPLE_TYPE "must be complete type" -#endif - -#if defined(BOOST_NO_CXX11_DECLTYPE) && defined(BOOST_COMMON_TYPE_DONT_USE_TYPEOF) -#include -#include -#endif -#include -#include -#include - -//----------------------------------------------------------------------------// -// // -// C++03 implementation of // -// 20.9.7.6 Other transformations [meta.trans.other] // -// Written by Howard Hinnant // -// Adapted for Boost by Beman Dawes, Vicente Botet and Jeffrey Hellrung // -// // -//----------------------------------------------------------------------------// - -namespace boost { - -// prototype #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) - template - struct common_type; -#else // or no specialization - template - struct common_type - { - public: - typedef typename common_type::type, V>::type type; - }; -#endif +template struct common_type +{ +}; + +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) + +template using common_type_t = typename common_type::type; + +namespace type_traits_detail +{ + +template using common_type_fold = common_type_t, T...>; + +} // namespace type_traits_detail + +template +struct common_type: type_traits_detail::mp_defer +{ +}; -// 1 arg - template -#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) - struct common_type #else - struct common_type -#endif - { - BOOST_COMMON_TYPE_STATIC_ASSERT(sizeof(T) > 0, BOOST_COMMON_TYPE_MUST_BE_A_COMPLE_TYPE, (T)); - public: - typedef T type; - }; +template +struct common_type: common_type::type, T...> +{ +}; -// 2 args -namespace type_traits_detail { +#endif // !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) - template - struct common_type_2 - { - private: - BOOST_COMMON_TYPE_STATIC_ASSERT(sizeof(T) > 0, BOOST_COMMON_TYPE_MUST_BE_A_COMPLE_TYPE, (T)); - BOOST_COMMON_TYPE_STATIC_ASSERT(sizeof(U) > 0, BOOST_COMMON_TYPE_MUST_BE_A_COMPLE_TYPE, (U)); - static bool declval_bool(); // workaround gcc bug; not required by std - static typename add_rvalue_reference::type declval_T(); // workaround gcc bug; not required by std - static typename add_rvalue_reference::type declval_U(); // workaround gcc bug; not required by std - static typename add_rvalue_reference::type declval_b(); +#else + +template< + class T1 = void, class T2 = void, class T3 = void, + class T4 = void, class T5 = void, class T6 = void, + class T7 = void, class T8 = void, class T9 = void +> +struct common_type: common_type::type, T3, T4, T5, T6, T7, T8, T9> +{ +}; + +#endif // !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) + +// one argument + +template struct common_type: boost::decay +{ +}; + +// two arguments + +namespace type_traits_detail +{ + +// binary common_type #if !defined(BOOST_NO_CXX11_DECLTYPE) - public: - typedef decltype(declval() ? declval() : declval()) type; -#elif defined(BOOST_COMMON_TYPE_DONT_USE_TYPEOF) - public: - typedef typename detail_type_traits_common_type::common_type_impl< - typename remove_cv::type, - typename remove_cv::type - >::type type; + +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) + +#if !defined(BOOST_MSVC) || BOOST_MSVC > 1800 + +// internal compiler error on msvc-12.0 + +template using builtin_common_type = typename boost::decay()? boost::declval(): boost::declval() )>::type; + +template struct common_type_impl: mp_defer +{ +}; + #else - public: - typedef BOOST_TYPEOF_TPL(declval_b() ? declval_T() : declval_U()) type; -#endif -#if defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ == 3 - public: - void public_dummy_function_just_to_silence_warning(); -#endif - }; +template using builtin_common_type = decltype( boost::declval()? boost::declval(): boost::declval() ); - template - struct common_type_2 - { - typedef T type; - }; - } +template struct common_type_impl_2: mp_defer +{ +}; + +template using decay_common_type = typename boost::decay::type>::type; + +template struct common_type_impl: mp_defer +{ +}; + +#endif // !defined(BOOST_MSVC) || BOOST_MSVC > 1800 -#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) - template - struct common_type #else - template - struct common_type -#endif - : public type_traits_detail::common_type_2 - { }; +template struct common_type_impl: boost::decay()? boost::declval(): boost::declval() )> +{ +}; -// 3 or more args -#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) - template - struct common_type { - public: - typedef typename common_type::type, V...>::type type; - }; -#endif -} // namespace boost +#endif // #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) -#endif // BOOST_TYPE_TRAITS_COMMON_TYPE_HPP +#endif // #if !defined(BOOST_NO_CXX11_DECLTYPE) + +// decay helper + +template::type, class T2d = typename boost::decay::type> struct common_type_decay_helper: boost::common_type +{ +}; + +template struct common_type_decay_helper: common_type_impl +{ +}; + +} // type_traits_detail + +template struct common_type: type_traits_detail::common_type_decay_helper +{ +}; + +} // namespace boost + +#endif // #ifndef BOOST_TYPE_TRAITS_COMMON_TYPE_HPP_INCLUDED diff --git a/include/boost/type_traits/conditional.hpp b/include/boost/type_traits/conditional.hpp index 8bbda85..b7e82db 100644 --- a/include/boost/type_traits/conditional.hpp +++ b/include/boost/type_traits/conditional.hpp @@ -1,4 +1,3 @@ - // (C) Copyright John Maddock 2010. // Use, modification and distribution are subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -10,14 +9,10 @@ #ifndef BOOST_TT_CONDITIONAL_HPP_INCLUDED #define BOOST_TT_CONDITIONAL_HPP_INCLUDED -#include - namespace boost { -template -struct conditional : public mpl::if_c -{ -}; +template struct conditional { typedef T type; }; +template struct conditional { typedef U type; }; } // namespace boost diff --git a/include/boost/type_traits/config.hpp b/include/boost/type_traits/config.hpp index 2e25ad0..47a0648 100644 --- a/include/boost/type_traits/config.hpp +++ b/include/boost/type_traits/config.hpp @@ -6,67 +6,16 @@ // // See http://www.boost.org/libs/type_traits for most recent version including documentation. -#ifndef BOOST_TT_CONFIG_HPP_INCLUDED -#define BOOST_TT_CONFIG_HPP_INCLUDED +#ifndef BOOST_TT_OLD_CONFIG_HPP_INCLUDED +#define BOOST_TT_OLD_CONFIG_HPP_INCLUDED -#ifndef BOOST_CONFIG_HPP -#include +// +// This header is deprecated and no longer used by type_traits: +// +#if defined(__GNUC__) || defined(_MSC_VER) +# pragma message("NOTE: Use of this header (boost/type_traits/config.hpp) is deprecated") #endif -#include - -// -// whenever we have a conversion function with ellipses -// it needs to be declared __cdecl to suppress compiler -// warnings from MS and Borland compilers (this *must* -// appear before we include is_same.hpp below): -#if defined(BOOST_MSVC) || (defined(__BORLANDC__) && !defined(BOOST_DISABLE_WIN32)) -# define BOOST_TT_DECL __cdecl -#else -# define BOOST_TT_DECL /**/ -#endif - -# if (BOOST_WORKAROUND(__MWERKS__, < 0x3000) \ - || BOOST_WORKAROUND(__IBMCPP__, < 600 ) \ - || BOOST_WORKAROUND(__BORLANDC__, < 0x5A0) \ - || defined(__ghs) \ - || BOOST_WORKAROUND(__HP_aCC, < 60700) \ - || BOOST_WORKAROUND(MPW_CPLUS, BOOST_TESTED_AT(0x890)) \ - || BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580))) \ - && defined(BOOST_NO_IS_ABSTRACT) - -# define BOOST_TT_NO_CONFORMING_IS_CLASS_IMPLEMENTATION 1 - -#endif - -#ifndef BOOST_TT_NO_CONFORMING_IS_CLASS_IMPLEMENTATION -# define BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION 1 -#endif - -// -// define BOOST_TT_TEST_MS_FUNC_SIGS -// when we want to test __stdcall etc function types with is_function etc -// (Note, does not work with Borland, even though it does support __stdcall etc): -// -#if defined(_MSC_EXTENSIONS) && !defined(__BORLANDC__) -# define BOOST_TT_TEST_MS_FUNC_SIGS -#endif - -// -// define BOOST_TT_NO_CV_FUNC_TEST -// if tests for cv-qualified member functions don't -// work in is_member_function_pointer -// -#if BOOST_WORKAROUND(__MWERKS__, < 0x3000) || BOOST_WORKAROUND(__IBMCPP__, <= 600) -# define BOOST_TT_NO_CV_FUNC_TEST -#endif - -// -// Macros that have been deprecated, defined here for backwards compatibility: -// -#define BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(x) -#define BOOST_TT_BROKEN_COMPILER_SPEC(x) - #endif // BOOST_TT_CONFIG_HPP_INCLUDED diff --git a/include/boost/type_traits/copy_cv.hpp b/include/boost/type_traits/copy_cv.hpp new file mode 100644 index 0000000..1605ca3 --- /dev/null +++ b/include/boost/type_traits/copy_cv.hpp @@ -0,0 +1,34 @@ +#ifndef BOOST_TYPE_TRAITS_COPY_CV_HPP_INCLUDED +#define BOOST_TYPE_TRAITS_COPY_CV_HPP_INCLUDED + +// +// Copyright 2015 Peter Dimov +// +// 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 +// + +#include +#include +#include +#include +#include + +namespace boost +{ + +template struct copy_cv +{ +private: + + typedef typename boost::conditional::value, typename boost::add_const::type, T>::type CT; + +public: + + typedef typename boost::conditional::value, typename boost::add_volatile::type, CT>::type type; +}; + +} // namespace boost + +#endif // #ifndef BOOST_TYPE_TRAITS_COPY_CV_HPP_INCLUDED diff --git a/include/boost/type_traits/decay.hpp b/include/boost/type_traits/decay.hpp old mode 100755 new mode 100644 index c23a9b0..4e81184 --- a/include/boost/type_traits/decay.hpp +++ b/include/boost/type_traits/decay.hpp @@ -9,33 +9,32 @@ #ifndef BOOST_TT_DECAY_HPP_INCLUDED #define BOOST_TT_DECAY_HPP_INCLUDED -#include #include #include #include #include #include -#include -#include +#include namespace boost { + namespace detail + { + + template struct decay_imp { typedef typename remove_cv::type type; }; + template struct decay_imp { typedef typename remove_bounds::type* type; }; + template struct decay_imp { typedef T* type; }; + + } + template< class T > struct decay { private: - typedef BOOST_DEDUCED_TYPENAME remove_reference::type Ty; + typedef typename remove_reference::type Ty; public: - typedef BOOST_DEDUCED_TYPENAME mpl::eval_if< - is_array, - mpl::identity::type*>, - BOOST_DEDUCED_TYPENAME mpl::eval_if< - is_function, - add_pointer, - mpl::identity - > - >::type type; + typedef typename boost::detail::decay_imp::value, boost::is_function::value>::type type; }; } // namespace boost diff --git a/include/boost/type_traits/declval.hpp b/include/boost/type_traits/declval.hpp new file mode 100644 index 0000000..a050012 --- /dev/null +++ b/include/boost/type_traits/declval.hpp @@ -0,0 +1,44 @@ +// declval.hpp -------------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + +#ifndef BOOST_TYPE_TRAITS_DECLVAL_HPP_INCLUDED +#define BOOST_TYPE_TRAITS_DECLVAL_HPP_INCLUDED + +#include + +//----------------------------------------------------------------------------// + +#include + +//----------------------------------------------------------------------------// +// // +// C++03 implementation of // +// 20.2.4 Function template declval [declval] // +// Written by Vicente J. Botet Escriba // +// // +// 1 The library provides the function template declval to simplify the +// definition of expressions which occur as unevaluated operands. +// 2 Remarks: If this function is used, the program is ill-formed. +// 3 Remarks: The template parameter T of declval may be an incomplete type. +// [ Example: +// +// template +// decltype(static_cast(declval())) convert(From&&); +// +// declares a function template convert which only participates in overloading +// if the type From can be explicitly converted to type To. For another example +// see class template common_type (20.9.7.6). -end example ] +//----------------------------------------------------------------------------// + +namespace boost { + + template + typename add_rvalue_reference::type declval() BOOST_NOEXCEPT; // as unevaluated operand + +} // namespace boost + +#endif // BOOST_TYPE_TRAITS_DECLVAL_HPP_INCLUDED diff --git a/include/boost/type_traits/detail/bool_trait_def.hpp b/include/boost/type_traits/detail/bool_trait_def.hpp index 69e4f1c..b6b0677 100644 --- a/include/boost/type_traits/detail/bool_trait_def.hpp +++ b/include/boost/type_traits/detail/bool_trait_def.hpp @@ -11,10 +11,15 @@ // $Date$ // $Revision$ +// +// This header is deprecated and no longer used by type_traits: +// +#if defined(__GNUC__) || defined(_MSC_VER) +# pragma message("NOTE: Use of this header (bool_trait_def.hpp) is deprecated") +#endif + #include #include -#include -#include #include // @@ -39,14 +44,6 @@ #undef BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1 #endif -#if defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x570) -# define BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \ - typedef ::boost::integral_constant type; \ - enum { value = type::value }; \ - /**/ -# define BOOST_TT_AUX_BOOL_C_BASE(C) -#endif - #ifndef BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL # define BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) /**/ #endif @@ -62,7 +59,6 @@ template< typename T > struct trait \ { \ public:\ BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \ - BOOST_MPL_AUX_LAMBDA_SUPPORT(1,trait,(T)) \ }; \ \ BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1,trait) \ @@ -75,7 +71,6 @@ template< typename T1, typename T2 > struct trait \ { \ public:\ BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \ - BOOST_MPL_AUX_LAMBDA_SUPPORT(2,trait,(T1,T2)) \ }; \ \ BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(2,trait) \ @@ -87,7 +82,6 @@ template< typename T1, typename T2, typename T3 > struct trait \ { \ public:\ BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \ - BOOST_MPL_AUX_LAMBDA_SUPPORT(3,trait,(T1,T2,T3)) \ }; \ \ BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(3,trait) \ @@ -99,7 +93,6 @@ template<> struct trait< sp > \ { \ public:\ BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \ - BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(1,trait,(sp)) \ }; \ /**/ @@ -109,7 +102,6 @@ template<> struct trait< sp1,sp2 > \ { \ public:\ BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \ - BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(2,trait,(sp1,sp2)) \ }; \ /**/ @@ -153,7 +145,6 @@ template< param > struct trait< sp1,sp2 > \ { \ public:\ BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \ - BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(2,trait,(sp1,sp2)) \ }; \ /**/ diff --git a/include/boost/type_traits/detail/common_arithmetic_type.hpp b/include/boost/type_traits/detail/common_arithmetic_type.hpp new file mode 100644 index 0000000..7211002 --- /dev/null +++ b/include/boost/type_traits/detail/common_arithmetic_type.hpp @@ -0,0 +1,212 @@ +#ifndef BOOST_TYPE_TRAITS_DETAIL_COMMON_ARITHMETIC_TYPE_HPP_INCLUDED +#define BOOST_TYPE_TRAITS_DETAIL_COMMON_ARITHMETIC_TYPE_HPP_INCLUDED + +// +// Copyright 2015 Peter Dimov +// +// 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 +// + +#include + +namespace boost +{ + +namespace type_traits_detail +{ + +template struct arithmetic_type; + +// Types bool, char, char16_t, char32_t, wchar_t, +// and the signed and unsigned integer types are +// collectively called integral types + +template<> struct arithmetic_type<1> +{ + typedef bool type; + typedef char (&result_type) [1]; +}; + +template<> struct arithmetic_type<2> +{ + typedef char type; + typedef char (&result_type) [2]; +}; + +template<> struct arithmetic_type<3> +{ + typedef wchar_t type; + typedef char (&result_type) [3]; +}; + +// There are five standard signed integer types: +// “signed char”, “short int”, “int”, “long int”, and “long long int”. + +template<> struct arithmetic_type<4> +{ + typedef signed char type; + typedef char (&result_type) [4]; +}; + +template<> struct arithmetic_type<5> +{ + typedef short type; + typedef char (&result_type) [5]; +}; + +template<> struct arithmetic_type<6> +{ + typedef int type; + typedef char (&result_type) [6]; +}; + +template<> struct arithmetic_type<7> +{ + typedef long type; + typedef char (&result_type) [7]; +}; + +template<> struct arithmetic_type<8> +{ + typedef boost::long_long_type type; + typedef char (&result_type) [8]; +}; + +// For each of the standard signed integer types, there exists a corresponding +// (but different) standard unsigned integer type: “unsigned char”, “unsigned short int”, +// “unsigned int”, “unsigned long int”, and “unsigned long long int” + +template<> struct arithmetic_type<9> +{ + typedef unsigned char type; + typedef char (&result_type) [9]; +}; + +template<> struct arithmetic_type<10> +{ + typedef unsigned short type; + typedef char (&result_type) [10]; +}; + +template<> struct arithmetic_type<11> +{ + typedef unsigned int type; + typedef char (&result_type) [11]; +}; + +template<> struct arithmetic_type<12> +{ + typedef unsigned long type; + typedef char (&result_type) [12]; +}; + +template<> struct arithmetic_type<13> +{ + typedef boost::ulong_long_type type; + typedef char (&result_type) [13]; +}; + +// There are three floating point types: float, double, and long double. + +template<> struct arithmetic_type<14> +{ + typedef float type; + typedef char (&result_type) [14]; +}; + +template<> struct arithmetic_type<15> +{ + typedef double type; + typedef char (&result_type) [15]; +}; + +template<> struct arithmetic_type<16> +{ + typedef long double type; + typedef char (&result_type) [16]; +}; + +#if !defined( BOOST_NO_CXX11_CHAR16_T ) + +template<> struct arithmetic_type<17> +{ + typedef char16_t type; + typedef char (&result_type) [17]; +}; + +#endif + +#if !defined( BOOST_NO_CXX11_CHAR32_T ) + +template<> struct arithmetic_type<18> +{ + typedef char32_t type; + typedef char (&result_type) [18]; +}; + +#endif + +#if defined( BOOST_HAS_INT128 ) + +template<> struct arithmetic_type<19> +{ + typedef boost::int128_type type; + typedef char (&result_type) [19]; +}; + +template<> struct arithmetic_type<20> +{ + typedef boost::uint128_type type; + typedef char (&result_type) [20]; +}; + +#endif + +template class common_arithmetic_type +{ +private: + + static arithmetic_type<1>::result_type select( arithmetic_type<1>::type ); + static arithmetic_type<2>::result_type select( arithmetic_type<2>::type ); + static arithmetic_type<3>::result_type select( arithmetic_type<3>::type ); + static arithmetic_type<4>::result_type select( arithmetic_type<4>::type ); + static arithmetic_type<5>::result_type select( arithmetic_type<5>::type ); + static arithmetic_type<6>::result_type select( arithmetic_type<6>::type ); + static arithmetic_type<7>::result_type select( arithmetic_type<7>::type ); + static arithmetic_type<8>::result_type select( arithmetic_type<8>::type ); + static arithmetic_type<9>::result_type select( arithmetic_type<9>::type ); + static arithmetic_type<10>::result_type select( arithmetic_type<10>::type ); + static arithmetic_type<11>::result_type select( arithmetic_type<11>::type ); + static arithmetic_type<12>::result_type select( arithmetic_type<12>::type ); + static arithmetic_type<13>::result_type select( arithmetic_type<13>::type ); + static arithmetic_type<14>::result_type select( arithmetic_type<14>::type ); + static arithmetic_type<15>::result_type select( arithmetic_type<15>::type ); + static arithmetic_type<16>::result_type select( arithmetic_type<16>::type ); + +#if !defined( BOOST_NO_CXX11_CHAR16_T ) + static arithmetic_type<17>::result_type select( arithmetic_type<17>::type ); +#endif + +#if !defined( BOOST_NO_CXX11_CHAR32_T ) + static arithmetic_type<18>::result_type select( arithmetic_type<18>::type ); +#endif + +#if defined( BOOST_HAS_INT128 ) + static arithmetic_type<19>::result_type select( arithmetic_type<19>::type ); + static arithmetic_type<20>::result_type select( arithmetic_type<20>::type ); +#endif + + static bool cond(); + +public: + + typedef typename arithmetic_type< sizeof(select( cond()? T(): U() )) >::type type; +}; + +} // namespace type_traits_detail + +} // namespace boost + +#endif // #ifndef BOOST_TYPE_TRAITS_DETAIL_COMMON_ARITHMETIC_TYPE_HPP_INCLUDED diff --git a/include/boost/type_traits/detail/common_type_imp.hpp b/include/boost/type_traits/detail/common_type_imp.hpp deleted file mode 100644 index 84de8b4..0000000 --- a/include/boost/type_traits/detail/common_type_imp.hpp +++ /dev/null @@ -1,333 +0,0 @@ -/******************************************************************************* - * boost/type_traits/detail/common_type_imp.hpp - * - * Copyright 2010, Jeffrey Hellrung. - * 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) - * - * struct boost::common_type - * - * common_type::type is the type of the expression - * b() ? x() : y() - * where b() returns a bool, x() has return type T, and y() has return type U. - * See - * http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2661.htm#common_type - * - * Note that this evaluates to void if one or both of T and U is void. - ******************************************************************************/ - -#ifndef BOOST_TYPE_TRAITS_DETAIL_COMMON_TYPE_IMP_HPP -#define BOOST_TYPE_TRAITS_DETAIL_COMMON_TYPE_IMP_HPP - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace boost -{ - -namespace detail_type_traits_common_type -{ - -/******************************************************************************* - * struct propagate_cv< From, To > - * - * This metafunction propagates cv-qualifiers on type From to type To. - ******************************************************************************/ - -template< class From, class To > -struct propagate_cv -{ typedef To type; }; -template< class From, class To > -struct propagate_cv< const From, To > -{ typedef To const type; }; -template< class From, class To > -struct propagate_cv< volatile From, To > -{ typedef To volatile type; }; -template< class From, class To > -struct propagate_cv< const volatile From, To > -{ typedef To const volatile type; }; - -/******************************************************************************* - * struct is_integral_or_enum - * - * This metafunction determines if T is an integral type which can be made - * signed or unsigned. - ******************************************************************************/ - -template< class T > -struct is_integral_or_enum - : public mpl::or_< is_integral, is_enum > -{ }; -template<> -struct is_integral_or_enum< bool > - : public false_type -{ }; - -/******************************************************************************* - * struct make_unsigned_soft - * struct make_signed_soft - * - * These metafunction are identical to make_unsigned and make_signed, - * respectively, except for special-casing bool. - ******************************************************************************/ - -template< class T > -struct make_unsigned_soft - : public make_unsigned -{ }; -template<> -struct make_unsigned_soft< bool > -{ typedef bool type; }; - -template< class T > -struct make_signed_soft - : public make_signed -{ }; -template<> -struct make_signed_soft< bool > -{ typedef bool type; }; - -/******************************************************************************* - * struct sizeof_t - * typedef ... yes_type - * typedef ... no_type - * - * These types are integral players in the use of the "sizeof trick", i.e., we - * can distinguish overload selection by inspecting the size of the return type - * of the overload. - ******************************************************************************/ - -template< std::size_t N > struct sizeof_t { char _dummy[N]; }; -typedef sizeof_t<1> yes_type; -typedef sizeof_t<2> no_type; -BOOST_MPL_ASSERT_RELATION( sizeof( yes_type ), ==, 1 ); -BOOST_MPL_ASSERT_RELATION( sizeof( no_type ), ==, 2 ); - -/******************************************************************************* - * rvalue_test(T&) -> no_type - * rvalue_test(...) -> yes_type - * - * These overloads are used to determine the rvalue-ness of an expression. - ******************************************************************************/ - -template< class T > no_type rvalue_test(T&); -yes_type rvalue_test(...); - -/******************************************************************************* - * struct conversion_test_overloads< Sequence > - * - * This struct has multiple overloads of the static member function apply, each - * one taking a single parameter of a type within the Boost.MPL sequence - * Sequence. Each such apply overload has a return type with sizeof equal to - * one plus the index of the parameter type within Sequence. Thus, we can - * deduce the type T of an expression as long as we can generate a finite set of - * candidate types containing T via these apply overloads and the "sizeof - * trick". - ******************************************************************************/ - -template< class First, class Last, std::size_t Index > -struct conversion_test_overloads_iterate - : public conversion_test_overloads_iterate< - typename mpl::next< First >::type, Last, Index + 1 - > -{ - using conversion_test_overloads_iterate< - typename mpl::next< First >::type, Last, Index + 1 - >::apply; - static sizeof_t< Index + 1 > - apply(typename mpl::deref< First >::type); -}; - -template< class Last, std::size_t Index > -struct conversion_test_overloads_iterate< Last, Last, Index > -{ static sizeof_t< Index + 1 > apply(...); }; - -template< class Sequence > -struct conversion_test_overloads - : public conversion_test_overloads_iterate< - typename mpl::begin< Sequence >::type, - typename mpl::end< Sequence >::type, - 0 - > -{ }; - -/******************************************************************************* - * struct select< Sequence, Index > - * - * select is synonymous with mpl::at_c unless Index equals the size of the - * Boost.MPL Sequence, in which case this evaluates to void. - ******************************************************************************/ - -template< - class Sequence, int Index, - int N = mpl::size< Sequence >::value -> -struct select - : public mpl::at_c< Sequence, Index > -{ }; -template< class Sequence, int N > -struct select< Sequence, N, N > -{ typedef void type; }; - -/******************************************************************************* - * class deduce_common_type< T, U, NominalCandidates > - * struct nominal_candidates - * struct common_type_dispatch_on_rvalueness - * struct common_type_impl - * - * These classes and structs implement the logic behind common_type, which goes - * roughly as follows. Let C be the type of the conditional expression - * declval< bool >() ? declval() : declval() - * if C is an rvalue, then: - * let T' and U' be T and U stripped of reference- and cv-qualifiers - * if T' and U' are pointer types, say, T' = V* and U' = W*, then: - * define the set of NominalCandidates to be - * { V*, W*, V'*, W'* } - * where V' is V with whatever cv-qualifiers are on W, and W' is W - * with whatever cv-qualifiers are on V - * else if T' and U' are both integral or enum types, then: - * define the set of NominalCandidates to be - * { - * unsigned_soft(T'), - * unsigned_soft(U'), - * signed_soft(T'), - * signed_soft(U'), - * T', - * U', - * unsigned int, - * int - * } - * where unsigned_soft(X) is make_unsigned_soft::type and - * signed_soft(X) is make_signed_soft::type (these are all - * generally necessary to cover the various integral promotion cases) - * else - * define the set of NominalCandidates to be - * { T', U' } - * else - * let V and W be T and U stripped of reference-qualifiers - * define the set of NominalCandidates to be - * { V&, W&, V'&, W'& } - * where V' is V with whatever cv-qualifiers are on W, and W' is W with - * whatever cv-qualifiers are on V - * define the set of Candidates to be equal to the set of NominalCandidates with - * duplicates removed, and use this set of Candidates to determine C using the - * conversion_test_overloads struct - ******************************************************************************/ - -template< class T, class U, class NominalCandidates > -class deduce_common_type -{ - typedef typename mpl::copy< - NominalCandidates, - mpl::inserter< - mpl::vector0<>, - mpl::if_< - mpl::contains< mpl::_1, mpl::_2 >, - mpl::_1, - mpl::push_back< mpl::_1, mpl::_2 > - > - > - >::type candidate_types; - static const int best_candidate_index = - sizeof( conversion_test_overloads< candidate_types >::apply( - declval< bool >() ? declval() : declval() - ) ) - 1; -public: - typedef typename select< candidate_types, best_candidate_index >::type type; -}; - -template< - class T, class U, - class V = typename remove_cv< typename remove_reference::type >::type, - class W = typename remove_cv< typename remove_reference::type >::type, - bool = is_integral_or_enum::value && is_integral_or_enum::value -> -struct nominal_candidates -{ typedef mpl::vector2 type; }; - -template< class T, class U, class V, class W > -struct nominal_candidates< T, U, V, W, true > -{ - typedef boost::mpl::vector8< - typename make_unsigned_soft::type, - typename make_unsigned_soft::type, - typename make_signed_soft::type, - typename make_signed_soft::type, - V, W, unsigned int, int - > type; -}; - -template< class T, class U, class V, class W > -struct nominal_candidates< T, U, V*, W*, false > -{ - typedef mpl::vector4< - V*, W*, - typename propagate_cv::type *, - typename propagate_cv::type * - > type; -}; - -template -struct common_type_dispatch_on_rvalueness - : public deduce_common_type< T, U, typename nominal_candidates::type > -{ }; - -template< class T, class U > -struct common_type_dispatch_on_rvalueness< T, U, false > -{ -private: - typedef typename remove_reference::type unrefed_T_type; - typedef typename remove_reference::type unrefed_U_type; -public: - typedef typename deduce_common_type< - T, U, - mpl::vector4< - unrefed_T_type &, - unrefed_U_type &, - typename propagate_cv< unrefed_U_type, unrefed_T_type >::type &, - typename propagate_cv< unrefed_T_type, unrefed_U_type >::type & - > - >::type type; -}; - -template< class T, class U > -struct common_type_impl - : public common_type_dispatch_on_rvalueness() ? declval() : declval() ) ) == sizeof( yes_type ) > -{ }; - -template< class T > struct common_type_impl< T, void > { typedef void type; }; -template< class T > struct common_type_impl< void, T > { typedef void type; }; -template<> struct common_type_impl< void, void > { typedef void type; }; - -} // namespace detail_type_traits_common_type - - -} // namespace boost - -#endif // BOOST_TYPE_TRAITS_DETAIL_COMMON_TYPE_HPP - diff --git a/include/boost/type_traits/detail/common_type_impl.hpp b/include/boost/type_traits/detail/common_type_impl.hpp new file mode 100644 index 0000000..53a634d --- /dev/null +++ b/include/boost/type_traits/detail/common_type_impl.hpp @@ -0,0 +1,107 @@ +#ifndef BOOST_TYPE_TRAITS_DETAIL_COMMON_TYPE_IMPL_HPP_INCLUDED +#define BOOST_TYPE_TRAITS_DETAIL_COMMON_TYPE_IMPL_HPP_INCLUDED + +// +// Copyright 2015 Peter Dimov +// +// 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 +// + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost +{ + +namespace type_traits_detail +{ + +// the arguments to common_type_impl have already been passed through decay<> + +template struct common_type_impl; + +// same type + +template struct common_type_impl +{ + typedef T type; +}; + +// one of the operands is a class type, try conversions in both directions + +template struct ct_class +{ + BOOST_STATIC_CONSTANT( bool, ct = boost::is_class::value || boost::is_union::value ); + BOOST_STATIC_CONSTANT( bool, cu = boost::is_class::value || boost::is_union::value ); + + BOOST_STATIC_CONSTANT( bool, value = ct || cu ); +}; + +template struct common_type_impl3; + +template struct common_type_class: public boost::conditional< + + boost::is_convertible::value && !boost::is_convertible::value, + boost::type_identity, + + typename boost::conditional< + + boost::is_convertible::value && !boost::is_convertible::value, + boost::type_identity, + + common_type_impl3 + >::type +>::type +{ +}; + +template struct common_type_impl: public boost::conditional< + ct_class::value, + common_type_class, + common_type_impl3 >::type +{ +}; + +// pointers + +template struct common_type_impl4; + +template struct common_type_impl3: public boost::conditional< + boost::is_pointer::value || boost::is_pointer::value, + composite_pointer_type, + common_type_impl4 >::type +{ +}; + +// pointers to members + +template struct common_type_impl5; + +template struct common_type_impl4: public boost::conditional< + boost::is_member_pointer::value || boost::is_member_pointer::value, + composite_member_pointer_type, + common_type_impl5 >::type +{ +}; + +// arithmetic types (including class types w/ conversions to arithmetic and enums) + +template struct common_type_impl5: public common_arithmetic_type +{ +}; + +} // namespace type_traits_detail + +} // namespace boost + +#endif // #ifndef BOOST_TYPE_TRAITS_DETAIL_COMMON_TYPE_IMPL_HPP_INCLUDED diff --git a/include/boost/type_traits/detail/composite_member_pointer_type.hpp b/include/boost/type_traits/detail/composite_member_pointer_type.hpp new file mode 100644 index 0000000..ecb4b68 --- /dev/null +++ b/include/boost/type_traits/detail/composite_member_pointer_type.hpp @@ -0,0 +1,105 @@ +#ifndef BOOST_TYPE_TRAITS_DETAIL_COMPOSITE_MEMBER_POINTER_TYPE_HPP_INCLUDED +#define BOOST_TYPE_TRAITS_DETAIL_COMPOSITE_MEMBER_POINTER_TYPE_HPP_INCLUDED + +// +// Copyright 2015 Peter Dimov +// +// 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 +// + +#include +#include +#include +#include +#include +#include + +namespace boost +{ + +namespace type_traits_detail +{ + +template struct composite_member_pointer_type; + +// nullptr_t + +#if !defined( BOOST_NO_CXX11_NULLPTR ) + +#if !defined( BOOST_NO_CXX11_DECLTYPE ) && ( ( defined( __clang__ ) && !defined( _LIBCPP_VERSION ) ) || defined( __INTEL_COMPILER ) ) + +template struct composite_member_pointer_type +{ + typedef T C::* type; +}; + +template struct composite_member_pointer_type +{ + typedef T C::* type; +}; + +template<> struct composite_member_pointer_type +{ + typedef decltype(nullptr) type; +}; + +#else + +template struct composite_member_pointer_type +{ + typedef T C::* type; +}; + +template struct composite_member_pointer_type +{ + typedef T C::* type; +}; + +template<> struct composite_member_pointer_type +{ + typedef std::nullptr_t type; +}; + +#endif + +#endif // !defined( BOOST_NO_CXX11_NULLPTR ) + +template struct common_member_class; + +template struct common_member_class +{ + typedef C type; +}; + +template struct common_member_class +{ + typedef typename boost::conditional< + + boost::is_base_of::value, + C2, + typename boost::conditional::value, C1, void>::type + + >::type type; +}; + +template struct composite_member_pointer_type +{ +private: + + typedef typename composite_pointer_type::type CPT; + typedef typename boost::remove_pointer::type CT; + + typedef typename common_member_class::type CB; + +public: + + typedef CT CB::* type; +}; + +} // namespace type_traits_detail + +} // namespace boost + +#endif // #ifndef BOOST_TYPE_TRAITS_DETAIL_COMPOSITE_MEMBER_POINTER_TYPE_HPP_INCLUDED diff --git a/include/boost/type_traits/detail/composite_pointer_type.hpp b/include/boost/type_traits/detail/composite_pointer_type.hpp new file mode 100644 index 0000000..c807954 --- /dev/null +++ b/include/boost/type_traits/detail/composite_pointer_type.hpp @@ -0,0 +1,144 @@ +#ifndef BOOST_TYPE_TRAITS_DETAIL_COMPOSITE_POINTER_TYPE_HPP_INCLUDED +#define BOOST_TYPE_TRAITS_DETAIL_COMPOSITE_POINTER_TYPE_HPP_INCLUDED + +// +// Copyright 2015 Peter Dimov +// +// 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 +// + +#include +#include +#include +#include +#include +#include +#include + +namespace boost +{ + +namespace type_traits_detail +{ + +template struct composite_pointer_type; + +// same type + +template struct composite_pointer_type +{ + typedef T* type; +}; + +// nullptr_t + +#if !defined( BOOST_NO_CXX11_NULLPTR ) + +#if !defined( BOOST_NO_CXX11_DECLTYPE ) && ( ( defined( __clang__ ) && !defined( _LIBCPP_VERSION ) ) || defined( __INTEL_COMPILER ) ) + +template struct composite_pointer_type +{ + typedef T* type; +}; + +template struct composite_pointer_type +{ + typedef T* type; +}; + +template<> struct composite_pointer_type +{ + typedef decltype(nullptr) type; +}; + +#else + +template struct composite_pointer_type +{ + typedef T* type; +}; + +template struct composite_pointer_type +{ + typedef T* type; +}; + +template<> struct composite_pointer_type +{ + typedef std::nullptr_t type; +}; + +#endif + +#endif // !defined( BOOST_NO_CXX11_NULLPTR ) + +namespace detail +{ + +template struct has_common_pointee +{ +private: + + typedef typename boost::remove_cv::type T2; + typedef typename boost::remove_cv::type U2; + +public: + + BOOST_STATIC_CONSTANT( bool, value = + (boost::is_same::value) + || boost::is_void::value + || boost::is_void::value + || (boost::is_base_of::value) + || (boost::is_base_of::value) ); +}; + +template struct common_pointee +{ +private: + + typedef typename boost::remove_cv::type T2; + typedef typename boost::remove_cv::type U2; + +public: + + typedef typename boost::conditional< + + boost::is_same::value || boost::is_void::value || boost::is_base_of::value, + typename boost::copy_cv::type, + typename boost::copy_cv::type + + >::type type; +}; + +template struct composite_pointer_impl +{ +private: + + typedef typename boost::remove_cv::type T2; + typedef typename boost::remove_cv::type U2; + +public: + + typedef typename boost::copy_cv::type const, T>::type, U>::type type; +}; + +} // detail + +template struct composite_pointer_type +{ + typedef typename boost::conditional< + + detail::has_common_pointee::value, + detail::common_pointee, + detail::composite_pointer_impl + + >::type::type * type; +}; + +} // namespace type_traits_detail + +} // namespace boost + +#endif // #ifndef BOOST_TYPE_TRAITS_DETAIL_COMPOSITE_POINTER_TYPE_HPP_INCLUDED diff --git a/include/boost/type_traits/detail/config.hpp b/include/boost/type_traits/detail/config.hpp new file mode 100644 index 0000000..ebb1dd6 --- /dev/null +++ b/include/boost/type_traits/detail/config.hpp @@ -0,0 +1,72 @@ + +// (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 +// http://www.boost.org/LICENSE_1_0.txt). +// +// See http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_CONFIG_HPP_INCLUDED +#define BOOST_TT_CONFIG_HPP_INCLUDED + +#ifndef BOOST_CONFIG_HPP +#include +#endif +#include +#include + +// +// whenever we have a conversion function with ellipses +// it needs to be declared __cdecl to suppress compiler +// warnings from MS and Borland compilers (this *must* +// appear before we include is_same.hpp below): +#if defined(BOOST_MSVC) || (defined(__BORLANDC__) && !defined(BOOST_DISABLE_WIN32)) +# define BOOST_TT_DECL __cdecl +#else +# define BOOST_TT_DECL /**/ +#endif + +# if (BOOST_WORKAROUND(__MWERKS__, < 0x3000) \ + || BOOST_WORKAROUND(__IBMCPP__, < 600 ) \ + || BOOST_WORKAROUND(__BORLANDC__, < 0x5A0) \ + || defined(__ghs) \ + || BOOST_WORKAROUND(__HP_aCC, < 60700) \ + || BOOST_WORKAROUND(MPW_CPLUS, BOOST_TESTED_AT(0x890)) \ + || BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580))) \ + && defined(BOOST_NO_IS_ABSTRACT) + +# define BOOST_TT_NO_CONFORMING_IS_CLASS_IMPLEMENTATION 1 + +#endif + +#ifndef BOOST_TT_NO_CONFORMING_IS_CLASS_IMPLEMENTATION +# define BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION 1 +#endif + +// +// define BOOST_TT_TEST_MS_FUNC_SIGS +// when we want to test __stdcall etc function types with is_function etc +// (Note, does not work with Borland, even though it does support __stdcall etc): +// +#if defined(_MSC_EXTENSIONS) && !defined(__BORLANDC__) +# define BOOST_TT_TEST_MS_FUNC_SIGS +#endif + +// +// define BOOST_TT_NO_CV_FUNC_TEST +// if tests for cv-qualified member functions don't +// work in is_member_function_pointer +// +#if BOOST_WORKAROUND(__MWERKS__, < 0x3000) || BOOST_WORKAROUND(__IBMCPP__, <= 600) +# define BOOST_TT_NO_CV_FUNC_TEST +#endif + +// +// Macros that have been deprecated, defined here for backwards compatibility: +// +#define BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(x) +#define BOOST_TT_BROKEN_COMPILER_SPEC(x) + +#endif // BOOST_TT_CONFIG_HPP_INCLUDED + + diff --git a/include/boost/type_traits/detail/cv_traits_impl.hpp b/include/boost/type_traits/detail/cv_traits_impl.hpp deleted file mode 100644 index 8e995bb..0000000 --- a/include/boost/type_traits/detail/cv_traits_impl.hpp +++ /dev/null @@ -1,140 +0,0 @@ - -// (C) Copyright Dave Abrahams, 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 -// http://www.boost.org/LICENSE_1_0.txt). -// -// See http://www.boost.org/libs/type_traits for most recent version including documentation. - - -#ifndef BOOST_TT_DETAIL_CV_TRAITS_IMPL_HPP_INCLUDED -#define BOOST_TT_DETAIL_CV_TRAITS_IMPL_HPP_INCLUDED - -#include -#include -#include - - -// implementation helper: - - -namespace boost { -namespace detail { - -#if BOOST_WORKAROUND(BOOST_MSVC, == 1700) -#define BOOST_TT_AUX_CV_TRAITS_IMPL_PARAM(X) X - template - struct cv_traits_imp - { - BOOST_STATIC_CONSTANT(bool, is_const = false); - BOOST_STATIC_CONSTANT(bool, is_volatile = false); - typedef T unqualified_type; - }; - - template - struct cv_traits_imp - { - BOOST_STATIC_CONSTANT(bool, is_const = false); - BOOST_STATIC_CONSTANT(bool, is_volatile = false); - typedef T unqualified_type[]; - }; - - template - struct cv_traits_imp - { - BOOST_STATIC_CONSTANT(bool, is_const = true); - BOOST_STATIC_CONSTANT(bool, is_volatile = false); - typedef T unqualified_type[]; - }; - - template - struct cv_traits_imp - { - BOOST_STATIC_CONSTANT(bool, is_const = false); - BOOST_STATIC_CONSTANT(bool, is_volatile = true); - typedef T unqualified_type[]; - }; - - template - struct cv_traits_imp - { - BOOST_STATIC_CONSTANT(bool, is_const = true); - BOOST_STATIC_CONSTANT(bool, is_volatile = true); - typedef T unqualified_type[]; - }; - - template - struct cv_traits_imp - { - BOOST_STATIC_CONSTANT(bool, is_const = false); - BOOST_STATIC_CONSTANT(bool, is_volatile = false); - typedef T unqualified_type[N]; - }; - - template - struct cv_traits_imp - { - BOOST_STATIC_CONSTANT(bool, is_const = true); - BOOST_STATIC_CONSTANT(bool, is_volatile = false); - typedef T unqualified_type[N]; - }; - - template - struct cv_traits_imp - { - BOOST_STATIC_CONSTANT(bool, is_const = false); - BOOST_STATIC_CONSTANT(bool, is_volatile = true); - typedef T unqualified_type[N]; - }; - - template - struct cv_traits_imp - { - BOOST_STATIC_CONSTANT(bool, is_const = true); - BOOST_STATIC_CONSTANT(bool, is_volatile = true); - typedef T unqualified_type[N]; - }; - -#else -#define BOOST_TT_AUX_CV_TRAITS_IMPL_PARAM(X) X * -template struct cv_traits_imp {}; - -template -struct cv_traits_imp -{ - BOOST_STATIC_CONSTANT(bool, is_const = false); - BOOST_STATIC_CONSTANT(bool, is_volatile = false); - typedef T unqualified_type; -}; -#endif - -template -struct cv_traits_imp -{ - BOOST_STATIC_CONSTANT(bool, is_const = true); - BOOST_STATIC_CONSTANT(bool, is_volatile = false); - typedef T unqualified_type; -}; - -template -struct cv_traits_imp -{ - BOOST_STATIC_CONSTANT(bool, is_const = false); - BOOST_STATIC_CONSTANT(bool, is_volatile = true); - typedef T unqualified_type; -}; - -template -struct cv_traits_imp -{ - BOOST_STATIC_CONSTANT(bool, is_const = true); - BOOST_STATIC_CONSTANT(bool, is_volatile = true); - typedef T unqualified_type; -}; - -} // namespace detail -} // namespace boost - - -#endif // BOOST_TT_DETAIL_CV_TRAITS_IMPL_HPP_INCLUDED diff --git a/include/boost/type_traits/detail/false_result.hpp b/include/boost/type_traits/detail/false_result.hpp deleted file mode 100644 index e65e8bc..0000000 --- a/include/boost/type_traits/detail/false_result.hpp +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright David Abrahams 2002. -// 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). -// -// See http://www.boost.org/libs/type_traits for most recent version including documentation. - - -#ifndef BOOST_TT_DETAIL_FALSE_RESULT_HPP_INCLUDED -#define BOOST_TT_DETAIL_FALSE_RESULT_HPP_INCLUDED - -#include - -namespace boost { -namespace type_traits { - -// Utility class which always "returns" false -struct false_result -{ - template struct result_ - { - BOOST_STATIC_CONSTANT(bool, value = false); - }; -}; - -}} // namespace boost::type_traits - -#endif // BOOST_TT_DETAIL_FALSE_RESULT_HPP_INCLUDED diff --git a/include/boost/type_traits/detail/has_binary_operator.hpp b/include/boost/type_traits/detail/has_binary_operator.hpp index d82a5ce..7bc783a 100644 --- a/include/boost/type_traits/detail/has_binary_operator.hpp +++ b/include/boost/type_traits/detail/has_binary_operator.hpp @@ -7,7 +7,7 @@ // See http://www.boost.org/libs/type_traits for most recent version including documentation. #include -#include +#include #include #include #include @@ -21,9 +21,6 @@ #include #include -// should be the last #include -#include - // cannot include this header without getting warnings of the kind: // gcc: // warning: value computed is not used @@ -40,7 +37,7 @@ # pragma GCC system_header #elif defined(BOOST_MSVC) # pragma warning ( push ) -# pragma warning ( disable : 4018 4244 4547 4800 4804 4805 4913 ) +# pragma warning ( disable : 4018 4244 4547 4800 4804 4805 4913 6334) #endif namespace boost { @@ -177,13 +174,7 @@ struct trait_impl1 < Lhs, Rhs, Ret, true > { template < typename Lhs, typename Rhs, typename Ret > struct trait_impl1 < Lhs, Rhs, Ret, false > { BOOST_STATIC_CONSTANT(bool, - value = ( - ::boost::type_traits::ice_and< - operator_exists < Lhs, Rhs >::value, - operator_returns_Ret < Lhs, Rhs, Ret, operator_returns_void < Lhs, Rhs >::value >::value - >::value - ) - ); + value = (operator_exists < Lhs, Rhs >::value && operator_returns_Ret < Lhs, Rhs, Ret, operator_returns_void < Lhs, Rhs >::value >::value)); }; // some specializations needs to be declared for the special void case @@ -218,12 +209,11 @@ struct trait_impl { } // namespace detail // this is the accessible definition of the trait to end user -BOOST_TT_AUX_BOOL_TRAIT_DEF3(BOOST_TT_TRAIT_NAME, Lhs, Rhs=Lhs, Ret=::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)::dont_care, (::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)::trait_impl < Lhs, Rhs, Ret >::value)) +template +struct BOOST_TT_TRAIT_NAME : public integral_constant::value)>{}; } // namespace boost #if defined(BOOST_MSVC) # pragma warning ( pop ) #endif - -#include diff --git a/include/boost/type_traits/detail/has_postfix_operator.hpp b/include/boost/type_traits/detail/has_postfix_operator.hpp index e9048e1..2a6c706 100644 --- a/include/boost/type_traits/detail/has_postfix_operator.hpp +++ b/include/boost/type_traits/detail/has_postfix_operator.hpp @@ -7,7 +7,7 @@ // See http://www.boost.org/libs/type_traits for most recent version including documentation. #include -#include +#include #include #include #include @@ -18,15 +18,12 @@ #include #include -// should be the last #include -#include - // avoid warnings #if defined(__GNUC__) # pragma GCC system_header #elif defined(BOOST_MSVC) # pragma warning ( push ) -# pragma warning ( disable : 4244 4913 ) +# pragma warning ( disable : 4244 4913 6334) #endif namespace boost { @@ -163,13 +160,7 @@ struct trait_impl1 < Lhs, Ret, true > { template < typename Lhs, typename Ret > struct trait_impl1 < Lhs, Ret, false > { BOOST_STATIC_CONSTANT(bool, - value = ( - ::boost::type_traits::ice_and< - operator_exists < Lhs >::value, - operator_returns_Ret < Lhs, Ret, operator_returns_void < Lhs >::value >::value - >::value - ) - ); + value = (operator_exists < Lhs >::value && operator_returns_Ret < Lhs, Ret, operator_returns_void < Lhs >::value >::value)); }; // specialization needs to be declared for the special void case @@ -191,12 +182,11 @@ struct trait_impl { } // namespace detail // this is the accessible definition of the trait to end user -BOOST_TT_AUX_BOOL_TRAIT_DEF2(BOOST_TT_TRAIT_NAME, Lhs, Ret=::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)::dont_care, (::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)::trait_impl< Lhs, Ret >::value)) +template +struct BOOST_TT_TRAIT_NAME : public integral_constant::value)>{}; } // namespace boost #if defined(BOOST_MSVC) # pragma warning ( pop ) #endif - -#include diff --git a/include/boost/type_traits/detail/has_prefix_operator.hpp b/include/boost/type_traits/detail/has_prefix_operator.hpp index e1cf8d0..72279e7 100644 --- a/include/boost/type_traits/detail/has_prefix_operator.hpp +++ b/include/boost/type_traits/detail/has_prefix_operator.hpp @@ -7,7 +7,7 @@ // See http://www.boost.org/libs/type_traits for most recent version including documentation. #include -#include +#include #include #include #include @@ -19,9 +19,6 @@ #include #include -// should be the last #include -#include - // cannot include this header without getting warnings of the kind: // gcc: // warning: value computed is not used @@ -34,7 +31,7 @@ # pragma GCC system_header #elif defined(BOOST_MSVC) # pragma warning ( push ) -# pragma warning ( disable : 4146 4804 4913 4244 ) +# pragma warning ( disable : 4146 4804 4913 4244 6334) #endif namespace boost { @@ -171,13 +168,7 @@ struct trait_impl1 < Rhs, Ret, true > { template < typename Rhs, typename Ret > struct trait_impl1 < Rhs, Ret, false > { BOOST_STATIC_CONSTANT(bool, - value = ( - ::boost::type_traits::ice_and< - operator_exists < Rhs >::value, - operator_returns_Ret < Rhs, Ret, operator_returns_void < Rhs >::value >::value - >::value - ) - ); + value = (operator_exists < Rhs >::value && operator_returns_Ret < Rhs, Ret, operator_returns_void < Rhs >::value >::value)); }; // specialization needs to be declared for the special void case @@ -199,12 +190,11 @@ struct trait_impl { } // namespace detail // this is the accessible definition of the trait to end user -BOOST_TT_AUX_BOOL_TRAIT_DEF2(BOOST_TT_TRAIT_NAME, Rhs, Ret=::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)::dont_care, (::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)::trait_impl < Rhs, Ret >::value)) +template +struct BOOST_TT_TRAIT_NAME : public integral_constant::value)>{}; } // namespace boost #if defined(BOOST_MSVC) # pragma warning ( pop ) #endif - -#include diff --git a/include/boost/type_traits/detail/ice_and.hpp b/include/boost/type_traits/detail/ice_and.hpp index 8b461b9..3ccb03e 100644 --- a/include/boost/type_traits/detail/ice_and.hpp +++ b/include/boost/type_traits/detail/ice_and.hpp @@ -11,6 +11,13 @@ #include +// +// This header is deprecated and no longer used by type_traits: +// +#if defined(__GNUC__) || defined(_MSC_VER) +# pragma message("NOTE: Use of this header (ice_and.hpp) is deprecated") +#endif + namespace boost { namespace type_traits { diff --git a/include/boost/type_traits/detail/ice_eq.hpp b/include/boost/type_traits/detail/ice_eq.hpp index ea42a60..5908f81 100644 --- a/include/boost/type_traits/detail/ice_eq.hpp +++ b/include/boost/type_traits/detail/ice_eq.hpp @@ -10,6 +10,13 @@ #include +// +// This header is deprecated and no longer used by type_traits: +// +#if defined(__GNUC__) || defined(_MSC_VER) +# pragma message("NOTE: Use of this header (ice_eq.hpp) is deprecated") +#endif + namespace boost { namespace type_traits { diff --git a/include/boost/type_traits/detail/ice_not.hpp b/include/boost/type_traits/detail/ice_not.hpp index ee1dca0..e095be9 100644 --- a/include/boost/type_traits/detail/ice_not.hpp +++ b/include/boost/type_traits/detail/ice_not.hpp @@ -10,6 +10,13 @@ #include +// +// This header is deprecated and no longer used by type_traits: +// +#if defined(__GNUC__) || defined(_MSC_VER) +# pragma message("NOTE: Use of this header (ice_not.hpp) is deprecated") +#endif + namespace boost { namespace type_traits { diff --git a/include/boost/type_traits/detail/ice_or.hpp b/include/boost/type_traits/detail/ice_or.hpp index f88d9f6..ea523c8 100644 --- a/include/boost/type_traits/detail/ice_or.hpp +++ b/include/boost/type_traits/detail/ice_or.hpp @@ -10,6 +10,13 @@ #include +// +// This header is deprecated and no longer used by type_traits: +// +#if defined(__GNUC__) || defined(_MSC_VER) +# pragma message("NOTE: Use of this header (ice_or.hpp) is deprecated") +#endif + namespace boost { namespace type_traits { diff --git a/include/boost/type_traits/detail/is_function_ptr_helper.hpp b/include/boost/type_traits/detail/is_function_ptr_helper.hpp index 1c3b17f..3538e40 100644 --- a/include/boost/type_traits/detail/is_function_ptr_helper.hpp +++ b/include/boost/type_traits/detail/is_function_ptr_helper.hpp @@ -15,12 +15,20 @@ #ifndef BOOST_TT_DETAIL_IS_FUNCTION_PTR_HELPER_HPP_INCLUDED #define BOOST_TT_DETAIL_IS_FUNCTION_PTR_HELPER_HPP_INCLUDED -#include - #if defined(BOOST_TT_PREPROCESSING_MODE) -# include -# include -# include +// +// Hide these #include from dependency analysers as +// these are required in maintenance mode only: +// +#define PP1 +#include PP1 +#undef PP1 +#define PP1 +#include PP1 +#undef PP1 +#define PP1 +#include PP1 +#undef PP1 #endif namespace boost { diff --git a/include/boost/type_traits/detail/is_function_ptr_tester.hpp b/include/boost/type_traits/detail/is_function_ptr_tester.hpp index 2eb8a6f..4fe88e8 100644 --- a/include/boost/type_traits/detail/is_function_ptr_tester.hpp +++ b/include/boost/type_traits/detail/is_function_ptr_tester.hpp @@ -15,12 +15,21 @@ #define BOOST_TT_DETAIL_IS_FUNCTION_PTR_TESTER_HPP_INCLUDED #include -#include #if defined(BOOST_TT_PREPROCESSING_MODE) -# include -# include -# include +// +// Hide include dependencies from analysers since they're +// only require in maintenance mode: +// +#define PP1 +#define PP2 +#define PP3 +#include PP1 +#include PP2 +#include PP3 +#undef PP1 +#undef PP2 +#undef PP3 #endif namespace boost { diff --git a/include/boost/type_traits/detail/is_mem_fun_pointer_impl.hpp b/include/boost/type_traits/detail/is_mem_fun_pointer_impl.hpp index bd5c591..5698a74 100644 --- a/include/boost/type_traits/detail/is_mem_fun_pointer_impl.hpp +++ b/include/boost/type_traits/detail/is_mem_fun_pointer_impl.hpp @@ -17,9 +17,19 @@ #include #if defined(BOOST_TT_PREPROCESSING_MODE) -# include -# include -# include +// +// Maintenance mode, hide include dependencies +// from trackers: +// +#define PPI +#include PPI +#undef PPI +#define PPI +#include PPI +#undef PPI +#define PPI +#include PPI +#undef PPI #endif namespace boost { diff --git a/include/boost/type_traits/detail/is_mem_fun_pointer_tester.hpp b/include/boost/type_traits/detail/is_mem_fun_pointer_tester.hpp index 334a843..5e31693 100644 --- a/include/boost/type_traits/detail/is_mem_fun_pointer_tester.hpp +++ b/include/boost/type_traits/detail/is_mem_fun_pointer_tester.hpp @@ -15,12 +15,22 @@ #define BOOST_TT_DETAIL_IS_MEM_FUN_POINTER_TESTER_HPP_INCLUDED #include -#include +#include #if defined(BOOST_TT_PREPROCESSING_MODE) -# include -# include -# include +// +// Maintentance mode, hide include dependencies +// from dependency trackers: +// +#define PPI +#include PPI +#undef PPI +#define PPI +#include PPI +#undef PPI +#define +#include PPI +#undef #endif namespace boost { diff --git a/include/boost/type_traits/detail/mp_defer.hpp b/include/boost/type_traits/detail/mp_defer.hpp new file mode 100644 index 0000000..7910e54 --- /dev/null +++ b/include/boost/type_traits/detail/mp_defer.hpp @@ -0,0 +1,56 @@ +#ifndef BOOST_TYPE_TRAITS_DETAIL_MP_DEFER_HPP_INCLUDED +#define BOOST_TYPE_TRAITS_DETAIL_MP_DEFER_HPP_INCLUDED + +// +// Copyright 2015 Peter Dimov +// +// 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 +// + +#include +#include + +namespace boost +{ + +namespace type_traits_detail +{ + +// mp_valid +// implementation by Bruno Dutra (by the name is_evaluable) + +template class F, class... T> +struct mp_valid_impl +{ + template class G, class = G> + static boost::true_type check(int); + + template class> + static boost::false_type check(...); + + using type = decltype(check(0)); +}; + +template class F, class... T> +using mp_valid = typename mp_valid_impl::type; + +// mp_defer + +struct mp_empty +{ +}; + +template class F, class... T> struct mp_defer_impl +{ + using type = F; +}; + +template class F, class... T> using mp_defer = typename boost::conditional::value, mp_defer_impl, mp_empty>::type; + +} // namespace type_traits_detail + +} // namespace boost + +#endif // #ifndef BOOST_TYPE_TRAITS_DETAIL_MP_DEFER_HPP_INCLUDED diff --git a/include/boost/type_traits/detail/size_t_trait_def.hpp b/include/boost/type_traits/detail/size_t_trait_def.hpp deleted file mode 100644 index 8cea9b4..0000000 --- a/include/boost/type_traits/detail/size_t_trait_def.hpp +++ /dev/null @@ -1,51 +0,0 @@ - -// NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION - -// Copyright Aleksey Gurtovoy 2002-2004 -// -// 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) - -// $Source$ -// $Date$ -// $Revision$ - -#include -#include -#include -#include - -#include - -// Obsolete. Remove. -#define BOOST_TT_AUX_SIZE_T_BASE(C) public ::boost::integral_constant -#define BOOST_TT_AUX_SIZE_T_TRAIT_VALUE_DECL(C) /**/ - - -#define BOOST_TT_AUX_SIZE_T_TRAIT_DEF1(trait,T,C) \ -template< typename T > struct trait \ - : public ::boost::integral_constant \ -{ \ -public:\ - BOOST_MPL_AUX_LAMBDA_SUPPORT(1,trait,(T)) \ -}; \ -\ -BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1,trait) \ -/**/ - -#define BOOST_TT_AUX_SIZE_T_TRAIT_SPEC1(trait,spec,C) \ -template<> struct trait \ - : public ::boost::integral_constant \ -{ \ -public:\ - BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(1,trait,(spec)) \ -}; \ -/**/ - -#define BOOST_TT_AUX_SIZE_T_TRAIT_PARTIAL_SPEC1_1(param,trait,spec,C) \ -template< param > struct trait \ - : public ::boost::integral_constant \ -{ \ -}; \ -/**/ diff --git a/include/boost/type_traits/detail/size_t_trait_undef.hpp b/include/boost/type_traits/detail/size_t_trait_undef.hpp deleted file mode 100644 index 1694fac..0000000 --- a/include/boost/type_traits/detail/size_t_trait_undef.hpp +++ /dev/null @@ -1,16 +0,0 @@ - -// NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION - -// Copyright Aleksey Gurtovoy 2002-2004 -// -// 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) - -// $Source$ -// $Date$ -// $Revision$ - -#undef BOOST_TT_AUX_SIZE_T_TRAIT_DEF1 -#undef BOOST_TT_AUX_SIZE_T_TRAIT_SPEC1 -#undef BOOST_TT_AUX_SIZE_T_TRAIT_PARTIAL_SPEC1_1 diff --git a/include/boost/type_traits/detail/template_arity_spec.hpp b/include/boost/type_traits/detail/template_arity_spec.hpp index fe9b422..36ea96d 100644 --- a/include/boost/type_traits/detail/template_arity_spec.hpp +++ b/include/boost/type_traits/detail/template_arity_spec.hpp @@ -1,4 +1,3 @@ - // NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION // Copyright Aleksey Gurtovoy 2002-2004 @@ -7,25 +6,11 @@ // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#include -#include -#include -#include -#include - -#if defined(BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT) \ - && defined(BOOST_MPL_CFG_BROKEN_OVERLOAD_RESOLUTION) -# define BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(i, name) \ -namespace mpl { namespace aux { \ -template< BOOST_MPL_PP_PARAMS(i, typename T) > \ -struct template_arity< \ - name< BOOST_MPL_PP_PARAMS(i, T) > \ - > \ - : int_ \ -{ \ -}; \ -}} \ -/**/ -#else -# define BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(i, name) /**/ +// +// This header is deprecated and no longer used by type_traits: +// +#if defined(__GNUC__) || defined(_MSC_VER) +# pragma message("NOTE: Use of this header (template_arity_spec.hpp) is deprecated") #endif + +# define BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(i, name) /**/ diff --git a/include/boost/type_traits/detail/type_trait_def.hpp b/include/boost/type_traits/detail/type_trait_def.hpp deleted file mode 100644 index bc54696..0000000 --- a/include/boost/type_traits/detail/type_trait_def.hpp +++ /dev/null @@ -1,67 +0,0 @@ - -// NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION - -// Copyright Aleksey Gurtovoy 2002-2004 -// -// 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) - -// $Source$ -// $Date$ -// $Revision$ - -#include -#include - -#define BOOST_TT_AUX_TYPE_TRAIT_DEF1(trait,T,result) \ -template< typename T > struct trait \ -{ \ -public:\ - typedef result type; \ - BOOST_MPL_AUX_LAMBDA_SUPPORT(1,trait,(T)) \ -}; \ -\ -BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1,trait) \ -/**/ - -#define BOOST_TT_AUX_TYPE_TRAIT_SPEC1(trait,spec,result) \ -template<> struct trait \ -{ \ -public:\ - typedef result type; \ - BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(1,trait,(spec)) \ -}; \ -/**/ - -#define BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1(trait,spec,result) \ -template<> struct trait##_impl \ -{ \ -public:\ - typedef result type; \ -}; \ -/**/ - -#define BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(param,trait,spec,result) \ -template< param > struct trait \ -{ \ -public:\ - typedef result type; \ -}; \ -/**/ - -#define BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(param1,param2,trait,spec,result) \ -template< param1, param2 > struct trait \ -{ \ -public:\ - typedef result; \ -}; \ -/**/ - -#define BOOST_TT_AUX_TYPE_TRAIT_IMPL_PARTIAL_SPEC1_1(param,trait,spec,result) \ -template< param > struct trait##_impl \ -{ \ -public:\ - typedef result type; \ -}; \ -/**/ diff --git a/include/boost/type_traits/detail/type_trait_undef.hpp b/include/boost/type_traits/detail/type_trait_undef.hpp deleted file mode 100644 index d8edf66..0000000 --- a/include/boost/type_traits/detail/type_trait_undef.hpp +++ /dev/null @@ -1,19 +0,0 @@ - -// NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION - -// Copyright Aleksey Gurtovoy 2002-2004 -// -// 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) - -// $Source$ -// $Date$ -// $Revision$ - -#undef BOOST_TT_AUX_TYPE_TRAIT_DEF1 -#undef BOOST_TT_AUX_TYPE_TRAIT_SPEC1 -#undef BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1 -#undef BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1 -#undef BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2 -#undef BOOST_TT_AUX_TYPE_TRAIT_IMPL_PARTIAL_SPEC1_1 diff --git a/include/boost/type_traits/detail/wrap.hpp b/include/boost/type_traits/detail/wrap.hpp deleted file mode 100644 index d0a75d0..0000000 --- a/include/boost/type_traits/detail/wrap.hpp +++ /dev/null @@ -1,18 +0,0 @@ -// (C) Copyright David Abrahams 2002. -// 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). -// -// See http://www.boost.org/libs/type_traits for most recent version including documentation. - -#ifndef BOOST_TT_DETAIL_WRAP_HPP_INCLUDED -#define BOOST_TT_DETAIL_WRAP_HPP_INCLUDED - -namespace boost { -namespace type_traits { - -template struct wrap {}; - -}} // namespace boost::type_traits - -#endif // BOOST_TT_DETAIL_WRAP_HPP_INCLUDED diff --git a/include/boost/type_traits/extent.hpp b/include/boost/type_traits/extent.hpp index c41f7f2..dfb3c54 100644 --- a/include/boost/type_traits/extent.hpp +++ b/include/boost/type_traits/extent.hpp @@ -10,8 +10,8 @@ #ifndef BOOST_TT_EXTENT_HPP_INCLUDED #define BOOST_TT_EXTENT_HPP_INCLUDED -// should be the last #include -#include +#include +#include namespace boost { @@ -131,11 +131,8 @@ template struct extent : public ::boost::integral_constant::value> { - BOOST_MPL_AUX_LAMBDA_SUPPORT(1,extent,(T)) }; } // namespace boost -#include - #endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED diff --git a/include/boost/type_traits/floating_point_promotion.hpp b/include/boost/type_traits/floating_point_promotion.hpp index 8b6ae3a..993e14e 100644 --- a/include/boost/type_traits/floating_point_promotion.hpp +++ b/include/boost/type_traits/floating_point_promotion.hpp @@ -6,86 +6,15 @@ #ifndef FILE_boost_type_traits_floating_point_promotion_hpp_INCLUDED #define FILE_boost_type_traits_floating_point_promotion_hpp_INCLUDED -#include - -#ifdef BOOST_NO_CV_SPECIALIZATIONS -#include -#include -#include -#include -#include -#include -#endif - -// Should be the last #include -#include - namespace boost { -namespace type_traits { namespace detail { + template struct floating_point_promotion { typedef T type; }; + template<> struct floating_point_promotion { typedef double type; }; + template<> struct floating_point_promotion { typedef double const type; }; + template<> struct floating_point_promotion{ typedef double volatile type; }; + template<> struct floating_point_promotion { typedef double const volatile type; }; -#ifndef BOOST_NO_CV_SPECIALIZATIONS - -template -struct floating_point_promotion -{ - typedef T type; -}; - -template<> -struct floating_point_promotion -{ - typedef double type; -}; - -template<> -struct floating_point_promotion -{ - typedef double const type; -}; - -template<> -struct floating_point_promotion -{ - typedef double volatile type; -}; - -template<> -struct floating_point_promotion -{ - typedef double const volatile type; -}; - -#else - -template -struct floating_point_promotion - : mpl::at< - mpl::vector< T, double, double const, double volatile, - double const volatile > - , mpl::plus< - is_same - , mpl::multiplies< is_same , mpl::int_<2> > - , mpl::multiplies< is_same , mpl::int_<3> > - , mpl::multiplies< is_same, mpl::int_<4> > - > - > -{ -}; - -#endif - -} } - -BOOST_TT_AUX_TYPE_TRAIT_DEF1( - floating_point_promotion - , T - , BOOST_DEDUCED_TYPENAME - boost::type_traits::detail::floating_point_promotion::type - ) } -#include - #endif // #ifndef FILE_boost_type_traits_floating_point_promotion_hpp_INCLUDED diff --git a/include/boost/type_traits/has_bit_and.hpp b/include/boost/type_traits/has_bit_and.hpp index ee3307f..a16c71a 100644 --- a/include/boost/type_traits/has_bit_and.hpp +++ b/include/boost/type_traits/has_bit_and.hpp @@ -12,32 +12,32 @@ #define BOOST_TT_TRAIT_NAME has_bit_and #define BOOST_TT_TRAIT_OP & #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\ - ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ - >::value\ - >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ + ( \ + (! ::boost::is_integral< Lhs_noref >::value ) || \ + (! ::boost::is_integral< Rhs_noref >::value )\ + )\ + )||\ /* Lhs==fundamental and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + )||\ /* Rhs==fundamental and Lhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Rhs_nocv >::value && \ ::boost::is_pointer< Lhs_noref >::value\ - >::value,\ + )||\ /* Lhs==pointer and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value\ - >::value + )\ + ) #include diff --git a/include/boost/type_traits/has_bit_and_assign.hpp b/include/boost/type_traits/has_bit_and_assign.hpp index 5b3112a..01e25e3 100644 --- a/include/boost/type_traits/has_bit_and_assign.hpp +++ b/include/boost/type_traits/has_bit_and_assign.hpp @@ -12,38 +12,38 @@ #define BOOST_TT_TRAIT_NAME has_bit_and_assign #define BOOST_TT_TRAIT_OP &= #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\ - ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ - >::value\ - >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ + (\ + (! ::boost::is_integral< Lhs_noref >::value ) || \ + (! ::boost::is_integral< Rhs_noref >::value )\ + )\ + )||\ /* Lhs==fundamental and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + )||\ /* Rhs==fundamental and Lhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Rhs_nocv >::value && \ ::boost::is_pointer< Lhs_noref >::value\ - >::value,\ + )||\ /* Lhs==pointer and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + )||\ /* Lhs==fundamental and Rhs==fundamental and Lhs==const */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ ::boost::is_const< Lhs_noref >::value\ - >::value\ - >::value + )\ + ) #include diff --git a/include/boost/type_traits/has_bit_or.hpp b/include/boost/type_traits/has_bit_or.hpp index 922b4ce..6e76929 100644 --- a/include/boost/type_traits/has_bit_or.hpp +++ b/include/boost/type_traits/has_bit_or.hpp @@ -12,32 +12,32 @@ #define BOOST_TT_TRAIT_NAME has_bit_or #define BOOST_TT_TRAIT_OP | #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\ - ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ - >::value\ - >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ + ( \ + (! ::boost::is_integral< Lhs_noref >::value ) || \ + (! ::boost::is_integral< Rhs_noref >::value )\ + )\ + )||\ /* Lhs==fundamental and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + )||\ /* Rhs==fundamental and Lhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Rhs_nocv >::value && \ ::boost::is_pointer< Lhs_noref >::value\ - >::value,\ + )||\ /* Lhs==pointer and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value\ - >::value + )\ + ) #include diff --git a/include/boost/type_traits/has_bit_or_assign.hpp b/include/boost/type_traits/has_bit_or_assign.hpp index 5481b92..891c39c 100644 --- a/include/boost/type_traits/has_bit_or_assign.hpp +++ b/include/boost/type_traits/has_bit_or_assign.hpp @@ -12,38 +12,38 @@ #define BOOST_TT_TRAIT_NAME has_bit_or_assign #define BOOST_TT_TRAIT_OP |= #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\ - ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ - >::value\ - >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ + ( \ + (! ::boost::is_integral< Lhs_noref >::value ) || \ + (! ::boost::is_integral< Rhs_noref >::value )\ + )\ + )||\ /* Lhs==fundamental and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + )||\ /* Rhs==fundamental and Lhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Rhs_nocv >::value && \ ::boost::is_pointer< Lhs_noref >::value\ - >::value,\ + )||\ /* Lhs==pointer and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + )||\ /* Lhs==fundamental and Rhs==fundamental and Lhs==const */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ ::boost::is_const< Lhs_noref >::value\ - >::value\ - >::value + )\ + ) #include diff --git a/include/boost/type_traits/has_bit_xor.hpp b/include/boost/type_traits/has_bit_xor.hpp index 883dcf6..05173ac 100644 --- a/include/boost/type_traits/has_bit_xor.hpp +++ b/include/boost/type_traits/has_bit_xor.hpp @@ -12,32 +12,32 @@ #define BOOST_TT_TRAIT_NAME has_bit_xor #define BOOST_TT_TRAIT_OP ^ #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\ - ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ - >::value\ - >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ + ( \ + (! ::boost::is_integral< Lhs_noref >::value ) || \ + (! ::boost::is_integral< Rhs_noref >::value )\ + )\ + )||\ /* Lhs==fundamental and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + )||\ /* Rhs==fundamental and Lhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Rhs_nocv >::value && \ ::boost::is_pointer< Lhs_noref >::value\ - >::value,\ + )||\ /* Lhs==pointer and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value\ - >::value + )\ + ) #include diff --git a/include/boost/type_traits/has_bit_xor_assign.hpp b/include/boost/type_traits/has_bit_xor_assign.hpp index e2767cc..3866b7a 100644 --- a/include/boost/type_traits/has_bit_xor_assign.hpp +++ b/include/boost/type_traits/has_bit_xor_assign.hpp @@ -12,38 +12,38 @@ #define BOOST_TT_TRAIT_NAME has_bit_xor_assign #define BOOST_TT_TRAIT_OP ^= #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\ - ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ - >::value\ - >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ + ( \ + (! ::boost::is_integral< Lhs_noref >::value ) || \ + (! ::boost::is_integral< Rhs_noref >::value )\ + )\ + )||\ /* Lhs==fundamental and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + )||\ /* Rhs==fundamental and Lhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Rhs_nocv >::value && \ ::boost::is_pointer< Lhs_noref >::value\ - >::value,\ + )||\ /* Lhs==pointer and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + )||\ /* Lhs==fundamental and Rhs==fundamental and Lhs==const */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ ::boost::is_const< Lhs_noref >::value\ - >::value\ - >::value + )\ + ) #include diff --git a/include/boost/type_traits/has_complement.hpp b/include/boost/type_traits/has_complement.hpp index dafd9f5..d323e12 100644 --- a/include/boost/type_traits/has_complement.hpp +++ b/include/boost/type_traits/has_complement.hpp @@ -12,15 +12,15 @@ #define BOOST_TT_TRAIT_NAME has_complement #define BOOST_TT_TRAIT_OP ~ #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* pointer */\ - ::boost::is_pointer< Rhs_noref >::value,\ + ::boost::is_pointer< Rhs_noref >::value || \ /* fundamental non integral */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Rhs_noref >::value,\ - ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ - >::value\ - >::value + (\ + ::boost::is_fundamental< Rhs_noref >::value && \ + (! ::boost::is_integral< Rhs_noref >::value )\ + )\ + ) #include diff --git a/include/boost/type_traits/has_dereference.hpp b/include/boost/type_traits/has_dereference.hpp index fe48e11..1e514cd 100644 --- a/include/boost/type_traits/has_dereference.hpp +++ b/include/boost/type_traits/has_dereference.hpp @@ -13,13 +13,13 @@ #define BOOST_TT_TRAIT_OP * #define BOOST_TT_FORBIDDEN_IF\ /* void* or fundamental */\ - ::boost::type_traits::ice_or<\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ + (\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ ::boost::is_void< Rhs_noptr >::value\ - >::value,\ + ) || \ ::boost::is_fundamental< Rhs_nocv >::value\ - >::value + ) #include diff --git a/include/boost/type_traits/has_divides.hpp b/include/boost/type_traits/has_divides.hpp index 277c2da..869e907 100644 --- a/include/boost/type_traits/has_divides.hpp +++ b/include/boost/type_traits/has_divides.hpp @@ -13,22 +13,22 @@ #define BOOST_TT_TRAIT_OP / #define BOOST_TT_FORBIDDEN_IF\ /* pointer with pointer or fundamental */\ - ::boost::type_traits::ice_or<\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ( \ + ::boost::is_fundamental< Rhs_nocv >::value || \ ::boost::is_pointer< Rhs_noref >::value\ - >::value\ - >::value,\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + )\ + )||\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ + ( \ + ::boost::is_fundamental< Lhs_nocv >::value || \ ::boost::is_pointer< Lhs_noref >::value\ - >::value\ - >::value\ - >::value + )\ + )\ + ) #include diff --git a/include/boost/type_traits/has_divides_assign.hpp b/include/boost/type_traits/has_divides_assign.hpp index b21a05a..1a8e3c1 100644 --- a/include/boost/type_traits/has_divides_assign.hpp +++ b/include/boost/type_traits/has_divides_assign.hpp @@ -12,30 +12,30 @@ #define BOOST_TT_TRAIT_NAME has_divides_assign #define BOOST_TT_TRAIT_OP /= #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==fundamental and Lhs==const and Rhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_const< Lhs_noref >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_const< Lhs_noref >::value && \ ::boost::is_fundamental< Rhs_nocv >::value\ - >::value,\ + ) || \ /* Lhs==pointer and (Rhs==fundamental or Rhs==pointer) */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ( \ + ::boost::is_fundamental< Rhs_nocv >::value || \ ::boost::is_pointer< Rhs_noref >::value\ - >::value\ - >::value,\ + )\ + )||\ /* Rhs==pointer and (Lhs==fundamental or Lhs==pointer) */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ + ( \ + ::boost::is_fundamental< Lhs_nocv >::value || \ ::boost::is_pointer< Lhs_noref >::value\ - >::value\ - >::value\ - >::value + )\ + )\ + ) #include diff --git a/include/boost/type_traits/has_equal_to.hpp b/include/boost/type_traits/has_equal_to.hpp index c2245c2..d80a55d 100644 --- a/include/boost/type_traits/has_equal_to.hpp +++ b/include/boost/type_traits/has_equal_to.hpp @@ -12,32 +12,32 @@ #define BOOST_TT_TRAIT_NAME has_equal_to #define BOOST_TT_TRAIT_OP == #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==pointer and Rhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_fundamental< Rhs_nocv >::value\ - >::value,\ + ) || \ /* Rhs==pointer and Lhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ ::boost::is_fundamental< Lhs_nocv >::value\ - >::value,\ + ) || \ /* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::type_traits::ice_not<\ - ::boost::type_traits::ice_or<\ - ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value,\ - ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value,\ - ::boost::is_same< Lhs_noptr, Rhs_noptr >::value,\ - ::boost::is_void< Lhs_noptr >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ::boost::is_pointer< Rhs_noref >::value && \ + (! \ + (\ + ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value || \ + ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value || \ + ::boost::is_same< Lhs_noptr, Rhs_noptr >::value || \ + ::boost::is_void< Lhs_noptr >::value || \ ::boost::is_void< Rhs_noptr >::value\ - >::value\ - >::value\ - >::value\ - >::value + )\ + )\ + )\ + ) #include diff --git a/include/boost/type_traits/has_greater.hpp b/include/boost/type_traits/has_greater.hpp index ce32658..32e0a12 100644 --- a/include/boost/type_traits/has_greater.hpp +++ b/include/boost/type_traits/has_greater.hpp @@ -12,32 +12,32 @@ #define BOOST_TT_TRAIT_NAME has_greater #define BOOST_TT_TRAIT_OP > #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==pointer and Rhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_fundamental< Rhs_nocv >::value\ - >::value,\ + ) || \ /* Rhs==pointer and Lhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ ::boost::is_fundamental< Lhs_nocv >::value\ - >::value,\ + ) || \ /* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::type_traits::ice_not<\ - ::boost::type_traits::ice_or<\ - ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value,\ - ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value,\ - ::boost::is_same< Lhs_noptr, Rhs_noptr >::value,\ - ::boost::is_void< Lhs_noptr >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ::boost::is_pointer< Rhs_noref >::value && \ + (! \ + ( \ + ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value || \ + ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value || \ + ::boost::is_same< Lhs_noptr, Rhs_noptr >::value || \ + ::boost::is_void< Lhs_noptr >::value || \ ::boost::is_void< Rhs_noptr >::value\ - >::value\ - >::value\ - >::value\ - >::value + )\ + )\ + )\ + ) #include diff --git a/include/boost/type_traits/has_greater_equal.hpp b/include/boost/type_traits/has_greater_equal.hpp index 681685a..a933a6b 100644 --- a/include/boost/type_traits/has_greater_equal.hpp +++ b/include/boost/type_traits/has_greater_equal.hpp @@ -12,32 +12,32 @@ #define BOOST_TT_TRAIT_NAME has_greater_equal #define BOOST_TT_TRAIT_OP >= #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==pointer and Rhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_fundamental< Rhs_nocv >::value\ - >::value,\ + ) || \ /* Rhs==pointer and Lhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ ::boost::is_fundamental< Lhs_nocv >::value\ - >::value,\ + ) || \ /* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::type_traits::ice_not<\ - ::boost::type_traits::ice_or<\ - ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value,\ - ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value,\ - ::boost::is_same< Lhs_noptr, Rhs_noptr >::value,\ - ::boost::is_void< Lhs_noptr >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ::boost::is_pointer< Rhs_noref >::value && \ + (! \ + ( \ + ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value || \ + ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value || \ + ::boost::is_same< Lhs_noptr, Rhs_noptr >::value || \ + ::boost::is_void< Lhs_noptr >::value || \ ::boost::is_void< Rhs_noptr >::value\ - >::value\ - >::value\ - >::value\ - >::value + )\ + )\ + )\ + ) #include diff --git a/include/boost/type_traits/has_left_shift.hpp b/include/boost/type_traits/has_left_shift.hpp index 88205d9..e95c12a 100644 --- a/include/boost/type_traits/has_left_shift.hpp +++ b/include/boost/type_traits/has_left_shift.hpp @@ -12,32 +12,32 @@ #define BOOST_TT_TRAIT_NAME has_left_shift #define BOOST_TT_TRAIT_OP << #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\ - ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ - >::value\ - >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ + ( \ + (! ::boost::is_integral< Lhs_noref >::value ) || \ + (! ::boost::is_integral< Rhs_noref >::value )\ + )\ + )||\ /* Lhs==fundamental and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + )||\ /* Rhs==fundamental and Lhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Rhs_nocv >::value && \ ::boost::is_pointer< Lhs_noref >::value\ - >::value,\ + )||\ /* Lhs==pointer and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value\ - >::value + )\ + ) #include diff --git a/include/boost/type_traits/has_left_shift_assign.hpp b/include/boost/type_traits/has_left_shift_assign.hpp index 0b3b9b1..74e0df9 100644 --- a/include/boost/type_traits/has_left_shift_assign.hpp +++ b/include/boost/type_traits/has_left_shift_assign.hpp @@ -12,38 +12,38 @@ #define BOOST_TT_TRAIT_NAME has_left_shift_assign #define BOOST_TT_TRAIT_OP <<= #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\ - ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ - >::value\ - >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ + ( \ + (! ::boost::is_integral< Lhs_noref >::value ) || \ + (! ::boost::is_integral< Rhs_noref >::value )\ + )\ + )||\ /* Lhs==fundamental and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + )||\ /* Rhs==fundamental and Lhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Rhs_nocv >::value && \ ::boost::is_pointer< Lhs_noref >::value\ - >::value,\ + )||\ /* Lhs==pointer and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + )||\ /* Lhs==fundamental and Rhs==fundamental and Lhs==const */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ ::boost::is_const< Lhs_noref >::value\ - >::value\ - >::value + )\ + ) #include diff --git a/include/boost/type_traits/has_less.hpp b/include/boost/type_traits/has_less.hpp index e1a045e..0eefcd2 100644 --- a/include/boost/type_traits/has_less.hpp +++ b/include/boost/type_traits/has_less.hpp @@ -12,32 +12,32 @@ #define BOOST_TT_TRAIT_NAME has_less #define BOOST_TT_TRAIT_OP < #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==pointer and Rhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_fundamental< Rhs_nocv >::value\ - >::value,\ + ) || \ /* Rhs==pointer and Lhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ ::boost::is_fundamental< Lhs_nocv >::value\ - >::value,\ + ) || \ /* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::type_traits::ice_not<\ - ::boost::type_traits::ice_or<\ - ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value,\ - ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value,\ - ::boost::is_same< Lhs_noptr, Rhs_noptr >::value,\ - ::boost::is_void< Lhs_noptr >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ::boost::is_pointer< Rhs_noref >::value && \ + (! \ + ( \ + ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value || \ + ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value || \ + ::boost::is_same< Lhs_noptr, Rhs_noptr >::value || \ + ::boost::is_void< Lhs_noptr >::value || \ ::boost::is_void< Rhs_noptr >::value\ - >::value\ - >::value\ - >::value\ - >::value + )\ + )\ + )\ + ) #include diff --git a/include/boost/type_traits/has_less_equal.hpp b/include/boost/type_traits/has_less_equal.hpp index c633b8b..4725bbd 100644 --- a/include/boost/type_traits/has_less_equal.hpp +++ b/include/boost/type_traits/has_less_equal.hpp @@ -12,32 +12,32 @@ #define BOOST_TT_TRAIT_NAME has_less_equal #define BOOST_TT_TRAIT_OP <= #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==pointer and Rhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_fundamental< Rhs_nocv >::value\ - >::value,\ + ) || \ /* Rhs==pointer and Lhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ ::boost::is_fundamental< Lhs_nocv >::value\ - >::value,\ + ) || \ /* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::type_traits::ice_not<\ - ::boost::type_traits::ice_or<\ - ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value,\ - ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value,\ - ::boost::is_same< Lhs_noptr, Rhs_noptr >::value,\ - ::boost::is_void< Lhs_noptr >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ::boost::is_pointer< Rhs_noref >::value && \ + (! \ + ( \ + ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value || \ + ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value || \ + ::boost::is_same< Lhs_noptr, Rhs_noptr >::value || \ + ::boost::is_void< Lhs_noptr >::value || \ ::boost::is_void< Rhs_noptr >::value\ - >::value\ - >::value\ - >::value\ - >::value + )\ + )\ + )\ + ) #include diff --git a/include/boost/type_traits/has_logical_and.hpp b/include/boost/type_traits/has_logical_and.hpp index 5bfa1c3..3bb1733 100644 --- a/include/boost/type_traits/has_logical_and.hpp +++ b/include/boost/type_traits/has_logical_and.hpp @@ -13,22 +13,22 @@ #define BOOST_TT_TRAIT_OP && #define BOOST_TT_FORBIDDEN_IF\ /* pointer with fundamental non convertible to bool */\ - ::boost::type_traits::ice_or<\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ - ::boost::type_traits::ice_not< ::boost::is_convertible< Rhs_nocv, bool >::value >::value\ - >::value\ - >::value,\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::type_traits::ice_not< ::boost::is_convertible< Lhs_nocv, bool >::value >::value\ - >::value\ - >::value\ - >::value + (\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ( \ + ::boost::is_fundamental< Rhs_nocv >::value && \ + (! ::boost::is_convertible< Rhs_nocv, bool >::value )\ + )\ + )||\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ + ( \ + ::boost::is_fundamental< Lhs_nocv >::value && \ + (! ::boost::is_convertible< Lhs_nocv, bool >::value )\ + )\ + )\ + ) #include diff --git a/include/boost/type_traits/has_logical_or.hpp b/include/boost/type_traits/has_logical_or.hpp index a4ae6c5..a188726 100644 --- a/include/boost/type_traits/has_logical_or.hpp +++ b/include/boost/type_traits/has_logical_or.hpp @@ -13,22 +13,22 @@ #define BOOST_TT_TRAIT_OP || #define BOOST_TT_FORBIDDEN_IF\ /* pointer with fundamental non convertible to bool */\ - ::boost::type_traits::ice_or<\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ - ::boost::type_traits::ice_not< ::boost::is_convertible< Rhs_nocv, bool >::value >::value\ - >::value\ - >::value,\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::type_traits::ice_not< ::boost::is_convertible< Lhs_nocv, bool >::value >::value\ - >::value\ - >::value\ - >::value + (\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + (\ + ::boost::is_fundamental< Rhs_nocv >::value && \ + (! ::boost::is_convertible< Rhs_nocv, bool >::value )\ + )\ + )||\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + (! ::boost::is_convertible< Lhs_nocv, bool >::value )\ + )\ + )\ + ) #include diff --git a/include/boost/type_traits/has_minus.hpp b/include/boost/type_traits/has_minus.hpp index cc1d06b..5e13c16 100644 --- a/include/boost/type_traits/has_minus.hpp +++ b/include/boost/type_traits/has_minus.hpp @@ -12,43 +12,43 @@ #define BOOST_TT_TRAIT_NAME has_minus #define BOOST_TT_TRAIT_OP - #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==pointer and Rhs==fundamental and Rhs!=integral */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ - ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ - >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ + (! ::boost::is_integral< Rhs_noref >::value )\ + ) || \ /* Lhs==void* and (Rhs==fundamental or Rhs==pointer) */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::is_void< Lhs_noptr >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ::boost::is_void< Lhs_noptr >::value && \ + ( \ + ::boost::is_fundamental< Rhs_nocv >::value || \ ::boost::is_pointer< Rhs_noref >::value\ - >::value\ - >::value,\ + )\ + ) || \ /* Rhs==void* and (Lhs==fundamental or Lhs==pointer) */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::is_void< Rhs_noptr >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ + ::boost::is_void< Rhs_noptr >::value && \ + (\ + ::boost::is_fundamental< Lhs_nocv >::value || \ ::boost::is_pointer< Lhs_noref >::value\ - >::value\ - >::value,\ + )\ + ) ||\ /* Lhs=fundamental and Rhs=pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + ) ||\ /* two different pointers */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::type_traits::ice_not< ::boost::is_same< Lhs_nocv, Rhs_nocv >::value >::value\ - >::value\ - >::value + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ::boost::is_pointer< Rhs_noref >::value && \ + (! ::boost::is_same< Lhs_nocv, Rhs_nocv >::value )\ + )\ + ) #include diff --git a/include/boost/type_traits/has_minus_assign.hpp b/include/boost/type_traits/has_minus_assign.hpp index 84ba359..b53474e 100644 --- a/include/boost/type_traits/has_minus_assign.hpp +++ b/include/boost/type_traits/has_minus_assign.hpp @@ -12,48 +12,48 @@ #define BOOST_TT_TRAIT_NAME has_minus_assign #define BOOST_TT_TRAIT_OP -= #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==pointer and Rhs==fundamental and Rhs!=integral */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ - ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ - >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ + (! ::boost::is_integral< Rhs_noref >::value )\ + ) || \ /* Lhs==void* and Rhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::is_void< Lhs_noptr >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ::boost::is_void< Lhs_noptr >::value && \ ::boost::is_fundamental< Rhs_nocv >::value\ - >::value,\ + ) || \ /* Rhs==void* and Lhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::is_void< Rhs_noptr >::value,\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ + ::boost::is_void< Rhs_noptr >::value && \ ::boost::is_fundamental< Lhs_nocv >::value\ - >::value,\ + ) || \ /* Lhs=fundamental and Rhs=pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + ) || \ /* Lhs==pointer and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + ) || \ /* (Lhs==fundamental or Lhs==pointer) and (Rhs==fundamental or Rhs==pointer) and (Lhs==const) */\ - ::boost::type_traits::ice_and<\ - ::boost::type_traits::ice_or<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value || \ ::boost::is_pointer< Lhs_noref >::value\ - >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + ) && \ + (\ + ::boost::is_fundamental< Rhs_nocv >::value || \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + ) && \ ::boost::is_const< Lhs_noref >::value\ - >::value\ - >::value + )\ + ) #include diff --git a/include/boost/type_traits/has_modulus.hpp b/include/boost/type_traits/has_modulus.hpp index 6948728..24a815f 100644 --- a/include/boost/type_traits/has_modulus.hpp +++ b/include/boost/type_traits/has_modulus.hpp @@ -12,32 +12,32 @@ #define BOOST_TT_TRAIT_NAME has_modulus #define BOOST_TT_TRAIT_OP % #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\ - ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ - >::value\ - >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ + (\ + (! ::boost::is_integral< Lhs_noref >::value ) || \ + (! ::boost::is_integral< Rhs_noref >::value )\ + )\ + )||\ /* Lhs==fundamental and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + )||\ /* Rhs==fundamental and Lhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Rhs_nocv >::value && \ ::boost::is_pointer< Lhs_noref >::value\ - >::value,\ + )||\ /* Lhs==pointer and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value\ - >::value + )\ + ) #include diff --git a/include/boost/type_traits/has_modulus_assign.hpp b/include/boost/type_traits/has_modulus_assign.hpp index f0531f0..5e3e83f 100644 --- a/include/boost/type_traits/has_modulus_assign.hpp +++ b/include/boost/type_traits/has_modulus_assign.hpp @@ -12,38 +12,38 @@ #define BOOST_TT_TRAIT_NAME has_modulus_assign #define BOOST_TT_TRAIT_OP %= #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\ - ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ - >::value\ - >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ + ( \ + (! ::boost::is_integral< Lhs_noref >::value ) || \ + (! ::boost::is_integral< Rhs_noref >::value )\ + )\ + )||\ /* Lhs==fundamental and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + )||\ /* Rhs==fundamental and Lhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Rhs_nocv >::value && \ ::boost::is_pointer< Lhs_noref >::value\ - >::value,\ + )||\ /* Lhs==pointer and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + )||\ /* Lhs==fundamental and Rhs==fundamental and Lhs==const */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ ::boost::is_const< Lhs_noref >::value\ - >::value\ - >::value + )\ + ) #include diff --git a/include/boost/type_traits/has_multiplies.hpp b/include/boost/type_traits/has_multiplies.hpp index 4b578c5..591a0ce 100644 --- a/include/boost/type_traits/has_multiplies.hpp +++ b/include/boost/type_traits/has_multiplies.hpp @@ -13,22 +13,22 @@ #define BOOST_TT_TRAIT_OP * #define BOOST_TT_FORBIDDEN_IF\ /* pointer with pointer or fundamental */\ - ::boost::type_traits::ice_or<\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + (\ + ::boost::is_fundamental< Rhs_nocv >::value || \ ::boost::is_pointer< Rhs_noref >::value\ - >::value\ - >::value,\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + )\ + )||\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ + (\ + ::boost::is_fundamental< Lhs_nocv >::value || \ ::boost::is_pointer< Lhs_noref >::value\ - >::value\ - >::value\ - >::value + )\ + )\ + ) #include diff --git a/include/boost/type_traits/has_multiplies_assign.hpp b/include/boost/type_traits/has_multiplies_assign.hpp index 1678b7b..b24f879 100644 --- a/include/boost/type_traits/has_multiplies_assign.hpp +++ b/include/boost/type_traits/has_multiplies_assign.hpp @@ -12,30 +12,30 @@ #define BOOST_TT_TRAIT_NAME has_multiplies_assign #define BOOST_TT_TRAIT_OP *= #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==fundamental and Lhs==const and Rhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_const< Lhs_noref >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_const< Lhs_noref >::value && \ ::boost::is_fundamental< Rhs_nocv >::value\ - >::value,\ + ) || \ /* Lhs==pointer and (Rhs==fundamental or Rhs==pointer) */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ( \ + ::boost::is_fundamental< Rhs_nocv >::value || \ ::boost::is_pointer< Rhs_noref >::value\ - >::value\ - >::value,\ + )\ + )||\ /* Rhs==pointer and (Lhs==fundamental or Lhs==pointer) */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ + ( \ + ::boost::is_fundamental< Lhs_nocv >::value || \ ::boost::is_pointer< Lhs_noref >::value\ - >::value\ - >::value\ - >::value + )\ + )\ + ) #include diff --git a/include/boost/type_traits/has_new_operator.hpp b/include/boost/type_traits/has_new_operator.hpp index c615127..4def872 100644 --- a/include/boost/type_traits/has_new_operator.hpp +++ b/include/boost/type_traits/has_new_operator.hpp @@ -11,12 +11,9 @@ #include // std::nothrow_t #include // std::size_t -#include +#include #include -#include - -// should be the last #include -#include +#include #if defined(new) # if BOOST_WORKAROUND(BOOST_MSVC, >= 1310) @@ -129,19 +126,17 @@ namespace detail { #endif #endif BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_or< - (s1 == sizeof(type_traits::yes_type)), - (s2 == sizeof(type_traits::yes_type)), - (s3 == sizeof(type_traits::yes_type)), - (s4 == sizeof(type_traits::yes_type)), - (s5 == sizeof(type_traits::yes_type)), + (s1 == sizeof(type_traits::yes_type)) || + (s2 == sizeof(type_traits::yes_type)) || + (s3 == sizeof(type_traits::yes_type)) || + (s4 == sizeof(type_traits::yes_type)) || + (s5 == sizeof(type_traits::yes_type)) || (s6 == sizeof(type_traits::yes_type)) - >::value) ); }; } // namespace detail -BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_new_operator,T,::boost::detail::has_new_operator_impl::value) +template struct has_new_operator : public integral_constant::value>{}; } // namespace boost @@ -149,6 +144,4 @@ BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_new_operator,T,::boost::detail::has_new_operato # pragma pop_macro("new") #endif -#include - #endif // BOOST_TT_HAS_NEW_OPERATOR_HPP_INCLUDED diff --git a/include/boost/type_traits/has_not_equal_to.hpp b/include/boost/type_traits/has_not_equal_to.hpp index e7e3700..c2b6705 100644 --- a/include/boost/type_traits/has_not_equal_to.hpp +++ b/include/boost/type_traits/has_not_equal_to.hpp @@ -12,32 +12,32 @@ #define BOOST_TT_TRAIT_NAME has_not_equal_to #define BOOST_TT_TRAIT_OP != #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==pointer and Rhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_fundamental< Rhs_nocv >::value\ - >::value,\ + ) || \ /* Rhs==pointer and Lhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ ::boost::is_fundamental< Lhs_nocv >::value\ - >::value,\ + ) || \ /* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::type_traits::ice_not<\ - ::boost::type_traits::ice_or<\ - ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value,\ - ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value,\ - ::boost::is_same< Lhs_noptr, Rhs_noptr >::value,\ - ::boost::is_void< Lhs_noptr >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ::boost::is_pointer< Rhs_noref >::value && \ + (! \ + (\ + ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value || \ + ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value || \ + ::boost::is_same< Lhs_noptr, Rhs_noptr >::value || \ + ::boost::is_void< Lhs_noptr >::value || \ ::boost::is_void< Rhs_noptr >::value\ - >::value\ - >::value\ - >::value\ - >::value + )\ + )\ + )\ + ) #include diff --git a/include/boost/type_traits/has_nothrow_assign.hpp b/include/boost/type_traits/has_nothrow_assign.hpp index 83e5968..a7312a1 100644 --- a/include/boost/type_traits/has_nothrow_assign.hpp +++ b/include/boost/type_traits/has_nothrow_assign.hpp @@ -9,36 +9,75 @@ #ifndef BOOST_TT_HAS_NOTHROW_ASSIGN_HPP_INCLUDED #define BOOST_TT_HAS_NOTHROW_ASSIGN_HPP_INCLUDED -#include +#include +#include -// should be the last #include -#include +#if !defined(BOOST_HAS_NOTHROW_ASSIGN) || defined(BOOST_MSVC) || defined(BOOST_INTEL) +#include +#if !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) +#include +#include +#include +#include +#include +#include +#include +#endif +#endif +#if defined(__GNUC__) || defined(__SUNPRO_CC) +#include +#include +#include +#include +#ifdef BOOST_INTEL +#include +#endif +#endif namespace boost { -namespace detail{ +#if !defined(BOOST_HAS_NOTHROW_ASSIGN) && !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) + + namespace detail + { + template struct has_nothrow_assign_imp{ static const bool value = false; }; + template struct has_nothrow_assign_imp{ static const bool value = noexcept(boost::declval::type>() = boost::declval::type>()); }; + template struct has_nothrow_assign_imp{ static const bool value = has_nothrow_assign_imp::value; }; + template struct has_nothrow_assign_imp{ static const bool value = has_nothrow_assign_imp::value; }; + } -template -struct has_nothrow_assign_imp{ -#ifndef BOOST_HAS_NOTHROW_ASSIGN - BOOST_STATIC_CONSTANT(bool, value = ::boost::has_trivial_assign::value); -#else - BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_NOTHROW_ASSIGN(T)); #endif -}; -} + template + struct has_nothrow_assign : public integral_constant < bool, +#ifndef BOOST_HAS_NOTHROW_ASSIGN +#if !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) + // Portable C++11 version: + detail::has_nothrow_assign_imp::type>::value || is_volatile::type>::value || is_reference::value), + is_assignable::type, typename add_reference::type>::value + >::value +#else + ::boost::has_trivial_assign::value +#endif +#else + BOOST_HAS_NOTHROW_ASSIGN(T) +#endif + > {}; -BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_assign,T,::boost::detail::has_nothrow_assign_imp::value) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_assign,void,false) +template struct has_nothrow_assign : public has_nothrow_assign {}; +template <> struct has_nothrow_assign : public false_type{}; +template struct has_nothrow_assign : public false_type{}; +template struct has_nothrow_assign : public false_type{}; +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) +template struct has_nothrow_assign : public false_type{}; +#endif #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_assign,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_assign,void const volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_assign,void volatile,false) +template <> struct has_nothrow_assign : public false_type{}; +template <> struct has_nothrow_assign : public false_type{}; +template <> struct has_nothrow_assign : public false_type{}; #endif } // namespace boost -#include - #endif // BOOST_TT_HAS_NOTHROW_ASSIGN_HPP_INCLUDED diff --git a/include/boost/type_traits/has_nothrow_constructor.hpp b/include/boost/type_traits/has_nothrow_constructor.hpp index 3bc4f80..e5af89f 100644 --- a/include/boost/type_traits/has_nothrow_constructor.hpp +++ b/include/boost/type_traits/has_nothrow_constructor.hpp @@ -9,45 +9,64 @@ #ifndef BOOST_TT_HAS_NOTHROW_CONSTRUCTOR_HPP_INCLUDED #define BOOST_TT_HAS_NOTHROW_CONSTRUCTOR_HPP_INCLUDED -#include +#include +#include -// should be the last #include -#include +#ifdef BOOST_HAS_NOTHROW_CONSTRUCTOR + +#if defined(BOOST_MSVC) || defined(BOOST_INTEL) +#include +#endif +#if defined(__GNUC__ ) || defined(__SUNPRO_CC) +#include +#endif namespace boost { -namespace detail{ +template struct has_nothrow_constructor : public integral_constant{}; -template -struct has_nothrow_constructor_imp{ -#ifdef BOOST_HAS_NOTHROW_CONSTRUCTOR - BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_NOTHROW_CONSTRUCTOR(T)); -#else - BOOST_STATIC_CONSTANT(bool, value = ::boost::has_trivial_constructor::value); +#elif !defined(BOOST_NO_CXX11_NOEXCEPT) + +#include +#include + +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable:4197) // top-level volatile in cast is ignored #endif -}; +namespace boost { namespace detail{ + + template struct has_nothrow_constructor_imp : public boost::integral_constant{}; + template struct has_nothrow_constructor_imp : public boost::integral_constant{}; + template struct has_nothrow_constructor_imp : public has_nothrow_constructor_imp {}; } -BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_constructor,T,::boost::detail::has_nothrow_constructor_imp::value) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_default_constructor,T,::boost::detail::has_nothrow_constructor_imp::value) +template struct has_nothrow_constructor : public detail::has_nothrow_constructor_imp::value>{}; -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_constructor,void,false) -#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_constructor,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_constructor,void const volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_constructor,void volatile,false) +#ifdef BOOST_MSVC +#pragma warning(pop) #endif -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_default_constructor,void,false) -#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_default_constructor,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_default_constructor,void const volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_default_constructor,void volatile,false) +#else + +#include + +namespace boost { + +template struct has_nothrow_constructor : public ::boost::has_trivial_constructor {}; + #endif +template<> struct has_nothrow_constructor : public false_type {}; +#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS +template<> struct has_nothrow_constructor : public false_type{}; +template<> struct has_nothrow_constructor : public false_type{}; +template<> struct has_nothrow_constructor : public false_type{}; +#endif + +template struct has_nothrow_default_constructor : public has_nothrow_constructor{}; + } // namespace boost -#include - #endif // BOOST_TT_HAS_NOTHROW_CONSTRUCTOR_HPP_INCLUDED diff --git a/include/boost/type_traits/has_nothrow_copy.hpp b/include/boost/type_traits/has_nothrow_copy.hpp index 9c3c903..8b92e43 100644 --- a/include/boost/type_traits/has_nothrow_copy.hpp +++ b/include/boost/type_traits/has_nothrow_copy.hpp @@ -9,45 +9,70 @@ #ifndef BOOST_TT_HAS_NOTHROW_COPY_HPP_INCLUDED #define BOOST_TT_HAS_NOTHROW_COPY_HPP_INCLUDED -#include +#include +#include -// should be the last #include -#include +#ifdef BOOST_HAS_NOTHROW_COPY + +#if defined(BOOST_CLANG) || defined(__GNUC__) || defined(__ghs__) || defined(__CODEGEARC__) || defined(__SUNPRO_CC) +#include +#include +#include +#include +#ifdef BOOST_INTEL +#include +#endif +#elif defined(BOOST_MSVC) || defined(BOOST_INTEL) +#include +#include +#endif namespace boost { +template struct has_nothrow_copy_constructor : public integral_constant{}; + +#elif !defined(BOOST_NO_CXX11_NOEXCEPT) + +#include +#include + +namespace boost{ + namespace detail{ +template +struct has_nothrow_copy_constructor_imp : public boost::integral_constant{}; template -struct has_nothrow_copy_imp{ -#ifdef BOOST_HAS_NOTHROW_COPY - BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_NOTHROW_COPY(T)); -#else - BOOST_STATIC_CONSTANT(bool, value = ::boost::has_trivial_copy::value); -#endif -}; +struct has_nothrow_copy_constructor_imp : public boost::integral_constant()))>{}; } -BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_copy,T,::boost::detail::has_nothrow_copy_imp::value) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_copy_constructor,T,::boost::detail::has_nothrow_copy_imp::value) +template struct has_nothrow_copy_constructor : public detail::has_nothrow_copy_constructor_imp::value>{}; + +#else + +#include + +namespace boost{ + +template struct has_nothrow_copy_constructor : public integral_constant::value>{}; -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy,void,false) -#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy,void const volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy,void volatile,false) #endif -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy_constructor,void,false) -#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy_constructor,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy_constructor,void const volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy_constructor,void volatile,false) +template <> struct has_nothrow_copy_constructor : public false_type{}; +template struct has_nothrow_copy_constructor : public false_type{}; +template struct has_nothrow_copy_constructor : public false_type{}; +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) +template struct has_nothrow_copy_constructor : public false_type{}; #endif +#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS +template <> struct has_nothrow_copy_constructor : public false_type{}; +template <> struct has_nothrow_copy_constructor : public false_type{}; +template <> struct has_nothrow_copy_constructor : public false_type{}; +#endif + +template struct has_nothrow_copy : public has_nothrow_copy_constructor{}; } // namespace boost -#include - #endif // BOOST_TT_HAS_NOTHROW_COPY_HPP_INCLUDED diff --git a/include/boost/type_traits/has_nothrow_destructor.hpp b/include/boost/type_traits/has_nothrow_destructor.hpp index 4f5882a..273eb9f 100644 --- a/include/boost/type_traits/has_nothrow_destructor.hpp +++ b/include/boost/type_traits/has_nothrow_destructor.hpp @@ -11,15 +11,37 @@ #include -// should be the last #include -#include +#if !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(__SUNPRO_CC) && !defined(BOOST_MSVC) + +#include +#include + +namespace boost{ + + namespace detail{ + + template + struct has_nothrow_destructor_imp : public boost::integral_constant{}; + template + struct has_nothrow_destructor_imp : public boost::integral_constant()->~T())>{}; + + } + + template struct has_nothrow_destructor : public detail::has_nothrow_destructor_imp::value>{}; + template struct has_nothrow_destructor : public has_nothrow_destructor{}; + template struct has_nothrow_destructor : public integral_constant{}; +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) + template struct has_nothrow_destructor : public integral_constant{}; +#endif +} +#else namespace boost { -BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_destructor,T,::boost::has_trivial_destructor::value) +template struct has_nothrow_destructor : public ::boost::has_trivial_destructor {}; } // namespace boost -#include +#endif #endif // BOOST_TT_HAS_NOTHROW_DESTRUCTOR_HPP_INCLUDED diff --git a/include/boost/type_traits/has_plus.hpp b/include/boost/type_traits/has_plus.hpp index 70c1200..2d79328 100644 --- a/include/boost/type_traits/has_plus.hpp +++ b/include/boost/type_traits/has_plus.hpp @@ -12,37 +12,37 @@ #define BOOST_TT_TRAIT_NAME has_plus #define BOOST_TT_TRAIT_OP + #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==pointer and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + ) || \ /* Lhs==void* and Rhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::is_void< Lhs_noptr >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ::boost::is_void< Lhs_noptr >::value && \ ::boost::is_fundamental< Rhs_nocv >::value\ - >::value,\ + ) || \ /* Rhs==void* and Lhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::is_void< Rhs_noptr >::value,\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ + ::boost::is_void< Rhs_noptr >::value && \ ::boost::is_fundamental< Lhs_nocv >::value\ - >::value,\ + ) || \ /* Lhs==pointer and Rhs==fundamental and Rhs!=integral */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ - ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ - >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ + (! ::boost::is_integral< Rhs_noref >::value )\ + ) || \ /* Rhs==pointer and Lhs==fundamental and Lhs!=integral */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value\ - >::value\ - >::value + (\ + ::boost::is_pointer< Rhs_noref >::value && \ + ::boost::is_fundamental< Lhs_nocv >::value && \ + (! ::boost::is_integral< Lhs_noref >::value )\ + )\ + ) #include diff --git a/include/boost/type_traits/has_plus_assign.hpp b/include/boost/type_traits/has_plus_assign.hpp index 6d65204..5ef6f23 100644 --- a/include/boost/type_traits/has_plus_assign.hpp +++ b/include/boost/type_traits/has_plus_assign.hpp @@ -12,49 +12,49 @@ #define BOOST_TT_TRAIT_NAME has_plus_assign #define BOOST_TT_TRAIT_OP += #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==pointer and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + ) || \ /* Lhs==void* and Rhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::is_void< Lhs_noptr >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ::boost::is_void< Lhs_noptr >::value && \ ::boost::is_fundamental< Rhs_nocv >::value\ - >::value,\ + ) || \ /* Rhs==void* and Lhs==fundamental */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::is_void< Rhs_noptr >::value,\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ + ::boost::is_void< Rhs_noptr >::value && \ ::boost::is_fundamental< Lhs_nocv >::value\ - >::value,\ + ) || \ /* Lhs==pointer and Rhs==fundamental and Rhs!=integral */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ - ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ - >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ + (! ::boost::is_integral< Rhs_noref >::value )\ + ) || \ /* Rhs==pointer and Lhs==fundamental and Lhs!=bool */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::type_traits::ice_not< ::boost::is_same< Lhs_nocv, bool >::value >::value\ - >::value,\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ + ::boost::is_fundamental< Lhs_nocv >::value && \ + (! ::boost::is_same< Lhs_nocv, bool >::value )\ + ) || \ /* (Lhs==fundamental or Lhs==pointer) and (Rhs==fundamental or Rhs==pointer) and (Lhs==const) */\ - ::boost::type_traits::ice_and<\ - ::boost::type_traits::ice_or<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value || \ ::boost::is_pointer< Lhs_noref >::value\ - >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + ) && \ + ( \ + ::boost::is_fundamental< Rhs_nocv >::value || \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + ) && \ ::boost::is_const< Lhs_noref >::value\ - >::value\ - >::value + )\ + ) #include diff --git a/include/boost/type_traits/has_post_decrement.hpp b/include/boost/type_traits/has_post_decrement.hpp index 024acb0..e3f98ff 100644 --- a/include/boost/type_traits/has_post_decrement.hpp +++ b/include/boost/type_traits/has_post_decrement.hpp @@ -14,25 +14,25 @@ #define BOOST_TT_TRAIT_NAME has_post_decrement #define BOOST_TT_TRAIT_OP -- #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* bool */\ - ::boost::is_same< bool, Lhs_nocv >::value,\ + ::boost::is_same< bool, Lhs_nocv >::value || \ /* void* */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_void< Lhs_noptr >::value\ - >::value,\ + ) || \ /* (fundamental or pointer) and const */\ - ::boost::type_traits::ice_and<\ - ::boost::type_traits::ice_or<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ( \ + ::boost::is_fundamental< Lhs_nocv >::value || \ ::boost::is_pointer< Lhs_noref >::value\ - >::value,\ + ) && \ ::boost::is_const< Lhs_noref >::value\ - >::value,\ + )||\ /* Arrays */ \ ::boost::is_array::value\ - >::value + ) #include diff --git a/include/boost/type_traits/has_post_increment.hpp b/include/boost/type_traits/has_post_increment.hpp index b055607..3861a2b 100644 --- a/include/boost/type_traits/has_post_increment.hpp +++ b/include/boost/type_traits/has_post_increment.hpp @@ -14,25 +14,25 @@ #define BOOST_TT_TRAIT_NAME has_post_increment #define BOOST_TT_TRAIT_OP ++ #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* bool */\ - ::boost::is_same< bool, Lhs_nocv >::value,\ + ::boost::is_same< bool, Lhs_nocv >::value || \ /* void* */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_void< Lhs_noptr >::value\ - >::value,\ + ) || \ /* (fundamental or pointer) and const */\ - ::boost::type_traits::ice_and<\ - ::boost::type_traits::ice_or<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ( \ + ::boost::is_fundamental< Lhs_nocv >::value || \ ::boost::is_pointer< Lhs_noref >::value\ - >::value,\ + ) && \ ::boost::is_const< Lhs_noref >::value\ - >::value,\ + )||\ /* Arrays */ \ ::boost::is_array::value\ - >::value + ) #include diff --git a/include/boost/type_traits/has_pre_decrement.hpp b/include/boost/type_traits/has_pre_decrement.hpp index feb3d9d..7ef0783 100644 --- a/include/boost/type_traits/has_pre_decrement.hpp +++ b/include/boost/type_traits/has_pre_decrement.hpp @@ -14,25 +14,25 @@ #define BOOST_TT_TRAIT_NAME has_pre_decrement #define BOOST_TT_TRAIT_OP -- #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* bool */\ - ::boost::is_same< bool, Rhs_nocv >::value,\ + ::boost::is_same< bool, Rhs_nocv >::value || \ /* void* */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ ::boost::is_void< Rhs_noptr >::value\ - >::value,\ + ) || \ /* (fundamental or pointer) and const */\ - ::boost::type_traits::ice_and<\ - ::boost::type_traits::ice_or<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ( \ + ::boost::is_fundamental< Rhs_nocv >::value || \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + ) && \ ::boost::is_const< Rhs_noref >::value\ - >::value,\ + )||\ /* Arrays */ \ ::boost::is_array::value\ - >::value + ) #include diff --git a/include/boost/type_traits/has_pre_increment.hpp b/include/boost/type_traits/has_pre_increment.hpp index 6a2411d..c4c9734 100644 --- a/include/boost/type_traits/has_pre_increment.hpp +++ b/include/boost/type_traits/has_pre_increment.hpp @@ -14,25 +14,25 @@ #define BOOST_TT_TRAIT_NAME has_pre_increment #define BOOST_TT_TRAIT_OP ++ #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* bool */\ - ::boost::is_same< bool, Rhs_nocv >::value,\ + ::boost::is_same< bool, Rhs_nocv >::value || \ /* void* */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Rhs_noref >::value,\ + (\ + ::boost::is_pointer< Rhs_noref >::value && \ ::boost::is_void< Rhs_noptr >::value\ - >::value,\ + ) || \ /* (fundamental or pointer) and const */\ - ::boost::type_traits::ice_and<\ - ::boost::type_traits::ice_or<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ( \ + ::boost::is_fundamental< Rhs_nocv >::value || \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + ) && \ ::boost::is_const< Rhs_noref >::value\ - >::value,\ + )||\ /* Arrays */ \ ::boost::is_array::value\ - >::value + ) #include diff --git a/include/boost/type_traits/has_right_shift.hpp b/include/boost/type_traits/has_right_shift.hpp index 5735870..5562911 100644 --- a/include/boost/type_traits/has_right_shift.hpp +++ b/include/boost/type_traits/has_right_shift.hpp @@ -12,32 +12,32 @@ #define BOOST_TT_TRAIT_NAME has_right_shift #define BOOST_TT_TRAIT_OP >> #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\ - ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ - >::value\ - >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ + ( \ + (! ::boost::is_integral< Lhs_noref >::value ) || \ + (! ::boost::is_integral< Rhs_noref >::value )\ + )\ + )||\ /* Lhs==fundamental and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + )||\ /* Rhs==fundamental and Lhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Rhs_nocv >::value && \ ::boost::is_pointer< Lhs_noref >::value\ - >::value,\ + )||\ /* Lhs==pointer and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value\ - >::value + )\ + ) #include diff --git a/include/boost/type_traits/has_right_shift_assign.hpp b/include/boost/type_traits/has_right_shift_assign.hpp index 0536e71..0e2c263 100644 --- a/include/boost/type_traits/has_right_shift_assign.hpp +++ b/include/boost/type_traits/has_right_shift_assign.hpp @@ -12,38 +12,38 @@ #define BOOST_TT_TRAIT_NAME has_right_shift_assign #define BOOST_TT_TRAIT_OP >>= #define BOOST_TT_FORBIDDEN_IF\ - ::boost::type_traits::ice_or<\ + (\ /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ - ::boost::type_traits::ice_or<\ - ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\ - ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ - >::value\ - >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ + ( \ + (! ::boost::is_integral< Lhs_noref >::value ) || \ + (! ::boost::is_integral< Rhs_noref >::value )\ + )\ + )||\ /* Lhs==fundamental and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + )||\ /* Rhs==fundamental and Lhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Rhs_nocv >::value && \ ::boost::is_pointer< Lhs_noref >::value\ - >::value,\ + )||\ /* Lhs==pointer and Rhs==pointer */\ - ::boost::type_traits::ice_and<\ - ::boost::is_pointer< Lhs_noref >::value,\ + (\ + ::boost::is_pointer< Lhs_noref >::value && \ ::boost::is_pointer< Rhs_noref >::value\ - >::value,\ + )||\ /* Lhs==fundamental and Rhs==fundamental and Lhs==const */\ - ::boost::type_traits::ice_and<\ - ::boost::is_fundamental< Lhs_nocv >::value,\ - ::boost::is_fundamental< Rhs_nocv >::value,\ + (\ + ::boost::is_fundamental< Lhs_nocv >::value && \ + ::boost::is_fundamental< Rhs_nocv >::value && \ ::boost::is_const< Lhs_noref >::value\ - >::value\ - >::value + )\ + ) #include diff --git a/include/boost/type_traits/has_trivial_assign.hpp b/include/boost/type_traits/has_trivial_assign.hpp index 404b62c..a5e625d 100644 --- a/include/boost/type_traits/has_trivial_assign.hpp +++ b/include/boost/type_traits/has_trivial_assign.hpp @@ -9,49 +9,43 @@ #ifndef BOOST_TT_HAS_TRIVIAL_ASSIGN_HPP_INCLUDED #define BOOST_TT_HAS_TRIVIAL_ASSIGN_HPP_INCLUDED -#include +#include #include +#include + +#if !defined(BOOST_HAS_TRIVIAL_ASSIGN) || defined(BOOST_MSVC) || defined(__GNUC__) || defined(BOOST_INTEL) || defined(__SUNPRO_CC) || defined(__clang) #include #include #include -#include -#include -#include - -// should be the last #include -#include +#include +#endif namespace boost { -namespace detail { - -template -struct has_trivial_assign_impl -{ + template + struct has_trivial_assign : public integral_constant < bool, #ifdef BOOST_HAS_TRIVIAL_ASSIGN - BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_TRIVIAL_ASSIGN(T)); + BOOST_HAS_TRIVIAL_ASSIGN(T) #else - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_and< - ::boost::is_pod::value, - ::boost::type_traits::ice_not< ::boost::is_const::value >::value, - ::boost::type_traits::ice_not< ::boost::is_volatile::value >::value - >::value)); + ::boost::is_pod::value && !::boost::is_const::value && !::boost::is_volatile::value #endif -}; + > {}; -} // namespace detail - -BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_assign,T,::boost::detail::has_trivial_assign_impl::value) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_assign,void,false) + template<> struct has_trivial_assign : public false_type{}; #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_assign,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_assign,void const volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_assign,void volatile,false) + template<> struct has_trivial_assign : public false_type{}; + template<> struct has_trivial_assign : public false_type{}; + template<> struct has_trivial_assign : public false_type{}; #endif + template struct has_trivial_assign : public false_type{}; + template struct has_trivial_assign : public false_type{}; +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) + template struct has_trivial_assign : public false_type{}; +#endif + // Arrays are not explictly assignable: + template struct has_trivial_assign : public false_type{}; + template struct has_trivial_assign : public false_type{}; } // namespace boost -#include - #endif // BOOST_TT_HAS_TRIVIAL_ASSIGN_HPP_INCLUDED diff --git a/include/boost/type_traits/has_trivial_constructor.hpp b/include/boost/type_traits/has_trivial_constructor.hpp index 30dbdd8..06c137d 100644 --- a/include/boost/type_traits/has_trivial_constructor.hpp +++ b/include/boost/type_traits/has_trivial_constructor.hpp @@ -9,43 +9,49 @@ #ifndef BOOST_TT_HAS_TRIVIAL_CONSTRUCTOR_HPP_INCLUDED #define BOOST_TT_HAS_TRIVIAL_CONSTRUCTOR_HPP_INCLUDED -#include #include #include -#include +#include -// should be the last #include -#include +#ifdef BOOST_HAS_TRIVIAL_CONSTRUCTOR +#ifdef BOOST_HAS_SGI_TYPE_TRAITS +#include +#elif defined(__GNUC__) || defined(__SUNPRO_CC) +#include +#ifdef BOOST_INTEL +#include +#endif +#endif +#endif + + +#if (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 409)) || defined(BOOST_CLANG) || (defined(__SUNPRO_CC) && defined(BOOST_HAS_TRIVIAL_CONSTRUCTOR)) +#include +#define BOOST_TT_TRIVIAL_CONSTRUCT_FIX && is_default_constructible::value +#else +// +// Mot all compilers, particularly older GCC versions can handle the fix above. +#define BOOST_TT_TRIVIAL_CONSTRUCT_FIX +#endif namespace boost { -namespace detail { - -template -struct has_trivial_ctor_impl -{ +template struct has_trivial_constructor #ifdef BOOST_HAS_TRIVIAL_CONSTRUCTOR - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_or< - ::boost::is_pod::value, - BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) - >::value)); + : public integral_constant ::value || BOOST_HAS_TRIVIAL_CONSTRUCTOR(T)) BOOST_TT_TRIVIAL_CONSTRUCT_FIX)>{}; #else - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_or< - ::boost::is_pod::value, - false - >::value)); + : public integral_constant ::value>{}; #endif -}; -} // namespace detail +template <> struct has_trivial_constructor : public boost::false_type{}; +template <> struct has_trivial_constructor : public boost::false_type{}; +template <> struct has_trivial_constructor : public boost::false_type{}; +template <> struct has_trivial_constructor : public boost::false_type{}; -BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_constructor,T,::boost::detail::has_trivial_ctor_impl::value) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_default_constructor,T,::boost::detail::has_trivial_ctor_impl::value) +template struct has_trivial_default_constructor : public has_trivial_constructor {}; + +#undef BOOST_TT_TRIVIAL_CONSTRUCT_FIX } // namespace boost -#include - #endif // BOOST_TT_HAS_TRIVIAL_CONSTRUCTOR_HPP_INCLUDED diff --git a/include/boost/type_traits/has_trivial_copy.hpp b/include/boost/type_traits/has_trivial_copy.hpp index 1c567cf..26819b9 100644 --- a/include/boost/type_traits/has_trivial_copy.hpp +++ b/include/boost/type_traits/has_trivial_copy.hpp @@ -9,74 +9,49 @@ #ifndef BOOST_TT_HAS_TRIVIAL_COPY_HPP_INCLUDED #define BOOST_TT_HAS_TRIVIAL_COPY_HPP_INCLUDED -#include #include -#include #include -#include -#include -#include +#include -#ifdef __clang__ +#if (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 409)) || defined(BOOST_CLANG) || (defined(__SUNPRO_CC) && defined(BOOST_HAS_TRIVIAL_COPY)) #include +#define BOOST_TT_TRIVIAL_CONSTRUCT_FIX && is_copy_constructible::value +#else +#define BOOST_TT_TRIVIAL_CONSTRUCT_FIX #endif -// should be the last #include -#include - namespace boost { -namespace detail { - -template -struct has_trivial_copy_impl -{ +template struct has_trivial_copy +: public integral_constant::value); -# else - BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_TRIVIAL_COPY(T)); -# endif + BOOST_HAS_TRIVIAL_COPY(T) BOOST_TT_TRIVIAL_CONSTRUCT_FIX #else - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_and< - ::boost::is_pod::value, - ::boost::type_traits::ice_not< ::boost::is_volatile::value >::value - >::value)); + ::boost::is_pod::value #endif -}; +>{}; +// Arrays are not explicitly copyable: +template struct has_trivial_copy : public false_type{}; +template struct has_trivial_copy : public false_type{}; +// Are volatile types ever trivial? We don't really know, so assume not: +template struct has_trivial_copy : public false_type{}; -#ifdef __clang__ - -template -struct has_trivial_copy_impl -{ - static const bool value = has_trivial_copy_impl::value; -}; - -#endif - -} // namespace detail - -BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_copy,T,::boost::detail::has_trivial_copy_impl::value) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_copy_constructor,T,::boost::detail::has_trivial_copy_impl::value) - -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy,void,false) +template <> struct has_trivial_copy : public false_type{}; #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy,void const volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy,void volatile,false) +template <> struct has_trivial_copy : public false_type{}; +template <> struct has_trivial_copy : public false_type{}; +template <> struct has_trivial_copy : public false_type{}; #endif -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy_constructor,void,false) -#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy_constructor,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy_constructor,void const volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy_constructor,void volatile,false) +template struct has_trivial_copy : public false_type{}; +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) +template struct has_trivial_copy : public false_type{}; #endif +template struct has_trivial_copy_constructor : public has_trivial_copy{}; + +#undef BOOST_TT_TRIVIAL_CONSTRUCT_FIX + } // namespace boost -#include - #endif // BOOST_TT_HAS_TRIVIAL_COPY_HPP_INCLUDED diff --git a/include/boost/type_traits/has_trivial_destructor.hpp b/include/boost/type_traits/has_trivial_destructor.hpp index 79d7522..763283d 100644 --- a/include/boost/type_traits/has_trivial_destructor.hpp +++ b/include/boost/type_traits/has_trivial_destructor.hpp @@ -9,41 +9,40 @@ #ifndef BOOST_TT_HAS_TRIVIAL_DESTRUCTOR_HPP_INCLUDED #define BOOST_TT_HAS_TRIVIAL_DESTRUCTOR_HPP_INCLUDED -#include #include -#include -#include +#include -// should be the last #include -#include +#ifdef BOOST_HAS_TRIVIAL_DESTRUCTOR + +#if defined(BOOST_INTEL) || defined(BOOST_MSVC) +#include +#endif +#ifdef BOOST_HAS_SGI_TYPE_TRAITS +#include +#endif + +#if defined(__GNUC__) || defined(__clang) || defined(__SUNPRO_CC) +#include +#endif namespace boost { -namespace detail { - -template -struct has_trivial_dtor_impl -{ -#ifdef BOOST_HAS_TRIVIAL_DESTRUCTOR - BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_TRIVIAL_DESTRUCTOR(T)); +template struct has_trivial_destructor : public integral_constant{}; #else - BOOST_STATIC_CONSTANT(bool, value = ::boost::is_pod::value); +#include + +namespace boost{ + +template struct has_trivial_destructor : public integral_constant::value>{}; #endif -}; -} // namespace detail - -BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_destructor,T,::boost::detail::has_trivial_dtor_impl::value) - -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_destructor,void,false) +template <> struct has_trivial_destructor : public false_type{}; #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_destructor,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_destructor,void const volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_destructor,void volatile,false) +template <> struct has_trivial_destructor : public false_type{}; +template <> struct has_trivial_destructor : public false_type{}; +template <> struct has_trivial_destructor : public false_type{}; #endif } // namespace boost -#include - #endif // BOOST_TT_HAS_TRIVIAL_DESTRUCTOR_HPP_INCLUDED diff --git a/include/boost/type_traits/has_trivial_move_assign.hpp b/include/boost/type_traits/has_trivial_move_assign.hpp index db337f7..f7bb198 100644 --- a/include/boost/type_traits/has_trivial_move_assign.hpp +++ b/include/boost/type_traits/has_trivial_move_assign.hpp @@ -11,47 +11,62 @@ #ifndef BOOST_TT_HAS_TRIVIAL_MOVE_ASSIGN_HPP_INCLUDED #define BOOST_TT_HAS_TRIVIAL_MOVE_ASSIGN_HPP_INCLUDED -#include +#include +#include + +#if !defined(BOOST_HAS_TRIVIAL_MOVE_ASSIGN) || defined(BOOST_MSVC) || defined(BOOST_INTEL) #include #include #include -#include -#include +#ifdef BOOST_MSVC +#include +#endif +#endif -// should be the last #include -#include +#if defined(__GNUC__) || defined(__clang) +#include +#include +#endif -namespace boost { +#ifdef __SUNPRO_CC +#include +#include +#if __cplusplus >= 201103 +#define SOLARIS_EXTRA_CHECK && is_assignable::type&, typename remove_const::type&&>::value +#endif +#endif -namespace detail { +#ifndef SOLARIS_EXTRA_CHECK +#define SOLARIS_EXTRA_CHECK +#endif + +namespace boost{ template -struct has_trivial_move_assign_impl -{ +struct has_trivial_move_assign : public integral_constant::value, - ::boost::type_traits::ice_not< ::boost::is_const::value >::value, - ::boost::type_traits::ice_not< ::boost::is_volatile::value >::value - >::value)); + ::boost::is_pod::value && !::boost::is_const::value && !::boost::is_volatile::value SOLARIS_EXTRA_CHECK #endif -}; + > {}; -} // namespace detail - -BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_move_assign,T,::boost::detail::has_trivial_move_assign_impl::value) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_assign,void,false) +template <> struct has_trivial_move_assign : public false_type{}; #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_assign,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_assign,void const volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_assign,void volatile,false) +template <> struct has_trivial_move_assign : public false_type{}; +template <> struct has_trivial_move_assign : public false_type{}; +template <> struct has_trivial_move_assign : public false_type{}; #endif +template struct has_trivial_move_assign : public false_type{}; +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES +template struct has_trivial_move_assign : public false_type{}; +#endif +// Array types are not assignable: +template struct has_trivial_move_assign : public false_type{}; +template struct has_trivial_move_assign : public false_type{}; } // namespace boost -#include +#undef SOLARIS_EXTRA_CHECK #endif // BOOST_TT_HAS_TRIVIAL_MOVE_ASSIGN_HPP_INCLUDED diff --git a/include/boost/type_traits/has_trivial_move_constructor.hpp b/include/boost/type_traits/has_trivial_move_constructor.hpp index a341834..9e601f3 100644 --- a/include/boost/type_traits/has_trivial_move_constructor.hpp +++ b/include/boost/type_traits/has_trivial_move_constructor.hpp @@ -11,47 +11,67 @@ #ifndef BOOST_TT_HAS_TRIVIAL_MOVE_CONSTRUCTOR_HPP_INCLUDED #define BOOST_TT_HAS_TRIVIAL_MOVE_CONSTRUCTOR_HPP_INCLUDED -#include #include +#include + +#ifdef BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR + +#if defined(BOOST_MSVC) || defined(BOOST_INTEL) #include #include -#include -#include +#endif + +#if defined(__GNUC__) || defined(__clang) +#include +#include +#endif -// should be the last #include -#include namespace boost { -namespace detail { +template struct has_trivial_move_constructor : public integral_constant{}; -template -struct has_trivial_move_ctor_impl -{ -#ifdef BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR - BOOST_STATIC_CONSTANT(bool, value = (BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T))); #else - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_and< - ::boost::is_pod::value, - ::boost::type_traits::ice_not< ::boost::is_volatile::value >::value - >::value)); + +#ifdef __SUNPRO_CC +#include +#include +#if __cplusplus >= 201103 +#define SOLARIS_EXTRA_CHECK && is_constructible::type, typename remove_const::type&&>::value +#endif #endif -}; -} // namespace detail +#ifndef SOLARIS_EXTRA_CHECK +#define SOLARIS_EXTRA_CHECK +#endif -BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_move_constructor,T,::boost::detail::has_trivial_move_ctor_impl::value) +#include +#include -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_constructor,void,false) +namespace boost { + +template struct has_trivial_move_constructor + : public integral_constant::value && !::boost::is_volatile::value SOLARIS_EXTRA_CHECK>{}; + +#undef SOLARIS_EXTRA_CHECK + +#endif + +template <> struct has_trivial_move_constructor : public false_type{}; #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_constructor,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_constructor,void const volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_move_constructor,void volatile,false) +template <> struct has_trivial_move_constructor : public false_type{}; +template <> struct has_trivial_move_constructor : public false_type{}; +template <> struct has_trivial_move_constructor : public false_type{}; #endif +// What should we do with reference types??? The standard seems to suggest these are trivial, even if the thing they reference is not: +template struct has_trivial_move_constructor : public true_type{}; +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES +template struct has_trivial_move_constructor : public true_type{}; +#endif +// Arrays can not be explicitly copied: +template struct has_trivial_move_constructor : public false_type{}; +template struct has_trivial_move_constructor : public false_type{}; } // namespace boost -#include - #endif // BOOST_TT_HAS_TRIVIAL_MOVE_CONSTRUCTOR_HPP_INCLUDED diff --git a/include/boost/type_traits/has_virtual_destructor.hpp b/include/boost/type_traits/has_virtual_destructor.hpp index b741197..4b0f383 100644 --- a/include/boost/type_traits/has_virtual_destructor.hpp +++ b/include/boost/type_traits/has_virtual_destructor.hpp @@ -11,19 +11,16 @@ #define BOOST_TT_HAS_VIRTUAL_DESTRUCTOR_HPP_INCLUDED #include -// should be the last #include -#include +#include namespace boost { #ifdef BOOST_HAS_VIRTUAL_DESTRUCTOR -BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_virtual_destructor,T,BOOST_HAS_VIRTUAL_DESTRUCTOR(T)) + template struct has_virtual_destructor : public integral_constant{}; #else -BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_virtual_destructor,T,false) + template struct has_virtual_destructor : public integral_constant{}; #endif } // namespace boost -#include - #endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED diff --git a/include/boost/type_traits/integral_constant.hpp b/include/boost/type_traits/integral_constant.hpp index c684771..dac784f 100644 --- a/include/boost/type_traits/integral_constant.hpp +++ b/include/boost/type_traits/integral_constant.hpp @@ -1,4 +1,4 @@ -// (C) Copyright John Maddock 2005. +// (C) Copyright John Maddock 2015. // 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) @@ -7,32 +7,98 @@ #define BOOST_TYPE_TRAITS_INTEGRAL_CONSTANT_HPP #include -#include -#include +#include + +#if (BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400)) \ + || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610)) \ + || BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840)) \ + || BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3202)) \ + || BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION, BOOST_TESTED_AT(810)) ) + + +namespace boost{ + namespace mpl + { + template struct bool_; + template struct integral_c; + struct integral_c_tag; + } +} + +#else + +namespace mpl_{ + + template struct bool_; + template struct integral_c; + struct integral_c_tag; +} + +namespace boost +{ + namespace mpl + { + using ::mpl_::bool_; + using ::mpl_::integral_c; + using ::mpl_::integral_c_tag; + } +} + +#endif namespace boost{ -#if defined(BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS) || defined(__BORLANDC__) -template -#else -template -#endif -struct integral_constant : public mpl::integral_c -{ - typedef integral_constant type; -}; + template + struct integral_constant + { + typedef mpl::integral_c_tag tag; + typedef T value_type; + typedef integral_constant type; + static const T value = val; + // + // This helper function is just to disable type-punning + // warnings from GCC: + // + template + static U& dereference(U* p) { return *p; } -template<> struct integral_constant : public mpl::true_ -{ - typedef integral_constant type; -}; -template<> struct integral_constant : public mpl::false_ -{ - typedef integral_constant type; -}; + operator const mpl::integral_c& ()const + { + static const char data[sizeof(long)] = { 0 }; + return dereference(reinterpret_cast*>(&data)); + } + BOOST_CONSTEXPR operator T()const { return val; } + }; -typedef integral_constant true_type; -typedef integral_constant false_type; + template + T const integral_constant::value; + + template + struct integral_constant + { + typedef mpl::integral_c_tag tag; + typedef integral_constant type; + static const bool value = val; + // + // This helper function is just to disable type-punning + // warnings from GCC: + // + template + static T& dereference(T* p) { return *p; } + + operator const mpl::bool_& ()const + { + static const char data = 0; + return dereference(reinterpret_cast*>(&data)); + } + BOOST_CONSTEXPR operator bool()const { return val; } + }; + + template + bool const integral_constant::value; + + typedef integral_constant true_type; + typedef integral_constant false_type; } diff --git a/include/boost/type_traits/integral_promotion.hpp b/include/boost/type_traits/integral_promotion.hpp index 9c5514b..0478f56 100644 --- a/include/boost/type_traits/integral_promotion.hpp +++ b/include/boost/type_traits/integral_promotion.hpp @@ -7,18 +7,12 @@ #define FILE_boost_type_traits_integral_promotion_hpp_INCLUDED #include - -#include -#include #include #include #include #include #include -// Should be the last #include -#include - namespace boost { namespace type_traits { namespace detail { @@ -168,27 +162,20 @@ struct integral_promotion_impl >::type type; }; -template -struct integral_promotion - : public boost::mpl::eval_if< - need_promotion::type> - , integral_promotion_impl - , boost::mpl::identity - > -{ -}; +template struct integral_promotion { typedef T type; }; +template struct integral_promotion : public integral_promotion_impl{}; } } -BOOST_TT_AUX_TYPE_TRAIT_DEF1( - integral_promotion - , T - , BOOST_DEDUCED_TYPENAME - boost::type_traits::detail::integral_promotion::type - ) -} +template struct integral_promotion +{ +private: + typedef boost::type_traits::detail::need_promotion::type> tag_type; +public: + typedef typename boost::type_traits::detail::integral_promotion::type type; +}; -#include +} #endif // #ifndef FILE_boost_type_traits_integral_promotion_hpp_INCLUDED diff --git a/include/boost/type_traits/intrinsics.hpp b/include/boost/type_traits/intrinsics.hpp index e8a87b0..14a3ee8 100644 --- a/include/boost/type_traits/intrinsics.hpp +++ b/include/boost/type_traits/intrinsics.hpp @@ -8,8 +8,10 @@ #ifndef BOOST_TT_INTRINSICS_HPP_INCLUDED #define BOOST_TT_INTRINSICS_HPP_INCLUDED +#ifndef BOOST_TT_DISABLE_INTRINSICS + #ifndef BOOST_TT_CONFIG_HPP_INCLUDED -#include +#include #endif // @@ -44,6 +46,9 @@ // BOOST_IS_ENUM(T) true is T is an enum // BOOST_IS_POLYMORPHIC(T) true if T is a polymorphic type // BOOST_ALIGNMENT_OF(T) should evaluate to the alignment requirements of type T. +// +// define BOOST_TT_DISABLE_INTRINSICS to prevent any intrinsics being used (mostly used when testing) +// #ifdef BOOST_HAS_SGI_TYPE_TRAITS // Hook into SGI's __type_traits class, this will pick up user supplied @@ -85,18 +90,20 @@ #if (defined(BOOST_MSVC) && defined(BOOST_MSVC_FULL_VER) && (BOOST_MSVC_FULL_VER >=140050215))\ || (defined(BOOST_INTEL) && defined(_MSC_VER) && (_MSC_VER >= 1500)) -# include -# include - +// +// Note that even though these intrinsics rely on other type traits classes +// we do not #include those here as it produces cyclic dependencies and +// can cause the intrinsics to not even be used at all! +// # define BOOST_IS_UNION(T) __is_union(T) # define BOOST_IS_POD(T) (__is_pod(T) && __has_trivial_constructor(T)) # define BOOST_IS_EMPTY(T) __is_empty(T) # define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) __has_trivial_constructor(T) -# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T)|| ( ::boost::is_pod::value && !::boost::is_volatile::value)) +# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) || ::boost::is_pod::value) # define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) || ( ::boost::is_pod::value && ! ::boost::is_const::value && !::boost::is_volatile::value)) # define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T) || ::boost::is_pod::value) # define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_constructor(T) || ::boost::has_trivial_constructor::value) -# define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy(T) || ::boost::has_trivial_copy::value) +# define BOOST_HAS_NOTHROW_COPY(T) ((__has_nothrow_copy(T) || ::boost::has_trivial_copy::value) && !is_array::value) # define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) || ::boost::has_trivial_assign::value) # define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T) @@ -105,15 +112,18 @@ # define BOOST_IS_CLASS(T) __is_class(T) # define BOOST_IS_CONVERTIBLE(T,U) ((__is_convertible_to(T,U) || (is_same::value && !is_function::value)) && !__is_abstract(U)) # define BOOST_IS_ENUM(T) __is_enum(T) -// This one doesn't quite always do the right thing: -// # define BOOST_IS_POLYMORPHIC(T) __is_polymorphic(T) // This one fails if the default alignment has been changed with /Zp: // # define BOOST_ALIGNMENT_OF(T) __alignof(T) # if defined(_MSC_VER) && (_MSC_VER >= 1700) -# define BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T) ((__has_trivial_move_constructor(T) || __is_pod(T)) && !::boost::is_volatile::value && !::boost::is_reference::value) -# define BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T) ((__has_trivial_move_assign(T) || __is_pod(T)) && ! ::boost::is_const::value && !::boost::is_volatile::value && !::boost::is_reference::value) +# define BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T) ((__has_trivial_move_constructor(T) || boost::is_pod::value) && ! ::boost::is_volatile::value && ! ::boost::is_reference::value) +# define BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T) ((__has_trivial_move_assign(T) || boost::is_pod::value) && ! ::boost::is_const::value && !::boost::is_volatile::value && ! ::boost::is_reference::value) # endif +#ifndef BOOST_NO_CXX11_FINAL +// This one doesn't quite always do the right thing on older VC++ versions +// we really need it when the final keyword is supporyted though: +# define BOOST_IS_POLYMORPHIC(T) __is_polymorphic(T) +#endif #if _MSC_FULL_VER >= 180020827 # define BOOST_IS_NOTHROW_MOVE_ASSIGN(T) (__is_nothrow_assignable(T&, T&&)) # define BOOST_IS_NOTHROW_MOVE_CONSTRUCT(T) (__is_nothrow_constructible(T, T&&)) @@ -144,10 +154,12 @@ // This is a rubbish fix as it basically stops type traits from working correctly, // but maybe the best we can do for now. See https://svn.boost.org/trac/boost/ticket/10694 // +// +// Note that even though these intrinsics rely on other type traits classes +// we do not #include those here as it produces cyclic dependencies and +// can cause the intrinsics to not even be used at all! +// # include -# include -# include -# include # if __has_feature(is_union) # define BOOST_IS_UNION(T) __is_union(T) @@ -162,22 +174,22 @@ # 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::value && !is_volatile::value) +# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) && !is_reference::value) # endif # if __has_feature(has_trivial_assign) -# define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && !is_volatile::value) +# define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && !is_volatile::value && is_assignable::value) # endif # if __has_feature(has_trivial_destructor) -# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T) +# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T) && is_destructible::value) # endif # if __has_feature(has_nothrow_constructor) -# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) __has_nothrow_constructor(T) +# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_constructor(T) && is_default_constructible::value) # endif # if __has_feature(has_nothrow_copy) -# define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy(T) && !is_volatile::value && !is_reference::value) +# define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy(T) && !is_volatile::value && !is_reference::value && is_copy_constructible::value) # endif # if __has_feature(has_nothrow_assign) -# define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) && !is_volatile::value) +# define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) && !is_volatile::value && is_assignable::value) # endif # if __has_feature(has_virtual_destructor) # define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T) @@ -201,12 +213,17 @@ # define BOOST_IS_POLYMORPHIC(T) __is_polymorphic(T) # endif # if __has_feature(has_trivial_move_constructor) -# define BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T) __has_trivial_move_constructor(T) +# define BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T) (__has_trivial_move_constructor(T) && is_constructible::value && !::boost::is_volatile::value) # endif # if __has_feature(has_trivial_move_assign) -# define BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T) __has_trivial_move_assign(T) +# define BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T) (__has_trivial_move_assign(T) && is_assignable::value && !::boost::is_volatile::value) +# endif +# if (!defined(unix) && !defined(__unix__)) || defined(__LP64__) || !defined(__GNUC__) +// GCC sometimes lies about alignment requirements +// of type double on 32-bit unix platforms, use the +// old implementation instead in that case: +# define BOOST_ALIGNMENT_OF(T) __alignof(T) # endif -# define BOOST_ALIGNMENT_OF(T) __alignof(T) # if __has_feature(is_final) # define BOOST_IS_FINAL(T) __is_final(T) # endif @@ -215,9 +232,11 @@ #endif #if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3) && !defined(__GCCXML__))) && !defined(BOOST_CLANG) -# include -# include -# include +// +// Note that even though these intrinsics rely on other type traits classes +// we do not #include those here as it produces cyclic dependencies and +// can cause the intrinsics to not even be used at all! +// #ifdef BOOST_INTEL # define BOOST_INTEL_TT_OPTS || is_pod::value @@ -229,12 +248,20 @@ # define BOOST_IS_POD(T) __is_pod(T) # define BOOST_IS_EMPTY(T) __is_empty(T) # define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) ((__has_trivial_constructor(T) BOOST_INTEL_TT_OPTS) && ! ::boost::is_volatile::value) -# define BOOST_HAS_TRIVIAL_COPY(T) ((__has_trivial_copy(T) BOOST_INTEL_TT_OPTS) && !is_reference::value && ! ::boost::is_volatile::value) +# define BOOST_HAS_TRIVIAL_COPY(T) ((__has_trivial_copy(T) BOOST_INTEL_TT_OPTS) && !is_reference::value) +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409 +# define BOOST_HAS_TRIVIAL_ASSIGN(T) ((__has_trivial_assign(T) BOOST_INTEL_TT_OPTS) && ! ::boost::is_volatile::value && ! ::boost::is_const::value && is_assignable::value) +# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T) BOOST_INTEL_TT_OPTS && is_destructible::value) +# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_constructor(T) && is_default_constructible::value BOOST_INTEL_TT_OPTS) +# define BOOST_HAS_NOTHROW_COPY(T) ((__has_nothrow_copy(T) BOOST_INTEL_TT_OPTS) && !is_volatile::value && !is_reference::value && is_copy_constructible::value) +# define BOOST_HAS_NOTHROW_ASSIGN(T) ((__has_nothrow_assign(T) BOOST_INTEL_TT_OPTS) && !is_volatile::value && !is_const::value && is_assignable::value) +#else # define BOOST_HAS_TRIVIAL_ASSIGN(T) ((__has_trivial_assign(T) BOOST_INTEL_TT_OPTS) && ! ::boost::is_volatile::value && ! ::boost::is_const::value) # define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T) BOOST_INTEL_TT_OPTS) # define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_constructor(T) BOOST_INTEL_TT_OPTS) -# define BOOST_HAS_NOTHROW_COPY(T) ((__has_nothrow_copy(T) BOOST_INTEL_TT_OPTS) && !is_volatile::value && !is_reference::value) -# define BOOST_HAS_NOTHROW_ASSIGN(T) ((__has_nothrow_assign(T) BOOST_INTEL_TT_OPTS) && !is_volatile::value && !is_const::value) +# define BOOST_HAS_NOTHROW_COPY(T) ((__has_nothrow_copy(T) BOOST_INTEL_TT_OPTS) && !is_volatile::value && !is_reference::value && !is_array::value) +# define BOOST_HAS_NOTHROW_ASSIGN(T) ((__has_nothrow_assign(T) BOOST_INTEL_TT_OPTS) && !is_volatile::value && !is_const::value && !is_array::value) +#endif # define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T) # define BOOST_IS_ABSTRACT(T) __is_abstract(T) @@ -252,24 +279,26 @@ # define BOOST_IS_FINAL(T) __is_final(T) # endif +# if (__GNUC__ >= 5) && (__cplusplus >= 201103) +# define BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T) (__is_trivially_assignable(T&, T&&) && is_assignable::value && !::boost::is_volatile::value) +# define BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T) (__is_trivially_constructible(T, T&&) && is_constructible::value && !::boost::is_volatile::value) +# endif + # define BOOST_HAS_TYPE_TRAITS_INTRINSICS #endif #if defined(__SUNPRO_CC) && (__SUNPRO_CC >= 0x5130) -# include -# include -# include - # define BOOST_IS_UNION(T) __oracle_is_union(T) -# define BOOST_IS_POD(T) __oracle_is_pod(T) +# define BOOST_IS_POD(T) (__oracle_is_pod(T) && !is_function::value) # define BOOST_IS_EMPTY(T) __oracle_is_empty(T) # define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) (__oracle_has_trivial_constructor(T) && ! ::boost::is_volatile::value) -# define BOOST_HAS_TRIVIAL_COPY(T) (__oracle_has_trivial_copy(T) && !is_reference::value && ! ::boost::is_volatile::value) -# define BOOST_HAS_TRIVIAL_ASSIGN(T) ((__oracle_has_trivial_assign(T) || __oracle_is_trivial(T)) && ! ::boost::is_volatile::value && ! ::boost::is_const::value) -# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) __oracle_has_trivial_destructor(T) -# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__oracle_has_nothrow_constructor(T) || __oracle_has_trivial_constructor(T) || __oracle_is_trivial(T)) -# define BOOST_HAS_NOTHROW_COPY(T) ((__oracle_has_nothrow_copy(T) || __oracle_has_trivial_copy(T) || __oracle_is_trivial(T)) && !is_volatile::value && !is_reference::value) -# define BOOST_HAS_NOTHROW_ASSIGN(T) ((__oracle_has_nothrow_assign(T) || __oracle_has_trivial_assign(T) || __oracle_is_trivial(T)) && !is_volatile::value && !is_const::value) +# define BOOST_HAS_TRIVIAL_COPY(T) (__oracle_has_trivial_copy(T) && !is_reference::value) +# define BOOST_HAS_TRIVIAL_ASSIGN(T) ((__oracle_has_trivial_assign(T) || __oracle_is_trivial(T)) && ! ::boost::is_volatile::value && ! ::boost::is_const::value && is_assignable::value) +# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__oracle_has_trivial_destructor(T) && is_destructible::value) +# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) ((__oracle_has_nothrow_constructor(T) || __oracle_has_trivial_constructor(T) || __oracle_is_trivial(T)) && is_default_constructible::value) +// __oracle_has_nothrow_copy appears to behave the same as __oracle_has_nothrow_assign, disabled for now: +//# define BOOST_HAS_NOTHROW_COPY(T) ((__oracle_has_nothrow_copy(T) || __oracle_has_trivial_copy(T) || __oracle_is_trivial(T)) && !is_volatile::value && !is_reference::value && is_copy_constructible::value) +# define BOOST_HAS_NOTHROW_ASSIGN(T) ((__oracle_has_nothrow_assign(T) || __oracle_has_trivial_assign(T) || __oracle_is_trivial(T)) && !is_volatile::value && !is_const::value && is_assignable::value) # define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __oracle_has_virtual_destructor(T) # define BOOST_IS_ABSTRACT(T) __oracle_is_abstract(T) @@ -292,7 +321,7 @@ # define BOOST_IS_POD(T) __is_pod(T) # define BOOST_IS_EMPTY(T) __is_empty(T) # define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) __has_trivial_constructor(T) -# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) && !is_reference::value && !is_volatile::value) +# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) && !is_reference::value) # define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && !is_volatile::value) # define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T) # define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) __has_nothrow_constructor(T) @@ -319,7 +348,7 @@ # define BOOST_IS_POD(T) __is_pod(T) # define BOOST_IS_EMPTY(T) __is_empty(T) # define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) (__has_trivial_default_constructor(T)) -# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy_constructor(T) && !is_volatile::value && !is_reference::value) +# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy_constructor(T) && !is_reference::value) # define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && !is_volatile::value) # define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T)) # define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_default_constructor(T)) @@ -338,11 +367,7 @@ # define BOOST_HAS_TYPE_TRAITS_INTRINSICS #endif +#endif // BOOST_TT_DISABLE_INTRINSICS + #endif // BOOST_TT_INTRINSICS_HPP_INCLUDED - - - - - - diff --git a/include/boost/type_traits/is_abstract.hpp b/include/boost/type_traits/is_abstract.hpp index f1cd92c..7715c5c 100644 --- a/include/boost/type_traits/is_abstract.hpp +++ b/include/boost/type_traits/is_abstract.hpp @@ -49,20 +49,18 @@ // #include +#include #ifndef BOOST_IS_ABSTRACT #include #include #include -#include #ifdef BOOST_NO_IS_ABSTRACT #include #endif #endif -// should be the last #include -#include - namespace boost { + namespace detail{ #ifdef BOOST_IS_ABSTRACT @@ -141,13 +139,11 @@ struct is_abstract_imp } #ifndef BOOST_NO_IS_ABSTRACT -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_abstract,T,::boost::detail::is_abstract_imp::value) +template struct is_abstract : public integral_constant::value> {}; #else -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_abstract,T,::boost::detail::is_polymorphic_imp::value) +template struct is_abstract : public integral_constant::value> {}; #endif } // namespace boost -#include - #endif //BOOST_TT_IS_ABSTRACT_CLASS_HPP diff --git a/include/boost/type_traits/is_arithmetic.hpp b/include/boost/type_traits/is_arithmetic.hpp index a1d8c46..c23811e 100644 --- a/include/boost/type_traits/is_arithmetic.hpp +++ b/include/boost/type_traits/is_arithmetic.hpp @@ -9,43 +9,14 @@ #ifndef BOOST_TT_IS_ARITHMETIC_HPP_INCLUDED #define BOOST_TT_IS_ARITHMETIC_HPP_INCLUDED -#if !defined( __CODEGEARC__ ) #include -#include -#include -#include -#endif - -// should be the last #include -#include +#include namespace boost { -#if !defined(__CODEGEARC__) -namespace detail { - -template< typename T > -struct is_arithmetic_impl -{ - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_or< - ::boost::is_integral::value, - ::boost::is_float::value - >::value)); -}; - -} // namespace detail -#endif - -//* is a type T an arithmetic type described in the standard (3.9.1p8) -#if defined(__CODEGEARC__) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_arithmetic,T,__is_arithmetic(T)) -#else -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_arithmetic,T,::boost::detail::is_arithmetic_impl::value) -#endif +template +struct is_arithmetic : public integral_constant::value || is_floating_point::value> {}; } // namespace boost -#include - #endif // BOOST_TT_IS_ARITHMETIC_HPP_INCLUDED diff --git a/include/boost/type_traits/is_array.hpp b/include/boost/type_traits/is_array.hpp index c381ca4..497dc49 100644 --- a/include/boost/type_traits/is_array.hpp +++ b/include/boost/type_traits/is_array.hpp @@ -14,30 +14,25 @@ #ifndef BOOST_TT_IS_ARRAY_HPP_INCLUDED #define BOOST_TT_IS_ARRAY_HPP_INCLUDED -#include - - +#include #include -// should be the last #include -#include - namespace boost { #if defined( __CODEGEARC__ ) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_array,T,__is_array(T)) + template struct is_array : public integral_constant {}; #else -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_array,T,false) + template struct is_array : public false_type {}; #if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,is_array,T[N],true) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,is_array,T const[N],true) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,is_array,T volatile[N],true) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,is_array,T const volatile[N],true) + template struct is_array : public true_type {}; + template struct is_array : public true_type{}; + template struct is_array : public true_type{}; + template struct is_array : public true_type{}; #if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840)) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_array,T[],true) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_array,T const[],true) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_array,T volatile[],true) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_array,T const volatile[],true) + template struct is_array : public true_type{}; + template struct is_array : public true_type{}; + template struct is_array : public true_type{}; + template struct is_array : public true_type{}; #endif #endif @@ -45,6 +40,4 @@ BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_array,T const volatile[],t } // namespace boost -#include - #endif // BOOST_TT_IS_ARRAY_HPP_INCLUDED diff --git a/include/boost/type_traits/is_assignable.hpp b/include/boost/type_traits/is_assignable.hpp new file mode 100644 index 0000000..9cf681d --- /dev/null +++ b/include/boost/type_traits/is_assignable.hpp @@ -0,0 +1,76 @@ + +// (C) Copyright John Maddock 2015. +// 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). +// +// See http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_IS_ASSIGNABLE_HPP_INCLUDED +#define BOOST_TT_IS_ASSIGNABLE_HPP_INCLUDED + +#include +#include + +namespace boost{ + + template struct is_assignable; + +} + +#if !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800) + +#include +#include + +namespace boost{ + + namespace detail{ + + struct is_assignable_imp + { + template() = boost::declval())> + static boost::type_traits::yes_type test(int); + + template + static boost::type_traits::no_type test(...); + }; + + } + + template struct is_assignable : public integral_constant(0)) == sizeof(boost::type_traits::yes_type)>{}; + template struct is_assignable : public is_assignable{}; + template struct is_assignable : public is_assignable{}; + template struct is_assignable : public is_assignable{}; + template struct is_assignable : public is_assignable{}; + template struct is_assignable : public integral_constant{}; + template struct is_assignable : public integral_constant{}; + template struct is_assignable : public integral_constant{}; + template struct is_assignable : public integral_constant{}; + +#else + +#include +#include + +namespace boost{ + + // We don't know how to implement this: + template struct is_assignable : public integral_constant{}; + template struct is_assignable : public integral_constant::value && is_pod::type>::value>{}; + template struct is_assignable : public integral_constant{}; + template struct is_assignable : public integral_constant{}; + template struct is_assignable : public integral_constant{}; + template struct is_assignable : public integral_constant{}; + template struct is_assignable : public integral_constant{}; + /* + template <> struct is_assignable : public integral_constant{}; + template <> struct is_assignable : public integral_constant{}; + template <> struct is_assignable : public integral_constant{}; + template <> struct is_assignable : public integral_constant{}; + */ +#endif + +} // namespace boost + +#endif // BOOST_TT_IS_ASSIGNABLE_HPP_INCLUDED diff --git a/include/boost/type_traits/is_base_and_derived.hpp b/include/boost/type_traits/is_base_and_derived.hpp index 632b699..ee3dce5 100644 --- a/include/boost/type_traits/is_base_and_derived.hpp +++ b/include/boost/type_traits/is_base_and_derived.hpp @@ -10,18 +10,16 @@ #define BOOST_TT_IS_BASE_AND_DERIVED_HPP_INCLUDED #include +#include #ifndef BOOST_IS_BASE_OF #include #include #include -#include #include #include #endif #include - -// should be the last #include -#include +#include namespace boost { @@ -230,23 +228,17 @@ struct is_base_and_derived_impl #endif } // namespace detail -BOOST_TT_AUX_BOOL_TRAIT_DEF2( - is_base_and_derived - , Base - , Derived - , (::boost::detail::is_base_and_derived_impl::value) - ) +template struct is_base_and_derived + : public integral_constant::value)> {}; -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_base_and_derived,Base&,Derived,false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_base_and_derived,Base,Derived&,false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_base_and_derived,Base&,Derived&,false) +template struct is_base_and_derived : public false_type{}; +template struct is_base_and_derived : public false_type{}; +template struct is_base_and_derived : public false_type{}; #if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x610)) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(typename Base,is_base_and_derived,Base,Base,false) +template struct is_base_and_derived : public true_type{}; #endif } // namespace boost -#include - #endif // BOOST_TT_IS_BASE_AND_DERIVED_HPP_INCLUDED diff --git a/include/boost/type_traits/is_base_of.hpp b/include/boost/type_traits/is_base_of.hpp index 3655b0b..89f2f67 100644 --- a/include/boost/type_traits/is_base_of.hpp +++ b/include/boost/type_traits/is_base_of.hpp @@ -12,11 +12,6 @@ #include #include #include -#include -#include - -// should be the last #include -#include namespace boost { @@ -26,24 +21,19 @@ namespace boost { { typedef typename remove_cv::type ncvB; typedef typename remove_cv::type ncvD; - BOOST_STATIC_CONSTANT(bool, value = (::boost::type_traits::ice_or< - (::boost::detail::is_base_and_derived_impl::value), - (::boost::type_traits::ice_and< ::boost::is_same::value, ::boost::is_class::value>::value)>::value)); + BOOST_STATIC_CONSTANT(bool, value = ( + (::boost::detail::is_base_and_derived_impl::value) || + (::boost::is_same::value && ::boost::is_class::value))); }; } -BOOST_TT_AUX_BOOL_TRAIT_DEF2( - is_base_of - , Base - , Derived - , (::boost::detail::is_base_of_imp::value)) + template struct is_base_of + : public integral_constant::value)> {}; -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_base_of,Base&,Derived,false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_base_of,Base,Derived&,false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_base_of,Base&,Derived&,false) + template struct is_base_of : false_type{}; + template struct is_base_of : false_type{}; + template struct is_base_of : false_type{}; } // namespace boost -#include - #endif // BOOST_TT_IS_BASE_AND_DERIVED_HPP_INCLUDED diff --git a/include/boost/type_traits/is_base_of_tr1.hpp b/include/boost/type_traits/is_base_of_tr1.hpp index 7264f15..210bf54 100644 --- a/include/boost/type_traits/is_base_of_tr1.hpp +++ b/include/boost/type_traits/is_base_of_tr1.hpp @@ -12,10 +12,6 @@ #include #include #include -#include - -// should be the last #include -#include namespace boost { namespace tr1{ @@ -25,24 +21,17 @@ namespace boost { namespace tr1{ { typedef typename remove_cv::type ncvB; typedef typename remove_cv::type ncvD; - BOOST_STATIC_CONSTANT(bool, value = (::boost::type_traits::ice_or< - (::boost::detail::is_base_and_derived_impl::value), - (::boost::is_same::value)>::value)); + BOOST_STATIC_CONSTANT(bool, value = ((::boost::detail::is_base_and_derived_impl::value) || (::boost::is_same::value))); }; } -BOOST_TT_AUX_BOOL_TRAIT_DEF2( - is_base_of - , Base - , Derived - , (::boost::tr1::detail::is_base_of_imp::value)) + template struct is_base_of + : public integral_constant::value)>{}; -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_base_of,Base&,Derived,false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_base_of,Base,Derived&,false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_base_of,Base&,Derived&,false) + template struct is_base_of : public false_type{}; + template struct is_base_of : public false_type{}; + template struct is_base_of : public false_type{}; } } // namespace boost -#include - #endif // BOOST_TT_IS_BASE_OF_TR1_HPP_INCLUDED diff --git a/include/boost/type_traits/is_class.hpp b/include/boost/type_traits/is_class.hpp index 0675b57..e3a22d2 100644 --- a/include/boost/type_traits/is_class.hpp +++ b/include/boost/type_traits/is_class.hpp @@ -10,12 +10,11 @@ #ifndef BOOST_TT_IS_CLASS_HPP_INCLUDED #define BOOST_TT_IS_CLASS_HPP_INCLUDED -#include +#include #include +#include #ifndef BOOST_IS_CLASS # include -# include -# include #ifdef BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION # include @@ -29,13 +28,6 @@ #endif // BOOST_IS_CLASS -#ifdef __EDG_VERSION__ -# include -#endif - -// should be the last #include -#include - namespace boost { namespace detail { @@ -63,10 +55,8 @@ struct is_class_impl { BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_and< - sizeof(is_class_tester(0)) == sizeof(::boost::type_traits::yes_type), - ::boost::type_traits::ice_not< ::boost::is_union::value >::value - >::value) + sizeof(is_class_tester(0)) == sizeof(::boost::type_traits::yes_type) + && ! ::boost::is_union::value ); }; @@ -79,10 +69,8 @@ struct is_class_impl template static ::boost::type_traits::no_type is_class_tester(...); BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_and< - sizeof(is_class_tester(0)) == sizeof(::boost::type_traits::yes_type), - ::boost::type_traits::ice_not< ::boost::is_union::value >::value - >::value) + sizeof(is_class_tester(0)) == sizeof(::boost::type_traits::yes_type) + && ! ::boost::is_union::value ); }; @@ -94,14 +82,13 @@ template struct is_class_impl { BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_and< - ::boost::type_traits::ice_not< ::boost::is_union::value >::value, - ::boost::type_traits::ice_not< ::boost::is_scalar::value >::value, - ::boost::type_traits::ice_not< ::boost::is_array::value >::value, - ::boost::type_traits::ice_not< ::boost::is_reference::value>::value, - ::boost::type_traits::ice_not< ::boost::is_void::value >::value, - ::boost::type_traits::ice_not< ::boost::is_function::value >::value - >::value)); + ! ::boost::is_union::value >::value + && ! ::boost::is_scalar::value + && ! ::boost::is_array::value + && ! ::boost::is_reference::value + && ! ::boost::is_void::value + && ! ::boost::is_function::value + ); }; # endif // BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION @@ -115,15 +102,13 @@ struct is_class_impl } // namespace detail +template struct is_class : public integral_constant::value> {}; # ifdef __EDG_VERSION__ -BOOST_TT_AUX_BOOL_TRAIT_DEF1( - is_class,T, boost::detail::is_class_impl::type>::value) -# else -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_class,T,::boost::detail::is_class_impl::value) +template struct is_class : public is_class{}; +template struct is_class : public is_class{}; +template struct is_class : public is_class{}; # endif } // namespace boost -#include - #endif // BOOST_TT_IS_CLASS_HPP_INCLUDED diff --git a/include/boost/type_traits/is_complex.hpp b/include/boost/type_traits/is_complex.hpp index 0813dac..08210eb 100644 --- a/include/boost/type_traits/is_complex.hpp +++ b/include/boost/type_traits/is_complex.hpp @@ -8,27 +8,14 @@ #ifndef BOOST_TT_IS_COMPLEX_HPP #define BOOST_TT_IS_COMPLEX_HPP -#include #include -// should be the last #include -#include - +#include namespace boost { -namespace detail{ -struct is_convertible_from_tester -{ - template - is_convertible_from_tester(const std::complex&); -}; - -} - -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_complex,T,(::boost::is_convertible::value)) + template struct is_complex : public false_type {}; + template struct is_complex > : public true_type{}; } // namespace boost -#include - #endif //BOOST_TT_IS_COMPLEX_HPP diff --git a/include/boost/type_traits/is_compound.hpp b/include/boost/type_traits/is_compound.hpp index bbaaa42..7995eb8 100644 --- a/include/boost/type_traits/is_compound.hpp +++ b/include/boost/type_traits/is_compound.hpp @@ -9,38 +9,16 @@ #ifndef BOOST_TT_IS_COMPOUND_HPP_INCLUDED #define BOOST_TT_IS_COMPOUND_HPP_INCLUDED -#include #include -#include - -// should be the last #include -#include namespace boost { -#if !defined( __CODEGEARC__ ) -namespace detail { - -template -struct is_compound_impl -{ - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_not< - ::boost::is_fundamental::value - >::value)); -}; - -} // namespace detail -#endif // !defined( __CODEGEARC__ ) - #if defined( __CODEGEARC__ ) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_compound,T,__is_compound(T)) + template struct is_compound : public integral_constant {}; #else -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_compound,T,::boost::detail::is_compound_impl::value) + template struct is_compound : public integral_constant::value> {}; #endif } // namespace boost -#include - #endif // BOOST_TT_IS_COMPOUND_HPP_INCLUDED diff --git a/include/boost/type_traits/is_const.hpp b/include/boost/type_traits/is_const.hpp index e3e62b6..d9dd2aa 100644 --- a/include/boost/type_traits/is_const.hpp +++ b/include/boost/type_traits/is_const.hpp @@ -21,70 +21,26 @@ #ifndef BOOST_TT_IS_CONST_HPP_INCLUDED #define BOOST_TT_IS_CONST_HPP_INCLUDED -#include -#include - -# include -# ifdef __GNUC__ -# include -# endif -# if BOOST_WORKAROUND(BOOST_MSVC, < 1400) -# include -# endif - -// should be the last #include -#include +#include namespace boost { #if defined( __CODEGEARC__ ) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_const,T,__is_const(T)) + template + struct is_const : public integral_constant {}; #else -namespace detail{ -// -// We can't filter out rvalue_references at the same level as -// references or we get ambiguities from msvc: -// -template -struct is_const_rvalue_filter -{ -#if BOOST_WORKAROUND(BOOST_MSVC, < 1400) - BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::cv_traits_imp::type*>::is_const); -#else - BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::cv_traits_imp::is_const); -#endif -}; -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES -template -struct is_const_rvalue_filter -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; -#endif -} - -//* is a type T declared const - is_const -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_const,T,::boost::detail::is_const_rvalue_filter::value) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_const,T&,false) - -#if defined(BOOST_ILLEGAL_CV_REFERENCES) -// these are illegal specialisations; cv-qualifies applied to -// references have no effect according to [8.3.2p1], -// C++ Builder requires them though as it treats cv-qualified -// references as distinct types... -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_const,T& const,false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_const,T& volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_const,T& const volatile,false) -#endif + template + struct is_const : public false_type {}; + template struct is_const : public true_type{}; + template struct is_const : public true_type{}; + template struct is_const : public true_type{}; #endif } // namespace boost -#include - #endif // BOOST_TT_IS_CONST_HPP_INCLUDED diff --git a/include/boost/type_traits/is_constructible.hpp b/include/boost/type_traits/is_constructible.hpp new file mode 100644 index 0000000..2017317 --- /dev/null +++ b/include/boost/type_traits/is_constructible.hpp @@ -0,0 +1,80 @@ + +// (C) Copyright John Maddock 2015. +// 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). +// +// See http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_IS_CONSTRUCTIBLE_HPP_INCLUDED +#define BOOST_TT_IS_CONSTRUCTIBLE_HPP_INCLUDED + +#include +#include + +#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800) && !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40500) + +#include +#include +#include +#include + +namespace boost{ + + namespace detail{ + + struct is_constructible_imp + { + template()...))> + static boost::type_traits::yes_type test(int); + template + static boost::type_traits::no_type test(...); + + template()))> + static boost::type_traits::yes_type test1(int); + template + static boost::type_traits::no_type test1(...); + + template + static boost::type_traits::yes_type ref_test(T); + template + static boost::type_traits::no_type ref_test(...); + }; + + } + + template struct is_constructible : public integral_constant(0)) == sizeof(boost::type_traits::yes_type)>{}; + template struct is_constructible : public integral_constant::value && sizeof(detail::is_constructible_imp::test1(0)) == sizeof(boost::type_traits::yes_type)>{}; + template struct is_constructible : public integral_constant(boost::declval())) == sizeof(boost::type_traits::yes_type)>{}; + template struct is_constructible : public integral_constant(boost::declval())) == sizeof(boost::type_traits::yes_type)>{}; + + template <> struct is_constructible : public false_type{}; + template <> struct is_constructible : public false_type{}; + template <> struct is_constructible : public false_type{}; + template <> struct is_constructible : public false_type{}; + + template struct is_constructible : public is_default_constructible{}; + +#else + +#include +#include + +namespace boost{ + + // We don't know how to implement this: + template struct is_constructible : public is_convertible{}; + template struct is_constructible : public is_default_constructible{}; + template <> struct is_constructible : public false_type{}; + template <> struct is_constructible : public false_type{}; + template <> struct is_constructible : public false_type{}; + template <> struct is_constructible : public false_type{}; + template struct is_constructible : public false_type{}; +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + template struct is_constructible : public false_type{}; +#endif +#endif + +} // namespace boost + +#endif // BOOST_TT_IS_CONSTRUCTIBLE_HPP_INCLUDED diff --git a/include/boost/type_traits/is_convertible.hpp b/include/boost/type_traits/is_convertible.hpp index a844cec..bc11a59 100644 --- a/include/boost/type_traits/is_convertible.hpp +++ b/include/boost/type_traits/is_convertible.hpp @@ -13,14 +13,14 @@ #define BOOST_TT_IS_CONVERTIBLE_HPP_INCLUDED #include +#include #ifndef BOOST_IS_CONVERTIBLE #include -#include +#include #include -#include #include #include -#ifndef BOOST_NO_IS_ABSTRACT +#if !defined(BOOST_NO_IS_ABSTRACT) #include #endif #include @@ -31,13 +31,13 @@ #include #endif #if !defined(BOOST_NO_SFINAE_EXPR) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) -# include +# include #endif +#elif defined(BOOST_MSVC) || defined(BOOST_INTEL) +#include +#include #endif // BOOST_IS_CONVERTIBLE -// should be always the last #include directive -#include - namespace boost { #ifndef BOOST_IS_CONVERTIBLE @@ -54,7 +54,7 @@ namespace boost { namespace detail { -#if !defined(BOOST_NO_SFINAE_EXPR) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) +#if !defined(BOOST_NO_SFINAE_EXPR) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !(defined(BOOST_GCC) && (BOOST_GCC < 40700)) // This is a C++11 conforming version, place this first and use it wherever possible: @@ -336,38 +336,15 @@ struct is_convertible_basic_impl template struct is_convertible_impl { - enum { value = - (::boost::type_traits::ice_and< - ::boost::type_traits::ice_or< - ::boost::detail::is_convertible_basic_impl::value, - ::boost::is_void::value - >::value, - ::boost::type_traits::ice_not< - ::boost::is_array::value - >::value, - ::boost::type_traits::ice_not< - ::boost::is_function::value - >::value - >::value) }; + enum { + value = ( ::boost::detail::is_convertible_basic_impl::value && ! ::boost::is_array::value && ! ::boost::is_function::value) + }; }; #elif !defined(__BORLANDC__) || __BORLANDC__ > 0x551 template struct is_convertible_impl { - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_and< - ::boost::type_traits::ice_or< - ::boost::detail::is_convertible_basic_impl::value, - ::boost::is_void::value - >::value, - ::boost::type_traits::ice_not< - ::boost::is_array::value - >::value, - ::boost::type_traits::ice_not< - ::boost::is_function::value - >::value - >::value) - ); + BOOST_STATIC_CONSTANT(bool, value = ( ::boost::detail::is_convertible_basic_impl::value && !::boost::is_array::value && !::boost::is_function::value)); }; #endif @@ -443,52 +420,55 @@ struct is_convertible_impl_dispatch // implementation above: // #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -# define TT_AUX_BOOL_CV_VOID_TRAIT_SPEC2_PART1(trait,spec1,spec2,value) \ - BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC2(trait,spec1,spec2,value) \ - BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC2(trait,spec1,spec2 const,value) \ - BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC2(trait,spec1,spec2 volatile,value) \ - BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC2(trait,spec1,spec2 const volatile,value) \ - /**/ -# define TT_AUX_BOOL_CV_VOID_TRAIT_SPEC2(trait,spec1,spec2,value) \ - TT_AUX_BOOL_CV_VOID_TRAIT_SPEC2_PART1(trait,spec1,spec2,value) \ - TT_AUX_BOOL_CV_VOID_TRAIT_SPEC2_PART1(trait,spec1 const,spec2,value) \ - TT_AUX_BOOL_CV_VOID_TRAIT_SPEC2_PART1(trait,spec1 volatile,spec2,value) \ - TT_AUX_BOOL_CV_VOID_TRAIT_SPEC2_PART1(trait,spec1 const volatile,spec2,value) \ - /**/ +template <> struct is_convertible_impl_dispatch : public true_type{}; +template <> struct is_convertible_impl_dispatch : public true_type{}; +template <> struct is_convertible_impl_dispatch : public true_type{}; +template <> struct is_convertible_impl_dispatch : public true_type{}; - TT_AUX_BOOL_CV_VOID_TRAIT_SPEC2(is_convertible,void,void,true) +template <> struct is_convertible_impl_dispatch : public true_type{}; +template <> struct is_convertible_impl_dispatch : public true_type{}; +template <> struct is_convertible_impl_dispatch : public true_type{}; +template <> struct is_convertible_impl_dispatch : public true_type{}; -# undef TT_AUX_BOOL_CV_VOID_TRAIT_SPEC2 -# undef TT_AUX_BOOL_CV_VOID_TRAIT_SPEC2_PART1 +template <> struct is_convertible_impl_dispatch : public true_type{}; +template <> struct is_convertible_impl_dispatch : public true_type{}; +template <> struct is_convertible_impl_dispatch : public true_type{}; +template <> struct is_convertible_impl_dispatch : public true_type{}; + +template <> struct is_convertible_impl_dispatch : public true_type{}; +template <> struct is_convertible_impl_dispatch : public true_type{}; +template <> struct is_convertible_impl_dispatch : public true_type{}; +template <> struct is_convertible_impl_dispatch : public true_type{}; #else - BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC2(is_convertible,void,void,true) +template <> struct is_convertible_impl_dispatch : public true_type{}; #endif // BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(typename To,is_convertible,void,To,false) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(typename From,is_convertible,From,void,false) +template struct is_convertible_impl_dispatch : public false_type{}; +template struct is_convertible_impl_dispatch : public false_type{}; + #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(typename To,is_convertible,void const,To,false) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(typename To,is_convertible,void volatile,To,false) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(typename To,is_convertible,void const volatile,To,false) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(typename From,is_convertible,From,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(typename From,is_convertible,From,void volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(typename From,is_convertible,From,void const volatile,false) +template struct is_convertible_impl_dispatch : public false_type{}; +template struct is_convertible_impl_dispatch : public false_type{}; +template struct is_convertible_impl_dispatch : public false_type{}; +template struct is_convertible_impl_dispatch : public false_type{}; +template struct is_convertible_impl_dispatch : public false_type{}; +template struct is_convertible_impl_dispatch : public false_type{}; #endif } // namespace detail -BOOST_TT_AUX_BOOL_TRAIT_DEF2(is_convertible,From,To,(::boost::detail::is_convertible_impl_dispatch::value)) +template +struct is_convertible : public integral_constant::value> {}; #else -BOOST_TT_AUX_BOOL_TRAIT_DEF2(is_convertible,From,To,BOOST_IS_CONVERTIBLE(From,To)) +template +struct is_convertible : public integral_constant {}; #endif } // namespace boost -#include - #endif // BOOST_TT_IS_CONVERTIBLE_HPP_INCLUDED diff --git a/include/boost/type_traits/is_copy_assignable.hpp b/include/boost/type_traits/is_copy_assignable.hpp index 48af818..76afdda 100644 --- a/include/boost/type_traits/is_copy_assignable.hpp +++ b/include/boost/type_traits/is_copy_assignable.hpp @@ -18,7 +18,7 @@ && !defined(BOOST_INTEL_CXX_VERSION) && \ !(defined(BOOST_MSVC) && _MSC_VER == 1800) #define BOOST_TT_CXX11_IS_COPY_ASSIGNABLE -#include +#include #else //For compilers without decltype #include @@ -27,10 +27,6 @@ #include #endif - -// should be the last #include -#include - namespace boost { namespace detail{ @@ -132,16 +128,14 @@ struct is_copy_assignable_impl { } // namespace detail -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_copy_assignable,T,::boost::detail::is_copy_assignable_impl::value) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_copy_assignable,void,false) +template struct is_copy_assignable : public integral_constant::value>{}; +template <> struct is_copy_assignable : public false_type{}; #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_copy_assignable,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_copy_assignable,void const volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_copy_assignable,void volatile,false) +template <> struct is_copy_assignable : public false_type{}; +template <> struct is_copy_assignable : public false_type{}; +template <> struct is_copy_assignable : public false_type{}; #endif } // namespace boost -#include - #endif // BOOST_TT_IS_COPY_ASSIGNABLE_HPP_INCLUDED diff --git a/include/boost/type_traits/is_copy_constructible.hpp b/include/boost/type_traits/is_copy_constructible.hpp index 24f5eeb..c688264 100644 --- a/include/boost/type_traits/is_copy_constructible.hpp +++ b/include/boost/type_traits/is_copy_constructible.hpp @@ -10,116 +10,178 @@ #define BOOST_TT_IS_COPY_CONSTRUCTIBLE_HPP_INCLUDED #include +#include + +#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800) && !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40900) + +#include + +#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1800) + +namespace boost { + +template struct is_copy_constructible : public boost::is_constructible{}; + +template <> struct is_copy_constructible : public false_type{}; +template <> struct is_copy_constructible : public false_type{}; +template <> struct is_copy_constructible : public false_type{}; +template <> struct is_copy_constructible : public false_type{}; + +} // namespace boost + +#else +// +// Special version for VC12 which has a problem when a base class (such as non_copyable) has a deleted +// copy constructor. In this case the compiler thinks there really is a copy-constructor and tries to +// instantiate the deleted member. std::is_copy_constructible has the same issue (or at least returns +// an incorrect value, which just defers the issue into the users code) as well. We can at least fix +// boost::non_copyable as a base class as a special case: +// +#include +#include + +namespace boost { + + namespace detail + { + + template struct is_copy_constructible_imp : public boost::is_constructible{}; + template struct is_copy_constructible_imp : public false_type{}; + + } + + template struct is_copy_constructible : public detail::is_copy_constructible_imp::value>{}; + + template <> struct is_copy_constructible : public false_type{}; + template <> struct is_copy_constructible : public false_type{}; + template <> struct is_copy_constructible : public false_type{}; + template <> struct is_copy_constructible : public false_type{}; + +} // namespace boost + +#endif + +#else + #include #include #include #include -#include +#include +#include +#include #include -// should be the last #include -#include +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable:4181) +#endif namespace boost { -namespace detail{ + namespace detail{ -template -struct is_copy_constructible_impl2 { + template + struct is_copy_constructible_impl2 { -// Intel compiler has problems with SFINAE for copy constructors and deleted functions: -// -// error: function *function_name* cannot be referenced -- it is a deleted function -// static boost::type_traits::yes_type test(T1&, decltype(T1(boost::declval()))* = 0); -// ^ -// -// MSVC 12.0 (Visual 2013) has problems when the copy constructor has been deleted. See: -// https://connect.microsoft.com/VisualStudio/feedback/details/800328/std-is-copy-constructible-is-broken + // Intel compiler has problems with SFINAE for copy constructors and deleted functions: + // + // error: function *function_name* cannot be referenced -- it is a deleted function + // static boost::type_traits::yes_type test(T1&, decltype(T1(boost::declval()))* = 0); + // ^ + // + // MSVC 12.0 (Visual 2013) has problems when the copy constructor has been deleted. See: + // https://connect.microsoft.com/VisualStudio/feedback/details/800328/std-is-copy-constructible-is-broken #if !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS) && !defined(BOOST_INTEL_CXX_VERSION) && !(defined(BOOST_MSVC) && _MSC_VER == 1800) #ifdef BOOST_NO_CXX11_DECLTYPE - template - static boost::type_traits::yes_type test(T1&, boost::mpl::int_()))>* = 0); + template + static boost::type_traits::yes_type test(const T1&, boost::mpl::int_()))>* = 0); #else - template - static boost::type_traits::yes_type test(T1&, decltype(T1(boost::declval()))* = 0); + template + static boost::type_traits::yes_type test(const T1&, decltype(T1(boost::declval()))* = 0); #endif - static boost::type_traits::no_type test(...); + static boost::type_traits::no_type test(...); #else - template - static boost::type_traits::no_type test(T1&, typename T1::boost_move_no_copy_constructor_or_assign* = 0); - static boost::type_traits::yes_type test(...); + template + static boost::type_traits::no_type test(const T1&, typename T1::boost_move_no_copy_constructor_or_assign* = 0); + static boost::type_traits::yes_type test(...); #endif - // If you see errors like this: - // - // `'T::T(const T&)' is private` - // `boost/type_traits/is_copy_constructible.hpp:68:5: error: within this context` - // - // then you are trying to call that macro for a structure defined like that: - // - // struct T { - // ... - // private: - // T(const T &); - // ... - // }; - // - // To fix that you must modify your structure: - // - // // C++03 and C++11 version - // struct T: private boost::noncopyable { - // ... - // private: - // T(const T &); - // ... - // }; - // - // // C++11 version - // struct T { - // ... - // private: - // T(const T &) = delete; - // ... - // }; - BOOST_STATIC_CONSTANT(bool, value = ( + // If you see errors like this: + // + // `'T::T(const T&)' is private` + // `boost/type_traits/is_copy_constructible.hpp:68:5: error: within this context` + // + // then you are trying to call that macro for a structure defined like that: + // + // struct T { + // ... + // private: + // T(const T &); + // ... + // }; + // + // To fix that you must modify your structure: + // + // // C++03 and C++11 version + // struct T: private boost::noncopyable { + // ... + // private: + // T(const T &); + // ... + // }; + // + // // C++11 version + // struct T { + // ... + // private: + // T(const T &) = delete; + // ... + // }; + BOOST_STATIC_CONSTANT(bool, value = ( sizeof(test( - boost::declval::type>() + boost::declval::type>() )) == sizeof(boost::type_traits::yes_type) - || - boost::is_rvalue_reference::value - )); -}; + && + !boost::is_rvalue_reference::value + && !boost::is_array::value + )); + }; -template -struct is_copy_constructible_impl2 { - BOOST_STATIC_CONSTANT(bool, value = false); -}; + template + struct is_copy_constructible_impl2 { + BOOST_STATIC_CONSTANT(bool, value = false); + }; -template -struct is_copy_constructible_impl { + template + struct is_copy_constructible_impl { - BOOST_STATIC_CONSTANT(bool, value = ( - boost::detail::is_copy_constructible_impl2< + BOOST_STATIC_CONSTANT(bool, value = ( + boost::detail::is_copy_constructible_impl2< boost::is_base_and_derived::value, T - >::value - )); -}; + >::value + )); + }; -} // namespace detail + } // namespace detail -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_copy_constructible,T,::boost::detail::is_copy_constructible_impl::value) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_copy_constructible,void,false) + template struct is_copy_constructible : public integral_constant::value>{}; + template <> struct is_copy_constructible : public false_type{}; #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_copy_constructible,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_copy_constructible,void const volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_copy_constructible,void volatile,false) + template <> struct is_copy_constructible : public false_type{}; + template <> struct is_copy_constructible : public false_type{}; + template <> struct is_copy_constructible : public false_type{}; #endif } // namespace boost -#include +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#endif #endif // BOOST_TT_IS_COPY_CONSTRUCTIBLE_HPP_INCLUDED diff --git a/include/boost/type_traits/is_default_constructible.hpp b/include/boost/type_traits/is_default_constructible.hpp new file mode 100644 index 0000000..7fd63f8 --- /dev/null +++ b/include/boost/type_traits/is_default_constructible.hpp @@ -0,0 +1,64 @@ + +// (C) Copyright John Maddock 2015. +// 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). +// +// See http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_IS_DEFAULT_CONSTRUCTIBLE_HPP_INCLUDED +#define BOOST_TT_IS_DEFAULT_CONSTRUCTIBLE_HPP_INCLUDED + +#include +#include + +#if !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800) && !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40500) + +#include + +namespace boost{ + + namespace detail{ + + struct is_default_constructible_imp + { + template + static boost::type_traits::yes_type test(int); + + template + static boost::type_traits::no_type test(...); + }; + + } + + template struct is_default_constructible : public integral_constant(0)) == sizeof(boost::type_traits::yes_type)>{}; + template struct is_default_constructible : public is_default_constructible{}; + template struct is_default_constructible : public is_default_constructible{}; + template struct is_default_constructible : public integral_constant{}; +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) + template struct is_default_constructible : public integral_constant{}; +#endif + template <> struct is_default_constructible : public integral_constant{}; + template <> struct is_default_constructible : public integral_constant{}; + template <> struct is_default_constructible : public integral_constant{}; + template <> struct is_default_constructible : public integral_constant{}; + +#else + +#include + +namespace boost{ + + // We don't know how to implement this, note we can not use has_trivial_constructor here + // because the correct implementation of that trait requires this one: + template struct is_default_constructible : public is_pod{}; + template <> struct is_default_constructible : public integral_constant{}; + template <> struct is_default_constructible : public integral_constant{}; + template <> struct is_default_constructible : public integral_constant{}; + template <> struct is_default_constructible : public integral_constant{}; + +#endif + +} // namespace boost + +#endif // BOOST_TT_IS_DEFAULT_CONSTRUCTIBLE_HPP_INCLUDED diff --git a/include/boost/type_traits/is_destructible.hpp b/include/boost/type_traits/is_destructible.hpp new file mode 100644 index 0000000..9f1e5d9 --- /dev/null +++ b/include/boost/type_traits/is_destructible.hpp @@ -0,0 +1,60 @@ + +// (C) Copyright John Maddock 2015. +// 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). +// +// See http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_IS_DESTRUCTIBLE_HPP_INCLUDED +#define BOOST_TT_IS_DESTRUCTIBLE_HPP_INCLUDED + +#include +#include + +#if !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800) + +#include +#include + +namespace boost{ + + namespace detail{ + + struct is_destructible_imp + { + template().~T())> + static boost::type_traits::yes_type test(int); + template + static boost::type_traits::no_type test(...); + }; + + } + + template struct is_destructible : public integral_constant(0)) == sizeof(boost::type_traits::yes_type)>{}; + +#else + +#include +#include + +namespace boost{ + + // We don't know how to implement this: + template struct is_destructible : public integral_constant::value || is_class::value>{}; +#endif + + template <> struct is_destructible : public false_type{}; + template <> struct is_destructible : public false_type{}; + template <> struct is_destructible : public false_type{}; + template <> struct is_destructible : public false_type{}; + template struct is_destructible : public is_destructible{}; +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + template struct is_destructible : public is_destructible{}; +#endif + template struct is_destructible : public is_destructible{}; + template struct is_destructible : public is_destructible{}; + +} // namespace boost + +#endif // BOOST_TT_IS_DESTRUCTIBLE_HPP_INCLUDED diff --git a/include/boost/type_traits/is_empty.hpp b/include/boost/type_traits/is_empty.hpp index adb239e..ef288c5 100644 --- a/include/boost/type_traits/is_empty.hpp +++ b/include/boost/type_traits/is_empty.hpp @@ -10,16 +10,12 @@ #define BOOST_TT_IS_EMPTY_HPP_INCLUDED #include -#include -#include +#include #include -# include -# include -# include - -// should be always the last #include directive -#include +#include +#include +#include #ifndef BOOST_INTERNAL_IS_EMPTY #define BOOST_INTERNAL_IS_EMPTY(T) false @@ -75,12 +71,8 @@ struct is_empty_impl { typedef typename remove_cv::type cvt; BOOST_STATIC_CONSTANT( - bool, value = ( - ::boost::type_traits::ice_or< - ::boost::detail::empty_helper::value>::value - , BOOST_INTERNAL_IS_EMPTY(cvt) - >::value - )); + bool, + value = ( ::boost::detail::empty_helper::value>::value || BOOST_INTERNAL_IS_EMPTY(cvt))); }; #else // __BORLANDC__ @@ -107,35 +99,21 @@ struct is_empty_impl BOOST_STATIC_CONSTANT( bool, value = ( - ::boost::type_traits::ice_or< ::boost::detail::empty_helper< cvt , ::boost::is_class::value , ::boost::is_convertible< r_type,int>::value - >::value - , BOOST_INTERNAL_IS_EMPTY(cvt) - >::value)); + >::value || BOOST_INTERNAL_IS_EMPTY(cvt)); }; #endif // __BORLANDC__ - -// these help when the compiler has no partial specialization support: -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_empty,void,false) -#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_empty,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_empty,void volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_empty,void const volatile,false) -#endif - } // namespace detail -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_empty,T,::boost::detail::is_empty_impl::value) +template struct is_empty : integral_constant::value> {}; } // namespace boost -#include - #undef BOOST_INTERNAL_IS_EMPTY #endif // BOOST_TT_IS_EMPTY_HPP_INCLUDED diff --git a/include/boost/type_traits/is_enum.hpp b/include/boost/type_traits/is_enum.hpp index 7929c96..eada480 100644 --- a/include/boost/type_traits/is_enum.hpp +++ b/include/boost/type_traits/is_enum.hpp @@ -12,6 +12,7 @@ #define BOOST_TT_IS_ENUM_HPP_INCLUDED #include +#include #ifndef BOOST_IS_ENUM #include #include @@ -21,16 +22,13 @@ #ifdef __GNUC__ #include #endif -#include +#include #if defined(BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION) # include # include #endif #endif -// should be the last #include -#include - namespace boost { #ifndef BOOST_IS_ENUM @@ -43,11 +41,7 @@ namespace detail { template struct is_class_or_union { - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_or< - ::boost::is_class::value - , ::boost::is_union::value - >::value)); + BOOST_STATIC_CONSTANT(bool, value = ::boost::is_class::value || ::boost::is_union::value); }; #else @@ -94,8 +88,8 @@ template <> struct is_enum_helper { template struct type - : public ::boost::is_convertible::type,::boost::detail::int_convertible> { + static const bool value = ::boost::is_convertible::type, ::boost::detail::int_convertible>::value; }; }; @@ -112,34 +106,28 @@ template struct is_enum_impl // order to correctly deduce that noncopyable types are not enums // (dwa 2002/04/15)... BOOST_STATIC_CONSTANT(bool, selector = - (::boost::type_traits::ice_or< ::boost::is_arithmetic::value - , ::boost::is_reference::value - , ::boost::is_function::value - , is_class_or_union::value - , is_array::value - >::value)); + || ::boost::is_reference::value + || ::boost::is_function::value + || is_class_or_union::value + || is_array::value); #else // ...however, not checking is_class_or_union on non-conforming // compilers prevents a dependency recursion. BOOST_STATIC_CONSTANT(bool, selector = - (::boost::type_traits::ice_or< ::boost::is_arithmetic::value - , ::boost::is_reference::value - , ::boost::is_function::value - , is_array::value - >::value)); + || ::boost::is_reference::value + || ::boost::is_function::value + || is_array::value); #endif // BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION #else // !defined(__GNUC__): BOOST_STATIC_CONSTANT(bool, selector = - (::boost::type_traits::ice_or< ::boost::is_arithmetic::value - , ::boost::is_reference::value - , is_class_or_union::value - , is_array::value - >::value)); + || ::boost::is_reference::value + || is_class_or_union::value + || is_array::value); #endif @@ -155,34 +143,24 @@ template struct is_enum_impl BOOST_STATIC_CONSTANT(bool, value = helper::value); }; -// these help on compilers with no partial specialization support: -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_enum,void,false) -#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_enum,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_enum,void volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_enum,void const volatile,false) -#endif - } // namespace detail -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_enum,T,::boost::detail::is_enum_impl::value) +template struct is_enum : public integral_constant::value> {}; #else // __BORLANDC__ // // buggy is_convertible prevents working // implementation of is_enum: -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_enum,T,false) +template struct is_enum : public integral_constant {}; #endif #else // BOOST_IS_ENUM -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_enum,T,BOOST_IS_ENUM(T)) +template struct is_enum : public integral_constant {}; #endif } // namespace boost -#include - #endif // BOOST_TT_IS_ENUM_HPP_INCLUDED diff --git a/include/boost/type_traits/is_final.hpp b/include/boost/type_traits/is_final.hpp index 36bd62e..410d186 100644 --- a/include/boost/type_traits/is_final.hpp +++ b/include/boost/type_traits/is_final.hpp @@ -11,31 +11,20 @@ #ifndef BOOST_TT_IS_FINAL_HPP_INCLUDED #define BOOST_TT_IS_FINAL_HPP_INCLUDED -#include -#include #include - -// should be the last #include -#include +#include +#ifdef BOOST_IS_FINAL +#include +#endif namespace boost { -namespace detail { -template struct is_final_impl -{ #ifdef BOOST_IS_FINAL - typedef typename remove_cv::type cvt; - BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_FINAL(cvt)); +template struct is_final : public integral_constant::type)> {}; #else - BOOST_STATIC_CONSTANT(bool, value = false); +template struct is_final : public integral_constant {}; #endif -}; -} // namespace detail - -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_final,T,::boost::detail::is_final_impl::value) } // namespace boost -#include - #endif // BOOST_TT_IS_FINAL_HPP_INCLUDED diff --git a/include/boost/type_traits/is_float.hpp b/include/boost/type_traits/is_float.hpp index 25d16f1..7bf7d1f 100644 --- a/include/boost/type_traits/is_float.hpp +++ b/include/boost/type_traits/is_float.hpp @@ -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 @@ -10,18 +9,12 @@ #define BOOST_TYPE_TRAITS_IS_FLOAT_HPP_INCLUDED // should be the last #include -#include +#include namespace boost { //* is a type T a floating-point type described in the standard (3.9.1p8) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_float,T,false) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_float,float,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_float,double,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_float,long double,true) - + template struct is_float : public is_floating_point {}; } // namespace boost -#include - #endif // BOOST_TYPE_TRAITS_IS_FLOAT_HPP_INCLUDED diff --git a/include/boost/type_traits/is_floating_point.hpp b/include/boost/type_traits/is_floating_point.hpp index 2224453..196c900 100755 --- a/include/boost/type_traits/is_floating_point.hpp +++ b/include/boost/type_traits/is_floating_point.hpp @@ -1,4 +1,3 @@ - // (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000-2005. // Use, modification and distribution are subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -9,19 +8,23 @@ #ifndef BOOST_TYPE_TRAITS_IS_FLOATING_HPP_INCLUDED #define BOOST_TYPE_TRAITS_IS_FLOATING_HPP_INCLUDED -// should be the last #include -#include +#include namespace boost { //* is a type T a floating-point type described in the standard (3.9.1p8) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_floating_point,T,false) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_floating_point,float,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_floating_point,double,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_floating_point,long double,true) + template struct is_floating_point : public false_type{}; + template struct is_floating_point : public is_floating_point{}; + template struct is_floating_point : public is_floating_point{}; + template struct is_floating_point : public is_floating_point{}; + template<> struct is_floating_point : public true_type{}; + template<> struct is_floating_point : public true_type{}; + template<> struct is_floating_point : public true_type{}; + +#if defined(BOOST_HAS_FLOAT128) + template<> struct is_floating_point<__float128> : public true_type{}; +#endif } // namespace boost -#include - #endif // BOOST_TYPE_TRAITS_IS_FLOAT_HPP_INCLUDED diff --git a/include/boost/type_traits/is_function.hpp b/include/boost/type_traits/is_function.hpp index eeb4382..f77c1f0 100644 --- a/include/boost/type_traits/is_function.hpp +++ b/include/boost/type_traits/is_function.hpp @@ -12,8 +12,7 @@ #define BOOST_TT_IS_FUNCTION_HPP_INCLUDED #include -#include -#include +#include #if !defined(BOOST_TT_TEST_MS_FUNC_SIGS) # include @@ -22,9 +21,6 @@ # include #endif -// should be the last #include -#include - // is a type a function? // Please note that this implementation is unnecessarily complex: // we could just use !is_convertible::value, @@ -40,17 +36,16 @@ namespace detail { #if !defined(BOOST_TT_TEST_MS_FUNC_SIGS) template struct is_function_chooser - : public ::boost::type_traits::false_result { + template< typename T > struct result_ + : public false_type {}; }; template <> struct is_function_chooser { template< typename T > struct result_ - : public ::boost::type_traits::is_function_ptr_helper - { - }; + : public ::boost::type_traits::is_function_ptr_helper {}; }; template @@ -95,15 +90,13 @@ struct is_function_impl : public false_type #endif // !defined( __CODEGEARC__ ) #if defined( __CODEGEARC__ ) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_function,T,__is_function(T)) +template struct is_function : integral_constant {}; #else -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_function,T,::boost::detail::is_function_impl::value) +template struct is_function : integral_constant::value> {}; #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_function,T&&,false) +template struct is_function : public false_type {}; #endif #endif } // namespace boost -#include - #endif // BOOST_TT_IS_FUNCTION_HPP_INCLUDED diff --git a/include/boost/type_traits/is_fundamental.hpp b/include/boost/type_traits/is_fundamental.hpp index 138e296..f58767a 100644 --- a/include/boost/type_traits/is_fundamental.hpp +++ b/include/boost/type_traits/is_fundamental.hpp @@ -11,35 +11,16 @@ #include #include -#include - -// should be the last #include -#include namespace boost { -namespace detail { - -template -struct is_fundamental_impl - : public ::boost::type_traits::ice_or< - ::boost::is_arithmetic::value - , ::boost::is_void::value - > -{ -}; - -} // namespace detail - //* is a type T a fundamental type described in the standard (3.9.1) #if defined( __CODEGEARC__ ) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_fundamental,T,__is_fundamental(T)) +template struct is_fundamental : public integral_constant {}; #else -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_fundamental,T,::boost::detail::is_fundamental_impl::value) +template struct is_fundamental : public integral_constant::value || ::boost::is_void::value> {}; #endif } // namespace boost -#include - #endif // BOOST_TT_IS_FUNDAMENTAL_HPP_INCLUDED diff --git a/include/boost/type_traits/is_integral.hpp b/include/boost/type_traits/is_integral.hpp index 6bfad49..7a7e54b 100644 --- a/include/boost/type_traits/is_integral.hpp +++ b/include/boost/type_traits/is_integral.hpp @@ -10,79 +10,80 @@ #define BOOST_TT_IS_INTEGRAL_HPP_INCLUDED #include - -// should be the last #include -#include +#include namespace boost { +#if defined( __CODEGEARC__ ) + template + struct is_integral : public integral_constant {}; +#else + +template struct is_integral : public false_type {}; +template struct is_integral : public is_integral {}; +template struct is_integral : public is_integral{}; +template struct is_integral : public is_integral{}; + //* is a type T an [cv-qualified-] integral type described in the standard (3.9.1p3) // as an extension we include long long, as this is likely to be added to the // standard at a later date -#if defined( __CODEGEARC__ ) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_integral,T,__is_integral(T)) -#else -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_integral,T,false) +template<> struct is_integral : public true_type {}; +template<> struct is_integral : public true_type{}; +template<> struct is_integral : public true_type{}; +template<> struct is_integral : public true_type{}; -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned char,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned short,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned int,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned long,true) +template<> struct is_integral : public true_type{}; +template<> struct is_integral : public true_type{}; +template<> struct is_integral : public true_type{}; +template<> struct is_integral : public true_type{}; -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,signed char,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,signed short,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,signed int,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,signed long,true) - -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,bool,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,char,true) +template<> struct is_integral : public true_type{}; +template<> struct is_integral : public true_type{}; #ifndef BOOST_NO_INTRINSIC_WCHAR_T // If the following line fails to compile and you're using the Intel // compiler, see http://lists.boost.org/MailArchives/boost-users/msg06567.php, // and define BOOST_NO_INTRINSIC_WCHAR_T on the command line. -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,wchar_t,true) +template<> struct is_integral : public true_type{}; #endif // Same set of integral types as in boost/type_traits/integral_promotion.hpp. // Please, keep in sync. -- Alexander Nasonov #if (defined(BOOST_INTEL_CXX_VERSION) && defined(_MSC_VER) && (BOOST_INTEL_CXX_VERSION <= 600)) \ || (defined(__BORLANDC__) && (__BORLANDC__ == 0x600) && (_MSC_VER < 1300)) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int8,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int8,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int16,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int16,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int32,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int32,true) +template<> struct is_integral : public true_type{}; +template<> struct is_integral : public true_type{}; +template<> struct is_integral : public true_type{}; +template<> struct is_integral<__int8> : public true_type{}; +template<> struct is_integral<__int16> : public true_type{}; +template<> struct is_integral<__int32> : public true_type{}; #ifdef __BORLANDC__ -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int64,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int64,true) +template<> struct is_integral : public true_type{}; +template<> struct is_integral<__int64> : public true_type{}; #endif #endif # if defined(BOOST_HAS_LONG_LONG) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral, ::boost::ulong_long_type,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral, ::boost::long_long_type,true) +template<> struct is_integral< ::boost::ulong_long_type> : public true_type{}; +template<> struct is_integral< ::boost::long_long_type> : public true_type{}; #elif defined(BOOST_HAS_MS_INT64) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int64,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int64,true) +template<> struct is_integral : public true_type{}; +template<> struct is_integral<__int64> : public true_type{}; #endif #ifdef BOOST_HAS_INT128 -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,boost::int128_type,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,boost::uint128_type,true) +template<> struct is_integral : public true_type{}; +template<> struct is_integral : public true_type{}; #endif #ifndef BOOST_NO_CXX11_CHAR16_T -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,char16_t,true) +template<> struct is_integral : public true_type{}; #endif #ifndef BOOST_NO_CXX11_CHAR32_T -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,char32_t,true) +template<> struct is_integral : public true_type{}; #endif #endif // non-CodeGear implementation } // namespace boost -#include - #endif // BOOST_TT_IS_INTEGRAL_HPP_INCLUDED diff --git a/include/boost/type_traits/is_lvalue_reference.hpp b/include/boost/type_traits/is_lvalue_reference.hpp index 0b0130a..e94d787 100644 --- a/include/boost/type_traits/is_lvalue_reference.hpp +++ b/include/boost/type_traits/is_lvalue_reference.hpp @@ -21,36 +21,30 @@ #ifndef BOOST_TT_IS_LVALUE_REFERENCE_HPP_INCLUDED #define BOOST_TT_IS_LVALUE_REFERENCE_HPP_INCLUDED -#include - - -// should be the last #include -#include +#include namespace boost { #if defined( __CODEGEARC__ ) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_lvalue_reference,T,__is_reference(T)) + template struct is_lvalue_reference : public integral_constant{}; #else -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_lvalue_reference,T,false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_lvalue_reference,T&,true) + template struct is_lvalue_reference : public false_type{}; + template struct is_lvalue_reference : public true_type{}; #if defined(BOOST_ILLEGAL_CV_REFERENCES) // these are illegal specialisations; cv-qualifies applied to // references have no effect according to [8.3.2p1], // C++ Builder requires them though as it treats cv-qualified // references as distinct types... -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_lvalue_reference,T& const,true) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_lvalue_reference,T& volatile,true) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_lvalue_reference,T& const volatile,true) + template struct is_lvalue_reference : public true_type{}; + template struct is_lvalue_reference : public true_type{}; + template struct is_lvalue_reference : public true_type{}; #endif #endif } // namespace boost -#include - #endif // BOOST_TT_IS_REFERENCE_HPP_INCLUDED diff --git a/include/boost/type_traits/is_member_function_pointer.hpp b/include/boost/type_traits/is_member_function_pointer.hpp index d1c3690..223197f 100644 --- a/include/boost/type_traits/is_member_function_pointer.hpp +++ b/include/boost/type_traits/is_member_function_pointer.hpp @@ -11,7 +11,7 @@ #ifndef BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED #define BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED -#include +#include #include #if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(BOOST_TT_TEST_MS_FUNC_SIGS) @@ -22,29 +22,22 @@ // # include # include +# include #else # include # include # include -# include -# include # include #endif -// should be the last #include -#include - namespace boost { #if defined( __CODEGEARC__ ) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_function_pointer,T,__is_member_function_pointer( T )) +template struct is_member_function_pointer : public integral_constant {}; #elif !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(BOOST_TT_TEST_MS_FUNC_SIGS) -BOOST_TT_AUX_BOOL_TRAIT_DEF1( - is_member_function_pointer - , T - , ::boost::type_traits::is_mem_fun_pointer_impl::type>::value - ) +template struct is_member_function_pointer + : public ::boost::integral_constant::type>::value>{}; #else @@ -54,8 +47,8 @@ namespace detail { template struct is_mem_fun_pointer_select - : public ::boost::type_traits::false_result { + template struct result_ : public false_type{}; }; template <> @@ -82,14 +75,8 @@ struct is_mem_fun_pointer_select template struct is_member_function_pointer_impl - : public is_mem_fun_pointer_select< - ::boost::type_traits::ice_or< - ::boost::is_reference::value - , ::boost::is_array::value - >::value - >::template result_ -{ -}; + : public is_mem_fun_pointer_select< + ::boost::is_reference::value || ::boost::is_array::value>::template result_{}; template struct is_member_function_pointer_impl : public false_type{}; @@ -113,21 +100,21 @@ struct is_member_function_pointer_impl #endif -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_member_function_pointer,void,false) +template<> struct is_member_function_pointer_impl : public false_type{}; #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_member_function_pointer,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_member_function_pointer,void volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_member_function_pointer,void const volatile,false) +template<> struct is_member_function_pointer_impl : public false_type{}; +template<> struct is_member_function_pointer_impl : public false_type{}; +template<> struct is_member_function_pointer_impl : public false_type{}; #endif } // namespace detail -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_function_pointer,T,::boost::detail::is_member_function_pointer_impl::value) +template +struct is_member_function_pointer + : public integral_constant::value>{}; #endif } // namespace boost -#include - #endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED diff --git a/include/boost/type_traits/is_member_object_pointer.hpp b/include/boost/type_traits/is_member_object_pointer.hpp index 66b76c9..cb7cf14 100755 --- a/include/boost/type_traits/is_member_object_pointer.hpp +++ b/include/boost/type_traits/is_member_object_pointer.hpp @@ -10,37 +10,15 @@ #ifndef BOOST_TT_IS_MEMBER_OBJECT_POINTER_HPP_INCLUDED #define BOOST_TT_IS_MEMBER_OBJECT_POINTER_HPP_INCLUDED -#include #include #include -#include -#include - -// should be the last #include -#include namespace boost { -namespace detail{ - -template -struct is_member_object_pointer_impl -{ - BOOST_STATIC_CONSTANT( - bool, value = (::boost::type_traits::ice_and< - ::boost::is_member_pointer::value, - ::boost::type_traits::ice_not< - ::boost::is_member_function_pointer::value - >::value - >::value )); -}; - -} // namespace detail - -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_object_pointer,T,::boost::detail::is_member_object_pointer_impl::value) +template struct is_member_object_pointer + : public integral_constant::value && !::boost::is_member_function_pointer::value>{}; } // namespace boost -#include - #endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED diff --git a/include/boost/type_traits/is_member_pointer.hpp b/include/boost/type_traits/is_member_pointer.hpp index cba31af..9757afc 100644 --- a/include/boost/type_traits/is_member_pointer.hpp +++ b/include/boost/type_traits/is_member_pointer.hpp @@ -21,45 +21,25 @@ #ifndef BOOST_TT_IS_MEMBER_POINTER_HPP_INCLUDED #define BOOST_TT_IS_MEMBER_POINTER_HPP_INCLUDED -#include #include - -#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) -# include -#else -# include -# include -# include -# include -# include -# include -#endif - -// should be the last #include -#include +#include namespace boost { #if defined( __CODEGEARC__ ) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_pointer,T,__is_member_pointer(T)) -#elif BOOST_WORKAROUND(__BORLANDC__, < 0x600) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_pointer,T,false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*,true) - +template struct is_member_pointer : public integral_constant{}; #else -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_pointer,T,::boost::is_member_function_pointer::value) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*,true) +template struct is_member_pointer : public integral_constant::value>{}; +template struct is_member_pointer : public true_type{}; #if !BOOST_WORKAROUND(__MWERKS__,<=0x3003) && !BOOST_WORKAROUND(__IBMCPP__, <=600) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*const,true) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*volatile,true) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*const volatile,true) +template struct is_member_pointer : public true_type{}; +template struct is_member_pointer : public true_type{}; +template struct is_member_pointer : public true_type{}; #endif #endif } // namespace boost -#include - #endif // BOOST_TT_IS_MEMBER_POINTER_HPP_INCLUDED diff --git a/include/boost/type_traits/is_nothrow_move_assignable.hpp b/include/boost/type_traits/is_nothrow_move_assignable.hpp index 3268307..9755430 100644 --- a/include/boost/type_traits/is_nothrow_move_assignable.hpp +++ b/include/boost/type_traits/is_nothrow_move_assignable.hpp @@ -16,37 +16,27 @@ #include #include #include -#include -#include -#include #include -#include - -// should be the last #include -#include +#include namespace boost { -namespace detail{ - #ifdef BOOST_IS_NOTHROW_MOVE_ASSIGN template -struct is_nothrow_move_assignable_imp{ BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_NOTHROW_MOVE_ASSIGN(T)); }; -template -struct is_nothrow_move_assignable_imp{ BOOST_STATIC_CONSTANT(bool, value = false); }; -template -struct is_nothrow_move_assignable_imp{ BOOST_STATIC_CONSTANT(bool, value = false); }; -template -struct is_nothrow_move_assignable_imp{ BOOST_STATIC_CONSTANT(bool, value = false); }; -template -struct is_nothrow_move_assignable_imp{ BOOST_STATIC_CONSTANT(bool, value = false); }; -template -struct is_nothrow_move_assignable_imp{ BOOST_STATIC_CONSTANT(bool, value = false); }; - +struct is_nothrow_move_assignable : public integral_constant{}; +template struct is_nothrow_move_assignable : public false_type{}; +template struct is_nothrow_move_assignable : public false_type{}; +template struct is_nothrow_move_assignable : public false_type{}; +template struct is_nothrow_move_assignable : public false_type{}; +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) +template struct is_nothrow_move_assignable : public false_type{}; +#endif #elif !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR) +namespace detail{ + template struct false_or_cpp11_noexcept_move_assignable: public ::boost::false_type {}; @@ -57,52 +47,35 @@ struct false_or_cpp11_noexcept_move_assignable < > : public ::boost::integral_constant() = ::boost::declval())> {}; -template -struct is_nothrow_move_assignable_imp{ - BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::false_or_cpp11_noexcept_move_assignable::value); -}; +} template -struct is_nothrow_move_assignable_imp : public ::boost::false_type {}; -template -struct is_nothrow_move_assignable_imp : public ::boost::false_type{}; -template -struct is_nothrow_move_assignable_imp : public ::boost::false_type{}; -template -struct is_nothrow_move_assignable_imp : public ::boost::false_type{}; +struct is_nothrow_move_assignable : public integral_constant::value>{}; + +template struct is_nothrow_move_assignable : public ::boost::false_type {}; +template struct is_nothrow_move_assignable : public ::boost::false_type{}; +template struct is_nothrow_move_assignable : public ::boost::false_type{}; +template struct is_nothrow_move_assignable : public ::boost::false_type{}; #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES -template -struct is_nothrow_move_assignable_imp : public ::boost::false_type{}; +template struct is_nothrow_move_assignable : public ::boost::false_type{}; #endif #else template -struct is_nothrow_move_assignable_imp{ - BOOST_STATIC_CONSTANT(bool, value = ( - ::boost::type_traits::ice_and< - ::boost::type_traits::ice_or< - ::boost::has_trivial_move_assign::value, - ::boost::has_nothrow_assign::value - >::value, - ::boost::type_traits::ice_not< ::boost::is_array::value >::value - >::value)); -}; +struct is_nothrow_move_assignable : public integral_constant::value || ::boost::has_nothrow_assign::value) && ! ::boost::is_array::value>{}; #endif -} -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_nothrow_move_assignable,T,::boost::detail::is_nothrow_move_assignable_imp::value) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_nothrow_move_assignable,void,false) +template <> struct is_nothrow_move_assignable : public false_type{}; #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_nothrow_move_assignable,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_nothrow_move_assignable,void const volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_nothrow_move_assignable,void volatile,false) +template <> struct is_nothrow_move_assignable : public false_type{}; +template <> struct is_nothrow_move_assignable : public false_type{}; +template <> struct is_nothrow_move_assignable : public false_type{}; #endif } // namespace boost -#include - #endif // BOOST_TT_IS_NOTHROW_MOVE_ASSIGNABLE_HPP_INCLUDED diff --git a/include/boost/type_traits/is_nothrow_move_constructible.hpp b/include/boost/type_traits/is_nothrow_move_constructible.hpp index c09d5d1..3cbca21 100644 --- a/include/boost/type_traits/is_nothrow_move_constructible.hpp +++ b/include/boost/type_traits/is_nothrow_move_constructible.hpp @@ -13,42 +13,25 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include - -// should be the last #include -#include - -namespace boost { - -namespace detail{ +#include #ifdef BOOST_IS_NOTHROW_MOVE_CONSTRUCT -template -struct is_nothrow_move_constructible_imp{ - BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_NOTHROW_MOVE_CONSTRUCT(T)); -}; +namespace boost { template -struct is_nothrow_move_constructible_imp : public ::boost::false_type {}; -template -struct is_nothrow_move_constructible_imp : public ::boost::false_type{}; -template -struct is_nothrow_move_constructible_imp : public ::boost::false_type{}; -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES -template -struct is_nothrow_move_constructible_imp : public ::boost::false_type{}; -#endif +struct is_nothrow_move_constructible : public integral_constant{}; + +template struct is_nothrow_move_constructible : public ::boost::false_type {}; +template struct is_nothrow_move_constructible : public ::boost::false_type{}; #elif !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR) +#include +#include + +namespace boost{ namespace detail{ + template struct false_or_cpp11_noexcept_move_constructible: public ::boost::false_type {}; @@ -59,51 +42,44 @@ struct false_or_cpp11_noexcept_move_constructible < > : public ::boost::integral_constant()))> {}; -template -struct is_nothrow_move_constructible_imp{ - BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::false_or_cpp11_noexcept_move_constructible::value); -}; +} -template -struct is_nothrow_move_constructible_imp : public ::boost::false_type {}; -template -struct is_nothrow_move_constructible_imp : public ::boost::false_type{}; -template -struct is_nothrow_move_constructible_imp : public ::boost::false_type{}; -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES -template -struct is_nothrow_move_constructible_imp : public ::boost::false_type{}; -#endif +template struct is_nothrow_move_constructible + : public integral_constant::value>{}; + +template struct is_nothrow_move_constructible : public ::boost::false_type {}; +template struct is_nothrow_move_constructible : public ::boost::false_type{}; +template struct is_nothrow_move_constructible : public ::boost::false_type{}; +template struct is_nothrow_move_constructible : public ::boost::false_type{}; #else +#include +#include +#include + +namespace boost{ + template -struct is_nothrow_move_constructible_imp{ - BOOST_STATIC_CONSTANT(bool, value =( - ::boost::type_traits::ice_and< - ::boost::type_traits::ice_or< - ::boost::has_trivial_move_constructor::value, - ::boost::has_nothrow_copy::value - >::value, - ::boost::type_traits::ice_not< ::boost::is_array::value >::value - >::value)); -}; +struct is_nothrow_move_constructible + : public integral_constant::value || ::boost::has_nothrow_copy::value) && !::boost::is_array::value> +{}; #endif -} - -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_nothrow_move_constructible,T,::boost::detail::is_nothrow_move_constructible_imp::value) - -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_nothrow_move_constructible,void,false) +template <> struct is_nothrow_move_constructible : false_type{}; #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_nothrow_move_constructible,void const,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_nothrow_move_constructible,void const volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_nothrow_move_constructible,void volatile,false) +template <> struct is_nothrow_move_constructible : false_type{}; +template <> struct is_nothrow_move_constructible : false_type{}; +template <> struct is_nothrow_move_constructible : false_type{}; +#endif +// References are always trivially constructible, even if the thing they reference is not: +template struct is_nothrow_move_constructible : public ::boost::true_type{}; +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES +template struct is_nothrow_move_constructible : public ::boost::true_type{}; #endif } // namespace boost -#include - #endif // BOOST_TT_IS_NOTHROW_MOVE_CONSTRUCTIBLE_HPP_INCLUDED diff --git a/include/boost/type_traits/is_object.hpp b/include/boost/type_traits/is_object.hpp index 1d1ae4f..fc9d2f2 100644 --- a/include/boost/type_traits/is_object.hpp +++ b/include/boost/type_traits/is_object.hpp @@ -9,37 +9,20 @@ #ifndef BOOST_TT_IS_OBJECT_HPP_INCLUDED #define BOOST_TT_IS_OBJECT_HPP_INCLUDED +#include #include #include #include -#include -#include -#include - -// should be the last #include -#include namespace boost { -namespace detail { - -template -struct is_object_impl -{ - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_and< - ::boost::type_traits::ice_not< ::boost::is_reference::value>::value, - ::boost::type_traits::ice_not< ::boost::is_void::value>::value, - ::boost::type_traits::ice_not< ::boost::is_function::value>::value - >::value)); -}; - -} // namespace detail - -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_object,T,::boost::detail::is_object_impl::value) +template struct is_object + : public + integral_constant< + bool, + ! ::boost::is_reference::value && ! ::boost::is_void::value && ! ::boost::is_function::value > +{}; } // namespace boost -#include - #endif // BOOST_TT_IS_OBJECT_HPP_INCLUDED diff --git a/include/boost/type_traits/is_pod.hpp b/include/boost/type_traits/is_pod.hpp index 820a3ce..9204c93 100644 --- a/include/boost/type_traits/is_pod.hpp +++ b/include/boost/type_traits/is_pod.hpp @@ -9,16 +9,16 @@ #ifndef BOOST_TT_IS_POD_HPP_INCLUDED #define BOOST_TT_IS_POD_HPP_INCLUDED -#include +#include #include #include -#include #include -#include +#ifdef __SUNPRO_CC +#include +#endif -// should be the last #include -#include +#include #ifndef BOOST_IS_POD #define BOOST_INTERNAL_IS_POD(T) false @@ -31,49 +31,28 @@ namespace boost { // forward declaration, needed by 'is_pod_array_helper' template below template< typename T > struct is_POD; -namespace detail { - - -template struct is_pod_impl -{ - BOOST_STATIC_CONSTANT( - bool, value = - (::boost::type_traits::ice_or< - ::boost::is_scalar::value, - ::boost::is_void::value, - BOOST_INTERNAL_IS_POD(T) - >::value)); -}; +template struct is_pod +: public integral_constant::value || ::boost::is_void::value || BOOST_INTERNAL_IS_POD(T)> +{}; #if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS) -template -struct is_pod_impl - : public is_pod_impl -{ -}; +template struct is_pod : public is_pod{}; #endif // the following help compilers without partial specialization support: -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,void,true) +template<> struct is_pod : public true_type{}; #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,void const,true) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,void volatile,true) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,void const volatile,true) +template<> struct is_pod : public true_type{}; +template<> struct is_pod : public true_type{}; +template<> struct is_pod : public true_type{}; #endif -} // namespace detail - -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_pod,T,::boost::detail::is_pod_impl::value) -// is_POD is the old depricated name for this trait, do not use this as it may -// be removed in future without warning!! -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_POD,T,::boost::is_pod::value) +template struct is_POD : public is_pod{}; } // namespace boost -#include - #undef BOOST_INTERNAL_IS_POD #endif // BOOST_TT_IS_POD_HPP_INCLUDED diff --git a/include/boost/type_traits/is_pointer.hpp b/include/boost/type_traits/is_pointer.hpp index aad30f2..44b06c2 100644 --- a/include/boost/type_traits/is_pointer.hpp +++ b/include/boost/type_traits/is_pointer.hpp @@ -21,68 +21,27 @@ #ifndef BOOST_TT_IS_POINTER_HPP_INCLUDED #define BOOST_TT_IS_POINTER_HPP_INCLUDED -#include -#include -#include -#include -#include - - -// should be the last #include -#include +#include namespace boost { #if defined( __CODEGEARC__ ) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_pointer,T,__is_pointer(T)) +template struct is_pointer : public integral_constant{}; #else +template struct is_pointer : public false_type{}; +template struct is_pointer : public true_type{}; +template struct is_pointer : public true_type{}; +template struct is_pointer : public true_type{}; +template struct is_pointer : public true_type{}; -namespace detail { - -template< typename T > struct is_pointer_helper -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; - -# define TT_AUX_BOOL_TRAIT_HELPER_PARTIAL_SPEC(helper,sp,result) \ -template< typename T > struct helper \ -{ \ - BOOST_STATIC_CONSTANT(bool, value = result); \ -}; \ -/**/ - -TT_AUX_BOOL_TRAIT_HELPER_PARTIAL_SPEC(is_pointer_helper,T*,true) - -# undef TT_AUX_BOOL_TRAIT_HELPER_PARTIAL_SPEC - -template< typename T > -struct is_pointer_impl -{ - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_and< - ::boost::detail::is_pointer_helper::type>::value - , ::boost::type_traits::ice_not< - ::boost::is_member_pointer::value - >::value - >::value) - ); -}; - -} // namespace detail - -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_pointer,T,::boost::detail::is_pointer_impl::value) - -#if defined(__BORLANDC__) && !defined(__COMO__) && (__BORLANDC__ < 0x600) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_pointer,T&,false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_pointer,T& const,false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_pointer,T& volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_pointer,T& const volatile,false) +#ifdef BOOST_MSVC +template struct is_pointer : public is_pointer{}; +template struct is_pointer : public is_pointer{}; +template struct is_pointer : public is_pointer{}; #endif #endif } // namespace boost -#include - #endif // BOOST_TT_IS_POINTER_HPP_INCLUDED diff --git a/include/boost/type_traits/is_polymorphic.hpp b/include/boost/type_traits/is_polymorphic.hpp index aac9851..722d8b4 100644 --- a/include/boost/type_traits/is_polymorphic.hpp +++ b/include/boost/type_traits/is_polymorphic.hpp @@ -9,12 +9,10 @@ #define BOOST_TT_IS_POLYMORPHIC_HPP #include +#include #ifndef BOOST_IS_POLYMORPHIC #include -#include #endif -// should be the last #include -#include #include #if defined(BOOST_MSVC) && (BOOST_MSVC >= 1700) @@ -34,8 +32,7 @@ struct is_polymorphic_imp1 # if BOOST_WORKAROUND(__MWERKS__, <= 0x2407) // CWPro7 should return false always. typedef char d1, (&d2)[2]; # else - typedef typename remove_cv::type ncvT; - struct d1 : public ncvT + struct d1 : public T { d1(); # if !defined(__GNUC__) // this raises warnings with some classes, and buys nothing with GCC @@ -47,7 +44,7 @@ struct is_polymorphic_imp1 d1(const d1&); d1& operator=(const d1&); }; - struct d2 : public ncvT + struct d2 : public T { d2(); virtual ~d2()throw(); @@ -67,6 +64,10 @@ struct is_polymorphic_imp1 BOOST_STATIC_CONSTANT(bool, value = (sizeof(d2) == sizeof(d1))); }; +template struct is_polymorphic_imp1 : public is_polymorphic_imp1{}; +template struct is_polymorphic_imp1 : public is_polymorphic_imp1{}; +template struct is_polymorphic_imp1 : public is_polymorphic_imp1{}; + template struct is_polymorphic_imp2 { @@ -104,18 +105,16 @@ struct is_polymorphic_imp } // namespace detail -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_polymorphic,T,::boost::detail::is_polymorphic_imp::value) +template struct is_polymorphic : public integral_constant::value> {}; #else // BOOST_IS_POLYMORPHIC -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_polymorphic,T,BOOST_IS_POLYMORPHIC(T)) +template struct is_polymorphic : public integral_constant {}; #endif } // namespace boost -#include - #if defined(BOOST_MSVC) && (BOOST_MSVC >= 1700) #pragma warning(pop) #endif diff --git a/include/boost/type_traits/is_reference.hpp b/include/boost/type_traits/is_reference.hpp index 49b5f9f..85f0a63 100644 --- a/include/boost/type_traits/is_reference.hpp +++ b/include/boost/type_traits/is_reference.hpp @@ -12,34 +12,19 @@ #ifndef BOOST_TT_IS_REFERENCE_HPP_INCLUDED #define BOOST_TT_IS_REFERENCE_HPP_INCLUDED -#include #include #include -#include - -// should be the last #include -#include namespace boost { -namespace detail { - -template -struct is_reference_impl -{ - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_or< - ::boost::is_lvalue_reference::value, ::boost::is_rvalue_reference::value - >::value)); -}; - -} // namespace detail - -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_reference,T,::boost::detail::is_reference_impl::value) +template struct is_reference + : public + integral_constant< + bool, + ::boost::is_lvalue_reference::value || ::boost::is_rvalue_reference::value> +{}; } // namespace boost -#include - #endif // BOOST_TT_IS_REFERENCE_HPP_INCLUDED diff --git a/include/boost/type_traits/is_rvalue_reference.hpp b/include/boost/type_traits/is_rvalue_reference.hpp index 93cd0bf..50e88ed 100644 --- a/include/boost/type_traits/is_rvalue_reference.hpp +++ b/include/boost/type_traits/is_rvalue_reference.hpp @@ -9,21 +9,17 @@ #ifndef BOOST_TT_IS_RVALUE_REFERENCE_HPP_INCLUDED #define BOOST_TT_IS_RVALUE_REFERENCE_HPP_INCLUDED -#include - -// should be the last #include -#include +#include +#include namespace boost { -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_rvalue_reference,T,false) +template struct is_rvalue_reference : public false_type {}; #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_rvalue_reference,T&&,true) +template struct is_rvalue_reference : public true_type {}; #endif } // namespace boost -#include - #endif // BOOST_TT_IS_REFERENCE_HPP_INCLUDED diff --git a/include/boost/type_traits/is_same.hpp b/include/boost/type_traits/is_same.hpp index c8987b0..d16f4b2 100644 --- a/include/boost/type_traits/is_same.hpp +++ b/include/boost/type_traits/is_same.hpp @@ -21,25 +21,21 @@ #ifndef BOOST_TT_IS_SAME_HPP_INCLUDED #define BOOST_TT_IS_SAME_HPP_INCLUDED -#include -// should be the last #include -#include +#include namespace boost { -BOOST_TT_AUX_BOOL_TRAIT_DEF2(is_same,T,U,false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(typename T,is_same,T,T,true) + template struct is_same : public false_type {}; + template struct is_same : public true_type {}; #if BOOST_WORKAROUND(__BORLANDC__, < 0x600) // without this, Borland's compiler gives the wrong answer for // references to arrays: -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(typename T,is_same,T&,T&,true) + template struct is_same : public true_type{}; #endif } // namespace boost -#include - #endif // BOOST_TT_IS_SAME_HPP_INCLUDED diff --git a/include/boost/type_traits/is_scalar.hpp b/include/boost/type_traits/is_scalar.hpp index 4af3def..3031440 100644 --- a/include/boost/type_traits/is_scalar.hpp +++ b/include/boost/type_traits/is_scalar.hpp @@ -13,43 +13,15 @@ #include #include #include -#include #include -// should be the last #include -#include - namespace boost { -namespace detail { - template -struct is_scalar_impl -{ - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_or< - ::boost::is_arithmetic::value, - ::boost::is_enum::value, - ::boost::is_pointer::value, - ::boost::is_member_pointer::value - >::value)); -}; - -// these specializations are only really needed for compilers -// without partial specialization support: -template <> struct is_scalar_impl{ BOOST_STATIC_CONSTANT(bool, value = false ); }; -#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -template <> struct is_scalar_impl{ BOOST_STATIC_CONSTANT(bool, value = false ); }; -template <> struct is_scalar_impl{ BOOST_STATIC_CONSTANT(bool, value = false ); }; -template <> struct is_scalar_impl{ BOOST_STATIC_CONSTANT(bool, value = false ); }; -#endif - -} // namespace detail - -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_scalar,T,::boost::detail::is_scalar_impl::value) +struct is_scalar + : public integral_constant::value || ::boost::is_enum::value || ::boost::is_pointer::value || ::boost::is_member_pointer::value> +{}; } // namespace boost -#include - #endif // BOOST_TT_IS_SCALAR_HPP_INCLUDED diff --git a/include/boost/type_traits/is_signed.hpp b/include/boost/type_traits/is_signed.hpp index 5673284..48facd3 100644 --- a/include/boost/type_traits/is_signed.hpp +++ b/include/boost/type_traits/is_signed.hpp @@ -13,19 +13,16 @@ #include #include #include -#include - -// should be the last #include -#include +#include namespace boost { #if !defined( __CODEGEARC__ ) -namespace detail{ - #if !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238) && !defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION) +namespace detail{ + template struct is_signed_values { @@ -67,70 +64,98 @@ struct is_signed_select_helper }; template -struct is_signed_imp +struct is_signed_impl { - typedef is_signed_select_helper< - ::boost::type_traits::ice_or< - ::boost::is_integral::value, - ::boost::is_enum::value>::value - > selector; + typedef ::boost::detail::is_signed_select_helper< ::boost::is_integral::value || ::boost::is_enum::value> selector; typedef typename selector::template rebind binder; typedef typename binder::type type; BOOST_STATIC_CONSTANT(bool, value = type::value); }; -#else - -template struct is_signed_imp : public false_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -#ifdef BOOST_HAS_LONG_LONG -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -#endif -#if defined(CHAR_MIN) && (CHAR_MIN != 0) -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -#endif -#if defined(WCHAR_MIN) && (WCHAR_MIN != 0) -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -template <> struct is_signed_imp : public true_type{}; -#endif - -#endif - } -#endif // !defined( __CODEGEARC__ ) +template struct is_signed : public integral_constant::value> {}; -#if defined( __CODEGEARC__ ) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_signed,T,__is_signed(T)) #else -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_signed,T,::boost::detail::is_signed_imp::value) + +template struct is_signed : public false_type{}; + #endif +#else //defined( __CODEGEARC__ ) + template struct is_signed : public integral_constant{}; +#endif + +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; + +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +#ifdef BOOST_HAS_LONG_LONG +template <> struct is_signed< ::boost::long_long_type> : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; + +template <> struct is_signed< ::boost::ulong_long_type> : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +#endif +#if defined(CHAR_MIN) +#if CHAR_MIN != 0 +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +#else +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +#endif +#endif +#if defined(WCHAR_MIN) && !defined(BOOST_NO_INTRINSIC_WCHAR_T) +#if WCHAR_MIN != 0 +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +template <> struct is_signed : public true_type{}; +#else +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +template <> struct is_signed : public false_type{}; +#endif +#endif } // namespace boost -#include - #endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED diff --git a/include/boost/type_traits/is_stateless.hpp b/include/boost/type_traits/is_stateless.hpp index d8d4063..f9266da 100644 --- a/include/boost/type_traits/is_stateless.hpp +++ b/include/boost/type_traits/is_stateless.hpp @@ -14,35 +14,20 @@ #include #include #include -#include #include -// should be the last #include -#include - namespace boost { -namespace detail { - template -struct is_stateless_impl -{ - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_and< - ::boost::has_trivial_constructor::value, - ::boost::has_trivial_copy::value, - ::boost::has_trivial_destructor::value, - ::boost::is_class::value, - ::boost::is_empty::value - >::value)); -}; - -} // namespace detail - -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_stateless,T,::boost::detail::is_stateless_impl::value) +struct is_stateless + : public integral_constant::value + && ::boost::has_trivial_copy::value + && ::boost::has_trivial_destructor::value + && ::boost::is_class::value + && ::boost::is_empty::value)> +{}; } // namespace boost -#include - #endif // BOOST_TT_IS_STATELESS_HPP_INCLUDED diff --git a/include/boost/type_traits/is_union.hpp b/include/boost/type_traits/is_union.hpp index 610f162..c5e1a96 100644 --- a/include/boost/type_traits/is_union.hpp +++ b/include/boost/type_traits/is_union.hpp @@ -11,47 +11,21 @@ #ifndef BOOST_TT_IS_UNION_HPP_INCLUDED #define BOOST_TT_IS_UNION_HPP_INCLUDED -#include -#include #include - -// should be the last #include -#include +#include namespace boost { -namespace detail { -#ifndef __GNUC__ -template struct is_union_impl -{ - typedef typename remove_cv::type cvt; #ifdef BOOST_IS_UNION - BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_UNION(cvt)); +template struct is_union : public integral_constant {}; #else - BOOST_STATIC_CONSTANT(bool, value = false); +template struct is_union : public integral_constant {}; #endif -}; -#else -// -// using remove_cv here generates a whole load of needless -// warnings with gcc, since it doesn't do any good with gcc -// in any case (at least at present), just remove it: -// -template struct is_union_impl -{ -#ifdef BOOST_IS_UNION - BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_UNION(T)); -#else - BOOST_STATIC_CONSTANT(bool, value = false); -#endif -}; -#endif -} // namespace detail -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_union,T,::boost::detail::is_union_impl::value) +template struct is_union : public is_union{}; +template struct is_union : public is_union{}; +template struct is_union : public is_union{}; } // namespace boost -#include - #endif // BOOST_TT_IS_UNION_HPP_INCLUDED diff --git a/include/boost/type_traits/is_unsigned.hpp b/include/boost/type_traits/is_unsigned.hpp index 0602838..309f3ed 100644 --- a/include/boost/type_traits/is_unsigned.hpp +++ b/include/boost/type_traits/is_unsigned.hpp @@ -13,19 +13,17 @@ #include #include #include -#include -// should be the last #include -#include +#include namespace boost { #if !defined( __CODEGEARC__ ) -namespace detail{ - #if !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238) && !defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION) +namespace detail{ + template struct is_unsigned_values { @@ -46,7 +44,7 @@ struct is_ununsigned_helper }; template -struct is_ununsigned_select_helper +struct is_unsigned_select_helper { template struct rebind @@ -56,7 +54,7 @@ struct is_ununsigned_select_helper }; template <> -struct is_ununsigned_select_helper +struct is_unsigned_select_helper { template struct rebind @@ -66,70 +64,98 @@ struct is_ununsigned_select_helper }; template -struct is_unsigned_imp +struct is_unsigned { - typedef is_ununsigned_select_helper< - ::boost::type_traits::ice_or< - ::boost::is_integral::value, - ::boost::is_enum::value>::value - > selector; + typedef ::boost::detail::is_unsigned_select_helper< ::boost::is_integral::value || ::boost::is_enum::value > selector; typedef typename selector::template rebind binder; typedef typename binder::type type; BOOST_STATIC_CONSTANT(bool, value = type::value); }; +} // namespace detail + +template struct is_unsigned : public integral_constant::value> {}; + #else -template struct is_unsigned_imp : public false_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; +template struct is_unsigned : public false_type{}; + +#endif + +#else // defined( __CODEGEARC__ ) +template struct is_unsigned : public integral_constant {}; +#endif + +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; + +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned< short> : public false_type{}; +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned< int> : public false_type{}; +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned< long> : public false_type{}; +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned : public false_type{}; #ifdef BOOST_HAS_LONG_LONG -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -#endif -#if defined(CHAR_MIN) && (CHAR_MIN == 0) -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -#endif -#if defined(WCHAR_MIN) && (WCHAR_MIN == 0) && !defined(BOOST_NO_INTRINSIC_WCHAR_T) -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -template <> struct is_unsigned_imp : public true_type{}; -#endif +template <> struct is_unsigned< ::boost::ulong_long_type> : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned< ::boost::long_long_type> : public false_type{}; +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned : public false_type{}; #endif - -} - -#endif // !defined( __CODEGEARC__ ) - -#if defined( __CODEGEARC__ ) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_unsigned,T,__is_unsigned(T)) +#if defined(CHAR_MIN) +#if CHAR_MIN == 0 +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; #else -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_unsigned,T,::boost::detail::is_unsigned_imp::value) +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned : public false_type{}; +#endif +#endif +#if !defined(BOOST_NO_INTRINSIC_WCHAR_T) && defined(WCHAR_MIN) +#if WCHAR_MIN == 0 +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +template <> struct is_unsigned : public true_type{}; +#else +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned : public false_type{}; +template <> struct is_unsigned : public false_type{}; +#endif #endif - } // namespace boost -#include - #endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED diff --git a/include/boost/type_traits/is_virtual_base_of.hpp b/include/boost/type_traits/is_virtual_base_of.hpp index 3daad1b..f005256 100644 --- a/include/boost/type_traits/is_virtual_base_of.hpp +++ b/include/boost/type_traits/is_virtual_base_of.hpp @@ -10,11 +10,6 @@ #include #include -#include -#include - -// should be the last #include -#include namespace boost { namespace detail { @@ -34,7 +29,7 @@ struct is_virtual_base_of_impl }; template -struct is_virtual_base_of_impl +struct is_virtual_base_of_impl { union max_align { @@ -88,7 +83,7 @@ struct is_virtual_base_of_impl template struct is_virtual_base_of_impl2 { - typedef typename mpl::and_, mpl::not_ > >::type tag_type; + typedef boost::integral_constant::value && ! boost::is_same::value)> tag_type; typedef is_virtual_base_of_impl imp; BOOST_STATIC_CONSTANT(bool, value = imp::value); }; @@ -99,19 +94,12 @@ struct is_virtual_base_of_impl2 } // namespace detail -BOOST_TT_AUX_BOOL_TRAIT_DEF2( - is_virtual_base_of - , Base - , Derived - , (::boost::detail::is_virtual_base_of_impl2::value) -) +template struct is_virtual_base_of : public integral_constant::value)>{}; -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_virtual_base_of,Base&,Derived,false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_virtual_base_of,Base,Derived&,false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_virtual_base_of,Base&,Derived&,false) +template struct is_virtual_base_of : public false_type{}; +template struct is_virtual_base_of : public false_type{}; +template struct is_virtual_base_of : public false_type{}; } // namespace boost -#include - #endif diff --git a/include/boost/type_traits/is_void.hpp b/include/boost/type_traits/is_void.hpp index 6f6fbff..183f8ab 100644 --- a/include/boost/type_traits/is_void.hpp +++ b/include/boost/type_traits/is_void.hpp @@ -9,30 +9,18 @@ #ifndef BOOST_TT_IS_VOID_HPP_INCLUDED #define BOOST_TT_IS_VOID_HPP_INCLUDED -#include - -// should be the last #include -#include +#include namespace boost { -//* is a type T void - is_void -#if defined( __CODEGEARC__ ) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_void,T,__is_void(T)) -#else -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_void,T,false) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_void,void,true) +template +struct is_void : public false_type {}; -#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_void,void const,true) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_void,void volatile,true) -BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_void,void const volatile,true) -#endif - -#endif // non-CodeGear implementation +template<> struct is_void : public true_type {}; +template<> struct is_void : public true_type{}; +template<> struct is_void : public true_type{}; +template<> struct is_void : public true_type{}; } // namespace boost -#include - #endif // BOOST_TT_IS_VOID_HPP_INCLUDED diff --git a/include/boost/type_traits/is_volatile.hpp b/include/boost/type_traits/is_volatile.hpp index d9839da..cefe987 100644 --- a/include/boost/type_traits/is_volatile.hpp +++ b/include/boost/type_traits/is_volatile.hpp @@ -21,64 +21,25 @@ #ifndef BOOST_TT_IS_VOLATILE_HPP_INCLUDED #define BOOST_TT_IS_VOLATILE_HPP_INCLUDED -#include -#include - -# include -# if BOOST_WORKAROUND(BOOST_MSVC, < 1400) -# include -# endif - -// should be the last #include -#include +#include namespace boost { -namespace detail{ -template -struct is_volatile_rval_filter -{ -#if BOOST_WORKAROUND(BOOST_MSVC, < 1400) - BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::cv_traits_imp::type*>::is_volatile); -#else - BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::cv_traits_imp::is_volatile); -#endif -}; -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES -// -// We can't filter out rvalue_references at the same level as -// references or we get ambiguities from msvc: -// -template -struct is_volatile_rval_filter -{ - BOOST_STATIC_CONSTANT(bool, value = false); -}; -#endif -} - #if defined( __CODEGEARC__ ) -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_volatile,T,__is_volatile(T)) + + template + struct is_volatile : public integral_constant {}; + #else -//* is a type T declared volatile - is_volatile -BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_volatile,T,::boost::detail::is_volatile_rval_filter::value) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_volatile,T&,false) - -#if defined(BOOST_ILLEGAL_CV_REFERENCES) -// these are illegal specialisations; cv-qualifies applied to -// references have no effect according to [8.3.2p1], -// C++ Builder requires them though as it treats cv-qualified -// references as distinct types... -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_volatile,T& const,false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_volatile,T& volatile,false) -BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_volatile,T& const volatile,false) -#endif + template + struct is_volatile : public false_type {}; + template struct is_volatile : public true_type{}; + template struct is_volatile : public true_type{}; + template struct is_volatile : public true_type{}; #endif } // namespace boost -#include - #endif // BOOST_TT_IS_VOLATILE_HPP_INCLUDED diff --git a/include/boost/type_traits/make_signed.hpp b/include/boost/type_traits/make_signed.hpp index 51cdbb0..0d2d5df 100644 --- a/include/boost/type_traits/make_signed.hpp +++ b/include/boost/type_traits/make_signed.hpp @@ -9,7 +9,7 @@ #ifndef BOOST_TT_MAKE_SIGNED_HPP_INCLUDED #define BOOST_TT_MAKE_SIGNED_HPP_INCLUDED -#include +#include #include #include #include @@ -20,58 +20,45 @@ #include #include #include -#include -#include -#include #include -// should be the last #include -#include - namespace boost { -namespace detail { - template -struct make_signed_imp +struct make_signed { - BOOST_STATIC_ASSERT( - (::boost::type_traits::ice_or< ::boost::is_integral::value, ::boost::is_enum::value>::value)); - BOOST_STATIC_ASSERT( - (::boost::type_traits::ice_not< ::boost::is_same< - typename remove_cv::type, bool>::value>::value)); +private: + BOOST_STATIC_ASSERT_MSG(( ::boost::is_integral::value || ::boost::is_enum::value), "The template argument to make_signed must be an integer or enum type."); + BOOST_STATIC_ASSERT_MSG(!(::boost::is_same::type, bool>::value), "The template argument to make_signed must not be the type bool."); typedef typename remove_cv::type t_no_cv; - typedef typename mpl::if_c< - (::boost::type_traits::ice_and< - ::boost::is_signed::value, - ::boost::is_integral::value, - ::boost::type_traits::ice_not< ::boost::is_same::value>::value, - ::boost::type_traits::ice_not< ::boost::is_same::value>::value, - ::boost::type_traits::ice_not< ::boost::is_same::value>::value >::value), + typedef typename conditional< + (::boost::is_signed::value + && ::boost::is_integral::value + && ! ::boost::is_same::value + && ! ::boost::is_same::value + && ! ::boost::is_same::value), T, - typename mpl::if_c< - (::boost::type_traits::ice_and< - ::boost::is_integral::value, - ::boost::type_traits::ice_not< ::boost::is_same::value>::value, - ::boost::type_traits::ice_not< ::boost::is_same::value>::value, - ::boost::type_traits::ice_not< ::boost::is_same::value>::value> - ::value), - typename mpl::if_< - is_same, + typename conditional< + (::boost::is_integral::value + && ! ::boost::is_same::value + && ! ::boost::is_same::value + && ! ::boost::is_same::value), + typename conditional< + is_same::value, signed char, - typename mpl::if_< - is_same, + typename conditional< + is_same::value, signed short, - typename mpl::if_< - is_same, + typename conditional< + is_same::value, int, - typename mpl::if_< - is_same, + typename conditional< + is_same::value, long, #if defined(BOOST_HAS_LONG_LONG) #ifdef BOOST_HAS_INT128 - typename mpl::if_c< + typename conditional< sizeof(t_no_cv) == sizeof(boost::long_long_type), boost::long_long_type, boost::int128_type @@ -89,21 +76,21 @@ struct make_signed_imp >::type >::type, // Not a regular integer type: - typename mpl::if_c< + typename conditional< sizeof(t_no_cv) == sizeof(unsigned char), signed char, - typename mpl::if_c< + typename conditional< sizeof(t_no_cv) == sizeof(unsigned short), signed short, - typename mpl::if_c< + typename conditional< sizeof(t_no_cv) == sizeof(unsigned int), int, - typename mpl::if_c< + typename conditional< sizeof(t_no_cv) == sizeof(unsigned long), long, #if defined(BOOST_HAS_LONG_LONG) #ifdef BOOST_HAS_INT128 - typename mpl::if_c< + typename conditional< sizeof(t_no_cv) == sizeof(boost::long_long_type), boost::long_long_type, boost::int128_type @@ -124,28 +111,21 @@ struct make_signed_imp >::type base_integer_type; // Add back any const qualifier: - typedef typename mpl::if_< - is_const, + typedef typename conditional< + is_const::value, typename add_const::type, base_integer_type >::type const_base_integer_type; - +public: // Add back any volatile qualifier: - typedef typename mpl::if_< - is_volatile, + typedef typename conditional< + is_volatile::value, typename add_volatile::type, const_base_integer_type >::type type; }; - -} // namespace detail - -BOOST_TT_AUX_TYPE_TRAIT_DEF1(make_signed,T,typename boost::detail::make_signed_imp::type) - } // namespace boost -#include - #endif // BOOST_TT_ADD_REFERENCE_HPP_INCLUDED diff --git a/include/boost/type_traits/make_unsigned.hpp b/include/boost/type_traits/make_unsigned.hpp index 239153a..4b21eba 100644 --- a/include/boost/type_traits/make_unsigned.hpp +++ b/include/boost/type_traits/make_unsigned.hpp @@ -9,7 +9,7 @@ #ifndef BOOST_TT_MAKE_UNSIGNED_HPP_INCLUDED #define BOOST_TT_MAKE_UNSIGNED_HPP_INCLUDED -#include +#include #include #include #include @@ -20,58 +20,44 @@ #include #include #include -#include -#include -#include #include -// should be the last #include -#include - namespace boost { -namespace detail { - template -struct make_unsigned_imp +struct make_unsigned { - BOOST_STATIC_ASSERT( - (::boost::type_traits::ice_or< ::boost::is_integral::value, ::boost::is_enum::value>::value)); - BOOST_STATIC_ASSERT( - (::boost::type_traits::ice_not< ::boost::is_same< - typename remove_cv::type, bool>::value>::value)); +private: + BOOST_STATIC_ASSERT_MSG((::boost::is_integral::value || ::boost::is_enum::value), "The template argument to make_unsigned must be an integer or enum type."); + BOOST_STATIC_ASSERT_MSG((! ::boost::is_same::type, bool>::value), "The template argument to make_unsigned must not be the type bool"); typedef typename remove_cv::type t_no_cv; - typedef typename mpl::if_c< - (::boost::type_traits::ice_and< - ::boost::is_unsigned::value, - ::boost::is_integral::value, - ::boost::type_traits::ice_not< ::boost::is_same::value>::value, - ::boost::type_traits::ice_not< ::boost::is_same::value>::value, - ::boost::type_traits::ice_not< ::boost::is_same::value>::value >::value), + typedef typename conditional< + (::boost::is_unsigned::value && ::boost::is_integral::value + && ! ::boost::is_same::value + && ! ::boost::is_same::value + && ! ::boost::is_same::value), T, - typename mpl::if_c< - (::boost::type_traits::ice_and< - ::boost::is_integral::value, - ::boost::type_traits::ice_not< ::boost::is_same::value>::value, - ::boost::type_traits::ice_not< ::boost::is_same::value>::value, - ::boost::type_traits::ice_not< ::boost::is_same::value>::value> - ::value), - typename mpl::if_< - is_same, + typename conditional< + (::boost::is_integral::value + && ! ::boost::is_same::value + && ! ::boost::is_same::value + && ! ::boost::is_same::value), + typename conditional< + is_same::value, unsigned char, - typename mpl::if_< - is_same, + typename conditional< + is_same::value, unsigned short, - typename mpl::if_< - is_same, + typename conditional< + is_same::value, unsigned int, - typename mpl::if_< - is_same, + typename conditional< + is_same::value, unsigned long, #if defined(BOOST_HAS_LONG_LONG) #ifdef BOOST_HAS_INT128 - typename mpl::if_c< + typename conditional< sizeof(t_no_cv) == sizeof(boost::ulong_long_type), boost::ulong_long_type, boost::uint128_type @@ -89,21 +75,21 @@ struct make_unsigned_imp >::type >::type, // Not a regular integer type: - typename mpl::if_c< + typename conditional< sizeof(t_no_cv) == sizeof(unsigned char), unsigned char, - typename mpl::if_c< + typename conditional< sizeof(t_no_cv) == sizeof(unsigned short), unsigned short, - typename mpl::if_c< + typename conditional< sizeof(t_no_cv) == sizeof(unsigned int), unsigned int, - typename mpl::if_c< + typename conditional< sizeof(t_no_cv) == sizeof(unsigned long), unsigned long, #if defined(BOOST_HAS_LONG_LONG) #ifdef BOOST_HAS_INT128 - typename mpl::if_c< + typename conditional< sizeof(t_no_cv) == sizeof(boost::ulong_long_type), boost::ulong_long_type, boost::uint128_type @@ -124,28 +110,21 @@ struct make_unsigned_imp >::type base_integer_type; // Add back any const qualifier: - typedef typename mpl::if_< - is_const, + typedef typename conditional< + is_const::value, typename add_const::type, base_integer_type >::type const_base_integer_type; - +public: // Add back any volatile qualifier: - typedef typename mpl::if_< - is_volatile, + typedef typename conditional< + is_volatile::value, typename add_volatile::type, const_base_integer_type >::type type; }; - -} // namespace detail - -BOOST_TT_AUX_TYPE_TRAIT_DEF1(make_unsigned,T,typename boost::detail::make_unsigned_imp::type) - } // namespace boost -#include - #endif // BOOST_TT_ADD_REFERENCE_HPP_INCLUDED diff --git a/include/boost/type_traits/promote.hpp b/include/boost/type_traits/promote.hpp index 60f6278..587617a 100644 --- a/include/boost/type_traits/promote.hpp +++ b/include/boost/type_traits/promote.hpp @@ -10,31 +10,11 @@ #include #include -// Should be the last #include -#include - namespace boost { -namespace detail { - -template -struct promote_impl - : public integral_promotion< - BOOST_DEDUCED_TYPENAME floating_point_promotion::type - > -{ -}; +template struct promote : public integral_promotion::type>{}; } -BOOST_TT_AUX_TYPE_TRAIT_DEF1( - promote - , T - , BOOST_DEDUCED_TYPENAME boost::detail::promote_impl::type - ) -} - -#include - #endif // #ifndef FILE_boost_type_traits_promote_hpp_INCLUDED diff --git a/include/boost/type_traits/rank.hpp b/include/boost/type_traits/rank.hpp index 33f46c8..3dfc693 100644 --- a/include/boost/type_traits/rank.hpp +++ b/include/boost/type_traits/rank.hpp @@ -10,8 +10,7 @@ #ifndef BOOST_TT_RANK_HPP_INCLUDED #define BOOST_TT_RANK_HPP_INCLUDED -// should be the last #include -#include +#include namespace boost { @@ -77,13 +76,11 @@ struct rank_imp #endif // !defined( __CODEGEARC__ ) #if defined( __CODEGEARC__ ) -BOOST_TT_AUX_SIZE_T_TRAIT_DEF1(rank,T,__array_rank(T)) +template struct rank : public integral_constant{}; #else -BOOST_TT_AUX_SIZE_T_TRAIT_DEF1(rank,T,(::boost::detail::rank_imp::value)) +template struct rank : public integral_constant::value)>{}; #endif } // namespace boost -#include - #endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED diff --git a/include/boost/type_traits/remove_all_extents.hpp b/include/boost/type_traits/remove_all_extents.hpp index 1409da1..3ccdc98 100644 --- a/include/boost/type_traits/remove_all_extents.hpp +++ b/include/boost/type_traits/remove_all_extents.hpp @@ -13,28 +13,23 @@ #include #include -// should be the last #include -#include - namespace boost { -BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_all_extents,T,T) +template struct remove_all_extents{ typedef T type; }; #if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_all_extents,T[N],typename boost::remove_all_extents::type type) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_all_extents,T const[N],typename boost::remove_all_extents::type type) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_all_extents,T volatile[N],typename boost::remove_all_extents::type type) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_all_extents,T const volatile[N],typename boost::remove_all_extents::type type) +template struct remove_all_extents : public remove_all_extents{}; +template struct remove_all_extents : public remove_all_extents{}; +template struct remove_all_extents : public remove_all_extents{}; +template struct remove_all_extents : public remove_all_extents{}; #if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610)) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840)) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_all_extents,T[],typename boost::remove_all_extents::type) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_all_extents,T const[],typename boost::remove_all_extents::type) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_all_extents,T volatile[],typename boost::remove_all_extents::type) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_all_extents,T const volatile[],typename boost::remove_all_extents::type) +template struct remove_all_extents : public remove_all_extents{}; +template struct remove_all_extents : public remove_all_extents{}; +template struct remove_all_extents : public remove_all_extents{}; +template struct remove_all_extents : public remove_all_extents{}; #endif #endif } // namespace boost -#include - #endif // BOOST_TT_REMOVE_BOUNDS_HPP_INCLUDED diff --git a/include/boost/type_traits/remove_bounds.hpp b/include/boost/type_traits/remove_bounds.hpp index 2d26348..56988d2 100644 --- a/include/boost/type_traits/remove_bounds.hpp +++ b/include/boost/type_traits/remove_bounds.hpp @@ -9,32 +9,13 @@ #ifndef BOOST_TT_REMOVE_BOUNDS_HPP_INCLUDED #define BOOST_TT_REMOVE_BOUNDS_HPP_INCLUDED -#include -#include -#include +#include -// should be the last #include -#include +namespace boost +{ -namespace boost { - -BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_bounds,T,T) - -#if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_bounds,T[N],T type) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_bounds,T const[N],T const type) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_bounds,T volatile[N],T volatile type) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_bounds,T const volatile[N],T const volatile type) -#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610)) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840)) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_bounds,T[],T) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_bounds,T const[],T const) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_bounds,T volatile[],T volatile) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_bounds,T const volatile[],T const volatile) -#endif -#endif +template struct remove_bounds : public remove_extent {}; } // namespace boost -#include - #endif // BOOST_TT_REMOVE_BOUNDS_HPP_INCLUDED diff --git a/include/boost/type_traits/remove_const.hpp b/include/boost/type_traits/remove_const.hpp index 1020781..b47f851 100644 --- a/include/boost/type_traits/remove_const.hpp +++ b/include/boost/type_traits/remove_const.hpp @@ -11,69 +11,23 @@ #ifndef BOOST_TT_REMOVE_CONST_HPP_INCLUDED #define BOOST_TT_REMOVE_CONST_HPP_INCLUDED -#include -#include #include -#include - #include - -// should be the last #include -#include +#include namespace boost { + // convert a type T to a non-cv-qualified type - remove_const + template struct remove_const{ typedef T type; }; + template struct remove_const{ typedef T type; }; -namespace detail { - -template -struct remove_const_helper -{ - typedef T type; -}; - -template -struct remove_const_helper -{ - typedef T volatile type; -}; - - -template -struct remove_const_impl -{ - typedef typename remove_const_helper< - typename cv_traits_imp::unqualified_type - , ::boost::is_volatile::value - >::type type; -}; - -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES -// -// We can't filter out rvalue_references at the same level as -// references or we get ambiguities from msvc: -// -template -struct remove_const_impl -{ - typedef T&& type; -}; -#endif - -} // namespace detail - -// * convert a type T to non-const type - remove_const - -BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_const,T,typename boost::detail::remove_const_impl::type) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_const,T&,T&) #if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_const,T const[N],T type[N]) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_const,T const volatile[N],T volatile type[N]) + template struct remove_const{ typedef T type[N]; }; +#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840)) + template struct remove_const{ typedef T type[]; }; +#endif #endif - } // namespace boost -#include - #endif // BOOST_TT_REMOVE_CONST_HPP_INCLUDED diff --git a/include/boost/type_traits/remove_cv.hpp b/include/boost/type_traits/remove_cv.hpp index 9ba34a1..b50607f 100644 --- a/include/boost/type_traits/remove_cv.hpp +++ b/include/boost/type_traits/remove_cv.hpp @@ -11,53 +11,30 @@ #ifndef BOOST_TT_REMOVE_CV_HPP_INCLUDED #define BOOST_TT_REMOVE_CV_HPP_INCLUDED -#include #include #include - #include -// should be the last #include -#include - namespace boost { + // convert a type T to a non-cv-qualified type - remove_cv +template struct remove_cv{ typedef T type; }; +template struct remove_cv{ typedef T type; }; +template struct remove_cv{ typedef T type; }; +template struct remove_cv{ typedef T type; }; -namespace detail{ - -template -struct rvalue_ref_filter_rem_cv -{ - typedef typename boost::detail::cv_traits_imp::unqualified_type type; -}; - -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES -// -// We can't filter out rvalue_references at the same level as -// references or we get ambiguities from msvc: -// -template -struct rvalue_ref_filter_rem_cv -{ - typedef T&& type; -}; -#endif - -} - - -// convert a type T to a non-cv-qualified type - remove_cv -BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_cv,T,typename boost::detail::rvalue_ref_filter_rem_cv::type) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_cv,T&,T&) #if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_cv,T const[N],T type[N]) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_cv,T volatile[N],T type[N]) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_cv,T const volatile[N],T type[N]) +template struct remove_cv{ typedef T type[N]; }; +template struct remove_cv{ typedef T type[N]; }; +template struct remove_cv{ typedef T type[N]; }; +#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840)) +template struct remove_cv{ typedef T type[]; }; +template struct remove_cv{ typedef T type[]; }; +template struct remove_cv{ typedef T type[]; }; +#endif #endif } // namespace boost -#include - #endif // BOOST_TT_REMOVE_CV_HPP_INCLUDED diff --git a/include/boost/type_traits/remove_extent.hpp b/include/boost/type_traits/remove_extent.hpp index 9c4cdff..0b50a07 100644 --- a/include/boost/type_traits/remove_extent.hpp +++ b/include/boost/type_traits/remove_extent.hpp @@ -13,28 +13,23 @@ #include #include -// should be the last #include -#include - namespace boost { -BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_extent,T,T) +template struct remove_extent{ typedef T type; }; #if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_extent,T[N],T type) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_extent,T const[N],T const type) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_extent,T volatile[N],T volatile type) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_extent,T const volatile[N],T const volatile type) +template struct remove_extent { typedef T type; }; +template struct remove_extent { typedef T const type; }; +template struct remove_extent { typedef T volatile type; }; +template struct remove_extent { typedef T const volatile type; }; #if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610)) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840)) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_extent,T[],T) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_extent,T const[],T const) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_extent,T volatile[],T volatile) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_extent,T const volatile[],T const volatile) +template struct remove_extent { typedef T type; }; +template struct remove_extent { typedef T const type; }; +template struct remove_extent { typedef T volatile type; }; +template struct remove_extent { typedef T const volatile type; }; #endif #endif } // namespace boost -#include - #endif // BOOST_TT_REMOVE_BOUNDS_HPP_INCLUDED diff --git a/include/boost/type_traits/remove_pointer.hpp b/include/boost/type_traits/remove_pointer.hpp index fef7068..fb79e59 100644 --- a/include/boost/type_traits/remove_pointer.hpp +++ b/include/boost/type_traits/remove_pointer.hpp @@ -10,16 +10,12 @@ #define BOOST_TT_REMOVE_POINTER_HPP_INCLUDED #include -#include #if defined(BOOST_MSVC) #include #include #endif -// should be the last #include -#include - namespace boost { #ifdef BOOST_MSVC @@ -64,20 +60,18 @@ namespace detail{ }; } -BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_pointer,T,typename boost::detail::remove_pointer_imp2::type) +template struct remove_pointer{ typedef typename boost::detail::remove_pointer_imp2::type type; }; #else -BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_pointer,T,T) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_pointer,T*,T) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_pointer,T* const,T) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_pointer,T* volatile,T) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_pointer,T* const volatile,T) +template struct remove_pointer{ typedef T type; }; +template struct remove_pointer{ typedef T type; }; +template struct remove_pointer{ typedef T type; }; +template struct remove_pointer{ typedef T type; }; +template struct remove_pointer{ typedef T type; }; #endif } // namespace boost -#include - #endif // BOOST_TT_REMOVE_POINTER_HPP_INCLUDED diff --git a/include/boost/type_traits/remove_reference.hpp b/include/boost/type_traits/remove_reference.hpp index c59e7e3..f75e677 100644 --- a/include/boost/type_traits/remove_reference.hpp +++ b/include/boost/type_traits/remove_reference.hpp @@ -12,9 +12,6 @@ #include #include -// should be the last #include -#include - namespace boost { @@ -38,22 +35,20 @@ struct remove_rvalue_ref } // namespace detail -BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_reference,T,typename boost::detail::remove_rvalue_ref::type) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_reference,T&,T) +template struct remove_reference{ typedef typename boost::detail::remove_rvalue_ref::type type; }; +template struct remove_reference{ typedef T type; }; #if defined(BOOST_ILLEGAL_CV_REFERENCES) // these are illegal specialisations; cv-qualifies applied to // references have no effect according to [8.3.2p1], // C++ Builder requires them though as it treats cv-qualified // references as distinct types... -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_reference,T& const,T) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_reference,T& volatile,T) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_reference,T& const volatile,T) +template struct remove_reference{ typedef T type; }; +template struct remove_reference{ typedef T type; }; +template struct remove_reference{ typedef T type; }; #endif } // namespace boost -#include - #endif // BOOST_TT_REMOVE_REFERENCE_HPP_INCLUDED diff --git a/include/boost/type_traits/remove_volatile.hpp b/include/boost/type_traits/remove_volatile.hpp index c202776..475e39d 100644 --- a/include/boost/type_traits/remove_volatile.hpp +++ b/include/boost/type_traits/remove_volatile.hpp @@ -11,67 +11,24 @@ #ifndef BOOST_TT_REMOVE_VOLATILE_HPP_INCLUDED #define BOOST_TT_REMOVE_VOLATILE_HPP_INCLUDED -#include -#include #include #include - #include -// should be the last #include -#include - namespace boost { + // convert a type T to a non-cv-qualified type - remove_volatile + template struct remove_volatile{ typedef T type; }; + template struct remove_volatile{ typedef T type; }; -namespace detail { - -template -struct remove_volatile_helper -{ - typedef T type; -}; - -template -struct remove_volatile_helper -{ - typedef T const type; -}; - -template -struct remove_volatile_impl -{ - typedef typename remove_volatile_helper< - typename cv_traits_imp::unqualified_type - , ::boost::is_const::value - >::type type; -}; - -// -// We can't filter out rvalue_references at the same level as -// references or we get ambiguities from msvc: -// -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES -template -struct remove_volatile_impl -{ - typedef T&& type; -}; -#endif -} // namespace detail - -// * convert a type T to a non-volatile type - remove_volatile - -BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_volatile,T,typename boost::detail::remove_volatile_impl::type) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_volatile,T&,T&) #if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_volatile,T volatile[N],T type[N]) -BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_volatile,T const volatile[N],T const type[N]) + template struct remove_volatile{ typedef T type[N]; }; +#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840)) + template struct remove_volatile{ typedef T type[]; }; +#endif #endif } // namespace boost -#include - #endif // BOOST_TT_REMOVE_VOLATILE_HPP_INCLUDED diff --git a/include/boost/type_traits/transform_traits_spec.hpp b/include/boost/type_traits/transform_traits_spec.hpp deleted file mode 100644 index b12b5f8..0000000 --- a/include/boost/type_traits/transform_traits_spec.hpp +++ /dev/null @@ -1,14 +0,0 @@ - -// Copyright 2001 Aleksey Gurtovoy. -// 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). -// -// See http://www.boost.org/libs/type_traits for most recent version including documentation. - -#ifndef BOOST_TT_TRANSFORM_TRAITS_HPP_INCLUDED -#define BOOST_TT_TRANSFORM_TRAITS_HPP_INCLUDED - -#include - -#endif diff --git a/include/boost/type_traits/type_identity.hpp b/include/boost/type_traits/type_identity.hpp new file mode 100644 index 0000000..6d2dd5b --- /dev/null +++ b/include/boost/type_traits/type_identity.hpp @@ -0,0 +1,22 @@ +#ifndef BOOST_TYPE_TRAITS_TYPE_IDENTITY_HPP_INCLUDED +#define BOOST_TYPE_TRAITS_TYPE_IDENTITY_HPP_INCLUDED + +// +// Copyright 2015 Peter Dimov +// +// 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 +// + +namespace boost +{ + +template struct type_identity +{ + typedef T type; +}; + +} // namespace boost + +#endif // #ifndef BOOST_TYPE_TRAITS_TYPE_IDENTITY_HPP_INCLUDED diff --git a/include/boost/type_traits/type_with_alignment.hpp b/include/boost/type_traits/type_with_alignment.hpp index 7eb66a7..bfd5476 100644 --- a/include/boost/type_traits/type_with_alignment.hpp +++ b/include/boost/type_traits/type_with_alignment.hpp @@ -8,175 +8,83 @@ #ifndef BOOST_TT_TYPE_WITH_ALIGNMENT_INCLUDED #define BOOST_TT_TYPE_WITH_ALIGNMENT_INCLUDED -#include -#include -#include -#include -#include -#include #include #include #include #include - -// should be the last #include -#include - #include +#include #ifdef BOOST_MSVC # pragma warning(push) # pragma warning(disable: 4121) // alignment is sensitive to packing #endif +#ifdef _MSC_VER +#include +#endif + namespace boost { + namespace detail{ #ifndef __BORLANDC__ -namespace detail { + union max_align + { + char c; + short s; + int i; + long l; +#ifndef BOOST_NO_LONG_LONG + boost::long_long_type ll; +#endif +#ifdef BOOST_HAS_INT128 + boost::int128_type i128; +#endif + float f; + double d; + long double ld; +#ifdef BOOST_HAS_FLOAT128 + __float128 f128; +#endif + }; -class alignment_dummy; -typedef void (*function_ptr)(); -typedef int (alignment_dummy::*member_ptr); -typedef int (alignment_dummy::*member_function_ptr)(); +template struct long_double_alignment{ typedef long double type; }; +template struct long_double_alignment{ typedef boost::detail::max_align type; }; -#ifdef BOOST_HAS_LONG_LONG -#define BOOST_TT_ALIGNMENT_BASE_TYPES BOOST_PP_TUPLE_TO_LIST( \ - 12, ( \ - char, short, int, long, ::boost::long_long_type, float, double, long double \ - , void*, function_ptr, member_ptr, member_function_ptr)) -#else -#define BOOST_TT_ALIGNMENT_BASE_TYPES BOOST_PP_TUPLE_TO_LIST( \ - 11, ( \ - char, short, int, long, float, double, long double \ - , void*, function_ptr, member_ptr, member_function_ptr)) +template struct double_alignment{ typedef double type; }; +template struct double_alignment{ typedef typename long_double_alignment::value >= Target>::type type; }; + +#ifndef BOOST_NO_LONG_LONG +template struct long_long_alignment{ typedef boost::long_long_type type; }; +template struct long_long_alignment{ typedef typename double_alignment::value >= Target>::type type; }; #endif -#define BOOST_TT_HAS_ONE_T(D,Data,T) boost::detail::has_one_T< T > +template struct long_alignment{ typedef long type; }; +#ifndef BOOST_NO_LONG_LONG +template struct long_alignment{ typedef typename long_long_alignment::value >= Target>::type type; }; +#else +template struct long_alignment{ typedef typename double_alignment::value >= Target>::type type; }; +#endif -#define BOOST_TT_ALIGNMENT_STRUCT_TYPES \ - BOOST_PP_LIST_TRANSFORM(BOOST_TT_HAS_ONE_T, \ - X, \ - BOOST_TT_ALIGNMENT_BASE_TYPES) +template struct int_alignment{ typedef int type; }; +template struct int_alignment{ typedef typename long_alignment::value >= Target>::type type; }; -#define BOOST_TT_ALIGNMENT_TYPES \ - BOOST_PP_LIST_APPEND(BOOST_TT_ALIGNMENT_BASE_TYPES, \ - BOOST_TT_ALIGNMENT_STRUCT_TYPES) +template struct short_alignment{ typedef short type; }; +template struct short_alignment{ typedef typename int_alignment::value >= Target>::type type; }; -// -// lower_alignment_helper -- -// -// This template gets instantiated a lot, so use partial -// specialization when available to reduce the compiler burden. -// -template -struct lower_alignment_helper -{ - typedef char type; - enum { value = true }; -}; - -template -struct lower_alignment_helper -{ - enum { value = (alignment_of::value == target) }; - typedef typename mpl::if_c::type type; -}; - -#define BOOST_TT_CHOOSE_MIN_ALIGNMENT(R,P,I,T) \ - typename lower_alignment_helper< \ - BOOST_PP_CAT(found,I),target,T \ - >::type BOOST_PP_CAT(t,I); \ - enum { \ - BOOST_PP_CAT(found,BOOST_PP_INC(I)) \ - = lower_alignment_helper::value \ - }; - -#define BOOST_TT_CHOOSE_T(R,P,I,T) T BOOST_PP_CAT(t,I); - -template -struct has_one_T -{ - T data; -}; - -template -union lower_alignment -{ - enum { found0 = false }; - - BOOST_PP_LIST_FOR_EACH_I( - BOOST_TT_CHOOSE_MIN_ALIGNMENT - , ignored - , BOOST_TT_ALIGNMENT_TYPES - ) -}; - -union max_align -{ - BOOST_PP_LIST_FOR_EACH_I( - BOOST_TT_CHOOSE_T - , ignored - , BOOST_TT_ALIGNMENT_TYPES - ) -}; - -#undef BOOST_TT_ALIGNMENT_BASE_TYPES -#undef BOOST_TT_HAS_ONE_T -#undef BOOST_TT_ALIGNMENT_STRUCT_TYPES -#undef BOOST_TT_ALIGNMENT_TYPES -#undef BOOST_TT_CHOOSE_MIN_ALIGNMENT -#undef BOOST_TT_CHOOSE_T - -template -struct is_aligned -{ - BOOST_STATIC_CONSTANT(bool, - value = (TAlign >= Align) & (TAlign % Align == 0) - ); -}; - - -} // namespace detail - -template -struct is_pod< ::boost::detail::lower_alignment > -{ - BOOST_STATIC_CONSTANT(std::size_t, value = true); -}; - -// This alignment method originally due to Brian Parker, implemented by David -// Abrahams, and then ported here by Doug Gregor. -namespace detail{ - -template -class type_with_alignment_imp -{ - typedef ::boost::detail::lower_alignment t1; - typedef typename mpl::if_c< - ::boost::detail::is_aligned< ::boost::alignment_of::value,Align >::value - , t1 - , ::boost::detail::max_align - >::type align_t; - - BOOST_STATIC_CONSTANT(std::size_t, found = alignment_of::value); - - BOOST_STATIC_ASSERT(found >= Align); - BOOST_STATIC_ASSERT(found % Align == 0); - - public: - typedef align_t type; -}; +template struct char_alignment{ typedef char type; }; +template struct char_alignment{ typedef typename short_alignment::value >= Target>::type type; }; } template -class type_with_alignment - : public ::boost::detail::type_with_alignment_imp +struct type_with_alignment { + typedef typename boost::detail::char_alignment::value >= Align>::type type; }; -#if defined(__GNUC__) || (defined (__SUNPRO_CC) && (__SUNPRO_CC >= 0x5130)) +#if (defined(__GNUC__) || (defined (__SUNPRO_CC) && (__SUNPRO_CC >= 0x5130))) && !defined(BOOST_TT_DISABLE_INTRINSICS) namespace tt_align_ns { struct __attribute__((__aligned__(2))) a2 {}; struct __attribute__((__aligned__(4))) a4 {}; @@ -187,26 +95,25 @@ struct __attribute__((__aligned__(64))) a64 {}; struct __attribute__((__aligned__(128))) a128 {}; } -template<> class type_with_alignment<1> { public: typedef char type; }; -template<> class type_with_alignment<2> { public: typedef tt_align_ns::a2 type; }; -template<> class type_with_alignment<4> { public: typedef tt_align_ns::a4 type; }; -template<> class type_with_alignment<8> { public: typedef tt_align_ns::a8 type; }; -template<> class type_with_alignment<16> { public: typedef tt_align_ns::a16 type; }; -template<> class type_with_alignment<32> { public: typedef tt_align_ns::a32 type; }; -template<> class type_with_alignment<64> { public: typedef tt_align_ns::a64 type; }; -template<> class type_with_alignment<128> { public: typedef tt_align_ns::a128 type; }; +template<> struct type_with_alignment<1> { public: typedef char type; }; +template<> struct type_with_alignment<2> { public: typedef tt_align_ns::a2 type; }; +template<> struct type_with_alignment<4> { public: typedef tt_align_ns::a4 type; }; +template<> struct type_with_alignment<8> { public: typedef tt_align_ns::a8 type; }; +template<> struct type_with_alignment<16> { public: typedef tt_align_ns::a16 type; }; +template<> struct type_with_alignment<32> { public: typedef tt_align_ns::a32 type; }; +template<> struct type_with_alignment<64> { public: typedef tt_align_ns::a64 type; }; +template<> struct type_with_alignment<128> { public: typedef tt_align_ns::a128 type; }; + +template<> struct is_pod< ::boost::tt_align_ns::a2> : public true_type{}; +template<> struct is_pod< ::boost::tt_align_ns::a4> : public true_type{}; +template<> struct is_pod< ::boost::tt_align_ns::a8> : public true_type{}; +template<> struct is_pod< ::boost::tt_align_ns::a16> : public true_type{}; +template<> struct is_pod< ::boost::tt_align_ns::a32> : public true_type{}; +template<> struct is_pod< ::boost::tt_align_ns::a64> : public true_type{}; +template<> struct is_pod< ::boost::tt_align_ns::a128> : public true_type{}; -namespace detail { -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a2,true) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a4,true) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a8,true) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a16,true) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a32,true) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a64,true) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a128,true) -} #endif -#if defined(BOOST_MSVC) || (defined(BOOST_INTEL) && defined(_MSC_VER)) +#if (defined(BOOST_MSVC) || (defined(BOOST_INTEL) && defined(_MSC_VER))) && !defined(BOOST_TT_DISABLE_INTRINSICS) // // MSVC supports types which have alignments greater than the normal // maximum: these are used for example in the types __m64 and __m128 @@ -247,57 +154,56 @@ struct __declspec(align(128)) a128 { }; } -template<> class type_with_alignment<8> +template<> struct type_with_alignment<8> { - typedef mpl::if_c< + typedef boost::conditional< ::boost::alignment_of::value < 8, tt_align_ns::a8, - boost::detail::type_with_alignment_imp<8> >::type t1; + boost::detail::char_alignment<8, false> >::type t1; public: typedef t1::type type; }; -template<> class type_with_alignment<16> +template<> struct type_with_alignment<16> { - typedef mpl::if_c< + typedef boost::conditional< ::boost::alignment_of::value < 16, tt_align_ns::a16, - boost::detail::type_with_alignment_imp<16> >::type t1; + boost::detail::char_alignment<16, false> >::type t1; public: typedef t1::type type; }; -template<> class type_with_alignment<32> +template<> struct type_with_alignment<32> { - typedef mpl::if_c< + typedef boost::conditional< ::boost::alignment_of::value < 32, tt_align_ns::a32, - boost::detail::type_with_alignment_imp<32> >::type t1; + boost::detail::char_alignment<32, false> >::type t1; public: typedef t1::type type; }; -template<> class type_with_alignment<64> { - typedef mpl::if_c< +template<> struct type_with_alignment<64> { + typedef boost::conditional< ::boost::alignment_of::value < 64, tt_align_ns::a64, - boost::detail::type_with_alignment_imp<64> >::type t1; + boost::detail::char_alignment<64, false> >::type t1; public: typedef t1::type type; }; -template<> class type_with_alignment<128> { - typedef mpl::if_c< +template<> struct type_with_alignment<128> { + typedef boost::conditional< ::boost::alignment_of::value < 128, tt_align_ns::a128, - boost::detail::type_with_alignment_imp<128> >::type t1; + boost::detail::char_alignment<128, false> >::type t1; public: typedef t1::type type; }; -namespace detail { -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a8,true) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a16,true) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a32,true) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a64,true) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a128,true) -} +template<> struct is_pod< ::boost::tt_align_ns::a8> : public true_type{}; +template<> struct is_pod< ::boost::tt_align_ns::a16> : public true_type{}; +template<> struct is_pod< ::boost::tt_align_ns::a32> : public true_type{}; +template<> struct is_pod< ::boost::tt_align_ns::a64> : public true_type{}; +template<> struct is_pod< ::boost::tt_align_ns::a128> : public true_type{}; + #endif #else @@ -321,13 +227,13 @@ namespace detail { typedef ::boost::tt_align_ns::a16 max_align; -//#if ! BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x610)) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a2,true) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a4,true) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a8,true) -BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::tt_align_ns::a16,true) -//#endif } +//#if ! BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x610)) +template <> struct is_pod< ::boost::tt_align_ns::a2> : public true_type{}; +template <> struct is_pod< ::boost::tt_align_ns::a4> : public true_type{}; +template <> struct is_pod< ::boost::tt_align_ns::a8> : public true_type{}; +template <> struct is_pod< ::boost::tt_align_ns::a16> : public true_type{}; +//#endif template struct type_with_alignment { @@ -350,8 +256,6 @@ template <> struct type_with_alignment<16>{ typedef tt_align_ns::a16 type; }; # pragma warning(pop) #endif -#include - #endif // BOOST_TT_TYPE_WITH_ALIGNMENT_INCLUDED diff --git a/include/boost/utility/declval.hpp b/include/boost/utility/declval.hpp index a4ab2c8..229e9a3 100644 --- a/include/boost/utility/declval.hpp +++ b/include/boost/utility/declval.hpp @@ -8,37 +8,6 @@ #ifndef BOOST_UTILITY_DECLVAL_HPP #define BOOST_UTILITY_DECLVAL_HPP -#include - -//----------------------------------------------------------------------------// - -#include - -//----------------------------------------------------------------------------// -// // -// C++03 implementation of // -// 20.2.4 Function template declval [declval] // -// Written by Vicente J. Botet Escriba // -// // -// 1 The library provides the function template declval to simplify the -// definition of expressions which occur as unevaluated operands. -// 2 Remarks: If this function is used, the program is ill-formed. -// 3 Remarks: The template parameter T of declval may be an incomplete type. -// [ Example: -// -// template -// decltype(static_cast(declval())) convert(From&&); -// -// declares a function template convert which only participates in overloading -// if the type From can be explicitly converted to type To. For another example -// see class template common_type (20.9.7.6). -end example ] -//----------------------------------------------------------------------------// - -namespace boost { - - template - typename add_rvalue_reference::type declval() BOOST_NOEXCEPT; // as unevaluated operand - -} // namespace boost +#include #endif // BOOST_UTILITY_DECLVAL_HPP diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 8f18a9b..c799160 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -20,20 +20,25 @@ project : requirements intel:on sun:on msvc:on + libs/tt2/light/include ; rule all-tests { local result ; - for local source in [ glob *_test.cpp ] udt_specialisations.cpp + for local source in [ glob *_test*.cpp ] { result += [ run $(source) ] ; } + # + # These traits have both intrinsic support, and a std conforming version, test a version with intrinsics disabled for better code coverage: + # + for local source in has_nothrow_assign_test has_nothrow_constr_test has_nothrow_copy_test is_nothrow_move_assignable_test is_nothrow_move_constructible_test + { + result += [ run $(source).cpp : : : BOOST_TT_DISABLE_INTRINSICS : $(source)_no_intrinsics ] ; + } return $(result) ; } test-suite type_traits : [ all-tests ] ; -compile-fail common_type_fail.cpp ; - - diff --git a/test/aligned_storage_test_a2.cpp b/test/aligned_storage_a2_test.cpp similarity index 98% rename from test/aligned_storage_test_a2.cpp rename to test/aligned_storage_a2_test.cpp index fa7360d..f339359 100644 --- a/test/aligned_storage_test_a2.cpp +++ b/test/aligned_storage_a2_test.cpp @@ -59,7 +59,7 @@ void do_check(const T&) #ifndef TEST_STD // Non-Tr1 behaviour: - typedef typename tt::aligned_storage::type t3; + typedef typename tt::aligned_storage::type t3; t3 as3 = { 0, }; must_be_pod pod3; no_unused_warning(as3); diff --git a/test/common_type_3_test.cpp b/test/common_type_3_test.cpp new file mode 100644 index 0000000..fd228b8 --- /dev/null +++ b/test/common_type_3_test.cpp @@ -0,0 +1,22 @@ + +// Copyright Peter Dimov 2015 +// 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.tt.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_type.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif +#include + +TT_TEST_BEGIN(common_type_3) +{ + // just check whether the nullary specialization compiles + tt::common_type<> tmp; + (void)tmp; +} +TT_TEST_END diff --git a/test/common_type_4_test.cpp b/test/common_type_4_test.cpp new file mode 100644 index 0000000..3a6659f --- /dev/null +++ b/test/common_type_4_test.cpp @@ -0,0 +1,57 @@ + +// Copyright Peter Dimov 2015 +// 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.tt.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_type.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif +#include + +TT_TEST_BEGIN(common_type_4) +{ + // the unary case should be the same as decay + + BOOST_CHECK_TYPE(tt::common_type::type, void); + BOOST_CHECK_TYPE(tt::common_type::type, void); + BOOST_CHECK_TYPE(tt::common_type::type, void); + BOOST_CHECK_TYPE(tt::common_type::type, void); + + BOOST_CHECK_TYPE(tt::common_type::type, char); + BOOST_CHECK_TYPE(tt::common_type::type, char); + BOOST_CHECK_TYPE(tt::common_type::type, char); + BOOST_CHECK_TYPE(tt::common_type::type, char); + + BOOST_CHECK_TYPE(tt::common_type::type, char); + BOOST_CHECK_TYPE(tt::common_type::type, char); + BOOST_CHECK_TYPE(tt::common_type::type, char); + BOOST_CHECK_TYPE(tt::common_type::type, char); + + BOOST_CHECK_TYPE(tt::common_type::type, char*); + BOOST_CHECK_TYPE(tt::common_type::type, char const*); + BOOST_CHECK_TYPE(tt::common_type::type, char volatile*); + BOOST_CHECK_TYPE(tt::common_type::type, char const volatile*); + + BOOST_CHECK_TYPE(tt::common_type::type, char*); + BOOST_CHECK_TYPE(tt::common_type::type, char const*); + BOOST_CHECK_TYPE(tt::common_type::type, char volatile*); + BOOST_CHECK_TYPE(tt::common_type::type, char const volatile*); + + BOOST_CHECK_TYPE(tt::common_type::type, char*); + BOOST_CHECK_TYPE(tt::common_type::type, char const*); + BOOST_CHECK_TYPE(tt::common_type::type, char volatile*); + BOOST_CHECK_TYPE(tt::common_type::type, char const volatile*); + + BOOST_CHECK_TYPE(tt::common_type::type, char(*)()); + + BOOST_CHECK_TYPE(tt::common_type::type, UDT(*)()); + BOOST_CHECK_TYPE(tt::common_type::type, UDT const(*)()); + BOOST_CHECK_TYPE(tt::common_type::type, UDT volatile(*)()); + BOOST_CHECK_TYPE(tt::common_type::type, UDT const volatile(*)()); +} +TT_TEST_END diff --git a/test/common_type_5_test.cpp b/test/common_type_5_test.cpp new file mode 100644 index 0000000..0a0e237 --- /dev/null +++ b/test/common_type_5_test.cpp @@ -0,0 +1,56 @@ + +// Copyright Peter Dimov 2015 +// 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.tt.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_type.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif +#include + +template struct X +{ + T t_; + + X(): t_() {} + template X( X const & x ): t_( x.t_ ) {} +}; + +namespace boost +{ + + template struct common_type< X, X > + { + typedef X::type> type; + }; + +} // namespace boost + +TT_TEST_BEGIN(common_type_5) +{ + // user specializations, binary + + BOOST_CHECK_TYPE3( tt::common_type< X, X >::type, X ); + + BOOST_CHECK_TYPE3( tt::common_type< X&, X& >::type, X ); + BOOST_CHECK_TYPE3( tt::common_type< X&, X const& >::type, X ); + BOOST_CHECK_TYPE3( tt::common_type< X const&, X& >::type, X ); + BOOST_CHECK_TYPE3( tt::common_type< X const&, X const& >::type, X ); + + BOOST_CHECK_TYPE3( tt::common_type< X, X >::type, X ); + + BOOST_CHECK_TYPE3( tt::common_type< X&, X& >::type, X ); + BOOST_CHECK_TYPE3( tt::common_type< X&, X const& >::type, X ); + BOOST_CHECK_TYPE3( tt::common_type< X const&, X& >::type, X ); + BOOST_CHECK_TYPE3( tt::common_type< X const&, X const& >::type, X ); + + // ternary + + BOOST_CHECK_TYPE4( tt::common_type< X&, X const&, X volatile& >::type, X ); +} +TT_TEST_END diff --git a/test/common_type_6_test.cpp b/test/common_type_6_test.cpp new file mode 100644 index 0000000..e5ad774 --- /dev/null +++ b/test/common_type_6_test.cpp @@ -0,0 +1,39 @@ + +// Copyright Peter Dimov 2015 +// 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.tt.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_type.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif +#include + +struct X {}; +struct Y: X {}; + +TT_TEST_BEGIN(common_type_6) +{ + // binary case + + BOOST_CHECK_TYPE3(tt::common_type::type, void); + + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + + BOOST_CHECK_TYPE3(tt::common_type::type, X); + BOOST_CHECK_TYPE3(tt::common_type::type, X); + BOOST_CHECK_TYPE3(tt::common_type::type, X); + + BOOST_CHECK_TYPE3(tt::common_type::type, X); + BOOST_CHECK_TYPE3(tt::common_type::type, X); + BOOST_CHECK_TYPE3(tt::common_type::type, X); + BOOST_CHECK_TYPE3(tt::common_type::type, X); + BOOST_CHECK_TYPE3(tt::common_type::type, X); +} +TT_TEST_END diff --git a/test/common_type_sfinae2_test.cpp b/test/common_type_sfinae2_test.cpp new file mode 100644 index 0000000..2e585cf --- /dev/null +++ b/test/common_type_sfinae2_test.cpp @@ -0,0 +1,39 @@ + +// Copyright Peter Dimov 2015 +// 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.tt.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" +#ifdef TEST_STD +# include +#else +# include +# include +#endif +#include + +typedef char(&s1)[1]; +typedef char(&s2)[2]; + +template s1 has_type_impl( typename T::type * ); +template s2 has_type_impl( ... ); + +template struct has_type: tt::integral_constant(0)) == sizeof(s1)> {}; + +struct X {}; +struct Y {}; + +TT_TEST_BEGIN(common_type_sfinae2) +{ +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) + + BOOST_CHECK_INTEGRAL_CONSTANT( (has_type< tt::common_type >::value), false ); + BOOST_CHECK_INTEGRAL_CONSTANT( (has_type< tt::common_type >::value), false ); + BOOST_CHECK_INTEGRAL_CONSTANT( (has_type< tt::common_type >::value), false ); + BOOST_CHECK_INTEGRAL_CONSTANT( (has_type< tt::common_type >::value), false ); + +#endif +} +TT_TEST_END diff --git a/test/common_type_sfinae_test.cpp b/test/common_type_sfinae_test.cpp new file mode 100644 index 0000000..55aa3fe --- /dev/null +++ b/test/common_type_sfinae_test.cpp @@ -0,0 +1,45 @@ + +// Copyright Peter Dimov 2015 +// 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.tt.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_type.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif +#include + +struct X {}; +struct Y {}; + +TT_TEST_BEGIN(common_type_sfinae) +{ +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) + + { + tt::common_type tmp; + (void)tmp; + } + + { + tt::common_type tmp; + (void)tmp; + } + + { + tt::common_type tmp; + (void)tmp; + } + + { + tt::common_type tmp; + (void)tmp; + } + +#endif +} +TT_TEST_END diff --git a/test/common_type_test.cpp b/test/common_type_test.cpp index 111cbb1..047b65f 100644 --- a/test/common_type_test.cpp +++ b/test/common_type_test.cpp @@ -211,5 +211,11 @@ TT_TEST_BEGIN(common_type) #ifndef BOOST_NO_LONG_LONG BOOST_CHECK_TYPE4(tt::common_type::type, boost::long_long_type); #endif + + //changes related to defect LWG2141 + BOOST_CHECK_TYPE(tt::common_type::type, int); + BOOST_CHECK_TYPE(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, long); } TT_TEST_END diff --git a/test/copy_cv_test.cpp b/test/copy_cv_test.cpp new file mode 100644 index 0000000..2f4f281 --- /dev/null +++ b/test/copy_cv_test.cpp @@ -0,0 +1,44 @@ + +// Copyright Peter Dimov 2015 +// 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.tt.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_type.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif +#include + +TT_TEST_BEGIN(copy_cv) +{ + BOOST_CHECK_TYPE3(tt::copy_cv::type, int); + BOOST_CHECK_TYPE3(tt::copy_cv::type, int const); + BOOST_CHECK_TYPE3(tt::copy_cv::type, int volatile); + BOOST_CHECK_TYPE3(tt::copy_cv::type, int const volatile); + + BOOST_CHECK_TYPE3(tt::copy_cv::type, int const); + BOOST_CHECK_TYPE3(tt::copy_cv::type, int const); + BOOST_CHECK_TYPE3(tt::copy_cv::type, int const volatile); + BOOST_CHECK_TYPE3(tt::copy_cv::type, int const volatile); + + BOOST_CHECK_TYPE3(tt::copy_cv::type, int volatile); + BOOST_CHECK_TYPE3(tt::copy_cv::type, int const volatile); + BOOST_CHECK_TYPE3(tt::copy_cv::type, int volatile); + BOOST_CHECK_TYPE3(tt::copy_cv::type, int const volatile); + + BOOST_CHECK_TYPE3(tt::copy_cv::type, int const volatile); + BOOST_CHECK_TYPE3(tt::copy_cv::type, int const volatile); + BOOST_CHECK_TYPE3(tt::copy_cv::type, int const volatile); + BOOST_CHECK_TYPE3(tt::copy_cv::type, int const volatile); + + BOOST_CHECK_TYPE3(tt::copy_cv::type, int&); + + BOOST_CHECK_TYPE3(tt::copy_cv::type, int const* volatile); + + BOOST_CHECK_TYPE3(tt::copy_cv::type, long); +} +TT_TEST_END diff --git a/test/decay_test.cpp b/test/decay_test.cpp index 1a92c9d..cf22e15 100644 --- a/test/decay_test.cpp +++ b/test/decay_test.cpp @@ -5,6 +5,7 @@ // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include "test.hpp" +#include "check_type.hpp" #include "check_integral_constant.hpp" #ifdef TEST_STD # include @@ -61,7 +62,38 @@ namespace boost */ } -TT_TEST_BEGIN(is_class) +BOOST_DECL_TRANSFORM_TEST3(decay_test_1, ::tt::decay, const) +BOOST_DECL_TRANSFORM_TEST3(decay_test_2, ::tt::decay, volatile) +BOOST_DECL_TRANSFORM_TEST3(decay_test_3, ::tt::decay, const volatile) +BOOST_DECL_TRANSFORM_TEST3(decay_test_4, ::tt::decay, const&) +BOOST_DECL_TRANSFORM_TEST3(decay_test_5, ::tt::decay, volatile&) +BOOST_DECL_TRANSFORM_TEST3(decay_test_6, ::tt::decay, const volatile&) +BOOST_DECL_TRANSFORM_TEST(decay_test_7, ::tt::decay, const*, const*) +BOOST_DECL_TRANSFORM_TEST(decay_test_8, ::tt::decay, [], *) +BOOST_DECL_TRANSFORM_TEST(decay_test_9, ::tt::decay, [2], *) +BOOST_DECL_TRANSFORM_TEST(decay_test_10, ::tt::decay, [2][3], (*)[3]) +BOOST_DECL_TRANSFORM_TEST(decay_test_11, ::tt::decay, const[], const*) +BOOST_DECL_TRANSFORM_TEST(decay_test_12, ::tt::decay, const[2], const*) +BOOST_DECL_TRANSFORM_TEST(decay_test_13, ::tt::decay, const[2][3], const(*)[3]) +BOOST_DECL_TRANSFORM_TEST(decay_test_14, ::tt::decay, (int), (*)(int)) + + +TT_TEST_BEGIN(decay) + + decay_test_1(); + decay_test_2(); + decay_test_3(); + decay_test_4(); + decay_test_5(); + decay_test_6(); + decay_test_7(); + decay_test_8(); + decay_test_9(); + decay_test_10(); + decay_test_11(); + decay_test_12(); + decay_test_13(); + decay_test_14(); BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::decay::type,int>::value), @@ -88,20 +120,24 @@ TT_TEST_BEGIN(is_class) typedef int f1_type(void); typedef int f2_type(int); - BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< + BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::decay::type,int (*)(void)>::value), true ); BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same< ::tt::decay::type,int (*)(int)>::value), true ); +#ifndef BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS + // + // Don't test this if the std lib has no templated constructors (Oracle+STLPort): + // std::pair p = boost::make_pair( "foo", "bar" ); std::pair p2 = boost::make_pair( "foo", 1 ); #ifndef BOOST_NO_STD_WSTRING std::pair p3 = boost::make_pair( L"foo", "bar" ); std::pair p4 = boost::make_pair( L"foo", 1 ); #endif - +#endif // // Todo: make these work sometime. The test id not directly // related to decay::type and can be avoided for now. diff --git a/test/has_nothrow_assign_test.cpp b/test/has_nothrow_assign_test.cpp index ec3d110..421e91d 100644 --- a/test/has_nothrow_assign_test.cpp +++ b/test/has_nothrow_assign_test.cpp @@ -12,6 +12,26 @@ # include #endif +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS + +struct non_assignable +{ + non_assignable(); + non_assignable& operator=(const non_assignable&) = delete; +}; + +#endif + +#ifndef BOOST_NO_CXX11_NOEXCEPT + +struct noexcept_assignable +{ + noexcept_assignable(); + noexcept_assignable& operator=(const noexcept_assignable&)noexcept; +}; + +#endif + TT_TEST_BEGIN(has_nothrow_assign) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); @@ -205,6 +225,13 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::v BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, false); +#endif +#ifndef BOOST_NO_CXX11_NOEXCEPT +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_assign::value, true); +#endif + TT_TEST_END diff --git a/test/has_nothrow_constr_test.cpp b/test/has_nothrow_constr_test.cpp index fe365ab..0cc5cb7 100644 --- a/test/has_nothrow_constr_test.cpp +++ b/test/has_nothrow_constr_test.cpp @@ -26,6 +26,35 @@ public: explicit bug11324_derived(char arg) : data(arg) {} }; +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS + +struct deleted_default_construct +{ + deleted_default_construct() = delete; + deleted_default_construct(char val) : member(val) {} + char member; +}; + +#endif + +struct private_default_construct +{ +private: + private_default_construct(); +public: + private_default_construct(char val) : member(val) {} + char member; +}; + +#ifndef BOOST_NO_CXX11_NOEXCEPT +struct noexcept_default_construct +{ + noexcept_default_construct()noexcept; + noexcept_default_construct(char val)noexcept : member(val) {} + char member; +}; +#endif + TT_TEST_BEGIN(has_nothrow_constructor) @@ -178,6 +207,13 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::v BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, false); +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, false); +#ifndef BOOST_NO_CXX11_NOEXCEPT +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_constructor::value, true); +#endif TT_TEST_END diff --git a/test/has_nothrow_copy_test.cpp b/test/has_nothrow_copy_test.cpp index 9c6c8df..034cb65 100644 --- a/test/has_nothrow_copy_test.cpp +++ b/test/has_nothrow_copy_test.cpp @@ -12,6 +12,33 @@ # include #endif +struct non_copy +{ + non_copy(); +private: + non_copy(const non_copy&); +}; + +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS + +struct delete_copy +{ + delete_copy(); + delete_copy(const delete_copy&) = delete; +}; + +#endif + +#ifndef BOOST_NO_CXX11_NOEXCEPT + +struct noexcept_copy +{ + noexcept_copy(); + noexcept_copy& operator=(const noexcept_copy&)noexcept; +}; + +#endif + TT_TEST_BEGIN(has_nothrow_copy) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); @@ -185,9 +212,10 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); #endif BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +// These used to be true, but are now false to match std conforming behavior: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); // cases we would like to succeed but can't implement in the language: @@ -201,6 +229,18 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::val BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +#endif + +#ifndef BOOST_NO_CXX11_NOEXCEPT +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, true); +#endif + +#if !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800) +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_copy::value, false); +#endif + TT_TEST_END diff --git a/test/has_nothrow_destructor_test.cpp b/test/has_nothrow_destructor_test.cpp new file mode 100644 index 0000000..74f31bf --- /dev/null +++ b/test/has_nothrow_destructor_test.cpp @@ -0,0 +1,219 @@ + +// (C) Copyright 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 http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif + +#ifdef BOOST_MSVC +#pragma warning(disable:4290) // exception spec ignored +#endif + +struct nothrow_destruct +{ + nothrow_destruct(int); + ~nothrow_destruct()throw(); +}; + +#if !defined(BOOST_NO_CXX11_NOEXCEPT) + +struct noexcept_destruct +{ + noexcept_destruct(int); + ~noexcept_destruct()noexcept; +}; + +#endif + +struct throwing_base +{ + ~throwing_base() throw(int); +}; + +struct throwing_derived : public throwing_base {}; + +struct throwing_contained{ throwing_base data; }; + +TT_TEST_BEGIN(has_nothrow_destructor) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); + +#ifdef BOOST_HAS_LONG_LONG + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor< ::boost::ulong_long_type>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor< ::boost::long_long_type>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor< ::boost::ulong_long_type const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor< ::boost::long_long_type const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor< ::boost::ulong_long_type volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor< ::boost::long_long_type volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor< ::boost::ulong_long_type const volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor< ::boost::long_long_type const volatile>::value, true); + +#endif + +#ifdef BOOST_HAS_MS_INT64 + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor<__int8>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor<__int8 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor<__int8 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor<__int8 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor<__int16>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor<__int16 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor<__int16 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor<__int16 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor<__int32>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor<__int32 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor<__int32 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor<__int32 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor<__int64>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor<__int64 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor<__int64 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor<__int64 const volatile>::value, true); + +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); + + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); + +// +// These are commented out for now because it's not clear what the semantics should be: +// on the one hand references always have trivial destructors (in the sense that there is +// nothing to destruct), on the other hand the thing referenced may not have a trivial +// destructor, it really depends upon the users code as to what should happen here: +// +//BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, false); +//BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, false); +// +// Destructors on UDT's are non-throwing by default, unless they are explicity marked otherwise: +// +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, false); +// cases we would like to succeed but can't implement in the language: +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true, false); + +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor >::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor >::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor >::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor >::value, true, false); + +#if !defined(BOOST_NO_CXX11_NOEXCEPT) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, true); + +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_nothrow_destructor::value, false); + +TT_TEST_END + + + diff --git a/test/has_trivial_assign_test.cpp b/test/has_trivial_assign_test.cpp index cc8ad45..c5e40a3 100644 --- a/test/has_trivial_assign_test.cpp +++ b/test/has_trivial_assign_test.cpp @@ -12,6 +12,23 @@ # include #endif +struct non_assignable +{ + non_assignable(); +private: + non_assignable& operator=(const non_assignable&); +}; + +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS + +struct non_assignable2 +{ + non_assignable2(); + non_assignable2& operator=(const non_assignable2&) = delete; +}; + +#endif + TT_TEST_BEGIN(has_trivial_assign) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); @@ -180,9 +197,10 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); #endif BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, true); +// Arrays can not be explicitly assigned: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); @@ -203,6 +221,11 @@ BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_assign::value, false); + TT_TEST_END diff --git a/test/has_trivial_constr_test.cpp b/test/has_trivial_constr_test.cpp index 8db4ede..16a4e8a 100644 --- a/test/has_trivial_constr_test.cpp +++ b/test/has_trivial_constr_test.cpp @@ -27,6 +27,22 @@ public: explicit bug11324_derived(char arg) : data(arg) {} }; +struct private_construct +{ + private_construct(int); +private: + private_construct(); +}; + +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS + +struct deleted_construct +{ + deleted_construct(int); + deleted_construct() = delete; +}; + +#endif TT_TEST_BEGIN(has_trivial_constructor) @@ -167,7 +183,8 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, t BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true); +// Can't construct type void: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); // cases we would like to succeed but can't implement in the language: BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true, false); BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, true, false); @@ -187,6 +204,11 @@ BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_constructor::value, false); +#endif + TT_TEST_END diff --git a/test/has_trivial_copy_test.cpp b/test/has_trivial_copy_test.cpp index 9a0a042..043f76e 100644 --- a/test/has_trivial_copy_test.cpp +++ b/test/has_trivial_copy_test.cpp @@ -25,6 +25,13 @@ public: #endif +struct private_copy +{ + private_copy(); +private: + private_copy(const private_copy&); +}; + TT_TEST_BEGIN(has_trivial_copy) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); @@ -194,9 +201,10 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); #endif BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, true); +// Arrays can not be explicitly copied: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); // cases we would like to succeed but can't implement in the language: @@ -219,6 +227,7 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); #ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); #endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_copy::value, false); TT_TEST_END diff --git a/test/has_trivial_destructor_test.cpp b/test/has_trivial_destructor_test.cpp index 48196b7..3792004 100644 --- a/test/has_trivial_destructor_test.cpp +++ b/test/has_trivial_destructor_test.cpp @@ -12,6 +12,23 @@ # include #endif +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS + +struct deleted_destruct +{ + deleted_destruct(); + ~deleted_destruct() = delete; +}; + +#endif + +struct private_destruct +{ + private_destruct(); +private: + ~private_destruct(); +}; + TT_TEST_BEGIN(has_trivial_destructor) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, true); @@ -170,6 +187,11 @@ BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor >::value, true, false); BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_destructor >::value, true, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, false); +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_destructor::value, false); +#endif + TT_TEST_END diff --git a/test/has_trivial_move_assign_test.cpp b/test/has_trivial_move_assign_test.cpp index d54fcdc..242c92f 100644 --- a/test/has_trivial_move_assign_test.cpp +++ b/test/has_trivial_move_assign_test.cpp @@ -13,6 +13,38 @@ # include #endif +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS + +struct non_copyable_movable +{ + int val; + non_copyable_movable(int); + non_copyable_movable(const non_copyable_movable&) = delete; + non_copyable_movable& operator=(const non_copyable_movable&) = delete; + //non_copyable_movable(non_copyable_movable&&) = default; +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1800) || BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40500) + non_copyable_movable& operator=(non_copyable_movable&& o) + { + val = std::move(o.val); + return *this; + } +#else + non_copyable_movable& operator=(non_copyable_movable&&) = default; +#endif +}; + +struct copyable_non_moveable +{ + int val; + copyable_non_moveable(int); + copyable_non_moveable(const copyable_non_moveable&) = default; + copyable_non_moveable& operator=(const copyable_non_moveable&) = default; + copyable_non_moveable(copyable_non_moveable&&) = delete; + copyable_non_moveable& operator=(copyable_non_moveable&&) = delete; +}; + +#endif + TT_TEST_BEGIN(has_trivial_move_assign) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true); @@ -181,9 +213,10 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); #endif BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true); -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true); -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true); +// array types are not assignable: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); @@ -204,6 +237,11 @@ BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, true, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_assign::value, false); +#endif + TT_TEST_END diff --git a/test/has_trivial_move_constructor_test.cpp b/test/has_trivial_move_constructor_test.cpp index 472df99..fe227f4 100644 --- a/test/has_trivial_move_constructor_test.cpp +++ b/test/has_trivial_move_constructor_test.cpp @@ -13,6 +13,39 @@ # include #endif +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS + +struct non_copyable_movable +{ + int val; + non_copyable_movable(int); + non_copyable_movable(const non_copyable_movable&) = delete; + non_copyable_movable& operator=(const non_copyable_movable&) = delete; +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1800) || BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40500) + non_copyable_movable(non_copyable_movable&& o) : val(o.val){} + non_copyable_movable& operator=(non_copyable_movable&& o) + { + val = std::move(o.val); + return *this; + } +#else + non_copyable_movable(non_copyable_movable&&) = default; + non_copyable_movable& operator=(non_copyable_movable&&) = default; +#endif +}; + +struct copyable_non_moveable +{ + int val; + copyable_non_moveable(int); + copyable_non_moveable(const copyable_non_moveable&) = default; + copyable_non_moveable& operator=(const copyable_non_moveable&) = default; + copyable_non_moveable(copyable_non_moveable&&) = delete; + copyable_non_moveable& operator=(copyable_non_moveable&&) = delete; +}; + +#endif + TT_TEST_BEGIN(has_trivial_move_constructor) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); @@ -177,14 +210,14 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, tru BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); #endif -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); // cases we would like to succeed but can't implement in the language: @@ -204,6 +237,11 @@ BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, true, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::has_trivial_move_constructor::value, false); +#endif + TT_TEST_END diff --git a/test/init.cpp b/test/init.cpp deleted file mode 100644 index 95a5a9f..0000000 --- a/test/init.cpp +++ /dev/null @@ -1,23 +0,0 @@ - -// (C) Copyright 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 http://www.boost.org/LICENSE_1_0.txt) - -#include "test.hpp" - -boost::unit_test::test_suite* get_master_unit(const char* name) -{ - static boost::unit_test::test_suite* ptest_suite = 0; - if(0 == ptest_suite) - ptest_suite = BOOST_TEST_SUITE( name ? name : "" ); - return ptest_suite; -} - -boost::unit_test::test_suite* init_unit_test_suite ( int , char* [] ) -{ - return get_master_unit(); -} - - - diff --git a/test/is_arithmetic_test.cpp b/test/is_arithmetic_test.cpp index 41226d3..9192dfc 100644 --- a/test/is_arithmetic_test.cpp +++ b/test/is_arithmetic_test.cpp @@ -151,6 +151,15 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); #endif +#ifdef BOOST_HAS_INT128 +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +#endif + +#ifdef BOOST_HAS_FLOAT128 +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +#endif + TT_TEST_END diff --git a/test/is_assignable_test.cpp b/test/is_assignable_test.cpp new file mode 100644 index 0000000..8a13ca2 --- /dev/null +++ b/test/is_assignable_test.cpp @@ -0,0 +1,151 @@ + +// (C) Copyright 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 http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif + +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS + +struct non_assignable +{ + non_assignable(); + non_assignable& operator=(const non_assignable&) = delete; +}; + +#endif + +#ifndef BOOST_NO_CXX11_NOEXCEPT + +struct noexcept_assignable +{ + noexcept_assignable(); + noexcept_assignable& operator=(const non_assignable&)noexcept; +}; + +#endif + +TT_TEST_BEGIN(is_assignable) + +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), true); + +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), true); + +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), false); +#endif + +#ifdef BOOST_HAS_LONG_LONG + +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable< ::boost::ulong_long_type&>::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable< ::boost::long_long_type&>::value), true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable< ::boost::ulong_long_type const&>::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable< ::boost::long_long_type const&>::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable< ::boost::ulong_long_type volatile&>::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable< ::boost::long_long_type volatile&>::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable< ::boost::ulong_long_type const volatile&>::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable< ::boost::long_long_type const volatile&>::value), false); +#endif +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), true); +#ifndef TEST_STD +// unspecified behaviour: +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), true); +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), true); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), false); +//BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), true); +//BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), true); +//BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), true); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT((::tt::is_assignable::value), true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT((::tt::is_assignable::value), true, false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), false); +// cases we would like to succeed but can't implement in the language: +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT((::tt::is_assignable::value), true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT((::tt::is_assignable::value), true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT((::tt::is_assignable::value), true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT((::tt::is_assignable::value), true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT((::tt::is_assignable::value), true, false); + +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT((::tt::is_assignable::value), true, false); + +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), false); +#endif +#ifndef BOOST_NO_CXX11_NOEXCEPT +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_assignable::value), true); +#endif + +TT_TEST_END + + + diff --git a/test/is_constructible_test.cpp b/test/is_constructible_test.cpp new file mode 100644 index 0000000..8bcd7ab --- /dev/null +++ b/test/is_constructible_test.cpp @@ -0,0 +1,79 @@ + +// (C) Copyright 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 http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif + + +struct non_copy_constructible +{ + non_copy_constructible(); + non_copy_constructible(int); + non_copy_constructible(double*, double*); +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS + non_copy_constructible(const non_copy_constructible&) = delete; +#endif +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + non_copy_constructible(non_copy_constructible&&); +#endif +}; + + +struct A { }; +struct B : A { }; + +TT_TEST_BEGIN(is_constructible) + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_constructible::value) , false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_constructible::value) , false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_constructible::value) , false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_constructible::value) , false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_constructible::value) , false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_constructible::value) , false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_constructible::value) , false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_constructible::value) , false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_constructible::value) , false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_constructible::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_constructible::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_constructible::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_constructible::value), false); + +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT((::tt::is_constructible::value), true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT((::tt::is_constructible::value), true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT((::tt::is_constructible::value), true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT((::tt::is_constructible::value), true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT((::tt::is_constructible::value), true, false); +#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800) +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT((::tt::is_constructible::value), true, false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_constructible::value), false); +#endif +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_constructible::value), false); +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_constructible::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_constructible::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_constructible::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_constructible::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_constructible::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_constructible::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_constructible::value), true); + +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_constructible::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_constructible::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_constructible::value), true); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_constructible::value), false); +BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_constructible::value), false); + +TT_TEST_END + diff --git a/test/is_copy_assignable.cpp b/test/is_copy_assignable_test.cpp similarity index 100% rename from test/is_copy_assignable.cpp rename to test/is_copy_assignable_test.cpp diff --git a/test/is_copy_constructible_test.cpp b/test/is_copy_constructible_test.cpp index cbc4030..844f479 100644 --- a/test/is_copy_constructible_test.cpp +++ b/test/is_copy_constructible_test.cpp @@ -80,7 +80,10 @@ TT_TEST_BEGIN(is_copy_constructible) // Main part of the test BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_copy_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_copy_constructible::value, true); -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_copy_constructible::value, true); +// Only constructible from has3& not from const-reference, this only works if we have decltype: +#if !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800) +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_copy_constructible::value, false); +#endif BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_copy_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_copy_constructible::value, false); #if !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS) && !defined(BOOST_INTEL_CXX_VERSION) @@ -260,18 +263,9 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_copy_constructible::value, true BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_copy_constructible::value, true); #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES -// Code like `int&& a = 10;` or -// struct nonc { -// nonc() = default; -// nonc(const nonc&) = delete; -// nonc(nonc&&) = delete; -// nonc& operator=(const nonc&) = delete; -// nonc& operator=(nonc&&) = delete; -// }; -// -// nonc && a = nonc(); -// is legal in C++11. so this trait MUST return true. -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_copy_constructible::value, true); +// This is debatable, we used to insist this was true, but copy-constructibility +// implies copying a constant-object, and that isn't the case here: +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_copy_constructible::value, false); #endif BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_copy_constructible::value, true); diff --git a/test/is_default_constr_test.cpp b/test/is_default_constr_test.cpp new file mode 100644 index 0000000..89444b3 --- /dev/null +++ b/test/is_default_constr_test.cpp @@ -0,0 +1,204 @@ + +// (C) Copyright 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 http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif + +class bug11324_base +{ +public: + bug11324_base & operator=(const bug11324_base&){ throw int(); } + virtual ~bug11324_base() {} +}; + +class bug11324_derived : public bug11324_base +{ +public: + char data; + explicit bug11324_derived(char arg) : data(arg) {} +}; + +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS + +struct deleted_default_construct +{ + deleted_default_construct() = delete; + deleted_default_construct(char val) : member(val) {} + char member; +}; + +#endif + +struct private_default_construct +{ +private: + private_default_construct(); +public: + private_default_construct(char val) : member(val) {} + char member; +}; + +TT_TEST_BEGIN(is_default_constructible) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); + +#ifdef BOOST_HAS_LONG_LONG + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible< ::boost::ulong_long_type>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible< ::boost::long_long_type>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible< ::boost::ulong_long_type const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible< ::boost::long_long_type const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible< ::boost::ulong_long_type volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible< ::boost::long_long_type volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible< ::boost::ulong_long_type const volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible< ::boost::long_long_type const volatile>::value, true); + +#endif + +#ifdef BOOST_HAS_MS_INT64 + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible<__int8>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible<__int8 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible<__int8 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible<__int8 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible<__int16>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible<__int16 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible<__int16 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible<__int16 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible<__int32>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible<__int32 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible<__int32 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible<__int32 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible<__int64>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible<__int64 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible<__int64 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible<__int64 const volatile>::value, true); + +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); + + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, false); +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, false); +// cases we would like to succeed but can't implement in the language: +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true, false); +BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, true, false); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, false); +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, false); +#endif +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_default_constructible::value, false); + +TT_TEST_END + diff --git a/test/is_destructible_test.cpp b/test/is_destructible_test.cpp new file mode 100644 index 0000000..872f21b --- /dev/null +++ b/test/is_destructible_test.cpp @@ -0,0 +1,190 @@ + +// (C) Copyright 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 http://www.boost.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_integral_constant.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif + +#if !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS) + +struct deleted_destruct +{ + deleted_destruct(); + ~deleted_destruct() = delete; +}; + +#endif + + +TT_TEST_BEGIN(is_destructible) + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); + +#ifdef BOOST_HAS_LONG_LONG + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible< ::boost::ulong_long_type>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible< ::boost::long_long_type>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible< ::boost::ulong_long_type const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible< ::boost::long_long_type const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible< ::boost::ulong_long_type volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible< ::boost::long_long_type volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible< ::boost::ulong_long_type const volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible< ::boost::long_long_type const volatile>::value, true); + +#endif + +#ifdef BOOST_HAS_MS_INT64 + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible<__int8>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible<__int8 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible<__int8 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible<__int8 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible<__int16>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible<__int16 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible<__int16 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible<__int16 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible<__int32>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible<__int32 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible<__int32 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible<__int32 const volatile>::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible<__int64>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible<__int64 const>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible<__int64 volatile>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible<__int64 const volatile>::value, true); + +#endif + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); + + +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +#endif + +// +// These are commented out for now because it's not clear what the semantics should be: +// on the one hand references always have trivial destructors (in the sense that there is +// nothing to destruct), on the other hand the thing referenced may not have a trivial +// destructor, it really depends upon the users code as to what should happen here: +// +//BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, false); +//BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, false); + +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_destructible::value, false); +#endif + +TT_TEST_END + + + diff --git a/test/is_floating_point_test.cpp b/test/is_floating_point_test.cpp index 3b70b5f..15fec14 100644 --- a/test/is_floating_point_test.cpp +++ b/test/is_floating_point_test.cpp @@ -29,6 +29,13 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point::value, BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point::value, true); +#ifdef BOOST_HAS_FLOAT128 +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point<__float128>::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_floating_point::value, true); +#endif + // // cases that should not be true: // diff --git a/test/is_fundamental_test.cpp b/test/is_fundamental_test.cpp index a9dce34..0b33444 100644 --- a/test/is_fundamental_test.cpp +++ b/test/is_fundamental_test.cpp @@ -155,6 +155,15 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); #endif +#ifdef BOOST_HAS_INT128 +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +#endif + +#ifdef BOOST_HAS_FLOAT128 +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +#endif + TT_TEST_END diff --git a/test/is_nothrow_move_assignable_test.cpp b/test/is_nothrow_move_assignable_test.cpp index 9240a0e..b16af9d 100644 --- a/test/is_nothrow_move_assignable_test.cpp +++ b/test/is_nothrow_move_assignable_test.cpp @@ -13,6 +13,33 @@ # include #endif +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS + +struct non_assignable +{ + non_assignable(); + non_assignable& operator=(const non_assignable&) = delete; +}; + +#endif + +#ifndef BOOST_NO_CXX11_NOEXCEPT + +struct noexcept_assignable +{ + noexcept_assignable(); + noexcept_assignable& operator=(const non_assignable&)noexcept; +}; + +struct noexcept_move_assignable +{ + noexcept_move_assignable(); + noexcept_move_assignable& operator=(const noexcept_move_assignable&); + noexcept_move_assignable& operator=(noexcept_move_assignable&&)noexcept; +}; + +#endif + TT_TEST_BEGIN(is_nothrow_move_assignable) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable::value, true); @@ -214,6 +241,14 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable::value, false); +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable::value, false); +#endif +#if !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR) +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable::value, true); +#endif + TT_TEST_END diff --git a/test/is_nothrow_move_constructible_test.cpp b/test/is_nothrow_move_constructible_test.cpp index 9d258ae..105998f 100644 --- a/test/is_nothrow_move_constructible_test.cpp +++ b/test/is_nothrow_move_constructible_test.cpp @@ -6,6 +6,7 @@ // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include "test.hpp" +#include #include "check_integral_constant.hpp" #ifdef TEST_STD # include @@ -13,6 +14,40 @@ # include #endif +struct non_copy +{ + non_copy(); +private: + non_copy(const non_copy&); +}; + +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS + +struct delete_copy +{ + delete_copy(); + delete_copy(const delete_copy&) = delete; +}; + +#endif + +#ifndef BOOST_NO_CXX11_NOEXCEPT + +struct noexcept_copy +{ + noexcept_copy(); + noexcept_copy(const noexcept_copy&)noexcept; +}; + +struct noexcept_move +{ + noexcept_move(); + noexcept_move(const noexcept_move&); + noexcept_move(noexcept_move&&)noexcept; +}; + +#endif + TT_TEST_BEGIN(is_nothrow_move_constructible) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); @@ -181,11 +216,11 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, tr BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); #endif -BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); @@ -210,6 +245,17 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); + +#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); +#endif + +#if !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR) +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); +#endif + TT_TEST_END diff --git a/test/is_pod_test.cpp b/test/is_pod_test.cpp index 4f17741..94fd04a 100644 --- a/test/is_pod_test.cpp +++ b/test/is_pod_test.cpp @@ -177,6 +177,15 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod::value, true); #endif +#ifdef BOOST_HAS_INT128 +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod::value, true); +#endif + +#ifdef BOOST_HAS_FLOAT128 +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod::value, true); +#endif + TT_TEST_END diff --git a/test/is_pointer_test.cpp b/test/is_pointer_test.cpp index 5b71b92..2693e48 100644 --- a/test/is_pointer_test.cpp +++ b/test/is_pointer_test.cpp @@ -50,6 +50,7 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer::value, false); diff --git a/test/is_polymorphic_test.cpp b/test/is_polymorphic_test.cpp index 7426be8..b200b5a 100644 --- a/test/is_polymorphic_test.cpp +++ b/test/is_polymorphic_test.cpp @@ -82,6 +82,11 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_polymorphic::value, true); // this test was added to check for bug reported on 21 May 2003: BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_polymorphic::value, true); +#ifndef BOOST_NO_CXX11_FINAL +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_polymorphic < final_UDT >::value, false); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_polymorphic::value, true); +#endif + TT_TEST_END diff --git a/test/is_scalar_test.cpp b/test/is_scalar_test.cpp index 8b22363..99e484c 100644 --- a/test/is_scalar_test.cpp +++ b/test/is_scalar_test.cpp @@ -156,6 +156,16 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); #endif +#ifdef BOOST_HAS_INT128 +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +#endif + +#ifdef BOOST_HAS_FLOAT128 +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +#endif + + TT_TEST_END diff --git a/test/is_signed_test.cpp b/test/is_signed_test.cpp index c76a97a..66b7e15 100644 --- a/test/is_signed_test.cpp +++ b/test/is_signed_test.cpp @@ -12,6 +12,8 @@ # include #endif +#include + TT_TEST_BEGIN(is_signed) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed::value, true); @@ -35,6 +37,24 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed::value, false); #endif + +#if defined(CHAR_MIN) +#if CHAR_MIN != 0 +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed::value, true); +#else +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed::value, false); +#endif +#endif + + +#if defined(WCHAR_MIN) +#if WCHAR_MIN != 0 +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed::value, true); +#else +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_signed::value, false); +#endif +#endif + TT_TEST_END diff --git a/test/is_unsigned_test.cpp b/test/is_unsigned_test.cpp index 484c11e..4323247 100644 --- a/test/is_unsigned_test.cpp +++ b/test/is_unsigned_test.cpp @@ -12,6 +12,8 @@ # include #endif +#include + TT_TEST_BEGIN(is_signed) BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned::value, false); @@ -36,6 +38,23 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned::value, fals BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned::value, true); #endif +#if defined(CHAR_MIN) +#if CHAR_MIN != 0 +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned::value, false); +#else +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned::value, true); +#endif +#endif + + +#if defined(WCHAR_MIN) +#if WCHAR_MIN != 0 +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned::value, false); +#else +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_unsigned::value, true); +#endif +#endif + TT_TEST_END diff --git a/test/is_void_test.cpp b/test/is_void_test.cpp index c0a3f09..663702e 100644 --- a/test/is_void_test.cpp +++ b/test/is_void_test.cpp @@ -35,10 +35,3 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_void::value, false); TT_TEST_END - - - - - - - diff --git a/test/mpl_interop_test1.cpp b/test/mpl_interop_test1.cpp new file mode 100644 index 0000000..214c951 --- /dev/null +++ b/test/mpl_interop_test1.cpp @@ -0,0 +1,30 @@ + +// (C) Copyright 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 http://www.boost.org/LICENSE_1_0.txt) + +#include + +template +int dispatch_test_imp(const boost::mpl::bool_&) +{ + return 0; +} +template +int dispatch_test_imp(const boost::mpl::bool_&) +{ + return 1; +} + +template +int dispatch_test() +{ + return dispatch_test_imp(boost::is_void()); +} + + +int main() +{ + return (dispatch_test() == 1) && (dispatch_test() == 0) ? 0 : 1; +} \ No newline at end of file diff --git a/test/mpl_interop_test2.cpp b/test/mpl_interop_test2.cpp new file mode 100644 index 0000000..4624e0b --- /dev/null +++ b/test/mpl_interop_test2.cpp @@ -0,0 +1,25 @@ + +// (C) Copyright 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 http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include + +template +struct if_test +{ + typedef typename boost::mpl::if_< + boost::is_void, + int, T>::type type; +}; + +if_test::type t1 = 0; +if_test::type t2 = 0; + +int main() +{ + return (int)(t1 + t2); +} \ No newline at end of file diff --git a/test/mpl_interop_test3.cpp b/test/mpl_interop_test3.cpp new file mode 100644 index 0000000..0a4c8ac --- /dev/null +++ b/test/mpl_interop_test3.cpp @@ -0,0 +1,30 @@ + +// (C) Copyright 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 http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#include + +template +struct lambda_test +{ + typedef typename boost::mpl::remove_if >::type reduced_list; + typedef typename boost::mpl::transform >::type const_list; + typedef typename boost::mpl::front::type type; +}; + + +int main() +{ + typedef boost::mpl::list list_type; + + lambda_test::type i = 0; + return i; +} \ No newline at end of file diff --git a/test/promote_basic_test.cpp b/test/promote_basic_test.cpp old mode 100755 new mode 100644 diff --git a/test/promote_mpl_test.cpp b/test/promote_mpl_test.cpp old mode 100755 new mode 100644 diff --git a/test/promote_util.hpp b/test/promote_util.hpp old mode 100755 new mode 100644 diff --git a/test/test.hpp b/test/test.hpp index ae3d24e..6514dab 100644 --- a/test/test.hpp +++ b/test/test.hpp @@ -265,11 +265,6 @@ struct nothrow_construct_UDT { return true; } }; -#ifndef BOOST_NO_CXX11_FINAL -struct final_UDT final -{}; -#endif - class Base { }; class Derived : public Base { }; @@ -370,6 +365,14 @@ struct polymorphic_derived2 : public polymorphic_base virtual void method(); }; +#ifndef BOOST_NO_CXX11_FINAL +struct final_UDT final +{}; +struct polymorphic_derived_final final : public polymorphic_derived2 +{}; +#endif + + struct virtual_inherit1 : public virtual Base { }; struct virtual_inherit2 : public virtual_inherit1 { }; struct virtual_inherit3 : private virtual Base {}; diff --git a/test/tricky_is_enum_test.cpp b/test/tricky_is_enum_test.cpp old mode 100755 new mode 100644 diff --git a/test/type_identity_test.cpp b/test/type_identity_test.cpp new file mode 100644 index 0000000..acc3061 --- /dev/null +++ b/test/type_identity_test.cpp @@ -0,0 +1,60 @@ + +// (C) Copyright John Maddock 2000. +// (C) Copyright Peter Dimov 2015. +// 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.tt.org/LICENSE_1_0.txt) + +#include "test.hpp" +#include "check_type.hpp" +#ifdef TEST_STD +# include +#else +# include +#endif + +BOOST_DECL_TRANSFORM_TEST(type_identity_test_1, ::tt::type_identity, const, const) +BOOST_DECL_TRANSFORM_TEST(type_identity_test_2, ::tt::type_identity, volatile, volatile) +BOOST_DECL_TRANSFORM_TEST(type_identity_test_3, ::tt::type_identity, const volatile, const volatile) +BOOST_DECL_TRANSFORM_TEST0(type_identity_test_4, ::tt::type_identity) +BOOST_DECL_TRANSFORM_TEST(type_identity_test_5, ::tt::type_identity, [], []) +BOOST_DECL_TRANSFORM_TEST(type_identity_test_6, ::tt::type_identity, *const, *const) +BOOST_DECL_TRANSFORM_TEST(type_identity_test_7, ::tt::type_identity, *volatile, *volatile) +BOOST_DECL_TRANSFORM_TEST(type_identity_test_8, ::tt::type_identity, *const volatile, *const volatile) +BOOST_DECL_TRANSFORM_TEST(type_identity_test_9, ::tt::type_identity, *, *) +BOOST_DECL_TRANSFORM_TEST(type_identity_test_10, ::tt::type_identity, *, *) +BOOST_DECL_TRANSFORM_TEST(type_identity_test_11, ::tt::type_identity, volatile*, volatile*) +BOOST_DECL_TRANSFORM_TEST(type_identity_test_12, ::tt::type_identity, const[2], const[2]) +BOOST_DECL_TRANSFORM_TEST(type_identity_test_13, ::tt::type_identity, volatile[2], volatile[2]) +BOOST_DECL_TRANSFORM_TEST(type_identity_test_14, ::tt::type_identity, const volatile[2], const volatile[2]) +BOOST_DECL_TRANSFORM_TEST(type_identity_test_15, ::tt::type_identity, [2], [2]) +BOOST_DECL_TRANSFORM_TEST(type_identity_test_16, ::tt::type_identity, const*, const*) +BOOST_DECL_TRANSFORM_TEST(type_identity_test_17, ::tt::type_identity, const*volatile, const*volatile) +BOOST_DECL_TRANSFORM_TEST(type_identity_test_18, ::tt::type_identity, (), ()) +BOOST_DECL_TRANSFORM_TEST(type_identity_test_19, ::tt::type_identity, (int), (int)) +BOOST_DECL_TRANSFORM_TEST(type_identity_test_20, ::tt::type_identity, (*const)(), (*const)()) + +TT_TEST_BEGIN(type_identity) + + type_identity_test_1(); + type_identity_test_2(); + type_identity_test_3(); + type_identity_test_4(); + type_identity_test_5(); + type_identity_test_6(); + type_identity_test_7(); + type_identity_test_8(); + type_identity_test_9(); + type_identity_test_10(); + type_identity_test_11(); + type_identity_test_12(); + type_identity_test_13(); + type_identity_test_14(); + type_identity_test_15(); + type_identity_test_16(); + type_identity_test_17(); + type_identity_test_18(); + type_identity_test_19(); + type_identity_test_20(); + +TT_TEST_END