commit 749953f36bbde9c7de392d58032b7129fad12694 Author: Beman Dawes Date: Fri Jul 7 16:04:40 2000 +0000 This commit was generated by cvs2svn to compensate for changes in r4, which included commits to RCS files with non-trunk default branches. [SVN r7621] diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..3e84d7c --- /dev/null +++ b/.gitattributes @@ -0,0 +1,96 @@ +* text=auto !eol svneol=native#text/plain +*.gitattributes text svneol=native#text/plain + +# Scriptish formats +*.bat text svneol=native#text/plain +*.bsh text svneol=native#text/x-beanshell +*.cgi text svneol=native#text/plain +*.cmd text svneol=native#text/plain +*.js text svneol=native#text/javascript +*.php text svneol=native#text/x-php +*.pl text svneol=native#text/x-perl +*.pm text svneol=native#text/x-perl +*.py text svneol=native#text/x-python +*.sh eol=lf svneol=LF#text/x-sh +configure eol=lf svneol=LF#text/x-sh + +# Image formats +*.bmp binary svneol=unset#image/bmp +*.gif binary svneol=unset#image/gif +*.ico binary svneol=unset#image/ico +*.jpeg binary svneol=unset#image/jpeg +*.jpg binary svneol=unset#image/jpeg +*.png binary svneol=unset#image/png +*.tif binary svneol=unset#image/tiff +*.tiff binary svneol=unset#image/tiff +*.svg text svneol=native#image/svg%2Bxml + +# Data formats +*.pdf binary svneol=unset#application/pdf +*.avi binary svneol=unset#video/avi +*.doc binary svneol=unset#application/msword +*.dsp text svneol=crlf#text/plain +*.dsw text svneol=crlf#text/plain +*.eps binary svneol=unset#application/postscript +*.gz binary svneol=unset#application/gzip +*.mov binary svneol=unset#video/quicktime +*.mp3 binary svneol=unset#audio/mpeg +*.ppt binary svneol=unset#application/vnd.ms-powerpoint +*.ps binary svneol=unset#application/postscript +*.psd binary svneol=unset#application/photoshop +*.rdf binary svneol=unset#text/rdf +*.rss text svneol=unset#text/xml +*.rtf binary svneol=unset#text/rtf +*.sln text svneol=native#text/plain +*.swf binary svneol=unset#application/x-shockwave-flash +*.tgz binary svneol=unset#application/gzip +*.vcproj text svneol=native#text/xml +*.vcxproj text svneol=native#text/xml +*.vsprops text svneol=native#text/xml +*.wav binary svneol=unset#audio/wav +*.xls binary svneol=unset#application/vnd.ms-excel +*.zip binary svneol=unset#application/zip + +# Text formats +.htaccess text svneol=native#text/plain +*.bbk text svneol=native#text/xml +*.cmake text svneol=native#text/plain +*.css text svneol=native#text/css +*.dtd text svneol=native#text/xml +*.htm text svneol=native#text/html +*.html text svneol=native#text/html +*.ini text svneol=native#text/plain +*.log text svneol=native#text/plain +*.mak text svneol=native#text/plain +*.qbk text svneol=native#text/plain +*.rst text svneol=native#text/plain +*.sql text svneol=native#text/x-sql +*.txt text svneol=native#text/plain +*.xhtml text svneol=native#text/xhtml%2Bxml +*.xml text svneol=native#text/xml +*.xsd text svneol=native#text/xml +*.xsl text svneol=native#text/xml +*.xslt text svneol=native#text/xml +*.xul text svneol=native#text/xul +*.yml text svneol=native#text/plain +boost-no-inspect text svneol=native#text/plain +CHANGES text svneol=native#text/plain +COPYING text svneol=native#text/plain +INSTALL text svneol=native#text/plain +Jamfile text svneol=native#text/plain +Jamroot text svneol=native#text/plain +Jamfile.v2 text svneol=native#text/plain +Jamrules text svneol=native#text/plain +Makefile* text svneol=native#text/plain +README text svneol=native#text/plain +TODO text svneol=native#text/plain + +# Code formats +*.c text svneol=native#text/plain +*.cpp text svneol=native#text/plain +*.h text svneol=native#text/plain +*.hpp text svneol=native#text/plain +*.ipp text svneol=native#text/plain +*.tpp text svneol=native#text/plain +*.jam text svneol=native#text/plain +*.java text svneol=native#text/plain diff --git a/include/boost/detail/ob_type_traits.hpp b/include/boost/detail/ob_type_traits.hpp new file mode 100644 index 0000000..c5bab2e --- /dev/null +++ b/include/boost/detail/ob_type_traits.hpp @@ -0,0 +1,322 @@ +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +// See http://www.boost.org for most recent version including documentation. +// +// Crippled version of type traits for compilers that don't +// support partial specialisation. (C) John Maddock 2000 + +#ifndef BOOST_OB_TYPE_TRAITS_HPP +#define BOOST_OB_TYPE_TRAITS_HPP + +#ifndef BOOST_TYPE_TRAITS_HPP +#error Internal header file: This header must be included by only. +#endif + +// ************************************************************************** +// Helper macros for builitin compiler support. +// If your compiler has builtin support for any of the following +// traits concepts, then redefine the appropriate macros to pick +// up on the compiler support: + +#define BOOST_IS_CLASS(T) !is_union::value && \ + !is_scalar::value && \ + !is_array::value && \ + !is_reference::value && \ + !is_void::value +#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 + + +/**************************************************************************/ + +namespace boost{ +// +// start with fundamental type operations: +// these don't actually work: +// +template +struct remove_volatile{ typedef T type; }; +template +struct remove_const{ typedef T type; }; +template +struct remove_cv{ typedef T type; }; +template struct remove_reference{ typedef T type; }; +template struct add_reference{ typedef T& type; }; +template struct remove_bounds{ typedef T type; }; + +/**************************************************************************/ +// +// fundamental property classes: + +//* is a type T declared const - is_const +template +struct is_const{ enum{ value = false }; }; +template +struct is_volatile{ enum{ value = false }; }; +template struct is_same { enum{ value = false }; }; +template struct is_void{ enum{ value = false }; }; +template <> struct is_void{ enum{ value = false }; }; + +//* is a type T an unsigned integral type described in the standard (3.9.1p3) +template struct is_standard_unsigned_integral +{ enum{ value = false}; }; +template <> struct is_standard_unsigned_integral +{ enum{ value = true}; }; +template <> struct is_standard_unsigned_integral +{ enum{ value = true}; }; +template <> struct is_standard_unsigned_integral +{ enum{ value = true}; }; +template <> struct is_standard_unsigned_integral +{ enum{ value = true}; }; + +//* is a type T a signed integral type described in the standard (3.9.1p2) +template struct is_standard_signed_integral +{ enum{ value = false}; }; +template <> struct is_standard_signed_integral +{ enum{ value = true}; }; +template <> struct is_standard_signed_integral +{ enum{ value = true}; }; +template <> struct is_standard_signed_integral +{ enum{ value = true}; }; +template <> struct is_standard_signed_integral +{ enum{ value = true}; }; + +//* is a type T an integral type described in the standard (3.9.1p7) +template struct is_standard_integral +{ enum{ value = is_standard_unsigned_integral::value || +is_standard_signed_integral::value }; }; +template <> struct is_standard_integral +{ enum{ value = true}; }; +template <> struct is_standard_integral +{ enum{ value = true}; }; +template <> struct is_standard_integral +{ enum{ value = true}; }; + +//* is a type T a floating-point type described in the standard (3.9.1p8) +template struct is_standard_float +{ enum{ value = false}; }; +template <> struct is_standard_float +{ enum{ value = true}; }; +template <> struct is_standard_float +{ enum{ value = true}; }; +template <> struct is_standard_float +{ enum{ value = true}; }; + +//* is a type T an arithmetic type described in the standard (3.9.1p8) +template struct is_standard_arithmetic +{ enum{ value = is_standard_integral::value || is_standard_float::value}; }; + +//* is a type T a fundamental type described in the standard (3.9.1) +template struct is_standard_fundamental +{ enum{ value = is_standard_arithmetic::value || is_void::value}; }; + +//* is a type T an unsigned integral type provided by a compiler extension +// specialise for compiler defined extentions: +template struct is_extension_unsigned_integral +{ enum{ value = false}; }; + +//* is a type T a signed integral type provided by a compiler extension +// specialise for compiler defined extentions: +template struct is_extension_signed_integral +{ enum{ value = false}; }; + +#ifdef ULLONG_MAX +template <> struct is_extension_unsigned_integral +{ enum{ value = true}; }; +template <> struct is_extension_signed_integral +{ enum{ value = true}; }; +#endif +#if defined(__BORLANDC__) || defined(_MSC_VER) && !defined(__MWERKS__) +template <> struct is_extension_unsigned_integral +{ enum{ value = true}; }; +template <> struct is_extension_signed_integral<__int64> +{ enum{ value = true}; }; +#endif + +//* is a type T an integral type provided by a compiler extension +template struct is_extension_integral +{ enum{ value = is_extension_signed_integral::value || + is_extension_unsigned_integral::value }; }; + +//* is a type T a floating-point type provided by a compiler extension +template struct is_extension_float +{ enum{ value = false}; }; + +//* is a type T an arithmetic type provided by a compiler extension +template struct is_extension_arithmetic +{ enum{ value = is_extension_integral::value || is_extension_float::value}; }; + +//* is a type T a fundamental type provided by a compiler extension +template struct is_extension_fundamental +{ enum{ value = is_extension_arithmetic::value || is_void::value}; }; + +//* is a type T an unsigned integral type provided by the compiler or standard +template struct is_unsigned_integral +{ enum{ value = is_standard_unsigned_integral::value || is_extension_unsigned_integral::value}; }; + +//* is a type T a signed integral type provided by the compiler or standard +template struct is_signed_integral +{ enum{ value = is_standard_signed_integral::value || is_extension_signed_integral::value}; }; + +//* is a type T an integral type provided by the compiler or standard +template struct is_integral +{ enum{ value = is_standard_integral::value || is_extension_integral::value}; }; + +//* is a type T a floating-point type provided by the compiler or standard +template struct is_float +{ enum{ value = is_standard_float::value || is_extension_float::value}; }; + +//* is a type T an arithmetic type provided by the compiler or standard +template struct is_arithmetic +{ enum{ value = is_standard_arithmetic::value || is_extension_arithmetic::value}; }; + +//* is a type T a fundamental type provided by the compiler or standard +template struct is_fundamental +{ enum{ value = is_standard_fundamental::value || is_extension_fundamental::value}; }; + +//* is a type T an array - is_array +template struct is_array +{ enum{ value = false}; }; + +//* is a type T a pointer type (including function pointers) - is_pointer +template struct is_pointer { enum{ value = false}; }; +template <> struct is_pointer { enum{ value = true}; }; +template <> struct is_pointer { enum{ value = true}; }; +template <> struct is_pointer { enum{ value = true}; }; +template <> struct is_pointer { enum{ value = true}; }; +template <> struct is_pointer { enum{ value = true}; }; +template <> struct is_pointer { enum{ value = true}; }; +template <> struct is_pointer { enum{ value = true}; }; +template <> struct is_pointer { enum{ value = true}; }; +template <> struct is_pointer { enum{ value = true}; }; +template <> struct is_pointer { enum{ value = true}; }; +template <> struct is_pointer { enum{ value = true}; }; +template <> struct is_pointer { enum{ value = true}; }; +template <> struct is_pointer { enum{ value = true}; }; +template <> struct is_pointer { enum{ value = true}; }; +template <> struct is_pointer { enum{ value = true}; }; +template <> struct is_pointer { enum{ value = true}; }; +template <> struct is_pointer { enum{ value = true}; }; +template <> struct is_pointer { enum{ value = true}; }; +template <> struct is_pointer { enum{ value = true}; }; +template <> struct is_pointer { enum{ value = true}; }; +template <> struct is_pointer { enum{ value = true}; }; +template <> struct is_pointer { enum{ value = true}; }; + +//* is a type T a reference type - is_reference +template struct is_reference { enum{ value = false}; }; + +//*? is a type T a union type - is_union +template struct is_union +{ enum{ value = BOOST_IS_UNION(T) }; }; + +//*? is a type T an enum - is_enum +template struct is_enum +{ enum{ value = BOOST_IS_ENUM(T) }; }; + +//* is a type T a member function pointer - is_member_pointer +template struct is_member_pointer +{ enum{ value = false}; }; + +//* is type T an object type (allows cv-qual) +template struct is_object +{ enum{ value = !is_reference::type && !is_void::value }; }; + +//* is type T a standard scalar type (allows cv-qual) +template struct is_standard_scalar +{ enum{ value = is_standard_arithmetic::value + || is_enum::value + || is_pointer::value + || is_member_pointer::value }; }; + +//* is type T an extension scalar type (allows cv-qual) +template struct is_extension_scalar +{ enum{ value = is_extension_arithmetic::value + || is_enum::value + || is_pointer::value + || is_member_pointer::value }; }; + +//* is type T a builtin scalar type (allows cv-qual) +template struct is_scalar +{ enum{ value = is_arithmetic::value + || is_enum::value + || is_pointer::value + || is_member_pointer::value }; }; + +//*? is a type T a class type (class/struct) - is_class +template struct is_class +{ enum{ value = BOOST_IS_CLASS(T) }; }; + +//*? is a type T a compound type +template struct is_compound +{ enum{ value = is_array::value || is_pointer::value + || is_reference::value || is_class::value || is_union::value + || is_enum::value || is_member_pointer::value }; }; + +//*? is type T a POD type (allows cv-qual) +template struct is_POD +{ enum{ value = is_scalar::value //JM 7Jan2000 + || BOOST_IS_POD(T) }; }; + +//*? is type T an empty composite type (allows cv-qual) +template struct is_empty +{ enum{ value = BOOST_IS_EMPTY(T) }; }; + +//*? T has trivial default constructor (allows cv-qual) +template struct has_trivial_constructor +{ + enum{ value = is_POD::value || BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) }; +}; + +//*? T has trivial copy constructor (allows cv-qual) +template struct has_trivial_copy +{ + enum{ value = is_POD::value || BOOST_HAS_TRIVIAL_COPY(T) }; +}; + +//*? T has trivial assignment operator (allows cv-qual) +template +struct has_trivial_assign +{ + enum{ value = is_POD::value || BOOST_HAS_TRIVIAL_ASSIGN(T) }; +}; + +//*? T has trivial destructor (allows cv-qual) +template +struct has_trivial_destructor +{ + enum{ value = is_POD::value || BOOST_HAS_TRIVIAL_DESTRUCTOR(T) }; +}; + +} // namespace boost + +/**************************************************************************/ + +// +// undefine helper macro's: +// +#undef BOOST_IS_CLASS +#undef BOOST_IS_ENUM +#undef BOOST_IS_UNION +#undef BOOST_IS_POD +#undef BOOST_IS_EMPTY +#undef BOOST_HAS_TRIVIAL_CONSTRUCTOR +#undef BOOST_HAS_TRIVIAL_COPY +#undef BOOST_HAS_TRIVIAL_ASSIGN +#undef BOOST_HAS_TRIVIAL_DESTRUCTOR + +#endif // BOOST_OB_TYPE_TRAITS_HPP + + + + diff --git a/include/boost/detail/type_traits.hpp b/include/boost/detail/type_traits.hpp new file mode 100644 index 0000000..e807705 --- /dev/null +++ b/include/boost/detail/type_traits.hpp @@ -0,0 +1,499 @@ +// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. +// Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +// See http://www.boost.org for most recent version including documentation. + +#ifndef BOOST_DETAIL_TYPE_TRAITS_HPP +#define BOOST_DETAIL_TYPE_TRAITS_HPP + +#ifndef BOOST_TYPE_TRAITS_HPP +#error Internal header file: This header must be included by only. +#endif + +#include +#include + +// +// Helper macros for builitin compiler support. +// If your compiler has builtin support for any of the following +// traits concepts, then redefine the appropriate macros to pick +// up on the compiler support: +// +// (these should return false if T is cv-qualified; the type traits that use these +// will strip cv-qualification if necessary before passing T) +// BOOST_IS_CLASS(T) should evaluate to true if T is a class or struct type +// BOOST_IS_ENUM(T) should evaluate to true if T is an enumerator type +// 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 "T x;" has no effect +// BOOST_HAS_TRIVIAL_COPY(T) should evaluate to true if T(t) <==> memcpy +// 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) !is_union::value && \ + !is_scalar::value && \ + !is_array::value && \ + !is_reference::value && \ + !is_void::value +#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 + + +/**************************************************************************/ + +namespace boost{ +// +// start with fundamental type operations: + +namespace details { +// +// implementation helper: +// +template +struct cv_traits_imp{}; + +template +struct cv_traits_imp +{ + static const bool is_const = false; + static const bool is_volatile = false; + typedef T non_const_type; + typedef T non_volatile_type; + typedef T unqualified_type; + static const char* what() { return ""; } +}; + +template +struct cv_traits_imp +{ + static const bool is_const = true; + static const bool is_volatile = false; + typedef T non_const_type; + typedef const T non_volatile_type; + typedef T unqualified_type; + static const char* what() { return "const"; } +}; + +template +struct cv_traits_imp +{ + static const bool is_const = false; + static const bool is_volatile = true; + typedef volatile T non_const_type; + typedef T non_volatile_type; + typedef T unqualified_type; + static const char* what() { return "volatile"; } +}; + +template +struct cv_traits_imp +{ + static const bool is_const = true; + static const bool is_volatile = true; + typedef volatile T non_const_type; + typedef const T non_volatile_type; + typedef T unqualified_type; + static const char* what() { return "const volatile"; } +}; + +} // namespace details + +// * convert a type T to a non-volatile type - remove_volatile +template +struct remove_volatile +{ + typedef typename details::cv_traits_imp::non_volatile_type type; +}; +template struct remove_volatile{ typedef T& type; }; + +// * convert a type T to non-const type - remove_const +template +struct remove_const +{ + typedef typename details::cv_traits_imp::non_const_type type; +}; +template struct remove_const{ typedef T& type; }; + +// convert a type T to a non-cv-qualified type - remove_cv +template +struct remove_cv +{ + typedef typename details::cv_traits_imp::unqualified_type type; +}; +template struct remove_cv{ typedef T& type; }; + +// * convert a type T to a non-reference if it is one - remove_reference +template struct remove_reference{ typedef T type; }; +template struct remove_reference{ typedef T type; }; + +// * convert a type T to a reference unless it is one - add_reference +template struct add_reference{ typedef T& type; }; +template struct add_reference{ typedef T& type; }; + +// * convert an array type to underlying non-array type - remove_bounds +template struct remove_bounds{ typedef T type; }; +template struct remove_bounds{ typedef T type; }; + +/**************************************************************************/ +// +// fundamental property classes: + +//* is a type T declared const - is_const +template +struct is_const +{ + static const bool value = details::cv_traits_imp::is_const; +}; + +//* is a type T declared volatile - is_volatile +template +struct is_volatile +{ + static const bool value = details::cv_traits_imp::is_volatile; +}; + +//* is a type T the same as type U - is_same +template struct is_same { static const bool value = false; }; +template struct is_same { static const bool value = true; }; + +//* is a type T void - is_void +template struct is_void{ static const bool value = false; }; +template <> struct is_void{ static const bool value = true; }; + +//* is a type T an unsigned integral type described in the standard (3.9.1p3) +template struct is_standard_unsigned_integral +{ static const bool value = false; }; +template <> struct is_standard_unsigned_integral +{ static const bool value = true; }; +template <> struct is_standard_unsigned_integral +{ static const bool value = true; }; +template <> struct is_standard_unsigned_integral +{ static const bool value = true; }; +template <> struct is_standard_unsigned_integral +{ static const bool value = true; }; + +//* is a type T a signed integral type described in the standard (3.9.1p2) +template struct is_standard_signed_integral +{ static const bool value = false; }; +template <> struct is_standard_signed_integral +{ static const bool value = true; }; +template <> struct is_standard_signed_integral +{ static const bool value = true; }; +template <> struct is_standard_signed_integral +{ static const bool value = true; }; +template <> struct is_standard_signed_integral +{ static const bool value = true; }; + +//* is a type T an integral type described in the standard (3.9.1p7) +template struct is_standard_integral +{ static const bool value = is_standard_unsigned_integral::value || + is_standard_signed_integral::value; }; +template <> struct is_standard_integral +{ static const bool value = true; }; +template <> struct is_standard_integral +{ static const bool value = true; }; +template <> struct is_standard_integral +{ static const bool value = true; }; + +//* is a type T a floating-point type described in the standard (3.9.1p8) +template struct is_standard_float +{ static const bool value = false; }; +template <> struct is_standard_float +{ static const bool value = true; }; +template <> struct is_standard_float +{ static const bool value = true; }; +template <> struct is_standard_float +{ static const bool value = true; }; + +//* is a type T an arithmetic type described in the standard (3.9.1p8) +template struct is_standard_arithmetic +{ static const bool value = is_standard_integral::value || is_standard_float::value; }; + +//* is a type T a fundamental type described in the standard (3.9.1) +template struct is_standard_fundamental +{ static const bool value = is_standard_arithmetic::value || is_void::value; }; + +//* is a type T an unsigned integral type provided by a compiler extension +// specialise for compiler defined extentions: +template struct is_extension_unsigned_integral +{ static const bool value = false; }; + +//* is a type T a signed integral type provided by a compiler extension +// specialise for compiler defined extentions: +template struct is_extension_signed_integral +{ static const bool value = false; }; + +#ifdef ULLONG_MAX +template <> struct is_extension_unsigned_integral +{ static const bool value = true; }; +template <> struct is_extension_signed_integral +{ static const bool value = true; }; +#endif +#if defined(__BORLANDC__) || defined(_MSC_VER) && !defined(__MWERKS__) +template <> struct is_extension_unsigned_integral +{ static const bool value = true; }; +template <> struct is_extension_signed_integral<__int64> +{ static const bool value = true; }; +#endif + +//* is a type T an integral type provided by a compiler extension +template struct is_extension_integral +{ static const bool value = is_extension_signed_integral::value || + is_extension_unsigned_integral::value; }; + +//* is a type T a floating-point type provided by a compiler extension +template struct is_extension_float +{ static const bool value = false; }; + +//* is a type T an arithmetic type provided by a compiler extension +template struct is_extension_arithmetic +{ static const bool value = is_extension_integral::value || is_extension_float::value; }; + +//* is a type T a fundamental type provided by a compiler extension +template struct is_extension_fundamental +{ static const bool value = is_extension_arithmetic::value || is_void::value; }; + +//* is a type T an unsigned integral type provided by the compiler or standard +template struct is_unsigned_integral +{ static const bool value = is_standard_unsigned_integral::value || is_extension_unsigned_integral::value; }; + +//* is a type T a signed integral type provided by the compiler or standard +template struct is_signed_integral +{ static const bool value = is_standard_signed_integral::value || is_extension_signed_integral::value; }; + +//* is a type T an integral type provided by the compiler or standard +template struct is_integral +{ static const bool value = is_standard_integral::value || is_extension_integral::value; }; + +//* is a type T a floating-point type provided by the compiler or standard +template struct is_float +{ static const bool value = is_standard_float::value || is_extension_float::value; }; + +//* is a type T an arithmetic type provided by the compiler or standard +template struct is_arithmetic +{ static const bool value = is_standard_arithmetic::value || is_extension_arithmetic::value; }; + +//* is a type T a fundamental type provided by the compiler or standard +template struct is_fundamental +{ static const bool value = is_standard_fundamental::value || is_extension_fundamental::value; }; + +//* is a type T an array - is_array +template struct is_array +{ static const bool value = false; }; +template struct is_array +{ static const bool value = true; }; + +//* is a type T a pointer type (including function pointers) - is_pointer +template struct is_pointer { static const bool value = false; }; +template struct is_pointer { static const bool value = true; }; + +//* is a type T a reference type - is_reference +template struct is_reference { static const bool value = false; }; +template struct is_reference { static const bool value = true; }; + +//*? is a type T a union type - is_union +template struct is_union +{ +private: + typedef typename remove_cv::type cvt; +public: + static const bool value = BOOST_IS_UNION(cvt); +}; + +//*? is a type T an enum - is_enum +template struct is_enum +{ +private: + typedef typename remove_cv::type cvt; +public: + static const bool value = BOOST_IS_ENUM(cvt); +}; + +//* is a type T a member function pointer - is_member_pointer +template struct is_member_pointer +{ static const bool value = false; }; +template struct is_member_pointer +{ static const bool value = true; }; + +//* is type T an object type (allows cv-qual) +template struct is_object +{ +private: + typedef typename remove_cv::type cvt; +public: + static const bool value = !::boost::is_reference::value + && !::boost::is_void::value; +}; + +//* is type T a standard scalar type (allows cv-qual) +template struct is_standard_scalar +{ +private: + typedef typename remove_cv::type cvt; +public: + static const bool value = is_standard_arithmetic::value + || is_enum::value + || is_pointer::value + || is_member_pointer::value; +}; + +//* is type T an extension scalar type (allows cv-qual) +template struct is_extension_scalar +{ +private: + typedef typename remove_cv::type cvt; +public: + static const bool value = is_extension_arithmetic::value + || is_enum::value + || is_pointer::value + || is_member_pointer::value; +}; + +//* is type T a builtin scalar type (allows cv-qual) +template struct is_scalar +{ +private: + typedef typename remove_cv::type cvt; +public: + static const bool value = is_arithmetic::value + || is_enum::value + || is_pointer::value + || is_member_pointer::value; +}; + +//*? is a type T a class type (class/struct) - is_class +template struct is_class +{ +private: + typedef typename remove_cv::type cvt; +public: + static const bool value = BOOST_IS_CLASS(cvt); +}; + +//*? is a type T a compound type +template struct is_compound +{ static const bool value = is_array::value || is_pointer::value + || is_reference::value || is_class::value || is_union::value + || is_enum::value || is_member_pointer::value; }; + +//*? is type T a POD type (allows cv-qual) +template struct is_POD +{ +private: + typedef typename remove_cv::type cvt; +public: + static const bool value = is_scalar::value || BOOST_IS_POD(cvt); +}; +template struct is_POD +{ static const bool value = is_POD::value; }; + +// +// JM 7Jan2000 +// +namespace detail{ +template +struct empty_helper{ static const bool value = false; }; + +template +struct empty_helper_t1 : public T +{ +#ifdef __MWERKS__ + empty_helper_t1(); // hh compiler bug workaround +#endif + int i[256]; +}; +struct empty_helper_t2 { int i[256]; }; + +template +struct empty_helper +{ + static const bool value = (sizeof(empty_helper_t1) == sizeof(empty_helper_t2)); +}; +} + +//*? is type T an empty composite type (allows cv-qual) +template struct is_empty +{ +private: + typedef typename remove_cv::type cvt; +public: + static const bool value = ::boost::detail::empty_helper::value>::value + || BOOST_IS_EMPTY(cvt); +}; + +//*? T has trivial default constructor (allows cv-qual) +template struct has_trivial_constructor +{ +private: + typedef typename remove_cv::type cvt; +public: + static const bool value = is_POD::value + || BOOST_HAS_TRIVIAL_CONSTRUCTOR(cvt); +}; + +//*? T has trivial copy constructor (allows cv-qual) +template struct has_trivial_copy +{ +private: + typedef typename remove_cv::type cvt; +public: + static const bool value = is_POD::value + || BOOST_HAS_TRIVIAL_COPY(cvt); +}; + +//*? T has trivial assignment operator (allows cv-qual) +template +struct has_trivial_assign +{ +private: + typedef typename remove_cv::type cvt; +public: + static const bool value = is_POD::value + || BOOST_HAS_TRIVIAL_ASSIGN(cvt); +}; + +//*? T has trivial destructor (allows cv-qual) +template +struct has_trivial_destructor +{ +private: + typedef typename remove_cv::type cvt; +public: + static const bool value = is_POD::value + || BOOST_HAS_TRIVIAL_DESTRUCTOR(cvt); +}; + +} // namespace boost + +/**************************************************************************/ + +// +// undefine helper macro's: +// +#undef BOOST_IS_CLASS +#undef BOOST_IS_ENUM +#undef BOOST_IS_UNION +#undef BOOST_IS_POD +#undef BOOST_IS_EMPTY +#undef BOOST_HAS_TRIVIAL_CONSTRUCTOR +#undef BOOST_HAS_TRIVIAL_COPY +#undef BOOST_HAS_TRIVIAL_ASSIGN +#undef BOOST_HAS_TRIVIAL_DESTRUCTOR + +#endif // BOOST_DETAIL_TYPE_TRAITS_HPP + + + + + + diff --git a/include/boost/type_traits.hpp b/include/boost/type_traits.hpp new file mode 100644 index 0000000..b177a4e --- /dev/null +++ b/include/boost/type_traits.hpp @@ -0,0 +1,23 @@ +// (C) Copyright Boost.org 2000. Permission to copy, use, modify, sell and +// distribute this software is granted provided this copyright notice appears +// in all copies. This software is provided "as is" without express or implied +// warranty, and with no claim as to its suitability for any purpose. + +// See http://www.boost.org for most recent version including documentation. +// See boost/detail/type_traits.hpp and boost/detail/ob_type_traits.hpp +// for full copyright notices. + +#ifndef BOOST_TYPE_TRAITS_HPP +#define BOOST_TYPE_TRAITS_HPP + +#ifndef BOOST_CONFIG_HPP +#include +#endif + +#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +#include +#else +#include +#endif + +#endif // BOOST_TYPE_TRAITS_HPP