mirror of
https://github.com/boostorg/type_traits.git
synced 2025-07-29 20:17:21 +02:00
Update more compiler requirements.
This commit is contained in:
@ -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 <boost/type_traits/is_nothrow_move_assignable.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
@ -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 <boost/type_traits/is_nothrow_move_constructible.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
@ -16,6 +16,8 @@ references, void, and function types.
|
||||
|
||||
__std_ref 3.9p9.
|
||||
|
||||
[all_compilers]
|
||||
|
||||
__header ` #include <boost/type_traits/is_object.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
__examples
|
||||
|
@ -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.
|
||||
|
@ -17,6 +17,8 @@ __std_ref 3.9.2p2 and 8.3.1.
|
||||
|
||||
__header ` #include <boost/type_traits/is_pointer.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
[all_compilers]
|
||||
|
||||
__examples
|
||||
|
||||
[:`is_pointer<int*>` inherits from `__true_type`.]
|
||||
|
@ -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 <boost/type_traits/is_reference.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
|
@ -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 <boost/type_traits/is_rvalue_reference.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
|
@ -14,8 +14,8 @@ __true_type, otherwise inherits from __false_type.
|
||||
|
||||
__header ` #include <boost/type_traits/is_same.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
__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
|
||||
|
||||
|
@ -17,8 +17,7 @@ __std_ref 3.9p10.
|
||||
|
||||
__header ` #include <boost/type_traits/is_scalar.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
__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
|
||||
|
||||
|
@ -16,6 +16,8 @@ otherwise inherits from __false_type.
|
||||
|
||||
__std_ref 3.9.1, 7.2.
|
||||
|
||||
[all_compilers]
|
||||
|
||||
__header ` #include <boost/type_traits/is_signed.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
__examples
|
||||
|
@ -28,13 +28,10 @@ __std_ref 3.9p10.
|
||||
|
||||
__header ` #include <boost/type_traits/is_stateless.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
__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".
|
||||
|
||||
|
@ -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.
|
||||
|
@ -16,6 +16,8 @@ otherwise inherits from __false_type.
|
||||
|
||||
__std_ref 3.9.1, 7.2.
|
||||
|
||||
[all_compilers]
|
||||
|
||||
__header ` #include <boost/type_traits/is_unsigned.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
__examples
|
||||
|
@ -18,12 +18,13 @@ __std_ref 10.
|
||||
|
||||
__header ` #include <boost/type_traits/is_virtual_base_of.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
__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.]
|
||||
|
||||
|
@ -14,6 +14,8 @@ otherwise inherits from __false_type.
|
||||
|
||||
__std_ref 3.9.1p9.
|
||||
|
||||
[all_compilers]
|
||||
|
||||
__header ` #include <boost/type_traits/is_void.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
__examples
|
||||
|
@ -14,6 +14,8 @@ otherwise inherits from __false_type.
|
||||
|
||||
__std_ref 3.9.3.
|
||||
|
||||
[all_compilers]
|
||||
|
||||
__header ` #include <boost/type_traits/is_volatile.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
__examples
|
||||
|
@ -26,6 +26,8 @@ bool.
|
||||
|
||||
__std_ref 3.9.1.
|
||||
|
||||
[all_compilers]
|
||||
|
||||
__header ` #include <boost/type_traits/make_signed.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
[table Examples
|
||||
|
@ -26,6 +26,8 @@ bool.
|
||||
|
||||
__std_ref 3.9.1.
|
||||
|
||||
[all_compilers]
|
||||
|
||||
__header ` #include <boost/type_traits/make_unsigned.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
[table Examples
|
||||
|
@ -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 <boost/type_traits/promote.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
[table Examples
|
||||
|
@ -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 <boost/type_traits/rank.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
__examples
|
||||
|
@ -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 <boost/type_traits/remove_all_extents.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
|
@ -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 <boost/type_traits/remove_const.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
|
@ -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 <boost/type_traits/remove_cv.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
|
@ -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 <boost/type_traits/remove_extent.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
|
@ -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 <boost/type_traits/remove_pointer.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
|
@ -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 <boost/type_traits/remove_reference.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
|
@ -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 <boost/type_traits/remove_volatile.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
|
@ -29,7 +29,7 @@ rule all-tests {
|
||||
{
|
||||
result += [ run $(source) ] ;
|
||||
}
|
||||
for local source in has_nothrow_assign_test has_nothrow_constr_test has_nothrow_copy_test
|
||||
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 : : : <define>BOOST_TT_DISABLE_INTRINSICS : $(source)_no_intrinsics ] ;
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ struct delete_copy
|
||||
struct noexcept_copy
|
||||
{
|
||||
noexcept_copy();
|
||||
noexcept_copy& operator=(const non_copy&)noexcept;
|
||||
noexcept_copy& operator=(const noexcept_copy&)noexcept;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -13,6 +13,33 @@
|
||||
# include <boost/type_traits/is_nothrow_move_assignable.hpp>
|
||||
#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<bool>::value, true);
|
||||
@ -214,6 +241,14 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable<nothrow_copy_UDT>
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable<nothrow_construct_UDT>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable<test_abc1>::value, false);
|
||||
|
||||
#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable<non_assignable>::value, false);
|
||||
#endif
|
||||
#ifndef BOOST_NO_CXX11_NOEXCEPT
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable<noexcept_assignable>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable<noexcept_move_assignable>::value, true);
|
||||
#endif
|
||||
|
||||
TT_TEST_END
|
||||
|
||||
|
||||
|
@ -14,6 +14,40 @@
|
||||
# include <boost/type_traits/is_nothrow_move_constructible.hpp>
|
||||
#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<bool>::value, true);
|
||||
@ -211,6 +245,17 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<nothrow_assign
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<nothrow_construct_UDT>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<test_abc1>::value, false);
|
||||
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<non_copy>::value, false);
|
||||
|
||||
#ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<delete_copy>::value, false);
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_NO_CXX11_NOEXCEPT
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<noexcept_copy>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible<noexcept_move>::value, true);
|
||||
#endif
|
||||
|
||||
TT_TEST_END
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user