forked from boostorg/type_traits
Added support for native SGI type traits via BOOST_HAS_SGI_TYPE_TRAITS
[SVN r11486]
This commit is contained in:
@ -35,15 +35,49 @@
|
||||
// BOOST_HAS_TRIVIAL_ASSIGN(T) should evaluate to true if t = u <==> memcpy
|
||||
// BOOST_HAS_TRIVIAL_DESTRUCTOR(T) should evaluate to true if ~T() has no effect
|
||||
|
||||
#define BOOST_IS_CLASS(T) false
|
||||
#define BOOST_IS_ENUM(T) false
|
||||
#define BOOST_IS_UNION(T) false
|
||||
#define BOOST_IS_POD(T) false
|
||||
#define BOOST_IS_EMPTY(T) false
|
||||
#define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) false
|
||||
#define BOOST_HAS_TRIVIAL_COPY(T) false
|
||||
#define BOOST_HAS_TRIVIAL_ASSIGN(T) false
|
||||
#define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) false
|
||||
#ifdef BOOST_HAS_SGI_TYPE_TRAITS
|
||||
# define BOOST_IS_POD(T) ::boost::is_same< ::__type_traits<T>::is_POD_type, ::__true_type>::value
|
||||
# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) ::boost::is_same< ::__type_traits<T>::has_trivial_default_constructor, ::__true_type>::value
|
||||
# define BOOST_HAS_TRIVIAL_COPY(T) ::boost::is_same< ::__type_traits<T>::has_trivial_copy_constructor, ::__true_type>::value
|
||||
# define BOOST_HAS_TRIVIAL_ASSIGN(T) ::boost::is_same< ::__type_traits<T>::has_trivial_assignment_operator, ::__true_type>::value
|
||||
# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) ::boost::is_same< ::__type_traits<T>::has_trivial_destructor, ::__true_type>::value
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_IS_CLASS
|
||||
# define BOOST_IS_CLASS(T) false
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_IS_ENUM
|
||||
# define BOOST_IS_ENUM(T) false
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_IS_UNION
|
||||
# define BOOST_IS_UNION(T) false
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_IS_POD
|
||||
# define BOOST_IS_POD(T) false
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_IS_EMPTY
|
||||
# define BOOST_IS_EMPTY(T) false
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_HAS_TRIVIAL_CONSTRUCTOR
|
||||
# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) false
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_HAS_TRIVIAL_COPY
|
||||
# define BOOST_HAS_TRIVIAL_COPY(T) false
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_HAS_TRIVIAL_ASSIGN
|
||||
# define BOOST_HAS_TRIVIAL_ASSIGN(T) false
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_HAS_TRIVIAL_DESTRUCTOR
|
||||
# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) false
|
||||
#endif
|
||||
|
||||
|
||||
namespace boost{
|
||||
|
@ -31,6 +31,11 @@
|
||||
#include <boost/type_traits/function_traits.hpp>
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_HAS_SGI_TYPE_TRAITS
|
||||
# include <type_traits.h>
|
||||
# include <boost/type_traits/same_traits.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost{
|
||||
|
||||
/**********************************************
|
||||
|
@ -110,6 +110,7 @@ struct type_checker<T,T>
|
||||
#define value_fail(v, x) \
|
||||
++test_count; \
|
||||
++failures; \
|
||||
++expected_failures;\
|
||||
std::cout << "checking value of " << #x << "...failed" << std::endl; \
|
||||
std::cout << " " #x " does not compile on this compiler" << std::endl;
|
||||
|
||||
|
Reference in New Issue
Block a user