mirror of
https://github.com/boostorg/type_traits.git
synced 2025-07-30 04:27:22 +02:00
Update compiler compatibility notes.
This commit is contained in:
@ -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.
|
||||
|
||||
|
@ -12,6 +12,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;
|
||||
|
@ -16,9 +16,7 @@ __std_ref 3.9.2 and 8.3.4.
|
||||
|
||||
__header ` #include <boost/type_traits/is_array.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
__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
|
||||
|
||||
|
@ -28,11 +28,7 @@ __std_ref 10.
|
||||
|
||||
__header ` #include <boost/type_traits/is_base_of.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. 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
|
||||
|
||||
|
@ -16,13 +16,9 @@ __std_ref 3.9.2 and 9.2.
|
||||
|
||||
__header ` #include <boost/type_traits/is_class.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
__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
|
||||
|
||||
|
@ -15,6 +15,8 @@ some type `U`), otherwise false.
|
||||
|
||||
__std_ref 26.2.
|
||||
|
||||
[all_compilers]
|
||||
|
||||
__header ` #include <boost/type_traits/is_complex.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
[endsect]
|
||||
|
@ -15,6 +15,8 @@ a compound type (see also __is_fundamental).
|
||||
|
||||
__std_ref 3.9.2.
|
||||
|
||||
[all_compilers]
|
||||
|
||||
__header ` #include <boost/type_traits/is_compound.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
__examples
|
||||
|
@ -17,6 +17,8 @@ __std_ref 3.9.3.
|
||||
|
||||
__header ` #include <boost/type_traits/is_const.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
[all_compilers]
|
||||
|
||||
__examples
|
||||
|
||||
[:`is_const<int const>` inherits from `__true_type`.]
|
||||
|
@ -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 <boost/type_traits/is_convertible.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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 {};` ]
|
||||
|
@ -16,10 +16,7 @@ __std_ref 3.9.2 and 7.2.
|
||||
|
||||
__header ` #include <boost/type_traits/is_enum.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
__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
|
||||
|
||||
|
@ -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.
|
||||
|
@ -14,6 +14,8 @@ otherwise inherits from __false_type.
|
||||
|
||||
__std_ref 3.9.1p8.
|
||||
|
||||
[all_compilers]
|
||||
|
||||
__header ` #include <boost/type_traits/is_floating_point.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
__examples
|
||||
|
@ -21,6 +21,8 @@ __is_reference respectively:
|
||||
|
||||
__std_ref 3.9.2p1 and 8.3.5.
|
||||
|
||||
[all_compilers]
|
||||
|
||||
__header ` #include <boost/type_traits/is_function.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
__examples
|
||||
|
@ -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 <boost/type_traits/is_fundamental.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
__examples
|
||||
|
@ -14,6 +14,8 @@ otherwise inherits from __false_type.
|
||||
|
||||
__std_ref 3.9.1p7.
|
||||
|
||||
[all_compilers]
|
||||
|
||||
__header ` #include <boost/type_traits/is_integral.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
__examples
|
||||
|
@ -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_lvalue_reference.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
|
@ -15,6 +15,8 @@ otherwise inherits from __false_type.
|
||||
|
||||
__std_ref 3.9.2 and 8.3.3.
|
||||
|
||||
[all_compilers]
|
||||
|
||||
__header ` #include <boost/type_traits/is_member_function_pointer.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
__examples
|
||||
|
@ -15,6 +15,8 @@ otherwise inherits from __false_type.
|
||||
|
||||
__std_ref 3.9.2 and 8.3.3.
|
||||
|
||||
[all_compilers]
|
||||
|
||||
__header ` #include <boost/type_traits/is_member_object_pointer.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
__examples
|
||||
|
@ -16,6 +16,8 @@ otherwise inherits from __false_type.
|
||||
|
||||
__std_ref 3.9.2 and 8.3.3.
|
||||
|
||||
[all_compilers]
|
||||
|
||||
__header ` #include <boost/type_traits/is_member_pointer.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
__examples
|
||||
|
@ -275,8 +275,8 @@ See __has_trivial_constructor.
|
||||
[include is_compound.qbk]
|
||||
[include is_const.qbk]
|
||||
[include is_convertible.qbk]
|
||||
[include is_copy_constructible.qbk]
|
||||
[include is_copy_assignable.qbk]
|
||||
[include is_copy_constructible.qbk]
|
||||
[include is_empty.qbk]
|
||||
[include is_enum.qbk]
|
||||
[include is_final.qbk]
|
||||
|
Reference in New Issue
Block a user