From: wolf Date: Thu, 6 Feb 2003 17:42:11 +0000 (+0000) Subject: Add second part of boost. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5aebf1bcefcde69976ea3a3f73cd55e7c5dbceb;p=dealii-svn.git Add second part of boost. git-svn-id: https://svn.dealii.org/trunk@7054 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/contrib/boost/include/boost_local/config/posix_features.hpp b/deal.II/contrib/boost/include/boost_local/config/posix_features.hpp new file mode 100644 index 0000000000..2d9ec29fdb --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/config/posix_features.hpp @@ -0,0 +1,71 @@ +// (C) Copyright Boost.org 2001. 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. + +// All POSIX feature tests go in this file: + +# ifdef BOOST_HAS_UNISTD_H +# include + + // XOpen has , but is this the correct version check? +# if defined(_XOPEN_VERSION) && (_XOPEN_VERSION >= 3) +# define BOOST_HAS_NL_TYPES_H +# endif + + // POSIX version 6 requires +# if defined(_POSIX_VERSION) && (_POSIX_VERSION >= 200100) +# define BOOST_HAS_STDINT_H +# endif + + // POSIX version 2 requires +# if defined(_POSIX_VERSION) && (_POSIX_VERSION >= 199009L) +# define BOOST_HAS_DIRENT_H +# endif + + // POSIX defines _POSIX_THREADS > 0 for pthread support, + // however some platforms define _POSIX_THREADS without + // a value, hence the (_POSIX_THREADS+0 >= 0) check. + // Strictly speaking this may catch platforms with a + // non-functioning stub , but such occurrences should + // occur very rarely if at all. +# if defined(_POSIX_THREADS) && (_POSIX_THREADS+0 >= 0) && !defined(BOOST_HAS_WINTHREADS) +# define BOOST_HAS_PTHREADS +# endif + + // BOOST_HAS_NANOSLEEP: + // This is predicated on _POSIX_TIMERS or _XOPEN_REALTIME: +# if (defined(_POSIX_TIMERS) && (_POSIX_TIMERS+0 >= 0)) \ + || (defined(_XOPEN_REALTIME) && (_XOPEN_REALTIME+0 >= 0)) +# define BOOST_HAS_NANOSLEEP +# endif + + // BOOST_HAS_CLOCK_GETTIME: + // This is predicated on _POSIX_TIMERS (also on _XOPEN_REALTIME + // but at least one platform - linux - defines that flag without + // defining clock_gettime): +# if (defined(_POSIX_TIMERS) && (_POSIX_TIMERS+0 >= 0)) +# define BOOST_HAS_CLOCK_GETTIME +# endif + + // BOOST_HAS_SCHED_YIELD: + // This is predicated on _POSIX_PRIORITY_SCHEDULING or + // on _POSIX_THREAD_PRIORITY_SCHEDULING or on _XOPEN_REALTIME. +# if defined(_POSIX_PRIORITY_SCHEDULING) && (_POSIX_PRIORITY_SCHEDULING+0 > 0)\ + || (defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING+0 > 0))\ + || (defined(_XOPEN_REALTIME) && (_XOPEN_REALTIME+0 >= 0)) +# define BOOST_HAS_SCHED_YIELD +# endif + + // BOOST_HAS_GETTIMEOFDAY: + // BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE: + // These are predicated on _XOPEN_VERSION, and appears to be first released + // in issue 4, version 2 (_XOPEN_VERSION > 500). +# if defined(_XOPEN_VERSION) && (_XOPEN_VERSION+0 >= 500) +# define BOOST_HAS_GETTIMEOFDAY +# define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE +# endif + +# endif diff --git a/deal.II/contrib/boost/include/boost_local/config/select_compiler_config.hpp b/deal.II/contrib/boost/include/boost_local/config/select_compiler_config.hpp new file mode 100644 index 0000000000..c5a7dac26c --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/config/select_compiler_config.hpp @@ -0,0 +1,78 @@ +// Boost compiler configuration selection header file + +// (C) Copyright Boost.org 2001. 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. + +// locate which compiler we are using and define +// BOOST_COMPILER_CONFIG as needed: + +#if defined __GNUC__ +// GNU C++: +# define BOOST_COMPILER_CONFIG + +# elif defined __COMO__ +// Comeau C++ +# define BOOST_COMPILER_CONFIG + +#elif defined __KCC +// Kai C++ +# define BOOST_COMPILER_CONFIG + +#elif defined __sgi +// SGI MIPSpro C++ +# define BOOST_COMPILER_CONFIG + +#elif defined __DECCXX +// Compaq Tru64 Unix cxx +# define BOOST_COMPILER_CONFIG + +#elif defined __ghs +// Greenhills C++ +# define BOOST_COMPILER_CONFIG + +#elif defined __BORLANDC__ +// Borland +# define BOOST_COMPILER_CONFIG + +#elif defined(__ICL) || defined(__ICC) +// Intel +# define BOOST_COMPILER_CONFIG + +#elif defined __MWERKS__ +// Metrowerks CodeWarrior +# define BOOST_COMPILER_CONFIG + +#elif defined __SUNPRO_CC +// Sun Workshop Compiler C++ +# define BOOST_COMPILER_CONFIG + +#elif defined __HP_aCC +// HP aCC +# define BOOST_COMPILER_CONFIG + +#elif defined(__MRC__) || defined(__SC__) +// MPW MrCpp or SCpp +# define BOOST_COMPILER_CONFIG + +#elif defined(__IBMCPP__) +// IBM Visual Age +# define BOOST_COMPILER_CONFIG + +#elif defined _MSC_VER +// Microsoft Visual C++ +// +// Must remain the last #elif since some other vendors (Metrowerks, for +// example) also #define _MSC_VER +# define BOOST_COMPILER_CONFIG + +#elif defined (BOOST_ASSERT_CONFIG) +// this must come last - generate an error if we don't +// recognise the compiler: +# error "Unknown compiler - please configure and report the results to boost.org" + +#endif + diff --git a/deal.II/contrib/boost/include/boost_local/config/select_platform_config.hpp b/deal.II/contrib/boost/include/boost_local/config/select_platform_config.hpp new file mode 100644 index 0000000000..5612b23858 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/config/select_platform_config.hpp @@ -0,0 +1,84 @@ +// Boost compiler configuration selection header file + +// (C) Copyright Boost.org 2001. 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. + +// locate which platform we are on and define BOOST_PLATFORM_CONFIG as needed. +// Note that we define the headers to include using "header_name" not +// in order to prevent macro expansion within the header +// name (for example "linux" is a macro on linux systems). + +#if defined(linux) || defined(__linux) || defined(__linux__) +// linux: +# define BOOST_PLATFORM_CONFIG "boost_local/config/platform/linux.hpp" + +#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) +// BSD: +# define BOOST_PLATFORM_CONFIG "boost_local/config/platform/bsd.hpp" + +#elif defined(sun) || defined(__sun) +// solaris: +# define BOOST_PLATFORM_CONFIG "boost_local/config/platform/solaris.hpp" + +#elif defined(__sgi) +// SGI Irix: +# define BOOST_PLATFORM_CONFIG "boost_local/config/platform/irix.hpp" + +#elif defined(__hpux) +// hp unix: +# define BOOST_PLATFORM_CONFIG "boost_local/config/platform/hpux.hpp" + +#elif defined(__CYGWIN__) +// cygwin is not win32: +# define BOOST_PLATFORM_CONFIG "boost_local/config/platform/cygwin.hpp" + +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +// win32: +# define BOOST_PLATFORM_CONFIG "boost_local/config/platform/win32.hpp" + +#elif defined(__BEOS__) +// BeOS +# define BOOST_PLATFORM_CONFIG "boost_local/config/platform/beos.hpp" + +#elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) +// MacOS +# define BOOST_PLATFORM_CONFIG "boost_local/config/platform/macos.hpp" + +#elif defined(__IBMCPP__) +// IBM +# define BOOST_PLATFORM_CONFIG "boost_local/config/platform/aix.hpp" + +#elif defined(__amigaos__) +// AmigaOS +# define BOOST_PLATFORM_CONFIG "boost_local/config/platform/amigaos.hpp" + +#else + +# if defined(unix) \ + || defined(__unix) \ + || defined(_XOPEN_SOURCE) \ + || defined(_POSIX_SOURCE) + + // generic unix platform: + +# ifndef BOOST_HAS_UNISTD_H +# define BOOST_HAS_UNISTD_H +# endif + +# include + +# endif + +# if defined (BOOST_ASSERT_CONFIG) + // this must come last - generate an error if we don't + // recognise the platform: +# error "Unknown platform - please configure and report the results to boost.org" +# endif + +#endif + + diff --git a/deal.II/contrib/boost/include/boost_local/config/select_stdlib_config.hpp b/deal.II/contrib/boost/include/boost_local/config/select_stdlib_config.hpp new file mode 100644 index 0000000000..3163f38dfb --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/config/select_stdlib_config.hpp @@ -0,0 +1,65 @@ +// Boost compiler configuration selection header file + +// (C) Copyright Boost.org 2001. 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. + +// locate which std lib we are using and define BOOST_STDLIB_CONFIG as needed: + +// we need to include a std lib header here in order to detect which +// library is in use, use as it's about the smallest +// of the std lib headers - do not rely on this header being included - +// users can short-circuit this header if they know whose std lib +// they are using. + +#include + +#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) +// STLPort library; this _must_ come first, otherwise since +// STLport typically sits on top of some other library, we +// can end up detecting that first rather than STLport: +# define BOOST_STDLIB_CONFIG + +#elif defined(__LIBCOMO__) +// Commeau STL: +#define BOOST_STDLIB_CONFIG + +#elif defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER) +// Rogue Wave library: +# define BOOST_STDLIB_CONFIG + +#elif (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER) +// Dinkumware Library: +# define BOOST_STDLIB_CONFIG + +#elif defined(__GLIBCPP__) +// GNU libstdc++ 3 +# define BOOST_STDLIB_CONFIG + +#elif defined(__STL_CONFIG_H) +// generic SGI STL +# define BOOST_STDLIB_CONFIG + +#elif defined(__MSL_CPP__) +// MSL standard lib: +# define BOOST_STDLIB_CONFIG + +#elif defined(__IBMCPP__) +// take the default VACPP std lib +# define BOOST_STDLIB_CONFIG + +#elif defined(MSIPL_COMPILE_H) +// Modena C++ standard library +# define BOOST_STDLIB_CONFIG + +#elif defined (BOOST_ASSERT_CONFIG) +// this must come last - generate an error if we don't +// recognise the library: +# error "Unknown standard library - please configure and report the results to boost.org" + +#endif + + diff --git a/deal.II/contrib/boost/include/boost_local/config/suffix.hpp b/deal.II/contrib/boost/include/boost_local/config/suffix.hpp new file mode 100644 index 0000000000..332527f64d --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/config/suffix.hpp @@ -0,0 +1,359 @@ +// Boost config.hpp configuration header file ------------------------------// + +// (C) Copyright Boost.org 2001. 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. + +// Boost config.hpp policy and rationale documentation has been moved to +// http://www.boost.org/libs/config +// +// This file is intended to be stable, and relatively unchanging. +// It should contain boilerplate code only - no compiler specific +// code unless it is unavoidable - no changes unless unavoidable. + +#ifndef BOOST_CONFIG_SUFFIX_HPP +#define BOOST_CONFIG_SUFFIX_HPP + +# ifndef BOOST_DECL +# define BOOST_DECL // default for compilers not needing this decoration. +# endif + +// +// look for long long by looking for the appropriate macros in . +// Note that we use limits.h rather than climits for maximal portability, +// remember that since these just declare a bunch of macros, there should be +// no namespace issues from this. +// +#include +# if !defined(BOOST_HAS_LONG_LONG) \ + && !(defined(BOOST_MSVC) && BOOST_MSVC <=1300) && !defined(__BORLANDC__) \ + && (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX)) +# define BOOST_HAS_LONG_LONG +#endif +#if !defined(BOOST_HAS_LONG_LONG) && !defined(BOOST_NO_INTEGRAL_INT64_T) +# define BOOST_NO_INTEGRAL_INT64_T +#endif + +// GCC 3.x will clean up all of those nasty macro definitions that +// BOOST_NO_CTYPE_FUNCTIONS is intended to help work around, so undefine +// it under GCC 3.x. +#if defined(__GNUC__) && (__GNUC__ >= 3) && defined(BOOST_NO_CTYPE_FUNCTIONS) +# undef BOOST_NO_CTYPE_FUNCTIONS +#endif + + +// +// Assume any extensions are in namespace std:: unless stated otherwise: +// +# ifndef BOOST_STD_EXTENSION_NAMESPACE +# define BOOST_STD_EXTENSION_NAMESPACE std +# endif + +// +// If cv-qualified specializations are not allowed, then neither are cv-void ones: +// +# if defined(BOOST_NO_CV_SPECIALIZATIONS) \ + && !defined(BOOST_NO_CV_VOID_SPECIALIZATIONS) +# define BOOST_NO_CV_VOID_SPECIALIZATIONS +# endif + +// +// If there is no numeric_limits template, then it can't have any compile time +// constants either! +// +# if defined(BOOST_NO_LIMITS) \ + && !defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) +# define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS +# define BOOST_NO_MS_INT64_NUMERIC_LIMITS +# define BOOST_NO_LONG_LONG_NUMERIC_LIMITS +# endif + +// +// if there is no long long then there is no specialisation +// for numeric_limits either: +// +#if !defined(BOOST_HAS_LONG_LONG) && !defined(BOOST_NO_LONG_LONG_NUMERIC_LIMITS) +# define BOOST_NO_LONG_LONG_NUMERIC_LIMITS +#endif + +// +// if there is no __int64 then there is no specialisation +// for numeric_limits<__int64> either: +// +#if !defined(BOOST_HAS_MS_INT64) && !defined(BOOST_NO_MS_INT64_NUMERIC_LIMITS) +# define BOOST_NO_MS_INT64_NUMERIC_LIMITS +#endif + +// +// if member templates are supported then so is the +// VC6 subset of member templates: +// +# if !defined(BOOST_NO_MEMBER_TEMPLATES) \ + && !defined(BOOST_MSVC6_MEMBER_TEMPLATES) +# define BOOST_MSVC6_MEMBER_TEMPLATES +# endif + +// +// Without partial specialization, can't test for partial specialisation bugs: +// +# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ + && !defined(BOOST_BCB_PARTIAL_SPECIALIZATION_BUG) +# define BOOST_BCB_PARTIAL_SPECIALIZATION_BUG +# endif + +// +// Without partial specialization, std::iterator_traits can't work: +// +# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ + && !defined(BOOST_NO_STD_ITERATOR_TRAITS) +# define BOOST_NO_STD_ITERATOR_TRAITS +# endif + +// +// Without member template support, we can't have template constructors +// in the standard library either: +// +# if defined(BOOST_NO_MEMBER_TEMPLATES) \ + && !defined(BOOST_MSVC6_MEMBER_TEMPLATES) \ + && !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS) +# define BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS +# endif + +// +// Without member template support, we can't have a conforming +// std::allocator template either: +// +# if defined(BOOST_NO_MEMBER_TEMPLATES) \ + && !defined(BOOST_MSVC6_MEMBER_TEMPLATES) \ + && !defined(BOOST_NO_STD_ALLOCATOR) +# define BOOST_NO_STD_ALLOCATOR +# endif + +// +// If we have a standard allocator, then we have a partial one as well: +// +#if !defined(BOOST_NO_STD_ALLOCATOR) +# define BOOST_HAS_PARTIAL_STD_ALLOCATOR +#endif + +// +// We can't have a working std::use_facet if there is no std::locale: +// +# if defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_STD_USE_FACET) +# define BOOST_NO_STD_USE_FACET +# endif + +// +// We can't have a std::messages facet if there is no std::locale: +// +# if defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_STD_MESSAGES) +# define BOOST_NO_STD_MESSAGES +# endif + +// +// We can't have a working std::wstreambuf if there is no std::locale: +// +# if defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_STD_WSTREAMBUF) +# define BOOST_NO_STD_WSTREAMBUF +# endif + +// +// We can't have a if there is no : +// +# if defined(BOOST_NO_CWCHAR) && !defined(BOOST_NO_CWCTYPE) +# define BOOST_NO_CWCTYPE +# endif + +// +// We can't have a swprintf if there is no : +// +# if defined(BOOST_NO_CWCHAR) && !defined(BOOST_NO_SWPRINTF) +# define BOOST_NO_SWPRINTF +# endif + +// +// If Win32 support is turned off, then we must turn off +// threading support also, unless there is some other +// thread API enabled: +// +#if defined(BOOST_DISABLE_WIN32) && defined(_WIN32) \ + && !defined(BOOST_DISABLE_THREADS) && !defined(BOOST_HAS_PTHREADS) +# define BOOST_DISABLE_THREADS +#endif + +// +// Turn on threading support if the compiler thinks that it's in +// multithreaded mode. We put this here because there are only a +// limited number of macros that identify this (if there's any missing +// from here then add to the appropriate compiler section): +// +#if (defined(__MT__) || defined(_MT) || defined(_REENTRANT) \ + || defined(_PTHREADS)) && !defined(BOOST_HAS_THREADS) +# define BOOST_HAS_THREADS +#endif + +// +// Turn threading support off if BOOST_DISABLE_THREADS is defined: +// +#if defined(BOOST_DISABLE_THREADS) && defined(BOOST_HAS_THREADS) +# undef BOOST_HAS_THREADS +#endif + +// +// Turn threading support off if we don't recognise the threading API: +// +#if defined(BOOST_HAS_THREADS) && !defined(BOOST_HAS_PTHREADS)\ + && !defined(BOOST_HAS_WINTHREADS) && !defined(BOOST_HAS_BETHREADS)\ + && !defined(BOOST_HAS_MPTASKS) +# undef BOOST_HAS_THREADS +#endif + +// +// If the compiler claims to be C99 conformant, then it had better +// have a : +// +# if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901) +# define BOOST_HAS_STDINT_H +# endif + +// +// Define BOOST_NO_SLIST and BOOST_NO_HASH if required. +// Note that this is for backwards compatibility only. +// +# ifndef BOOST_HAS_SLIST +# define BOOST_NO_SLIST +# endif + +# ifndef BOOST_HAS_HASH +# define BOOST_NO_HASH +# endif + +// BOOST_NO_STDC_NAMESPACE workaround --------------------------------------// +// Because std::size_t usage is so common, even in boost headers which do not +// otherwise use the C library, the workaround is included here so +// that ugly workaround code need not appear in many other boost headers. +// NOTE WELL: This is a workaround for non-conforming compilers; +// must still be #included in the usual places so that inclusion +// works as expected with standard conforming compilers. The resulting +// double inclusion of is harmless. + +# ifdef BOOST_NO_STDC_NAMESPACE +# include + namespace std { using ::ptrdiff_t; using ::size_t; } +# endif + +// BOOST_NO_STD_MIN_MAX workaround -----------------------------------------// + +# ifdef BOOST_NO_STD_MIN_MAX + +namespace std { + template + inline const _Tp& min(const _Tp& __a, const _Tp& __b) { + return __b < __a ? __b : __a; + } + template + inline const _Tp& max(const _Tp& __a, const _Tp& __b) { + return __a < __b ? __b : __a; + } +} + +# endif + +// BOOST_STATIC_CONSTANT workaround --------------------------------------- // +// On compilers which don't allow in-class initialization of static integral +// constant members, we must use enums as a workaround if we want the constants +// to be available at compile-time. This macro gives us a convenient way to +// declare such constants. + +# ifdef BOOST_NO_INCLASS_MEMBER_INITIALIZATION +# define BOOST_STATIC_CONSTANT(type, assignment) enum { assignment } +# else +# define BOOST_STATIC_CONSTANT(type, assignment) static const type assignment +# endif + +// BOOST_USE_FACET workaround ----------------------------------------------// +// When the standard library does not have a conforming std::use_facet there +// are various workarounds available, but they differ from library to library. +// This macro provides a consistent way to access a locale's facets. +// Usage: +// replace +// std::use_facet(loc); +// with +// BOOST_USE_FACET(Type, loc); +// Note do not add a std:: prefix to the front of BOOST_USE_FACET! + +#if defined(BOOST_NO_STD_USE_FACET) +# ifdef BOOST_HAS_TWO_ARG_USE_FACET +# define BOOST_USE_FACET(Type, loc) std::use_facet(loc, static_cast(0)) +# elif defined(BOOST_HAS_MACRO_USE_FACET) +# define BOOST_USE_FACET(Type, loc) std::_USE(loc, Type) +# elif defined(BOOST_HAS_STLP_USE_FACET) +# define BOOST_USE_FACET(Type, loc) (*std::_Use_facet(loc)) +# endif +#else +# define BOOST_USE_FACET(Type, loc) std::use_facet< Type >(loc) +#endif + +// BOOST_NESTED_TEMPLATE workaround ------------------------------------------// +// Member templates are supported by some compilers even though they can't use +// the A::template member syntax, as a workaround replace: +// +// typedef typename A::template rebind binder; +// +// with: +// +// typedef typename A::BOOST_NESTED_TEMPLATE rebind binder; + +#ifndef BOOST_NO_MEMBER_TEMPLATE_KEYWORD +# define BOOST_NESTED_TEMPLATE template +#else +# define BOOST_NESTED_TEMPLATE +#endif + +// ---------------------------------------------------------------------------// + +// +// Helper macro BOOST_STRINGIZE: +// Converts the parameter X to a string after macro replacement +// on X has been performed. +// +#define BOOST_STRINGIZE(X) BOOST_DO_STRINGIZE(X) +#define BOOST_DO_STRINGIZE(X) #X + +// +// Helper macro BOOST_JOIN: +// The following piece of macro magic joins the two +// arguments together, even when one of the arguments is +// itself a macro (see 16.3.1 in C++ standard). The key +// is that macro expansion of macro arguments does not +// occur in BOOST_DO_JOIN2 but does in BOOST_DO_JOIN. +// +#define BOOST_JOIN( X, Y ) BOOST_DO_JOIN( X, Y ) +#define BOOST_DO_JOIN( X, Y ) BOOST_DO_JOIN2(X,Y) +#define BOOST_DO_JOIN2( X, Y ) X##Y + +// +// Set some default values for compiler/library/platform names. +// These are for debugging config setup only: +// +# ifndef BOOST_COMPILER +# define BOOST_COMPILER "Unknown ISO C++ Compiler" +# endif +# ifndef BOOST_STDLIB +# define BOOST_STDLIB "Unknown ISO standard library" +# endif +# ifndef BOOST_PLATFORM +# if defined(unix) || defined(__unix) || defined(_XOPEN_SOURCE) \ + || defined(_POSIX_SOURCE) +# define BOOST_PLATFORM "Generic Unix" +# else +# define BOOST_PLATFORM "Unknown" +# endif +# endif + +#endif + + diff --git a/deal.II/contrib/boost/include/boost_local/config/user.hpp b/deal.II/contrib/boost/include/boost_local/config/user.hpp new file mode 100644 index 0000000000..98adbac909 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/config/user.hpp @@ -0,0 +1,68 @@ +// boost/config/user.hpp ---------------------------------------------------// + +// (C) Copyright Boost.org 2001. 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. + +// Do not check in modified versions of this file, +// This file may be customized by the end user, but not by boost. + +// +// Use this file to define a site and compiler specific +// configuration policy: +// + +// define this to locate a compiler config file: +// #define BOOST_COMPILER_CONFIG + +// define this to locate a stdlib config file: +// #define BOOST_STDLIB_CONFIG + +// define this to locate a platform config file: +// #define BOOST_PLATFORM_CONFIG + +// define this to disable compiler config, +// use if your compiler config has nothing to set: +// #define BOOST_NO_COMPILER_CONFIG + +// define this to disable stdlib config, +// use if your stdlib config has nothing to set: +// #define BOOST_NO_STDLIB_CONFIG + +// define this to disable platform config, +// use if your platform config has nothing to set: +// #define BOOST_NO_PLATFORM_CONFIG + +// define this to disable all config options, +// excluding the user config. Use if your +// setup is fully ISO compliant, and has no +// useful extensions, or for autoconf generated +// setups: +// #define BOOST_NO_CONFIG + +// define this to make the config "optimistic" +// about unknown compiler versions. Normally +// unknown compiler versions are assumed to have +// all the defects of the last known version, however +// setting this flag, causes the config to assume +// that unknown compiler versions are fully conformant +// with the standard: +// #define BOOST_STRICT_CONFIG + +// define this to cause the config to halt compilation +// with an #error if it encounters anything unknown -- +// either an unknown compiler version or an unknown +// compiler/platform/library: +// #define BOOST_ASSERT_CONFIG + + +// define if you want to disable threading support, even +// when available: +// #define BOOST_DISABLE_THREADS + +// define when you want to disable Win32 specific features +// even when available: +// #define BOOST_DISABLE_WIN32 + + diff --git a/deal.II/contrib/boost/include/boost_local/detail/atomic_count.hpp b/deal.II/contrib/boost/include/boost_local/detail/atomic_count.hpp new file mode 100644 index 0000000000..593c667998 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/detail/atomic_count.hpp @@ -0,0 +1,123 @@ +#ifndef BOOST_DETAIL_ATOMIC_COUNT_HPP_INCLUDED +#define BOOST_DETAIL_ATOMIC_COUNT_HPP_INCLUDED + +#if _MSC_VER >= 1020 +#pragma once +#endif + +// +// boost/detail/atomic_count.hpp - thread/SMP safe reference counter +// +// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd. +// +// 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. +// +// typedef boost::detail::atomic_count; +// +// atomic_count a(n); +// +// (n is convertible to long) +// +// Effects: Constructs an atomic_count with an initial value of n +// +// a; +// +// Returns: (long) the current value of a +// +// ++a; +// +// Effects: Atomically increments the value of a +// Returns: nothing +// +// --a; +// +// Effects: Atomically decrements the value of a +// Returns: (long) zero if the new value of a is zero, +// unspecified non-zero value otherwise (usually the new value) +// +// Important note: when --a returns zero, it must act as a +// read memory barrier (RMB); i.e. the calling thread must +// have a synchronized view of the memory +// +// On Intel IA-32 (x86) memory is always synchronized, so this +// is not a problem. +// +// On many architectures the atomic instructions already act as +// a memory barrier. +// +// This property is necessary for proper reference counting, since +// a thread can update the contents of a shared object, then +// release its reference, and another thread may immediately +// release the last reference causing object destruction. +// +// The destructor needs to have a synchronized view of the +// object to perform proper cleanup. +// +// Original example by Alexander Terekhov: +// +// Given: +// +// - a mutable shared object OBJ; +// - two threads THREAD1 and THREAD2 each holding +// a private smart_ptr object pointing to that OBJ. +// +// t1: THREAD1 updates OBJ (thread-safe via some synchronization) +// and a few cycles later (after "unlock") destroys smart_ptr; +// +// t2: THREAD2 destroys smart_ptr WITHOUT doing any synchronization +// with respect to shared mutable object OBJ; OBJ destructors +// are called driven by smart_ptr interface... +// + +// Note: atomic_count_linux.hpp has been disabled by default; see the +// comments inside for more info. + +#include + +#ifndef BOOST_HAS_THREADS + +namespace boost +{ + +namespace detail +{ + +typedef long atomic_count; + +} + +} + +#elif defined(BOOST_USE_ASM_ATOMIC_H) +# include +#elif defined(BOOST_AC_USE_PTHREADS) +# include +#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) +# include +#elif defined(__GLIBCPP__) +# include +#elif defined(BOOST_HAS_PTHREADS) +# define BOOST_AC_USE_PTHREADS +# include +#else + +// #warning Unrecognized platform, detail::atomic_count will not be thread safe + +namespace boost +{ + +namespace detail +{ + +typedef long atomic_count; + +} + +} + +#endif + +#endif // #ifndef BOOST_DETAIL_ATOMIC_COUNT_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/detail/atomic_count_gcc.hpp b/deal.II/contrib/boost/include/boost_local/detail/atomic_count_gcc.hpp new file mode 100644 index 0000000000..c3d29a8736 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/detail/atomic_count_gcc.hpp @@ -0,0 +1,61 @@ +#ifndef BOOST_DETAIL_ATOMIC_COUNT_GCC_HPP_INCLUDED +#define BOOST_DETAIL_ATOMIC_COUNT_GCC_HPP_INCLUDED + +// +// boost/detail/atomic_count_gcc.hpp +// +// atomic_count for GNU libstdc++ v3 +// +// http://gcc.gnu.org/onlinedocs/porting/Thread-safety.html +// +// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd. +// Copyright (c) 2002 Lars Gullik Bjønnes +// +// 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. +// + +#include + +namespace boost +{ + +namespace detail +{ + +class atomic_count +{ +public: + + explicit atomic_count(long v) : value_(v) {} + + void operator++() + { + __atomic_add(&value_, 1); + } + + long operator--() + { + return !__exchange_and_add(&value_, -1); + } + + operator long() const + { + return __exchange_and_add(&value_, 0); + } + +private: + + atomic_count(atomic_count const &); + atomic_count & operator=(atomic_count const &); + + _Atomic_word value_; +}; + +} // namespace detail + +} // namespace boost + +#endif // #ifndef BOOST_DETAIL_ATOMIC_COUNT_GCC_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/detail/atomic_count_linux.hpp b/deal.II/contrib/boost/include/boost_local/detail/atomic_count_linux.hpp new file mode 100644 index 0000000000..1a69cec6cb --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/detail/atomic_count_linux.hpp @@ -0,0 +1,70 @@ +#ifndef BOOST_DETAIL_ATOMIC_COUNT_LINUX_HPP_INCLUDED +#define BOOST_DETAIL_ATOMIC_COUNT_LINUX_HPP_INCLUDED + +// +// boost/detail/atomic_count_linux.hpp +// +// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd. +// +// 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. +// + +// +// This implementation uses . This is a kernel header; +// using kernel headers in a user program may cause a number of problems, +// and not all flavors of Linux provide the atomic instructions. +// +// This file is only provided because the performance of this implementation +// is significantly higher than the pthreads version. Use at your own risk +// (by defining BOOST_USE_ASM_ATOMIC_H.) +// + +#include + +namespace boost +{ + +namespace detail +{ + +class atomic_count +{ +public: + + explicit atomic_count(long v) + { + atomic_t init = ATOMIC_INIT(v); + value_ = init; + } + + void operator++() + { + atomic_inc(&value_); + } + + long operator--() + { + return !atomic_dec_and_test(&value_); + } + + operator long() const + { + return atomic_read(&value_); + } + +private: + + atomic_count(atomic_count const &); + atomic_count & operator=(atomic_count const &); + + atomic_t value_; +}; + +} // namespace detail + +} // namespace boost + +#endif // #ifndef BOOST_DETAIL_ATOMIC_COUNT_LINUX_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/detail/atomic_count_pthreads.hpp b/deal.II/contrib/boost/include/boost_local/detail/atomic_count_pthreads.hpp new file mode 100644 index 0000000000..0f8c66368b --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/detail/atomic_count_pthreads.hpp @@ -0,0 +1,97 @@ +#ifndef BOOST_DETAIL_ATOMIC_COUNT_PTHREADS_HPP_INCLUDED +#define BOOST_DETAIL_ATOMIC_COUNT_PTHREADS_HPP_INCLUDED + +// +// boost/detail/atomic_count_pthreads.hpp +// +// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd. +// +// 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. +// + +#include + +// +// The generic pthread_mutex-based implementation sometimes leads to +// inefficiencies. Example: a class with two atomic_count members +// can get away with a single mutex. +// +// Users can detect this situation by checking BOOST_AC_USE_PTHREADS. +// + +namespace boost +{ + +namespace detail +{ + +class atomic_count +{ +private: + + class scoped_lock + { + public: + + scoped_lock(pthread_mutex_t & m): m_(m) + { + pthread_mutex_lock(&m_); + } + + ~scoped_lock() + { + pthread_mutex_unlock(&m_); + } + + private: + + pthread_mutex_t & m_; + }; + +public: + + explicit atomic_count(long v): value_(v) + { + pthread_mutex_init(&mutex_, 0); + } + + ~atomic_count() + { + pthread_mutex_destroy(&mutex_); + } + + void operator++() + { + scoped_lock lock(mutex_); + ++value_; + } + + long operator--() + { + scoped_lock lock(mutex_); + return --value_; + } + + operator long() const + { + scoped_lock lock(mutex_); + return value_; + } + +private: + + atomic_count(atomic_count const &); + atomic_count & operator=(atomic_count const &); + + mutable pthread_mutex_t mutex_; + long value_; +}; + +} // namespace detail + +} // namespace boost + +#endif // #ifndef BOOST_DETAIL_ATOMIC_COUNT_PTHREADS_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/detail/atomic_count_win32.hpp b/deal.II/contrib/boost/include/boost_local/detail/atomic_count_win32.hpp new file mode 100644 index 0000000000..2efa6309ba --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/detail/atomic_count_win32.hpp @@ -0,0 +1,62 @@ +#ifndef BOOST_DETAIL_ATOMIC_COUNT_WIN32_HPP_INCLUDED +#define BOOST_DETAIL_ATOMIC_COUNT_WIN32_HPP_INCLUDED + +#if _MSC_VER >= 1020 +#pragma once +#endif + +// +// boost/detail/atomic_count_win32.hpp +// +// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd. +// +// 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. +// + +#include + +namespace boost +{ + +namespace detail +{ + +class atomic_count +{ +public: + + explicit atomic_count(long v): value_(v) + { + } + + long operator++() + { + return winapi::InterlockedIncrement(&value_); + } + + long operator--() + { + return winapi::InterlockedDecrement(&value_); + } + + operator long() const + { + return value_; + } + +private: + + atomic_count(atomic_count const &); + atomic_count & operator=(atomic_count const &); + + volatile long value_; +}; + +} // namespace detail + +} // namespace boost + +#endif // #ifndef BOOST_DETAIL_ATOMIC_COUNT_WIN32_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/detail/lightweight_mutex.hpp b/deal.II/contrib/boost/include/boost_local/detail/lightweight_mutex.hpp new file mode 100644 index 0000000000..c542db003b --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/detail/lightweight_mutex.hpp @@ -0,0 +1,88 @@ +#ifndef BOOST_DETAIL_LIGHTWEIGHT_MUTEX_HPP_INCLUDED +#define BOOST_DETAIL_LIGHTWEIGHT_MUTEX_HPP_INCLUDED + +#if _MSC_VER >= 1020 +#pragma once +#endif + +// +// boost/detail/lightweight_mutex.hpp - lightweight mutex +// +// Copyright (c) 2002 Peter Dimov and Multi Media Ltd. +// +// 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. +// +// typedef boost::detail::lightweight_mutex; +// +// boost::detail::lightweight_mutex meets a subset of the Mutex concept +// requirements: http://www.boost.org/libs/thread/doc/mutex_concept.html#Mutex +// +// * Used by the smart pointer library +// * Performance oriented +// * Header-only implementation +// * Small memory footprint +// * Not a general purpose mutex, use boost::mutex, CRITICAL_SECTION or +// pthread_mutex instead. +// * Never spin in a tight lock/do-something/unlock loop, since +// lightweight_mutex does not guarantee fairness. +// * Never keep a lightweight_mutex locked for long periods. +// +// The current implementation can use a pthread_mutex, a CRITICAL_SECTION, +// or a platform-specific spinlock. +// +// You can force a particular implementation by defining BOOST_LWM_USE_PTHREADS, +// BOOST_LWM_USE_CRITICAL_SECTION, or BOOST_LWM_USE_SPINLOCK. +// +// If neither macro has been defined, the default is to use a spinlock on Win32, +// and a pthread_mutex otherwise. +// +// Note that a spinlock is not a general synchronization primitive. In particular, +// it is not guaranteed to be a memory barrier, and it is possible to "livelock" +// if a lower-priority thread has acquired the spinlock but a higher-priority +// thread is spinning trying to acquire the same lock. +// +// For these reasons, spinlocks have been disabled by default except on Windows, +// where a spinlock can be several orders of magnitude faster than a CRITICAL_SECTION. + + +// Note: lwm_linux.hpp has been disabled by default; see the comments +// inside for more info. + + +#include + +// Note to implementors: if you write a platform-specific spinlock +// for a platform that supports pthreads, be sure to test its performance +// against the pthreads-based version using shared_ptr_timing_test.cpp and +// shared_ptr_mt_test.cpp. Custom versions are usually not worth the trouble +// _unless_ the performance gains are substantial. +// +// Be sure to compare against a "real" pthreads library; +// shared_ptr_timing_test.cpp will compile succesfully with a stub do-nothing +// pthreads library, since it doesn't create any threads. + +#ifndef BOOST_HAS_THREADS +# include +#elif defined(BOOST_LWM_USE_SPINLOCK) && defined(BOOST_USE_ASM_ATOMIC_H) +# include +#elif defined(BOOST_LWM_USE_CRITICAL_SECTION) +# include +#elif defined(BOOST_LWM_USE_PTHREADS) +# include +#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) +# include +#elif defined(BOOST_LWM_USE_SPINLOCK) && defined(__sgi) +# include +#elif defined(BOOST_LWM_USE_SPINLOCK) && defined(__GLIBCPP__) +# include +#elif defined(BOOST_HAS_PTHREADS) +# define BOOST_LWM_USE_PTHREADS +# include +#else +# include +#endif + +#endif // #ifndef BOOST_DETAIL_LIGHTWEIGHT_MUTEX_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/detail/lwm_gcc.hpp b/deal.II/contrib/boost/include/boost_local/detail/lwm_gcc.hpp new file mode 100644 index 0000000000..bf8a09a361 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/detail/lwm_gcc.hpp @@ -0,0 +1,78 @@ +#ifndef BOOST_DETAIL_LWM_GCC_HPP_INCLUDED +#define BOOST_DETAIL_LWM_GCC_HPP_INCLUDED + +// +// boost/detail/lwm_gcc.hpp +// +// lightweight_mutex for GNU libstdc++ v3 +// +// http://gcc.gnu.org/onlinedocs/porting/Thread-safety.html +// +// Copyright (c) 2002 Peter Dimov and Multi Media Ltd. +// Copyright (c) 2002 Lars Gullik Bjønnes +// +// 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. +// + +#include +#include + +namespace boost +{ + +namespace detail +{ + +class lightweight_mutex +{ +private: + + _Atomic_word a_; + + lightweight_mutex(lightweight_mutex const &); + lightweight_mutex & operator=(lightweight_mutex const &); + +public: + + lightweight_mutex(): a_(1) + { + } + + class scoped_lock; + friend class scoped_lock; + + class scoped_lock + { + private: + + lightweight_mutex & m_; + + scoped_lock(scoped_lock const &); + scoped_lock & operator=(scoped_lock const &); + + public: + + explicit scoped_lock(lightweight_mutex & m): m_(m) + { + while( !__exchange_and_add(&m_.a_, -1) ) + { + __atomic_add(&m_.a_, 1); + sched_yield(); + } + } + + ~scoped_lock() + { + __atomic_add(&m_.a_, 1); + } + }; +}; + +} // namespace detail + +} // namespace boost + +#endif // #ifndef BOOST_DETAIL_LWM_GCC_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/detail/lwm_irix.hpp b/deal.II/contrib/boost/include/boost_local/detail/lwm_irix.hpp new file mode 100644 index 0000000000..2a5516182f --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/detail/lwm_irix.hpp @@ -0,0 +1,78 @@ +#ifndef BOOST_DETAIL_LWM_IRIX_HPP_INCLUDED +#define BOOST_DETAIL_LWM_IRIX_HPP_INCLUDED + +#if _MSC_VER >= 1020 +#pragma once +#endif + +// +// boost/detail/lwm_irix.hpp +// +// Copyright (c) 2002 Peter Dimov and Multi Media Ltd. +// Copyright (c) 2002 Dan Gohman +// +// 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. +// + +#include +#include +#include + +namespace boost +{ + +namespace detail +{ + +class lightweight_mutex +{ +private: + + __uint32_t l_; + + lightweight_mutex(lightweight_mutex const &); + lightweight_mutex & operator=(lightweight_mutex const &); + +public: + + lightweight_mutex(): l_(0) + { + } + + class scoped_lock; + friend class scoped_lock; + + class scoped_lock + { + private: + + lightweight_mutex & m_; + + scoped_lock(scoped_lock const &); + scoped_lock & operator=(scoped_lock const &); + + public: + + explicit scoped_lock(lightweight_mutex & m): m_(m) + { + while( test_and_set32(&m_.l_, 1) ) + { + sched_yield(); + } + } + + ~scoped_lock() + { + m_.l_ = 0; + } + }; +}; + +} // namespace detail + +} // namespace boost + +#endif // #ifndef BOOST_DETAIL_LWM_IRIX_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/detail/lwm_linux.hpp b/deal.II/contrib/boost/include/boost_local/detail/lwm_linux.hpp new file mode 100644 index 0000000000..62d8e64260 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/detail/lwm_linux.hpp @@ -0,0 +1,89 @@ +#ifndef BOOST_DETAIL_LWM_LINUX_HPP_INCLUDED +#define BOOST_DETAIL_LWM_LINUX_HPP_INCLUDED + +#if _MSC_VER >= 1020 +#pragma once +#endif + +// +// boost/detail/lwm_linux.hpp +// +// Copyright (c) 2002 Peter Dimov and Multi Media Ltd. +// +// 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. +// + +// +// This implementation uses . This is a kernel header; +// using kernel headers in a user program may cause a number of problems, +// and not all flavors of Linux provide the atomic instructions. +// +// This file is only provided because the performance of this implementation +// is about 3.5 times higher than the pthreads version. Use at your own risk +// (by defining BOOST_USE_ASM_ATOMIC_H.) +// + +#include +#include + +namespace boost +{ + +namespace detail +{ + +class lightweight_mutex +{ +private: + + atomic_t a_; + + lightweight_mutex(lightweight_mutex const &); + lightweight_mutex & operator=(lightweight_mutex const &); + +public: + + lightweight_mutex() + { + atomic_t a = ATOMIC_INIT(1); + a_ = a; + } + + class scoped_lock; + friend class scoped_lock; + + class scoped_lock + { + private: + + lightweight_mutex & m_; + + scoped_lock(scoped_lock const &); + scoped_lock & operator=(scoped_lock const &); + + public: + + explicit scoped_lock(lightweight_mutex & m): m_(m) + { + while( !atomic_dec_and_test(&m_.a_) ) + { + atomic_inc(&m_.a_); + sched_yield(); + } + } + + ~scoped_lock() + { + atomic_inc(&m_.a_); + } + }; +}; + +} // namespace detail + +} // namespace boost + +#endif // #ifndef BOOST_DETAIL_LWM_LINUX_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/detail/lwm_nop.hpp b/deal.II/contrib/boost/include/boost_local/detail/lwm_nop.hpp new file mode 100644 index 0000000000..671a5b0474 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/detail/lwm_nop.hpp @@ -0,0 +1,36 @@ +#ifndef BOOST_DETAIL_LWM_NOP_HPP_INCLUDED +#define BOOST_DETAIL_LWM_NOP_HPP_INCLUDED + +#if _MSC_VER >= 1020 +#pragma once +#endif + +// +// boost/detail/lwm_nop.hpp +// +// Copyright (c) 2002 Peter Dimov and Multi Media Ltd. +// +// 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. +// + +namespace boost +{ + +namespace detail +{ + +class lightweight_mutex +{ +public: + + typedef lightweight_mutex scoped_lock; +}; + +} // namespace detail + +} // namespace boost + +#endif // #ifndef BOOST_DETAIL_LWM_NOP_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/detail/lwm_pthreads.hpp b/deal.II/contrib/boost/include/boost_local/detail/lwm_pthreads.hpp new file mode 100644 index 0000000000..8ee5550e2e --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/detail/lwm_pthreads.hpp @@ -0,0 +1,85 @@ +#ifndef BOOST_DETAIL_LWM_PTHREADS_HPP_INCLUDED +#define BOOST_DETAIL_LWM_PTHREADS_HPP_INCLUDED + +#if _MSC_VER >= 1020 +#pragma once +#endif + +// +// boost/detail/lwm_pthreads.hpp +// +// Copyright (c) 2002 Peter Dimov and Multi Media Ltd. +// +// 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. +// + +#include + +namespace boost +{ + +namespace detail +{ + +class lightweight_mutex +{ +private: + + pthread_mutex_t m_; + + lightweight_mutex(lightweight_mutex const &); + lightweight_mutex & operator=(lightweight_mutex const &); + +public: + + lightweight_mutex() + { + +// HPUX 10.20 / DCE has a nonstandard pthread_mutex_init + +#if defined(__hpux) && defined(_DECTHREADS_) + pthread_mutex_init(&m_, pthread_mutexattr_default); +#else + pthread_mutex_init(&m_, 0); +#endif + } + + ~lightweight_mutex() + { + pthread_mutex_destroy(&m_); + } + + class scoped_lock; + friend class scoped_lock; + + class scoped_lock + { + private: + + pthread_mutex_t & m_; + + scoped_lock(scoped_lock const &); + scoped_lock & operator=(scoped_lock const &); + + public: + + scoped_lock(lightweight_mutex & m): m_(m.m_) + { + pthread_mutex_lock(&m_); + } + + ~scoped_lock() + { + pthread_mutex_unlock(&m_); + } + }; +}; + +} // namespace detail + +} // namespace boost + +#endif // #ifndef BOOST_DETAIL_LWM_PTHREADS_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/detail/lwm_win32.hpp b/deal.II/contrib/boost/include/boost_local/detail/lwm_win32.hpp new file mode 100644 index 0000000000..4051b3bff5 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/detail/lwm_win32.hpp @@ -0,0 +1,94 @@ +#ifndef BOOST_DETAIL_LWM_WIN32_HPP_INCLUDED +#define BOOST_DETAIL_LWM_WIN32_HPP_INCLUDED + +#if _MSC_VER >= 1020 +#pragma once +#endif + +// +// boost/detail/lwm_win32.hpp +// +// Copyright (c) 2002 Peter Dimov and Multi Media Ltd. +// +// 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. +// + +#include + +#ifdef __BORLANDC__ +# pragma warn -8027 // Functions containing while are not expanded inline +#endif + +namespace boost +{ + +namespace detail +{ + +class lightweight_mutex +{ +private: + + long l_; + + lightweight_mutex(lightweight_mutex const &); + lightweight_mutex & operator=(lightweight_mutex const &); + +public: + + lightweight_mutex(): l_(0) + { + } + + class scoped_lock; + friend class scoped_lock; + + class scoped_lock + { + private: + + lightweight_mutex & m_; + + scoped_lock(scoped_lock const &); + scoped_lock & operator=(scoped_lock const &); + + public: + + explicit scoped_lock(lightweight_mutex & m): m_(m) + { + while( winapi::InterlockedExchange(&m_.l_, 1) ) + { + // Note: changed to Sleep(1) from Sleep(0). + // According to MSDN, Sleep(0) will never yield + // to a lower-priority thread, whereas Sleep(1) + // will. Performance seems not to be affected. + + winapi::Sleep(1); + } + } + + ~scoped_lock() + { + winapi::InterlockedExchange(&m_.l_, 0); + + // Note: adding a yield here will make + // the spinlock more fair and will increase the overall + // performance of some applications substantially in + // high contention situations, but will penalize the + // low contention / single thread case up to 5x + } + }; +}; + +} // namespace detail + +} // namespace boost + +#ifdef __BORLANDC__ +# pragma warn .8027 // Functions containing while are not expanded inline +#endif + +#endif // #ifndef BOOST_DETAIL_LWM_WIN32_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/detail/lwm_win32_cs.hpp b/deal.II/contrib/boost/include/boost_local/detail/lwm_win32_cs.hpp new file mode 100644 index 0000000000..3eaccd3388 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/detail/lwm_win32_cs.hpp @@ -0,0 +1,78 @@ +#ifndef BOOST_DETAIL_LWM_WIN32_CS_HPP_INCLUDED +#define BOOST_DETAIL_LWM_WIN32_CS_HPP_INCLUDED + +#if _MSC_VER >= 1020 +#pragma once +#endif + +// +// boost/detail/lwm_win32_cs.hpp +// +// Copyright (c) 2002 Peter Dimov and Multi Media Ltd. +// +// 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. +// + +#include + +namespace boost +{ + +namespace detail +{ + +class lightweight_mutex +{ +private: + + winapi::critical_section cs_; + + lightweight_mutex(lightweight_mutex const &); + lightweight_mutex & operator=(lightweight_mutex const &); + +public: + + lightweight_mutex() + { + winapi::InitializeCriticalSection(&cs_); + } + + ~lightweight_mutex() + { + winapi::DeleteCriticalSection(&cs_); + } + + class scoped_lock; + friend class scoped_lock; + + class scoped_lock + { + private: + + lightweight_mutex & m_; + + scoped_lock(scoped_lock const &); + scoped_lock & operator=(scoped_lock const &); + + public: + + explicit scoped_lock(lightweight_mutex & m): m_(m) + { + winapi::EnterCriticalSection(&m_.cs_); + } + + ~scoped_lock() + { + winapi::LeaveCriticalSection(&m_.cs_); + } + }; +}; + +} // namespace detail + +} // namespace boost + +#endif // #ifndef BOOST_DETAIL_LWM_WIN32_CS_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/detail/shared_count.hpp b/deal.II/contrib/boost/include/boost_local/detail/shared_count.hpp new file mode 100644 index 0000000000..16d49df36a --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/detail/shared_count.hpp @@ -0,0 +1,445 @@ +#ifndef BOOST_DETAIL_SHARED_COUNT_HPP_INCLUDED +#define BOOST_DETAIL_SHARED_COUNT_HPP_INCLUDED + +#if _MSC_VER >= 1020 +#pragma once +#endif + +// +// detail/shared_count.hpp +// +// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd. +// +// 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. +// + +#include + +#ifndef BOOST_NO_AUTO_PTR +# include +#endif + +#include +#include +#include + +#include // for std::less +#include // for std::exception +#include // for std::bad_alloc + +#ifdef __BORLANDC__ +# pragma warn -8026 // Functions with excep. spec. are not expanded inline +# pragma warn -8027 // Functions containing try are not expanded inline +#endif + +namespace boost +{ + +// The standard library that comes with Borland C++ 5.5.1 +// defines std::exception and its members as having C calling +// convention (-pc). When the definition of use_count_is_zero +// is compiled with -ps, the compiler issues an error. +// Hence, the temporary #pragma option -pc below. The version +// check is deliberately conservative. + +#if defined(__BORLANDC__) && __BORLANDC__ == 0x551 +# pragma option push -pc +#endif + +class use_count_is_zero: public std::exception +{ +public: + + virtual char const * what() const throw() + { + return "boost::use_count_is_zero"; + } +}; + +#if defined(__BORLANDC__) && __BORLANDC__ == 0x551 +# pragma option pop +#endif + +class counted_base +{ +private: + + typedef detail::lightweight_mutex mutex_type; + +public: + + counted_base(): + use_count_(0), weak_count_(0) + { + } + + // pre: initial_use_count <= initial_weak_count + + explicit counted_base(long initial_use_count, long initial_weak_count): + use_count_(initial_use_count), weak_count_(initial_weak_count) + { + } + + virtual ~counted_base() // nothrow + { + } + + // dispose() is called when use_count_ drops to zero, to release + // the resources managed by *this. + // + // counted_base doesn't manage any resources except itself, and + // the default implementation is a no-op. + // + // dispose() is not pure virtual since weak_ptr instantiates a + // counted_base in its default constructor. + + virtual void dispose() // nothrow + { + } + + // destruct() is called when weak_count_ drops to zero. + + virtual void destruct() // nothrow + { + delete this; + } + + void add_ref() + { +#ifdef BOOST_HAS_THREADS + mutex_type::scoped_lock lock(mtx_); +#endif + if(use_count_ == 0 && weak_count_ != 0) boost::throw_exception(boost::use_count_is_zero()); + ++use_count_; + ++weak_count_; + } + + void release() // nothrow + { + long new_use_count; + long new_weak_count; + + { +#ifdef BOOST_HAS_THREADS + mutex_type::scoped_lock lock(mtx_); +#endif + new_use_count = --use_count_; + new_weak_count = --weak_count_; + } + + if(new_use_count == 0) + { + dispose(); + } + + if(new_weak_count == 0) + { + destruct(); + } + } + + void weak_add_ref() // nothrow + { +#ifdef BOOST_HAS_THREADS + mutex_type::scoped_lock lock(mtx_); +#endif + ++weak_count_; + } + + void weak_release() // nothrow + { + long new_weak_count; + + { +#ifdef BOOST_HAS_THREADS + mutex_type::scoped_lock lock(mtx_); +#endif + new_weak_count = --weak_count_; + } + + if(new_weak_count == 0) + { + destruct(); + } + } + + long use_count() const // nothrow + { +#ifdef BOOST_HAS_THREADS + mutex_type::scoped_lock lock(mtx_); +#endif + return use_count_; + } + +private: + + counted_base(counted_base const &); + counted_base & operator= (counted_base const &); + + // inv: use_count_ <= weak_count_ + + long use_count_; + long weak_count_; + +#ifdef BOOST_HAS_THREADS + mutable mutex_type mtx_; +#endif +}; + +inline void intrusive_ptr_add_ref(counted_base * p) +{ + p->add_ref(); +} + +inline void intrusive_ptr_release(counted_base * p) +{ + p->release(); +} + +namespace detail +{ + +// +// Borland's Codeguard trips up over the -Vx- option here: +// +#ifdef __CODEGUARD__ +#pragma option push -Vx- +#endif + +template class counted_base_impl: public counted_base +{ +private: + + P ptr; // copy constructor must not throw + D del; // copy constructor must not throw + + counted_base_impl(counted_base_impl const &); + counted_base_impl & operator= (counted_base_impl const &); + +public: + + // pre: initial_use_count <= initial_weak_count, d(p) must not throw + + counted_base_impl(P p, D d, long initial_use_count, long initial_weak_count): + counted_base(initial_use_count, initial_weak_count), ptr(p), del(d) + { + } + + virtual void dispose() // nothrow + { + del(ptr); + } +}; + +class weak_count; + +class shared_count +{ +private: + + counted_base * pi_; + + friend class weak_count; + + template shared_count(P, D, counted_base const *); + +public: + + shared_count(): pi_(new counted_base(1, 1)) + { + } + + explicit shared_count(counted_base * pi): pi_(pi) // never throws + { + pi_->add_ref(); + } + + template shared_count(P p, D d, void const * = 0): pi_(0) + { +#ifndef BOOST_NO_EXCEPTIONS + + try + { + pi_ = new counted_base_impl(p, d, 1, 1); + } + catch(...) + { + d(p); // delete p + throw; + } + +#else + + pi_ = new counted_base_impl(p, d, 1, 1); + + if(pi_ == 0) + { + d(p); // delete p + boost::throw_exception(std::bad_alloc()); + } + +#endif + } + + template shared_count(P, D, counted_base * pi): pi_(pi) + { + pi_->add_ref(); + } + +#ifndef BOOST_NO_AUTO_PTR + + // auto_ptr is special cased to provide the strong guarantee + + template + explicit shared_count(std::auto_ptr & r): pi_(new counted_base_impl< Y *, checked_deleter >(r.get(), checked_deleter(), 1, 1)) + { + r.release(); + } + +#endif + + ~shared_count() // nothrow + { + pi_->release(); + } + + shared_count(shared_count const & r): pi_(r.pi_) // nothrow + { + pi_->add_ref(); + } + + explicit shared_count(weak_count const & r); // throws use_count_is_zero when r.use_count() == 0 + + shared_count & operator= (shared_count const & r) // nothrow + { + counted_base * tmp = r.pi_; + tmp->add_ref(); + pi_->release(); + pi_ = tmp; + + return *this; + } + + void swap(shared_count & r) // nothrow + { + counted_base * tmp = r.pi_; + r.pi_ = pi_; + pi_ = tmp; + } + + long use_count() const // nothrow + { + return pi_->use_count(); + } + + bool unique() const // nothrow + { + return pi_->use_count() == 1; + } + + friend inline bool operator==(shared_count const & a, shared_count const & b) + { + return a.pi_ == b.pi_; + } + + friend inline bool operator<(shared_count const & a, shared_count const & b) + { + return std::less()(a.pi_, b.pi_); + } +}; + +#ifdef __CODEGUARD__ +#pragma option pop +#endif + + +class weak_count +{ +private: + + counted_base * pi_; + + friend class shared_count; + +public: + + weak_count(): pi_(new counted_base(0, 1)) // can throw + { + } + + weak_count(shared_count const & r): pi_(r.pi_) // nothrow + { + pi_->weak_add_ref(); + } + + weak_count(weak_count const & r): pi_(r.pi_) // nothrow + { + pi_->weak_add_ref(); + } + + ~weak_count() // nothrow + { + pi_->weak_release(); + } + + weak_count & operator= (shared_count const & r) // nothrow + { + counted_base * tmp = r.pi_; + tmp->weak_add_ref(); + pi_->weak_release(); + pi_ = tmp; + + return *this; + } + + weak_count & operator= (weak_count const & r) // nothrow + { + counted_base * tmp = r.pi_; + tmp->weak_add_ref(); + pi_->weak_release(); + pi_ = tmp; + + return *this; + } + + void swap(weak_count & r) // nothrow + { + counted_base * tmp = r.pi_; + r.pi_ = pi_; + pi_ = tmp; + } + + long use_count() const // nothrow + { + return pi_->use_count(); + } + + friend inline bool operator==(weak_count const & a, weak_count const & b) + { + return a.pi_ == b.pi_; + } + + friend inline bool operator<(weak_count const & a, weak_count const & b) + { + return std::less()(a.pi_, b.pi_); + } +}; + +inline shared_count::shared_count(weak_count const & r): pi_(r.pi_) +{ + pi_->add_ref(); +} + +} // namespace detail + +} // namespace boost + +#ifdef __BORLANDC__ +# pragma warn .8027 // Functions containing try are not expanded inline +# pragma warn .8026 // Functions with excep. spec. are not expanded inline +#endif + +#endif // #ifndef BOOST_DETAIL_SHARED_COUNT_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/detail/shared_ptr_nmt.hpp b/deal.II/contrib/boost/include/boost_local/detail/shared_ptr_nmt.hpp new file mode 100644 index 0000000000..5c8eb0711e --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/detail/shared_ptr_nmt.hpp @@ -0,0 +1,183 @@ +#ifndef BOOST_DETAIL_SHARED_PTR_NMT_HPP_INCLUDED +#define BOOST_DETAIL_SHARED_PTR_NMT_HPP_INCLUDED + +// +// detail/shared_ptr_nmt.hpp - shared_ptr.hpp without member templates +// +// (C) Copyright Greg Colvin and Beman Dawes 1998, 1999. +// Copyright (c) 2001, 2002 Peter Dimov +// +// 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/libs/smart_ptr/shared_ptr.htm for documentation. +// + +#include +#include +#include +#include + +#ifndef BOOST_NO_AUTO_PTR +# include // for std::auto_ptr +#endif + +#include // for std::swap +#include // for std::less +#include // for std::bad_alloc + +namespace boost +{ + +template class shared_ptr +{ +private: + + typedef detail::atomic_count count_type; + +public: + + typedef T element_type; + typedef T value_type; + + explicit shared_ptr(T * p = 0): px(p) + { +#ifndef BOOST_NO_EXCEPTIONS + + try // prevent leak if new throws + { + pn = new count_type(1); + } + catch(...) + { + boost::checked_delete(p); + throw; + } + +#else + + pn = new count_type(1); + + if(pn == 0) + { + boost::checked_delete(p); + boost::throw_exception(std::bad_alloc()); + } + +#endif + } + + ~shared_ptr() + { + if(--*pn == 0) + { + boost::checked_delete(px); + delete pn; + } + } + + shared_ptr(shared_ptr const & r): px(r.px) // never throws + { + pn = r.pn; + ++*pn; + } + + shared_ptr & operator=(shared_ptr const & r) + { + shared_ptr(r).swap(*this); + return *this; + } + +#ifndef BOOST_NO_AUTO_PTR + + explicit shared_ptr(std::auto_ptr & r) + { + pn = new count_type(1); // may throw + px = r.release(); // fix: moved here to stop leak if new throws + } + + shared_ptr & operator=(std::auto_ptr & r) + { + shared_ptr(r).swap(*this); + return *this; + } + +#endif + + void reset(T * p = 0) + { + BOOST_ASSERT(p == 0 || p != px); + shared_ptr(p).swap(*this); + } + + T & operator*() const // never throws + { + BOOST_ASSERT(px != 0); + return *px; + } + + T * operator->() const // never throws + { + BOOST_ASSERT(px != 0); + return px; + } + + T * get() const // never throws + { + return px; + } + + long use_count() const // never throws + { + return *pn; + } + + bool unique() const // never throws + { + return *pn == 1; + } + + void swap(shared_ptr & other) // never throws + { + std::swap(px, other.px); + std::swap(pn, other.pn); + } + +private: + + T * px; // contained pointer + count_type * pn; // ptr to reference counter +}; + +template inline bool operator==(shared_ptr const & a, shared_ptr const & b) +{ + return a.get() == b.get(); +} + +template inline bool operator!=(shared_ptr const & a, shared_ptr const & b) +{ + return a.get() != b.get(); +} + +template inline bool operator<(shared_ptr const & a, shared_ptr const & b) +{ + return std::less()(a.get(), b.get()); +} + +template void swap(shared_ptr & a, shared_ptr & b) +{ + a.swap(b); +} + +// get_pointer() enables boost::mem_fn to recognize shared_ptr + +template inline T * get_pointer(shared_ptr const & p) +{ + return p.get(); +} + +} // namespace boost + +#endif // #ifndef BOOST_DETAIL_SHARED_PTR_NMT_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/detail/winapi.hpp b/deal.II/contrib/boost/include/boost_local/detail/winapi.hpp new file mode 100644 index 0000000000..340036a0ca --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/detail/winapi.hpp @@ -0,0 +1,106 @@ +#ifndef BOOST_DETAIL_WINAPI_HPP_INCLUDED +#define BOOST_DETAIL_WINAPI_HPP_INCLUDED + +#if _MSC_VER >= 1020 +#pragma once +#endif + +// +// boost/detail/winapi.hpp - a lightweight version of +// +// Copyright (c) 2002 Peter Dimov and Multi Media Ltd. +// +// 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. +// + +namespace boost +{ + +namespace detail +{ + +namespace winapi +{ + +typedef long long_type; +typedef unsigned long dword_type; +typedef void * handle_type; + +#if defined(_WIN64) + +typedef __int64 int_ptr_type; +typedef unsigned __int64 uint_ptr_type; +typedef __int64 long_ptr_type; +typedef unsigned __int64 ulong_ptr_type; + +#else + +typedef int int_ptr_type; +typedef unsigned int uint_ptr_type; +typedef long long_ptr_type; +typedef unsigned long ulong_ptr_type; + +#endif + +struct critical_section +{ + struct critical_section_debug * DebugInfo; + long_type LockCount; + long_type RecursionCount; + handle_type OwningThread; + handle_type LockSemaphore; + ulong_ptr_type SpinCount; +}; + +#if defined(_WIN64) + +// Intel 6.0 on Win64 version, posted by Tim Fenders to [boost-users] + +extern "C" long_type __cdecl _InterlockedIncrement(long_type volatile *); +extern "C" long_type __cdecl _InterlockedDecrement(long_type volatile *); +extern "C" long_type __cdecl _InterlockedExchange(long_type volatile *, long_type); + +#pragma intrinsic(_InterlockedIncrement) +#pragma intrinsic(_InterlockedDecrement) +#pragma intrinsic(_InterlockedExchange) + +inline long_type InterlockedIncrement(long_type volatile * lp) +{ + return _InterlockedIncrement(lp); +} + +inline long_type InterlockedDecrement(long_type volatile* lp) +{ + return _InterlockedDecrement(lp); +} + +inline long_type InterlockedExchange(long_type volatile* lp, long_type l) +{ + return _InterlockedExchange(lp, l); +} + +#else + +extern "C" __declspec(dllimport) long_type __stdcall InterlockedIncrement(long_type volatile *); +extern "C" __declspec(dllimport) long_type __stdcall InterlockedDecrement(long_type volatile *); +extern "C" __declspec(dllimport) long_type __stdcall InterlockedExchange(long_type volatile *, long_type); + +#endif + +extern "C" __declspec(dllimport) void __stdcall Sleep(dword_type); + +extern "C" __declspec(dllimport) void __stdcall InitializeCriticalSection(critical_section *); +extern "C" __declspec(dllimport) void __stdcall EnterCriticalSection(critical_section *); +extern "C" __declspec(dllimport) void __stdcall LeaveCriticalSection(critical_section *); +extern "C" __declspec(dllimport) void __stdcall DeleteCriticalSection(critical_section *); + +} // namespace winapi + +} // namespace detail + +} // namespace boost + +#endif // #ifndef BOOST_DETAIL_WINAPI_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/mpl/bool_c.hpp b/deal.II/contrib/boost/include/boost_local/mpl/bool_c.hpp new file mode 100644 index 0000000000..f20dc9d2c2 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/mpl/bool_c.hpp @@ -0,0 +1,40 @@ +//----------------------------------------------------------------------------- +// boost mpl/bool_c.hpp header file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2000-02 +// Aleksey Gurtovoy +// +// Permission to use, copy, modify, distribute and sell this software +// and its documentation for any purpose is hereby granted without fee, +// provided that the above copyright notice appears in all copies and +// that both the copyright notice and this permission notice appear in +// supporting documentation. No representations are made about the +// suitability of this software for any purpose. It is provided "as is" +// without express or implied warranty. + +#ifndef BOOST_MPL_BOOL_C_HPP_INCLUDED +#define BOOST_MPL_BOOL_C_HPP_INCLUDED + +#include + +namespace boost { +namespace mpl { + +template< bool C > struct bool_c +{ + BOOST_STATIC_CONSTANT(bool, value = C); + typedef bool_c type; + typedef bool value_type; + operator bool() const { return this->value; } +}; + +// shorcuts +typedef bool_c true_c; +typedef bool_c false_c; + +} // namespace mpl +} // namespace boost + +#endif // BOOST_MPL_BOOL_C_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/mpl/if.hpp b/deal.II/contrib/boost/include/boost_local/mpl/if.hpp new file mode 100644 index 0000000000..64eb48d4fd --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/mpl/if.hpp @@ -0,0 +1,163 @@ +//----------------------------------------------------------------------------- +// boost/mpl/if.hpp header file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2000-02 Boost.org +// +// Permission to use, copy, modify, distribute and sell this software +// and its documentation for any purpose is hereby granted without fee, +// provided that the above copyright notice appears in all copies and +// that both the copyright notice and this permission notice appear in +// supporting documentation. No representations are made about the +// suitability of this software for any purpose. It is provided "as is" +// without express or implied warranty. + +#ifndef BOOST_MPL_IF_HPP_INCLUDED +#define BOOST_MPL_IF_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { +namespace mpl { + +#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) + +template< + bool C + , typename T1 + , typename T2 + > +struct if_c +{ + typedef T1 type; +}; + +template< + typename T1 + , typename T2 + > +struct if_c +{ + typedef T2 type; +}; + +template< + typename BOOST_MPL_AUX_VOID_SPEC_PARAM(C) + , typename BOOST_MPL_AUX_VOID_SPEC_PARAM(T1) + , typename BOOST_MPL_AUX_VOID_SPEC_PARAM(T2) + > +struct if_ +{ + typedef typename if_c< + BOOST_MPL_AUX_VALUE_WKND(C)::value + , T1 + , T2 + >::type type; + + BOOST_MPL_AUX_LAMBDA_SUPPORT(3,if_,(C,T1,T2)) +}; + +#elif defined(BOOST_MSVC) && (BOOST_MSVC <= 1300) + +// MSVC6.5-specific version + +template< + bool C + , typename T1 + , typename T2 + > +struct if_c +{ + private: + template struct answer { typedef T1 type; }; + template<> struct answer { typedef T2 type; }; + + public: + typedef typename answer< C >::type type; +}; + +// (almost) copy & paste in order to save one more +// recursively nested template instantiation to user +template< + typename C + , typename T1 + , typename T2 + > +struct if_ +{ + private: + template struct answer { typedef T1 type; }; + template<> struct answer { typedef T2 type; }; + + // agurt, 17/sep/02: in some situations MSVC 7.0 doesn't + // handle 'answer' expression very well + enum { c_ = C::value }; + + public: + typedef typename answer::type type; +}; + +#else + +// no partial class template specialization + +namespace aux { + +template< bool C > +struct if_impl +{ + template< typename T1, typename T2 > struct result_ + { + typedef T1 type; + }; +}; + +template<> +struct if_impl +{ + template< typename T1, typename T2 > struct result_ + { + typedef T2 type; + }; +}; + +} // namespace aux + +template< + bool C + , typename T1 + , typename T2 + > +struct if_c +{ + typedef typename aux::if_impl< C > + ::template result_::type type; +}; + +// (almost) copy & paste in order to save one more +// recursively nested template instantiation to user +template< + typename BOOST_MPL_AUX_VOID_SPEC_PARAM(C) + , typename BOOST_MPL_AUX_VOID_SPEC_PARAM(T1) + , typename BOOST_MPL_AUX_VOID_SPEC_PARAM(T2) + > +struct if_ +{ + typedef typename aux::if_impl< C::value > + ::template result_::type type; + + BOOST_MPL_AUX_LAMBDA_SUPPORT(3,if_,(C,T1,T2)) +}; + +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +BOOST_MPL_AUX_VOID_SPEC(3, if_) + +} // namespace mpl +} // namespace boost + +#endif // BOOST_MPL_IF_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/mpl/integral_c.hpp b/deal.II/contrib/boost/include/boost_local/mpl/integral_c.hpp new file mode 100644 index 0000000000..995cc3f1c0 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/mpl/integral_c.hpp @@ -0,0 +1,73 @@ +//----------------------------------------------------------------------------- +// boost/mpl/intergal_c.hpp header file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2000-02 +// Aleksey Gurtovoy +// +// Permission to use, copy, modify, distribute and sell this software +// and its documentation for any purpose is hereby granted without fee, +// provided that the above copyright notice appears in all copies and +// that both the copyright notice and this permission notice appear in +// supporting documentation. No representations are made about the +// suitability of this software for any purpose. It is provided "as is" +// without express or implied warranty. + +#ifndef BOOST_MPL_INTEGRAL_C_HPP_INCLUDED +#define BOOST_MPL_INTEGRAL_C_HPP_INCLUDED + +#include + +namespace boost { +namespace mpl { + +template< typename T, T N > +struct integral_c +{ + BOOST_STATIC_CONSTANT(T, value = N); + typedef integral_c type; + typedef T value_type; + + // have to #ifdef here: some compilers don't like the 'N + 1' form (MSVC), + // while some other don't like 'value + 1' (Borland), and some don't like + // either +#if defined(__EDG_VERSION__) && __EDG_VERSION__ <= 243 + private: + BOOST_STATIC_CONSTANT(T, next_value = (N + 1)); + BOOST_STATIC_CONSTANT(T, prior_value = (N - 1)); + public: + typedef integral_c next; + typedef integral_c prior; +#elif defined(__BORLANDC__) && (__BORLANDC__ <= 0x561 || !defined(BOOST_STRICT_CONFIG)) \ + || defined(__IBMCPP__) && (__IBMCPP__ <= 502 || !defined(BOOST_STRICT_CONFIG)) + typedef integral_c next; + typedef integral_c prior; +#else + typedef integral_c next; + typedef integral_c prior; +#endif + + // enables uniform function call syntax for families of overloaded + // functions that return objects of both arithmetic ('int', 'long', + // 'double', etc.) and 'integral_c<..>' types (for an example, see + // "mpl/example/power.cpp") + operator T() const { return this->value; } +}; + +#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ + && !defined(__BORLANDC__) || __BORLANDC__ > 0x551 +// 'bool' constant doesn't have 'next'/'prior' members +template< bool C > +struct integral_c +{ + BOOST_STATIC_CONSTANT(bool, value = C); + typedef integral_c type; + operator bool() const { return this->value; } +}; +#endif + +} // namespace mpl +} // namespace boost + +#endif // BOOST_MPL_INTEGRAL_C_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/mpl/lambda_fwd.hpp b/deal.II/contrib/boost/include/boost_local/mpl/lambda_fwd.hpp new file mode 100644 index 0000000000..65bd9badce --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/mpl/lambda_fwd.hpp @@ -0,0 +1,36 @@ +//----------------------------------------------------------------------------- +// boost mpl/labmda_fwd.hpp header file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2001-02 +// Aleksey Gurtovoy +// +// Permission to use, copy, modify, distribute and sell this software +// and its documentation for any purpose is hereby granted without fee, +// provided that the above copyright notice appears in all copies and +// that both the copyright notice and this permission notice appear in +// supporting documentation. No representations are made about the +// suitability of this software for any purpose. It is provided "as is" +// without express or implied warranty. + +#ifndef BOOST_MPL_LAMBDA_FWD_HPP_INCLUDED +#define BOOST_MPL_LAMBDA_FWD_HPP_INCLUDED + +#include +#include + +namespace boost { +namespace mpl { + +#if !defined(BOOST_MPL_NO_FULL_LAMBDA_SUPPORT) +template< typename T BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(long Arity) > +struct lambda; +#else +template< typename T, bool Protect > struct lambda; +#endif + +} // namespace mpl +} // namespace boost + +#endif // BOOST_MPL_LAMBDA_FWD_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/mpl/size_t_c.hpp b/deal.II/contrib/boost/include/boost_local/mpl/size_t_c.hpp new file mode 100644 index 0000000000..1df35807bf --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/mpl/size_t_c.hpp @@ -0,0 +1,49 @@ +//----------------------------------------------------------------------------- +// boost mpl/size_t_c.hpp header file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2000-02 +// Aleksey Gurtovoy +// +// Permission to use, copy, modify, distribute and sell this software +// and its documentation for any purpose is hereby granted without fee, +// provided that the above copyright notice appears in all copies and +// that both the copyright notice and this permission notice appear in +// supporting documentation. No representations are made about the +// suitability of this software for any purpose. It is provided "as is" +// without express or implied warranty. + +#ifndef BOOST_MPL_SIZE_T_C_HPP_INCLUDED +#define BOOST_MPL_SIZE_T_C_HPP_INCLUDED + +#include +#include +#include // for std::size_t + +namespace boost { +namespace mpl { + +template< std::size_t N > struct size_t_c +#if !defined(__BORLANDC__) + : integral_c< std::size_t,N > +{ + typedef size_t_c type; +}; +#else +{ + BOOST_STATIC_CONSTANT(std::size_t, value = N); + typedef size_t_c type; + typedef std::size_t value_type; + + typedef size_t_c next; + typedef size_t_c prior; + + operator std::size_t() const { return this->value; } +}; +#endif + +} // namespace mpl +} // namespace boost + +#endif // BOOST_MPL_SIZE_T_C_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/mpl/void.hpp b/deal.II/contrib/boost/include/boost_local/mpl/void.hpp new file mode 100644 index 0000000000..631aee69fe --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/mpl/void.hpp @@ -0,0 +1,49 @@ +//----------------------------------------------------------------------------- +// boost mpl/void.hpp header file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2001-02 +// Peter Dimov, Aleksey Gurtovoy +// +// Permission to use, copy, modify, distribute and sell this software +// and its documentation for any purpose is hereby granted without fee, +// provided that the above copyright notice appears in all copies and +// that both the copyright notice and this permission notice appear in +// supporting documentation. No representations are made about the +// suitability of this software for any purpose. It is provided "as is" +// without express or implied warranty. + +#ifndef BOOST_MPL_VOID_HPP_INCLUDED +#define BOOST_MPL_VOID_HPP_INCLUDED + +#include +#include + +namespace boost { +namespace mpl { + +struct void_; + +template< typename T > +struct is_void_ + : false_c +{ +#if defined(BOOST_MSVC) && BOOST_MSVC < 1300 + using false_c::value; +#endif +}; + +template<> +struct is_void_ + : true_c +{ +#if defined(BOOST_MSVC) && BOOST_MSVC < 1300 + using true_c::value; +#endif +}; + +} // namespace mpl +} // namespace boost + +#endif // BOOST_MPL_VOID_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/preprocessor/cat.hpp b/deal.II/contrib/boost/include/boost_local/preprocessor/cat.hpp new file mode 100644 index 0000000000..13ed886aa7 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/preprocessor/cat.hpp @@ -0,0 +1,36 @@ +# /* Copyright (C) 2001 +# * Housemarque Oy +# * http://www.housemarque.com +# * +# * 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. +# */ +# +# /* Revised by Paul Mensonides (2002) */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef BOOST_PREPROCESSOR_CAT_HPP +# define BOOST_PREPROCESSOR_CAT_HPP +# +# include +# +# /* BOOST_PP_CAT */ +# +# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC() +# define BOOST_PP_CAT(a, b) BOOST_PP_CAT_I(a, b) +# else +# define BOOST_PP_CAT(a, b) BOOST_PP_CAT_OO((a, b)) +# define BOOST_PP_CAT_OO(par) BOOST_PP_CAT_I ## par +# endif +# +# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC() +# define BOOST_PP_CAT_I(a, b) a ## b +# else +# define BOOST_PP_CAT_I(a, b) BOOST_PP_CAT_II(a ## b) +# define BOOST_PP_CAT_II(res) res +# endif +# +# endif diff --git a/deal.II/contrib/boost/include/boost_local/preprocessor/comma_if.hpp b/deal.II/contrib/boost/include/boost_local/preprocessor/comma_if.hpp new file mode 100644 index 0000000000..86e76d76ea --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/preprocessor/comma_if.hpp @@ -0,0 +1,18 @@ +# /* ************************************************************************** +# * * +# * (C) Copyright Paul Mensonides 2002. 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 at to its suitability for any purpose. * +# * * +# ************************************************************************** */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef BOOST_PREPROCESSOR_COMMA_IF_HPP +# define BOOST_PREPROCESSOR_COMMA_IF_HPP +# +# include +# +# endif diff --git a/deal.II/contrib/boost/include/boost_local/preprocessor/empty.hpp b/deal.II/contrib/boost/include/boost_local/preprocessor/empty.hpp new file mode 100644 index 0000000000..9c8751fe1b --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/preprocessor/empty.hpp @@ -0,0 +1,18 @@ +# /* ************************************************************************** +# * * +# * (C) Copyright Paul Mensonides 2002. 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 at to its suitability for any purpose. * +# * * +# ************************************************************************** */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef BOOST_PREPROCESSOR_EMPTY_HPP +# define BOOST_PREPROCESSOR_EMPTY_HPP +# +# include +# +# endif diff --git a/deal.II/contrib/boost/include/boost_local/preprocessor/enum_params.hpp b/deal.II/contrib/boost/include/boost_local/preprocessor/enum_params.hpp new file mode 100644 index 0000000000..0a6071c10f --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/preprocessor/enum_params.hpp @@ -0,0 +1,18 @@ +# /* ************************************************************************** +# * * +# * (C) Copyright Paul Mensonides 2002. 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 at to its suitability for any purpose. * +# * * +# ************************************************************************** */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef BOOST_PREPROCESSOR_ENUM_PARAMS_HPP +# define BOOST_PREPROCESSOR_ENUM_PARAMS_HPP +# +# include +# +# endif diff --git a/deal.II/contrib/boost/include/boost_local/preprocessor/identity.hpp b/deal.II/contrib/boost/include/boost_local/preprocessor/identity.hpp new file mode 100644 index 0000000000..494120a668 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/preprocessor/identity.hpp @@ -0,0 +1,18 @@ +# /* ************************************************************************** +# * * +# * (C) Copyright Paul Mensonides 2002. 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 at to its suitability for any purpose. * +# * * +# ************************************************************************** */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef BOOST_PREPROCESSOR_IDENTITY_HPP +# define BOOST_PREPROCESSOR_IDENTITY_HPP +# +# include +# +# endif diff --git a/deal.II/contrib/boost/include/boost_local/preprocessor/inc.hpp b/deal.II/contrib/boost/include/boost_local/preprocessor/inc.hpp new file mode 100644 index 0000000000..fd08ed61cc --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/preprocessor/inc.hpp @@ -0,0 +1,18 @@ +# /* ************************************************************************** +# * * +# * (C) Copyright Paul Mensonides 2002. 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 at to its suitability for any purpose. * +# * * +# ************************************************************************** */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef BOOST_PREPROCESSOR_INC_HPP +# define BOOST_PREPROCESSOR_INC_HPP +# +# include +# +# endif diff --git a/deal.II/contrib/boost/include/boost_local/preprocessor/iterate.hpp b/deal.II/contrib/boost/include/boost_local/preprocessor/iterate.hpp new file mode 100644 index 0000000000..19b9b4b4f4 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/preprocessor/iterate.hpp @@ -0,0 +1,18 @@ +# /* ************************************************************************** +# * * +# * (C) Copyright Paul Mensonides 2002. 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 at to its suitability for any purpose. * +# * * +# ************************************************************************** */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef BOOST_PREPROCESSOR_ITERATE_HPP +# define BOOST_PREPROCESSOR_ITERATE_HPP +# +# include +# +# endif diff --git a/deal.II/contrib/boost/include/boost_local/preprocessor/repeat.hpp b/deal.II/contrib/boost/include/boost_local/preprocessor/repeat.hpp new file mode 100644 index 0000000000..a880c4974d --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/preprocessor/repeat.hpp @@ -0,0 +1,18 @@ +# /* ************************************************************************** +# * * +# * (C) Copyright Paul Mensonides 2002. 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 at to its suitability for any purpose. * +# * * +# ************************************************************************** */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef BOOST_PREPROCESSOR_REPEAT_HPP +# define BOOST_PREPROCESSOR_REPEAT_HPP +# +# include +# +# endif diff --git a/deal.II/contrib/boost/include/boost_local/tuple/tuple.hpp b/deal.II/contrib/boost/include/boost_local/tuple/tuple.hpp new file mode 100644 index 0000000000..88a297ca42 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/tuple/tuple.hpp @@ -0,0 +1,95 @@ +// tuple.hpp - Boost Tuple Library -------------------------------------- + +// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) +// +// Permission to copy, use, sell and distribute this software is granted +// provided this copyright notice appears in all copies. +// Permission to modify the code and to distribute modified code is granted +// provided this copyright notice appears in all copies, and a notice +// that the code was modified is included with the copyright notice. +// +// This software is provided "as is" without express or implied warranty, +// and with no claim as to its suitability for any purpose. + +// For more information, see http://www.boost.org + +// ----------------------------------------------------------------- + +#ifndef BOOST_TUPLE_HPP +#define BOOST_TUPLE_HPP + +#if defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730 +// Work around a compiler bug. +// boost::python::tuple has to be seen by the compiler before the +// boost::tuple class template. +namespace boost { namespace python { class tuple; }} +#endif + +#include +#include + +#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) +// The MSVC version +#include + +#else +// other compilers +#include +#include + +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +namespace boost { + +using tuples::tuple; +using tuples::make_tuple; +using tuples::tie; +#if !defined(BOOST_NO_USING_TEMPLATE) +using tuples::get; +#elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) +// +// The "using tuples::get" statement causes the +// Borland compiler to ICE, use forwarding +// functions instead: +// +template +inline typename tuples::access_traits< + typename tuples::element >::type + >::non_const_type +get(tuples::cons& c) { + return tuples::get(c); +} +// get function for const cons-lists, returns a const reference to +// the element. If the element is a reference, returns the reference +// as such (that is, can return a non-const reference) +template +inline typename tuples::access_traits< + typename tuples::element >::type + >::const_type +get(const tuples::cons& c) { + return tuples::get(c); +} +#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +// +// MSVC, using declarations don't mix with templates well, +// so use forwarding functions instead: +// +template +typename tuples::detail::element_ref >::RET +get(tuples::cons& t, tuples::detail::workaround_holder* = 0) +{ + return tuples::detail::get_class::get(t); +} + +template +typename tuples::detail::element_const_ref >::RET +get(const tuples::cons& t, tuples::detail::workaround_holder* = 0) +{ + return tuples::detail::get_class::get(t); +} +#endif // BOOST_NO_USING_TEMPLATE + +} // end namespace boost + + +#endif // BOOST_TUPLE_HPP diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/add_const.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/add_const.hpp new file mode 100644 index 0000000000..ccdca0a253 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/add_const.hpp @@ -0,0 +1,48 @@ + +// (C) Copyright Dave Abrahams, 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_TT_ADD_CONST_HPP_INCLUDED +#define BOOST_TT_ADD_CONST_HPP_INCLUDED + +#include + +// should be the last #include +#include + +namespace boost { + +// * convert a type T to const type - add_const +// this is not required since the result is always +// the same as "T const", but it does suppress warnings +// from some compilers: + +#if defined(BOOST_MSVC) +// This bogus warning will appear when add_const is applied to a +// const volatile reference because we can't detect const volatile +// references with MSVC6. +# pragma warning(push) +# pragma warning(disable:4181) // warning C4181: qualifier applied to reference type ignored +#endif + +BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_const,T,T const) + +#if defined(BOOST_MSVC) +# pragma warning(pop) +#endif + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,add_const,T&,T&) +#endif + +} // namespace boost + +#include + +#endif // BOOST_TT_ADD_CONST_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/add_cv.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/add_cv.hpp new file mode 100644 index 0000000000..96326282cd --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/add_cv.hpp @@ -0,0 +1,48 @@ + +// (C) Copyright Dave Abrahams, 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_TT_ADD_CV_HPP_INCLUDED +#define BOOST_TT_ADD_CV_HPP_INCLUDED + +#include + +// should be the last #include +#include + +namespace boost { + +// * convert a type T to a const volatile type - add_cv +// this is not required since the result is always +// the same as "T const volatile", but it does suppress warnings +// from some compilers: + +#if defined(BOOST_MSVC) +// This bogus warning will appear when add_volatile is applied to a +// const volatile reference because we can't detect const volatile +// references with MSVC6. +# pragma warning(push) +# 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) + +#if defined(BOOST_MSVC) +# pragma warning(pop) +#endif + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,add_cv,T&,T&) +#endif + +} // namespace boost + +#include + +#endif // BOOST_TT_ADD_CV_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/add_pointer.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/add_pointer.hpp new file mode 100644 index 0000000000..897df384ec --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/add_pointer.hpp @@ -0,0 +1,37 @@ + +// (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_TT_ADD_POINTER_HPP_INCLUDED +#define BOOST_TT_ADD_POINTER_HPP_INCLUDED + +#include + +// should be the last #include +#include + +namespace boost { + +namespace detail { + +template +struct add_pointer_impl +{ + typedef typename remove_reference::type no_ref_type; + typedef no_ref_type* type; +}; + +} // namespace detail + +BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_pointer,T,typename detail::add_pointer_impl::type) + +} // namespace boost + +#include + +#endif // BOOST_TT_ADD_POINTER_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/add_reference.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/add_reference.hpp new file mode 100644 index 0000000000..b61dd4764f --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/add_reference.hpp @@ -0,0 +1,81 @@ + +// (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_TT_ADD_REFERENCE_HPP_INCLUDED +#define BOOST_TT_ADD_REFERENCE_HPP_INCLUDED + +#include +#include + +// should be the last #include +#include + +namespace boost { + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_reference,T,T&) +BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,add_reference,T&,T&) + +#elif defined(BOOST_MSVC6_MEMBER_TEMPLATES) + +namespace detail { + +template +struct reference_adder +{ + template struct result_ + { + typedef T& type; + }; +}; + +template <> +struct reference_adder +{ + template struct result_ + { + typedef T type; + }; +}; + +template +struct add_reference_impl +{ + typedef typename reference_adder< + ::boost::is_reference::value + >::template result_ result; + + typedef typename result::type type; +}; + +} // namespace detail + +BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_reference,T,typename detail::add_reference_impl::type) + +#else + +BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_reference,T,T&) + +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +// +// these full specialisations are always required: +BOOST_TT_AUX_TYPE_TRAIT_SPEC1(add_reference,void,void) +#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS +BOOST_TT_AUX_TYPE_TRAIT_SPEC1(add_reference,void const,void const) +BOOST_TT_AUX_TYPE_TRAIT_SPEC1(add_reference,void volatile,void volatile) +BOOST_TT_AUX_TYPE_TRAIT_SPEC1(add_reference,void const volatile,void const volatile) +#endif + +} // namespace boost + +#include + +#endif // BOOST_TT_ADD_REFERENCE_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/add_volatile.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/add_volatile.hpp new file mode 100644 index 0000000000..f7b97e627a --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/add_volatile.hpp @@ -0,0 +1,48 @@ + +// (C) Copyright Dave Abrahams, 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_TT_ADD_VOLATILE_HPP_INCLUDED +#define BOOST_TT_ADD_VOLATILE_HPP_INCLUDED + +#include + +// should be the last #include +#include + +namespace boost { + +// * convert a type T to volatile type - add_volatile +// this is not required since the result is always +// the same as "T volatile", but it does suppress warnings +// from some compilers: + +#if defined(BOOST_MSVC) +// This bogus warning will appear when add_volatile is applied to a +// const volatile reference because we can't detect const volatile +// references with MSVC6. +# pragma warning(push) +# pragma warning(disable:4181) // warning C4181: qualifier applied to reference type ignored +#endif + +BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_volatile,T,T volatile) + +#if defined(BOOST_MSVC) +# pragma warning(pop) +#endif + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,add_volatile,T&,T&) +#endif + +} // namespace boost + +#include + +#endif // BOOST_TT_ADD_VOLATILE_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/alignment_of.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/alignment_of.hpp new file mode 100644 index 0000000000..acb3d21066 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/alignment_of.hpp @@ -0,0 +1,85 @@ + +// (C) Copyright 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. + +#ifndef BOOST_TT_ALIGNMENT_OF_HPP_INCLUDED +#define BOOST_TT_ALIGNMENT_OF_HPP_INCLUDED + +#include +#include + +// should be the last #include +#include + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable: 4121) // alignment is sensitive to packing +#endif + +namespace boost { + +template struct alignment_of; + +// get the alignment of some arbitrary type: +namespace detail { + +template +struct alignment_of_hack +{ + char c; + T t; + alignment_of_hack(); +}; + + +template +struct alignment_logic +{ + BOOST_STATIC_CONSTANT(std::size_t, value = A < S ? A : S); +}; + + +template< typename T > +struct alignment_of_impl +{ + BOOST_STATIC_CONSTANT(std::size_t, value = + (::boost::detail::alignment_logic< + sizeof(detail::alignment_of_hack) - sizeof(T), + sizeof(T) + >::value)); +}; + +} // namespace detail + +BOOST_TT_AUX_SIZE_T_TRAIT_DEF1(alignment_of,T,::boost::detail::alignment_of_impl::value) + +// references have to be treated specially, assume +// that a reference is just a special pointer: +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +template +struct alignment_of + : alignment_of +{ +}; +#endif + +// void has to be treated specially: +BOOST_TT_AUX_SIZE_T_TRAIT_SPEC1(alignment_of,void,0) +#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) +#endif + +} // namespace boost + +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + +#include + +#endif // BOOST_TT_ALIGNMENT_OF_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/broken_compiler_spec.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/broken_compiler_spec.hpp new file mode 100644 index 0000000000..ccdd7d113d --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/broken_compiler_spec.hpp @@ -0,0 +1,108 @@ + +// Copyright (c) 2001 Aleksey Gurtovoy. +// 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. + +#ifndef BOOST_TT_BROKEN_COMPILER_SPEC_HPP_INCLUDED +#define BOOST_TT_BROKEN_COMPILER_SPEC_HPP_INCLUDED + +#include + +#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) + +# define BOOST_TT_BROKEN_COMPILER_SPEC(T) /**/ + +#else + +namespace boost { +// forward declarations +template< typename T > struct remove_const; +template< typename T > struct remove_volatile; +template< typename T > struct remove_cv; +template< typename T > struct remove_pointer; +template< typename T > struct remove_reference; +} + +// same as BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1 macro, except that it +// never gets #undef-ined +# define BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(trait,spec,result) \ +template<> struct trait \ +{ \ + typedef result type; \ +}; \ +/**/ + +# define BOOST_TT_AUX_REMOVE_CONST_VOLATILE_RANK1_SPEC(T) \ + BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_const,T const,T) \ + BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_const,T const volatile,T volatile) \ + BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_volatile,T volatile,T) \ + BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_volatile,T const volatile,T const) \ + BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_cv,T const,T) \ + BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_cv,T volatile,T) \ + BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_cv,T const volatile,T) \ + /**/ + +# define BOOST_TT_AUX_REMOVE_PTR_REF_RANK_1_SPEC(T) \ + BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_pointer,T*,T) \ + BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_reference,T&,T) \ + /**/ + +# define BOOST_TT_AUX_REMOVE_PTR_REF_RANK_2_SPEC(T) \ + BOOST_TT_AUX_REMOVE_PTR_REF_RANK_1_SPEC(T) \ + BOOST_TT_AUX_REMOVE_PTR_REF_RANK_1_SPEC(T const) \ + BOOST_TT_AUX_REMOVE_PTR_REF_RANK_1_SPEC(T volatile) \ + BOOST_TT_AUX_REMOVE_PTR_REF_RANK_1_SPEC(T const volatile) \ + /**/ + +# define BOOST_TT_AUX_REMOVE_ALL_RANK_1_SPEC(T) \ + BOOST_TT_AUX_REMOVE_PTR_REF_RANK_2_SPEC(T) \ + BOOST_TT_AUX_REMOVE_CONST_VOLATILE_RANK1_SPEC(T) \ + /**/ + +# define BOOST_TT_AUX_REMOVE_ALL_RANK_2_SPEC(T) \ + BOOST_TT_AUX_REMOVE_ALL_RANK_1_SPEC(T*) \ + BOOST_TT_AUX_REMOVE_ALL_RANK_1_SPEC(T const*) \ + BOOST_TT_AUX_REMOVE_ALL_RANK_1_SPEC(T volatile*) \ + BOOST_TT_AUX_REMOVE_ALL_RANK_1_SPEC(T const volatile*) \ + /**/ + +# define BOOST_TT_BROKEN_COMPILER_SPEC(T) \ + namespace boost { \ + BOOST_TT_AUX_REMOVE_ALL_RANK_1_SPEC(T) \ + BOOST_TT_AUX_REMOVE_ALL_RANK_2_SPEC(T) \ + BOOST_TT_AUX_REMOVE_ALL_RANK_2_SPEC(T*) \ + BOOST_TT_AUX_REMOVE_ALL_RANK_2_SPEC(T const*) \ + BOOST_TT_AUX_REMOVE_ALL_RANK_2_SPEC(T volatile*) \ + BOOST_TT_AUX_REMOVE_ALL_RANK_2_SPEC(T const volatile*) \ + } \ + /**/ + +# include + +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +BOOST_TT_BROKEN_COMPILER_SPEC(bool) +BOOST_TT_BROKEN_COMPILER_SPEC(char) +#ifndef BOOST_NO_INTRINSIC_WCHAR_T +BOOST_TT_BROKEN_COMPILER_SPEC(wchar_t) +#endif +BOOST_TT_BROKEN_COMPILER_SPEC(signed char) +BOOST_TT_BROKEN_COMPILER_SPEC(unsigned char) +BOOST_TT_BROKEN_COMPILER_SPEC(signed short) +BOOST_TT_BROKEN_COMPILER_SPEC(unsigned short) +BOOST_TT_BROKEN_COMPILER_SPEC(signed int) +BOOST_TT_BROKEN_COMPILER_SPEC(unsigned int) +BOOST_TT_BROKEN_COMPILER_SPEC(signed long) +BOOST_TT_BROKEN_COMPILER_SPEC(unsigned long) +BOOST_TT_BROKEN_COMPILER_SPEC(float) +BOOST_TT_BROKEN_COMPILER_SPEC(double) +BOOST_TT_BROKEN_COMPILER_SPEC(long double) + +// for backward compatibility +#define BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(T) \ + BOOST_TT_BROKEN_COMPILER_SPEC(T) \ +/**/ + +#endif // BOOST_TT_BROKEN_COMPILER_SPEC_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/config.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/config.hpp new file mode 100644 index 0000000000..704f7f5c08 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/config.hpp @@ -0,0 +1,94 @@ + +// (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_TT_CONFIG_HPP_INCLUDED +#define BOOST_TT_CONFIG_HPP_INCLUDED + +#ifndef BOOST_CONFIG_HPP +#include +#endif + +// +// Helper macros for builtin 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 largely ignore cv-qualifiers) +// 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 + +#ifdef BOOST_HAS_SGI_TYPE_TRAITS +# include +# include +# define BOOST_IS_POD(T) ::boost::is_same< typename ::__type_traits::is_POD_type, ::__true_type>::value +# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) ::boost::is_same< typename ::__type_traits::has_trivial_default_constructor, ::__true_type>::value +# define BOOST_HAS_TRIVIAL_COPY(T) ::boost::is_same< typename ::__type_traits::has_trivial_copy_constructor, ::__true_type>::value +# define BOOST_HAS_TRIVIAL_ASSIGN(T) ::boost::is_same< typename ::__type_traits::has_trivial_assignment_operator, ::__true_type>::value +# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) ::boost::is_same< typename ::__type_traits::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 + +// +// whenever we have a conversion function with elipses +// it needs to be declared __cdecl to suppress compiler +// warnings from MS and Borland compilers: +#if defined(BOOST_MSVC) || defined(__BORLANDC__) +# define BOOST_TT_DECL __cdecl +#else +# define BOOST_TT_DECL /**/ +#endif + +# if (defined(__MWERKS__) && __MWERKS__ >= 0x3000) || BOOST_MSVC > 1301 || defined(BOOST_NO_COMPILER_CONFIG) +# define BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION +#endif + +#endif // BOOST_TT_CONFIG_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/cv_traits.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/cv_traits.hpp new file mode 100644 index 0000000000..82b73969d5 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/cv_traits.hpp @@ -0,0 +1,25 @@ +// (C) Copyright Dave Abrahams, 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. +// +// defines traits classes for cv-qualified types: +// is_const, is_volatile, remove_const, remove_volatile, remove_cv. + +#ifndef BOOST_TT_CV_TRAITS_HPP_INCLUDED +#define BOOST_TT_CV_TRAITS_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include +#include +#include + +#endif // BOOST_TT_CV_TRAITS_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/function_traits.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/function_traits.hpp new file mode 100644 index 0000000000..83bf8206da --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/function_traits.hpp @@ -0,0 +1,237 @@ + +// Copyright (C) 2000 John Maddock (john_maddock@compuserve.com) +// +// Permission to copy and use this software is granted, +// provided this copyright notice appears in all copies. +// Permission to modify the code and to distribute modified code is granted, +// provided this copyright notice appears in all copies, and a notice +// that the code was modified is included with the copyright notice. +// +// This software is provided "as is" without express or implied warranty, +// and with no claim as to its suitability for any purpose. + +#ifndef BOOST_TT_FUNCTION_TRAITS_HPP_INCLUDED +#define BOOST_TT_FUNCTION_TRAITS_HPP_INCLUDED + +#include +#include +#include + +namespace boost { + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +namespace detail { + +template struct function_traits_helper; + +template +struct function_traits_helper +{ + BOOST_STATIC_CONSTANT(int, arity = 0); + typedef R result_type; +}; + +template +struct function_traits_helper +{ + BOOST_STATIC_CONSTANT(int, arity = 1); + typedef R result_type; + typedef T1 arg1_type; +}; + +template +struct function_traits_helper +{ + BOOST_STATIC_CONSTANT(int, arity = 2); + typedef R result_type; + typedef T1 arg1_type; + typedef T2 arg2_type; +}; + +template +struct function_traits_helper +{ + BOOST_STATIC_CONSTANT(int, arity = 3); + typedef R result_type; + typedef T1 arg1_type; + typedef T2 arg2_type; + typedef T3 arg3_type; +}; + +template +struct function_traits_helper +{ + BOOST_STATIC_CONSTANT(int, arity = 4); + typedef R result_type; + typedef T1 arg1_type; + typedef T2 arg2_type; + typedef T3 arg3_type; + typedef T4 arg4_type; +}; + +template +struct function_traits_helper +{ + BOOST_STATIC_CONSTANT(int, arity = 5); + typedef R result_type; + typedef T1 arg1_type; + typedef T2 arg2_type; + typedef T3 arg3_type; + typedef T4 arg4_type; + typedef T5 arg5_type; +}; + +template +struct function_traits_helper +{ + BOOST_STATIC_CONSTANT(int, arity = 6); + typedef R result_type; + typedef T1 arg1_type; + typedef T2 arg2_type; + typedef T3 arg3_type; + typedef T4 arg4_type; + typedef T5 arg5_type; + typedef T6 arg6_type; +}; + +template +struct function_traits_helper +{ + BOOST_STATIC_CONSTANT(int, arity = 7); + typedef R result_type; + typedef T1 arg1_type; + typedef T2 arg2_type; + typedef T3 arg3_type; + typedef T4 arg4_type; + typedef T5 arg5_type; + typedef T6 arg6_type; + typedef T7 arg7_type; +}; + +template +struct function_traits_helper +{ + BOOST_STATIC_CONSTANT(int, arity = 8); + typedef R result_type; + typedef T1 arg1_type; + typedef T2 arg2_type; + typedef T3 arg3_type; + typedef T4 arg4_type; + typedef T5 arg5_type; + typedef T6 arg6_type; + typedef T7 arg7_type; + typedef T8 arg8_type; +}; + +template +struct function_traits_helper +{ + BOOST_STATIC_CONSTANT(int, arity = 9); + typedef R result_type; + typedef T1 arg1_type; + typedef T2 arg2_type; + typedef T3 arg3_type; + typedef T4 arg4_type; + typedef T5 arg5_type; + typedef T6 arg6_type; + typedef T7 arg7_type; + typedef T8 arg8_type; + typedef T9 arg9_type; +}; + +template +struct function_traits_helper +{ + BOOST_STATIC_CONSTANT(int, arity = 10); + typedef R result_type; + typedef T1 arg1_type; + typedef T2 arg2_type; + typedef T3 arg3_type; + typedef T4 arg4_type; + typedef T5 arg5_type; + typedef T6 arg6_type; + typedef T7 arg7_type; + typedef T8 arg8_type; + typedef T9 arg9_type; + typedef T10 arg10_type; +}; + +} // end namespace detail + +template +struct function_traits : + public detail::function_traits_helper::type> +{ +}; + +#else + +namespace detail { + +template +struct type_of_size +{ + char elements[N]; +}; + +template +type_of_size<1> function_arity_helper(R (*f)()); + +template +type_of_size<2> function_arity_helper(R (*f)(T1)); + +template +type_of_size<3> function_arity_helper(R (*f)(T1, T2)); + +template +type_of_size<4> function_arity_helper(R (*f)(T1, T2, T3)); + +template +type_of_size<5> function_arity_helper(R (*f)(T1, T2, T3, T4)); + +template +type_of_size<6> function_arity_helper(R (*f)(T1, T2, T3, T4, T5)); + +template +type_of_size<7> function_arity_helper(R (*f)(T1, T2, T3, T4, T5, T6)); + +template +type_of_size<8> function_arity_helper(R (*f)(T1, T2, T3, T4, T5, T6, T7)); + +template +type_of_size<9> function_arity_helper(R (*f)(T1, T2, T3, T4, T5, T6, T7, T8)); + +template +type_of_size<10> function_arity_helper(R (*f)(T1, T2, T3, T4, T5, T6, T7, T8, + T9)); + +template +type_of_size<11> function_arity_helper(R (*f)(T1, T2, T3, T4, T5, T6, T7, T8, + T9, T10)); +} // end namespace detail + +// Won't work with references +template +struct function_traits +{ + BOOST_STATIC_CONSTANT(int, arity = (sizeof(detail::function_arity_helper((Function*)0))-1)); +}; + +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +} + +#endif // BOOST_TT_FUNCTION_TRAITS_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/has_nothrow_assign.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/has_nothrow_assign.hpp new file mode 100644 index 0000000000..cc44aa1777 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/has_nothrow_assign.hpp @@ -0,0 +1,26 @@ + +// (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_TT_HAS_NOTHROW_ASSIGN_HPP_INCLUDED +#define BOOST_TT_HAS_NOTHROW_ASSIGN_HPP_INCLUDED + +#include + +// should be the last #include +#include + +namespace boost { + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_assign,T,::boost::has_trivial_assign::value) + +} // namespace boost + +#include + +#endif // BOOST_TT_HAS_NOTHROW_ASSIGN_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/has_nothrow_constructor.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/has_nothrow_constructor.hpp new file mode 100644 index 0000000000..96c9e414c1 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/has_nothrow_constructor.hpp @@ -0,0 +1,26 @@ + +// (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_TT_HAS_NOTHROW_CONSTRUCTOR_HPP_INCLUDED +#define BOOST_TT_HAS_NOTHROW_CONSTRUCTOR_HPP_INCLUDED + +#include + +// should be the last #include +#include + +namespace boost { + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_constructor,T,::boost::has_trivial_constructor::value) + +} // namespace boost + +#include + +#endif // BOOST_TT_HAS_NOTHROW_CONSTRUCTOR_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/has_nothrow_copy.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/has_nothrow_copy.hpp new file mode 100644 index 0000000000..435023f03e --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/has_nothrow_copy.hpp @@ -0,0 +1,26 @@ + +// (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_TT_HAS_NOTHROW_COPY_HPP_INCLUDED +#define BOOST_TT_HAS_NOTHROW_COPY_HPP_INCLUDED + +#include + +// should be the last #include +#include + +namespace boost { + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_copy,T,::boost::has_trivial_copy::value) + +} // namespace boost + +#include + +#endif // BOOST_TT_HAS_NOTHROW_COPY_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/has_nothrow_destructor.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/has_nothrow_destructor.hpp new file mode 100644 index 0000000000..083e668624 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/has_nothrow_destructor.hpp @@ -0,0 +1,26 @@ + +// (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_TT_HAS_NOTHROW_DESTRUCTOR_HPP_INCLUDED +#define BOOST_TT_HAS_NOTHROW_DESTRUCTOR_HPP_INCLUDED + +#include + +// should be the last #include +#include + +namespace boost { + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_destructor,T,::boost::has_trivial_destructor::value) + +} // namespace boost + +#include + +#endif // BOOST_TT_HAS_NOTHROW_DESTRUCTOR_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/has_trivial_assign.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/has_trivial_assign.hpp new file mode 100644 index 0000000000..94db3676a4 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/has_trivial_assign.hpp @@ -0,0 +1,50 @@ + +// (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_TT_HAS_TRIVIAL_ASSIGN_HPP_INCLUDED +#define BOOST_TT_HAS_TRIVIAL_ASSIGN_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include +#include + +// should be the last #include +#include + +namespace boost { + +namespace detail { + +template +struct has_trivial_assign_impl +{ + BOOST_STATIC_CONSTANT(bool, value = + (::boost::type_traits::ice_and< + ::boost::type_traits::ice_or< + ::boost::is_POD::value, + BOOST_HAS_TRIVIAL_ASSIGN(T) + >::value, + ::boost::type_traits::ice_not< ::boost::is_const::value >::value, + ::boost::type_traits::ice_not< ::boost::is_volatile::value >::value + >::value)); +}; + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_assign,T,::boost::detail::has_trivial_assign_impl::value) + +} // namespace boost + +#include + +#endif // BOOST_TT_HAS_TRIVIAL_ASSIGN_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/has_trivial_constructor.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/has_trivial_constructor.hpp new file mode 100644 index 0000000000..dfc689bab2 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/has_trivial_constructor.hpp @@ -0,0 +1,42 @@ + +// (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_TT_HAS_TRIVIAL_CONSTRUCTOR_HPP_INCLUDED +#define BOOST_TT_HAS_TRIVIAL_CONSTRUCTOR_HPP_INCLUDED + +#include +#include +#include + +// should be the last #include +#include + +namespace boost { + +namespace detail { + +template +struct has_trivial_ctor_impl +{ + BOOST_STATIC_CONSTANT(bool, value = + (::boost::type_traits::ice_or< + ::boost::is_POD::value, + BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) + >::value)); +}; + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_constructor,T,::boost::detail::has_trivial_ctor_impl::value) + +} // namespace boost + +#include + +#endif // BOOST_TT_HAS_TRIVIAL_CONSTRUCTOR_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/has_trivial_copy.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/has_trivial_copy.hpp new file mode 100644 index 0000000000..7dc3b6d5ee --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/has_trivial_copy.hpp @@ -0,0 +1,48 @@ + +// (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_TT_HAS_TRIVIAL_COPY_HPP_INCLUDED +#define BOOST_TT_HAS_TRIVIAL_COPY_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include + +// should be the last #include +#include + +namespace boost { + +namespace detail { + +template +struct has_trivial_copy_impl +{ + BOOST_STATIC_CONSTANT(bool, value = + (::boost::type_traits::ice_and< + ::boost::type_traits::ice_or< + ::boost::is_POD::value, + BOOST_HAS_TRIVIAL_COPY(T) + >::value, + ::boost::type_traits::ice_not< ::boost::is_volatile::value >::value + >::value)); +}; + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_copy,T,::boost::detail::has_trivial_copy_impl::value) + +} // namespace boost + +#include + +#endif // BOOST_TT_HAS_TRIVIAL_COPY_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/has_trivial_destructor.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/has_trivial_destructor.hpp new file mode 100644 index 0000000000..62d8160ecb --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/has_trivial_destructor.hpp @@ -0,0 +1,42 @@ + +// (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_TT_HAS_TRIVIAL_DESTRUCTOR_HPP_INCLUDED +#define BOOST_TT_HAS_TRIVIAL_DESTRUCTOR_HPP_INCLUDED + +#include +#include +#include + +// should be the last #include +#include + +namespace boost { + +namespace detail { + +template +struct has_trivial_dtor_impl +{ + BOOST_STATIC_CONSTANT(bool, value = + (::boost::type_traits::ice_or< + ::boost::is_POD::value, + BOOST_HAS_TRIVIAL_DESTRUCTOR(T) + >::value)); +}; + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_destructor,T,::boost::detail::has_trivial_dtor_impl::value) + +} // namespace boost + +#include + +#endif // BOOST_TT_HAS_TRIVIAL_DESTRUCTOR_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/is_POD.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/is_POD.hpp new file mode 100644 index 0000000000..3ac943401a --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/is_POD.hpp @@ -0,0 +1,123 @@ + +// (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_TT_IS_POD_HPP_INCLUDED +#define BOOST_TT_IS_POD_HPP_INCLUDED + +#include +#include +#include +#include + +#include + +// should be the last #include +#include + +namespace boost { + +// forward declaration, needed by 'is_POD_array_helper' template below +template< typename T > struct is_POD; + +namespace detail { + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +template struct is_POD_impl +{ + BOOST_STATIC_CONSTANT( + bool, value = + (::boost::type_traits::ice_or< + ::boost::is_scalar::value, + ::boost::is_void::value, + BOOST_IS_POD(T) + >::value)); +}; + +template +struct is_POD_impl + : is_POD_impl +{ +}; + +#else + +template +struct is_POD_helper +{ + template struct result_ + { + BOOST_STATIC_CONSTANT( + bool, value = + (::boost::type_traits::ice_or< + ::boost::is_scalar::value, + ::boost::is_void::value, + BOOST_IS_POD(T) + >::value)); + }; +}; + +template +struct bool_to_yes_no_type +{ + typedef ::boost::type_traits::no_type type; +}; + +template <> +struct bool_to_yes_no_type +{ + typedef ::boost::type_traits::yes_type type; +}; + +template +struct is_POD_array_helper +{ + enum { is_pod = ::boost::is_POD::value }; // MSVC workaround + typedef typename bool_to_yes_no_type::type type; + type instance() const; +}; + +template +is_POD_array_helper is_POD_array(T*); + +template <> +struct is_POD_helper +{ + template struct result_ + { + static T& help(); + BOOST_STATIC_CONSTANT(bool, value = + sizeof(is_POD_array(help()).instance()) == sizeof(::boost::type_traits::yes_type) + ); + }; +}; + + +template struct is_POD_impl +{ + BOOST_STATIC_CONSTANT( + bool, value = ( + ::boost::detail::is_POD_helper< + ::boost::is_array::value + >::template result_::value + ) + ); +}; + +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_POD,T,::boost::detail::is_POD_impl::value) + +} // namespace boost + +#include + +#endif // BOOST_TT_IS_POD_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/is_arithmetic.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/is_arithmetic.hpp new file mode 100644 index 0000000000..098c673398 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/is_arithmetic.hpp @@ -0,0 +1,44 @@ + +// (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_TT_IS_ARITHMETIC_HPP_INCLUDED +#define BOOST_TT_IS_ARITHMETIC_HPP_INCLUDED + +#include +#include +#include +#include + +// should be the last #include +#include + +namespace boost { + +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 + +//* is a type T an arithmetic type described in the standard (3.9.1p8) +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_arithmetic,T,::boost::detail::is_arithmetic_impl::value) + +} // namespace boost + +#include + +#endif // BOOST_TT_IS_ARITHMETIC_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/is_array.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/is_array.hpp new file mode 100644 index 0000000000..37529a2d65 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/is_array.hpp @@ -0,0 +1,78 @@ + +// (C) Copyright Dave Abrahams, 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_TT_IS_ARRAY_HPP_INCLUDED +#define BOOST_TT_IS_ARRAY_HPP_INCLUDED + +#include + +#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +# include +# include +#endif + +#include + +// should be the last #include +#include + +namespace boost { + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_array,T,false) +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) + +#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +namespace detail { + +using ::boost::type_traits::yes_type; +using ::boost::type_traits::no_type; +using ::boost::type_traits::wrap; + +template< typename T > T(* is_array_tester1(wrap) )(wrap); +char BOOST_TT_DECL is_array_tester1(...); + +template< typename T> no_type is_array_tester2(T(*)(wrap)); +yes_type BOOST_TT_DECL is_array_tester2(...); + +template< typename T > +struct is_array_impl +{ + BOOST_STATIC_CONSTANT(bool, value = + sizeof(::boost::detail::is_array_tester2( + ::boost::detail::is_array_tester1( + ::boost::type_traits::wrap() + ) + )) == 1 + ); +}; + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_array,T,::boost::detail::is_array_impl::value) +#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_array,void,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_array,void const,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_array,void volatile,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_array,void const volatile,false) +#endif + +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +} // namespace boost + +#include + +#endif // BOOST_TT_IS_ARRAY_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/is_base_and_derived.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/is_base_and_derived.hpp new file mode 100644 index 0000000000..4999e17615 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/is_base_and_derived.hpp @@ -0,0 +1,56 @@ + +// (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_TT_IS_BASE_AND_DERIVED_HPP_INCLUDED +#define BOOST_TT_IS_BASE_AND_DERIVED_HPP_INCLUDED + +#include +#include +#include +#include + +// should be the last #include +#include + +namespace boost { + +namespace detail { + +template +struct is_base_and_derived_impl +{ + BOOST_STATIC_CONSTANT(bool, value = + (::boost::type_traits::ice_and< + ::boost::is_convertible::value, + ::boost::is_class::value, + ::boost::is_class::value + >::value) + ); +}; + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF2( + is_base_and_derived + , Base + , Derived + , (::boost::detail::is_base_and_derived_impl::value) + ) + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +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) +#endif + +} // namespace boost + +#include + +#endif // BOOST_TT_IS_BASE_AND_DERIVED_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/is_class.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/is_class.hpp new file mode 100644 index 0000000000..93ee718aa8 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/is_class.hpp @@ -0,0 +1,96 @@ +// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard +// Hinnant & John Maddock 2000-2002. 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_TT_IS_CLASS_HPP_INCLUDED +#define BOOST_TT_IS_CLASS_HPP_INCLUDED + +#include + +#ifdef BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION +# include +#else +# include +# include +# include +# include +# include +# include +# include +# include +#endif + +// should be the last #include +#include + +namespace boost { + +namespace detail { + +#ifdef BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION + +// This is actually the conforming implementation which works with +// abstract classes. However, enough compilers have trouble with +// it that most will use the one in +// boost/type_traits/object_traits.hpp. This implementation +// actually works with VC7.0, but other interactions seem to fail +// when we use it. + +// is_class<> metafunction due to Paul Mensonides +// (leavings@attbi.com). For more details: +// http://groups.google.com/groups?hl=en&selm=000001c1cc83%24e154d5e0%247772e50c%40c161550a&rnum=1 + +template +struct is_class_impl +{ + template static ::boost::type_traits::yes_type is_class_tester(void(U::*)(void)); + template static ::boost::type_traits::no_type is_class_tester(...); + + BOOST_STATIC_CONSTANT(bool, value = + sizeof(is_class_tester(0)) == sizeof(::boost::type_traits::yes_type) + ); +}; + +#else + +template +struct is_class_impl +{ +# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + 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)); +# else + 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 + >::value)); +# endif +}; + +# endif // BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_class,T,::boost::detail::is_class_impl::value) + +} // namespace boost + +#include + +#endif // BOOST_TT_IS_CLASS_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/is_compound.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/is_compound.hpp new file mode 100644 index 0000000000..1d24664fa1 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/is_compound.hpp @@ -0,0 +1,53 @@ + +// (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_TT_IS_COMPOUND_HPP_INCLUDED +#define BOOST_TT_IS_COMPOUND_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// should be the last #include +#include + +namespace boost { + +namespace detail { + +template +struct is_compound_impl +{ + BOOST_STATIC_CONSTANT(bool, value = + (::boost::type_traits::ice_or< + ::boost::is_array::value, + ::boost::is_pointer::value, + ::boost::is_reference::value, + ::boost::is_class::value, + ::boost::is_union::value, + ::boost::is_enum::value, + ::boost::is_member_pointer::value + >::value)); +}; + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_compound,T,::boost::detail::is_compound_impl::value) + +} // namespace boost + +#include + +#endif // BOOST_TT_IS_COMPOUND_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/is_const.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/is_const.hpp new file mode 100644 index 0000000000..980fba867d --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/is_const.hpp @@ -0,0 +1,112 @@ + +// (C) Copyright Dave Abrahams, 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_TT_IS_CONST_HPP_INCLUDED +#define BOOST_TT_IS_CONST_HPP_INCLUDED + +#include + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +# include +#else +# include +# include +# include +# include +#endif + +// should be the last #include +#include + +namespace boost { + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +//* is a type T declared const - is_const +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_const,T,::boost::detail::cv_traits_imp::is_const) +BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_const,T&,false) + +#if defined(__BORLANDC__) +// 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 + +#else + +namespace detail { + +using ::boost::type_traits::yes_type; +using ::boost::type_traits::no_type; + +yes_type is_const_tester(const volatile void*); +no_type is_const_tester(volatile void *); + +template +struct is_const_helper + : ::boost::type_traits::false_result +{ +}; + +template <> +struct is_const_helper +{ + template struct result_ + { + static T* t; + BOOST_STATIC_CONSTANT(bool, value = ( + sizeof(detail::yes_type) == sizeof(detail::is_const_tester(t)) + )); + }; +}; + +template <> +struct is_const_helper +{ + template struct result_ + { + static T t; + BOOST_STATIC_CONSTANT(bool, value = ( + sizeof(detail::yes_type) == sizeof(detail::is_const_tester(&t)) + )); + }; +}; + +template +struct is_const_impl + : is_const_helper< + is_reference::value + , is_array::value + >::template result_ +{ +}; + +} // namespace detail + +//* is a type T declared const - is_const +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_const,T,::boost::detail::is_const_impl::value) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_const,void,false) +#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_const,void const,true) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_const,void volatile,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_const,void const volatile,true) +#endif + +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +} // namespace boost + +#include + +#endif // BOOST_TT_IS_CONST_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/is_convertible.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/is_convertible.hpp new file mode 100644 index 0000000000..7217a73887 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/is_convertible.hpp @@ -0,0 +1,235 @@ + +// Copyright (C) 2000 John Maddock (john_maddock@compuserve.com) +// Copyright (C) 2000 Jeremy Siek (jsiek@lsc.nd.edu) +// Copyright (C) 1999, 2000 Jaakko J„rvi (jaakko.jarvi@cs.utu.fi) +// +// Permission to copy and use this software is granted, +// provided this copyright notice appears in all copies. +// Permission to modify the code and to distribute modified code is granted, +// provided this copyright notice appears in all copies, and a notice +// that the code was modified is included with the copyright notice. +// +// This software is provided "as is" without express or implied warranty, +// and with no claim as to its suitability for any purpose. +// + +#ifndef BOOST_TT_IS_CONVERTIBLE_HPP_INCLUDED +#define BOOST_TT_IS_CONVERTIBLE_HPP_INCLUDED + +#include +#include + +#if defined(BOOST_MSVC) && (BOOST_MSVC <= 1300) +# include +#endif + +// should be always the last #include directive +#include + +namespace boost { + +// is one type convertable to another? +// +// there are multiple versions of the is_convertible +// template, almost every compiler seems to require its +// own version. +// +// Thanks to Andrei Alexandrescu for the original version of the +// conversion detection technique! +// + +namespace detail { + +// MS specific version: + +#if defined(BOOST_MSVC) && (BOOST_MSVC <= 1300) + +// This workaround is necessary to handle when From is void +// which is normally taken care of by the partial specialization +// of the is_convertible typename. +using ::boost::type_traits::yes_type; +using ::boost::type_traits::no_type; + +template< typename From > +struct does_conversion_exist +{ + template< typename To > struct result_ + { + static no_type BOOST_TT_DECL _m_check(...); + static yes_type BOOST_TT_DECL _m_check(To); + static From _m_from; + enum { value = sizeof( _m_check(_m_from) ) == sizeof(yes_type) }; + }; +}; + +template<> +struct does_conversion_exist +{ + template< typename To > struct result_ + { + enum { value = ::boost::is_void::value }; + }; +}; + +template +struct is_convertible_impl + : does_conversion_exist::template result_ +{ +}; + +#elif defined(__BORLANDC__) +// +// special version for Borland compilers +// this version breaks when used for some +// UDT conversions: +// +template +struct is_convertible_impl +{ +#pragma option push -w-8074 + // This workaround for Borland breaks the EDG C++ frontend, + // so we only use it for Borland. + template struct checker + { + static ::boost::type_traits::no_type BOOST_TT_DECL _m_check(...); + static ::boost::type_traits::yes_type BOOST_TT_DECL _m_check(T); + }; + + static From _m_from; + static bool const value = sizeof( checker::_m_check(_m_from) ) + == sizeof(::boost::type_traits::yes_type); +#pragma option pop +}; + +#elif defined(__GNUC__) +// special version for gcc compiler + +struct any_conversion +{ + template any_conversion(const T&); + template any_conversion(T&); +}; + +template struct checker +{ + static boost::type_traits::no_type _m_check(any_conversion ...); + static boost::type_traits::yes_type _m_check(T, int); +}; + +template +struct is_convertible_impl +{ + static From _m_from; + static bool const value = sizeof( detail::checker::_m_check(_m_from, 0) ) + == sizeof(::boost::type_traits::yes_type); +}; + +#else + +template +struct is_convertible_impl +{ + static ::boost::type_traits::no_type BOOST_TT_DECL _m_check(...); + static ::boost::type_traits::yes_type BOOST_TT_DECL _m_check(To); + static From _m_from; + + BOOST_STATIC_CONSTANT(bool, value = + sizeof( _m_check(_m_from) ) == sizeof(::boost::type_traits::yes_type) + ); +}; + +#endif // is_convertible_impl + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF2(is_convertible,From,To,(::boost::detail::is_convertible_impl::value)) + +// +// Now add the full and partial specialisations +// for void types, these are common to all the +// implementation above: +// +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(typename To,is_convertible,void,To,false) +BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(typename From,is_convertible,From,void,false) +#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS +BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(typename To,is_convertible,void const,To,false) +BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(typename To,is_convertible,void volatile,To,false) +BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(typename To,is_convertible,void const volatile,To,false) +BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(typename From,is_convertible,From,void const,false) +BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(typename From,is_convertible,From,void volatile,false) +BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(typename From,is_convertible,From,void const volatile,false) +#endif +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS +# define TT_AUX_BOOL_CV_VOID_TRAIT_SPEC2_PART1(trait,spec1,spec2,value) \ + BOOST_TT_AUX_BOOL_TRAIT_SPEC2(trait,spec1,spec2,value) \ + BOOST_TT_AUX_BOOL_TRAIT_SPEC2(trait,spec1,spec2 const,value) \ + BOOST_TT_AUX_BOOL_TRAIT_SPEC2(trait,spec1,spec2 volatile,value) \ + BOOST_TT_AUX_BOOL_TRAIT_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) \ + /**/ + + TT_AUX_BOOL_CV_VOID_TRAIT_SPEC2(is_convertible,void,void,true) + +# undef TT_AUX_BOOL_CV_VOID_TRAIT_SPEC2 +# undef TT_AUX_BOOL_CV_VOID_TRAIT_SPEC2_PART1 + +#else + BOOST_TT_AUX_BOOL_TRAIT_SPEC2(is_convertible,void,void,true) +#endif // BOOST_NO_CV_VOID_SPECIALIZATIONS + + +#if defined(__GNUC__) + +// Declare specializations of is_convertible for all of the floating +// types to all of the integral types. This suppresses some nasty +// warnings + +# define TT_AUX_IS_CONVERTIBLE_SPEC(T1,T2) \ + BOOST_TT_AUX_BOOL_TRAIT_SPEC2(is_convertible,T1,T2,true) \ + /**/ + +# define TT_AUX_IS_CONVERTIBLE_SPEC_2(T1,T2) \ + TT_AUX_IS_CONVERTIBLE_SPEC(T1,signed T2) \ + TT_AUX_IS_CONVERTIBLE_SPEC(T1,unsigned T2) \ + /**/ + +# define TT_AUX_IS_CONVERTIBLE_FROM_FLOAT_SPEC(F) \ + TT_AUX_IS_CONVERTIBLE_SPEC(F,char) \ + TT_AUX_IS_CONVERTIBLE_SPEC_2(F,char) \ + TT_AUX_IS_CONVERTIBLE_SPEC_2(F,short) \ + TT_AUX_IS_CONVERTIBLE_SPEC_2(F,int) \ + TT_AUX_IS_CONVERTIBLE_SPEC_2(F,long) \ + TT_AUX_IS_CONVERTIBLE_SPEC_2(F,long long) \ + /**/ + +# define TT_AUX_IS_CONVERTIBLE_FROM_FLOAT_CV_SPEC(F) \ + TT_AUX_IS_CONVERTIBLE_FROM_FLOAT_SPEC(F const) \ + TT_AUX_IS_CONVERTIBLE_FROM_FLOAT_SPEC(F volatile) \ + TT_AUX_IS_CONVERTIBLE_FROM_FLOAT_SPEC(F const volatile) \ + /**/ + +TT_AUX_IS_CONVERTIBLE_FROM_FLOAT_CV_SPEC(float) +TT_AUX_IS_CONVERTIBLE_FROM_FLOAT_CV_SPEC(double) +TT_AUX_IS_CONVERTIBLE_FROM_FLOAT_CV_SPEC(long double) + +# undef TT_AUX_IS_CONVERTIBLE_FROM_FLOAT_CV_SPEC +# undef TT_AUX_IS_CONVERTIBLE_FROM_FLOAT_SPEC +# undef TT_AUX_IS_CONVERTIBLE_SPEC_2 +# undef TT_AUX_IS_CONVERTIBLE_SPEC + +#endif // __GNUC__ + +} // namespace boost + +#include + +#endif // BOOST_TT_IS_CONVERTIBLE_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/is_empty.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/is_empty.hpp new file mode 100644 index 0000000000..ae519d62e7 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/is_empty.hpp @@ -0,0 +1,198 @@ + +// (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_TT_IS_EMPTY_HPP_INCLUDED +#define BOOST_TT_IS_EMPTY_HPP_INCLUDED + +#include +#include +#include + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +# include +# include +# include +#else +# include +# include +# include +# include +# include +# include +# include +#endif + +// should be always the last #include directive +#include + +namespace boost { + +namespace detail { + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +template +struct empty_helper_t1 : public T +{ + empty_helper_t1(); // hh compiler bug workaround + int i[256]; +}; + +struct empty_helper_t2 { int i[256]; }; + +#ifndef __BORLANDC__ + +template +struct empty_helper +{ + BOOST_STATIC_CONSTANT(bool, value = false); +}; + +template +struct empty_helper +{ + BOOST_STATIC_CONSTANT( + bool, value = (sizeof(empty_helper_t1) == sizeof(empty_helper_t2)) + ); +}; + +template +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_IS_EMPTY(cvt) + >::value + )); +}; + +#else // __BORLANDC__ + +template +struct empty_helper +{ + BOOST_STATIC_CONSTANT(bool, value = false); +}; + +template +struct empty_helper +{ + BOOST_STATIC_CONSTANT(bool, value = ( + sizeof(empty_helper_t1) == sizeof(empty_helper_t2) + )); +}; + +template +struct is_empty_impl +{ + typedef typename remove_cv::type cvt; + typedef typename add_reference::type r_type; + + 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_IS_EMPTY(cvt) + >::value)); +}; + +#endif // __BORLANDC__ + +#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +#ifdef BOOST_MSVC6_MEMBER_TEMPLATES + +template +struct empty_helper_t1 : public T +{ + empty_helper_t1(); + int i[256]; +}; + +struct empty_helper_t2 { int i[256]; }; + +template +struct empty_helper_base +{ + enum { value = (sizeof(empty_helper_t1) == sizeof(empty_helper_t2)) }; +}; + +template +struct empty_helper_nonbase +{ + enum { value = false }; +}; + +template +struct empty_helper_chooser +{ + template struct result_ + { + typedef empty_helper_nonbase type; + }; +}; + +template <> +struct empty_helper_chooser +{ + template struct result_ + { + typedef empty_helper_base type; + }; +}; + +template +struct is_empty_impl +{ + typedef ::boost::detail::empty_helper_chooser< + ::boost::type_traits::ice_and< + ::boost::type_traits::ice_not< ::boost::is_reference::value >::value, + ::boost::type_traits::ice_not< ::boost::is_convertible::value >::value, + ::boost::type_traits::ice_not< ::boost::is_pointer::value >::value, + ::boost::type_traits::ice_not< ::boost::is_member_pointer::value >::value, + ::boost::type_traits::ice_not< ::boost::is_array::value >::value, + ::boost::type_traits::ice_not< ::boost::is_void::value >::value, + ::boost::type_traits::ice_not< + ::boost::is_convertible::value + >::value + >::value > chooser; + + typedef typename chooser::template result_ result; + typedef typename result::type eh_type; + + BOOST_STATIC_CONSTANT(bool, value = + (::boost::type_traits::ice_or::value)); +}; + +#else + +template struct is_empty_impl +{ + BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_EMPTY(T)); +}; + +#endif // BOOST_MSVC6_MEMBER_TEMPLATES + +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_empty,T,::boost::detail::is_empty_impl::value) + +} // namespace boost + +#include + +#endif // BOOST_TT_IS_EMPTY_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/is_enum.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/is_enum.hpp new file mode 100644 index 0000000000..a40012e00b --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/is_enum.hpp @@ -0,0 +1,115 @@ + +// (C) Copyright Dave Abrahams, 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_TT_IS_ENUM_HPP_INCLUDED +#define BOOST_TT_IS_ENUM_HPP_INCLUDED + +#include +#include +#include +#include +#include + +#ifdef BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION +# include +#endif + +// should be the last #include +#include + +namespace boost { + +#if !(defined(__BORLANDC__) && (__BORLANDC__ <= 0x551)) + +namespace detail { + +struct int_convertible +{ + int_convertible(int); +}; + +// Don't evaluate convertibility to int_convertible unless the type +// is non-arithmetic. This suppresses warnings with GCC. +template +struct is_enum_helper +{ + template struct type + { + BOOST_STATIC_CONSTANT(bool, value = false); + }; +}; + +template <> +struct is_enum_helper +{ + template struct type + : ::boost::is_convertible + { + }; +}; + +template struct is_enum_impl +{ + typedef ::boost::add_reference ar_t; + typedef typename ar_t::type r_type; + +#if defined(BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION) + BOOST_STATIC_CONSTANT(bool, selector = + (::boost::type_traits::ice_or< + ::boost::is_arithmetic::value + , ::boost::is_reference::value + // We MUST do this on conforming compilers in order to + // correctly deduce that noncopyable types are not enums (dwa + // 2002/04/15)... + , ::boost::is_class::value + >::value)); +#else + BOOST_STATIC_CONSTANT(bool, selector = + (::boost::type_traits::ice_or< + ::boost::is_arithmetic::value + , ::boost::is_reference::value + // However, not doing this on non-conforming compilers prevents + // a dependency recursion. + >::value)); +#endif + +#ifdef __BORLANDC__ + typedef ::boost::detail::is_enum_helper< + ::boost::detail::is_enum_impl::selector + > se_t; +#else + typedef ::boost::detail::is_enum_helper se_t; +#endif + typedef typename se_t::template type helper; + BOOST_STATIC_CONSTANT(bool, value = helper::value); +}; + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_enum,T,::boost::detail::is_enum_impl::value) + +// Specializations suppress some nasty warnings with GCC +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_enum,float,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_enum,double,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_enum,long double,false) + +#else // __BORLANDC__ +// +// buggy is_convertible prevents working +// implementation of is_enum: +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_enum,T,BOOST_IS_ENUM(T)) + +#endif + +} // namespace boost + +#include + +#endif // BOOST_TT_IS_ENUM_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/is_float.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/is_float.hpp new file mode 100644 index 0000000000..f556fcf3b4 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/is_float.hpp @@ -0,0 +1,28 @@ + +// (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_TYPE_TRAITS_IS_FLOAT_HPP_INCLUDED +#define BOOST_TYPE_TRAITS_IS_FLOAT_HPP_INCLUDED + +// should be the last #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) + +} // namespace boost + +#include + +#endif // BOOST_TYPE_TRAITS_IS_FLOAT_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/is_function.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/is_function.hpp new file mode 100644 index 0000000000..a7c28b8424 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/is_function.hpp @@ -0,0 +1,85 @@ + +// Copyright (C) 2000 John Maddock (john_maddock@compuserve.com) +// Copyright (C) 2002 Aleksey Gurtovoy (agurtovoy@meta-comm.com) +// +// Permission to copy and use this software is granted, +// provided this copyright notice appears in all copies. +// Permission to modify the code and to distribute modified code is granted, +// provided this copyright notice appears in all copies, and a notice +// that the code was modified is included with the copyright notice. +// +// This software is provided "as is" without express or implied warranty, +// and with no claim as to its suitability for any purpose. + +#ifndef BOOST_TT_IS_FUNCTION_HPP_INCLUDED +#define BOOST_TT_IS_FUNCTION_HPP_INCLUDED + +#include +#include +#include + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +# include +#else +# include +# 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, +// except that some compilers erroneously allow conversions from +// function pointers to void*. + +namespace boost { +namespace detail { + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +template +struct is_function_chooser + : ::boost::type_traits::false_result +{ +}; + +template <> +struct is_function_chooser +{ + template< typename T > struct result_ + : ::boost::type_traits::is_function_ptr_helper + { + }; +}; + +template +struct is_function_impl + : is_function_chooser< ::boost::is_reference::value > + ::template result_ +{ +}; + +#else + +template +struct is_function_impl +{ + static T* t; + BOOST_STATIC_CONSTANT( + bool, value = sizeof(::boost::type_traits::is_function_ptr_tester(t)) + == sizeof(::boost::type_traits::yes_type) + ); +}; + +#endif + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_function,T,::boost::detail::is_function_impl::value) + +} // namespace boost + +#include + +#endif // BOOST_TT_IS_FUNCTION_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/is_fundamental.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/is_fundamental.hpp new file mode 100644 index 0000000000..cfd21f8ddc --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/is_fundamental.hpp @@ -0,0 +1,42 @@ + +// (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_TT_IS_FUNDAMENTAL_HPP_INCLUDED +#define BOOST_TT_IS_FUNDAMENTAL_HPP_INCLUDED + +#include +#include +#include + +// should be the last #include +#include + +namespace boost { + +namespace detail { + +template +struct is_fundamental_impl + : ::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) +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_fundamental,T,::boost::detail::is_fundamental_impl::value) + +} // namespace boost + +#include + +#endif // BOOST_TT_IS_FUNDAMENTAL_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/is_integral.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/is_integral.hpp new file mode 100644 index 0000000000..2a2a329df6 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/is_integral.hpp @@ -0,0 +1,54 @@ + +// (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_TT_IS_INTEGRAL_HPP_INCLUDED +#define BOOST_TT_IS_INTEGRAL_HPP_INCLUDED + +#include + +// should be the last #include +#include + +namespace boost { + +//* is a type T an [cv-qualified-] integral type described in the standard (3.9.1p3) +// as an extention we include long long, as this is likely to be added to the +// standard at a later date +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_integral,T,false) + +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) + +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) + +#ifndef BOOST_NO_INTRINSIC_WCHAR_T +BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,wchar_t,true) +#endif + +# if defined(BOOST_HAS_LONG_LONG) +BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned long long,true) +BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,long long,true) +#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) +#endif + +} // namespace boost + +#include + +#endif // BOOST_TT_IS_INTEGRAL_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/is_member_function_pointer.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/is_member_function_pointer.hpp new file mode 100644 index 0000000000..ab9055a3c5 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/is_member_function_pointer.hpp @@ -0,0 +1,117 @@ + +// (C) Copyright Dave Abrahams, 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_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED +#define BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED + +#include + +#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(__BORLANDC__) +# include +#else +# include +# include +# include +# include +# include +# include +#endif + +// should be the last #include +#include + +namespace boost { + +#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(__BORLANDC__) + +BOOST_TT_AUX_BOOL_TRAIT_DEF1( + is_member_function_pointer + , T + , ::boost::type_traits::is_mem_fun_pointer_impl::value + ) + +#else + +#ifndef __BORLANDC__ + +namespace detail { + +template +struct is_member_function_pointer_select + : ::boost::type_traits::false_result +{ +}; + +template <> +struct is_member_function_pointer_select +{ + template struct result_ + { + static T& make_t; + typedef result_ self_type; + + BOOST_STATIC_CONSTANT( + bool, value = ( + 1 == sizeof(::boost::type_traits::is_mem_fun_pointer_tester(self_type::make_t)) + )); + }; +}; + +template +struct is_mem_fun_pointer_impl + : is_member_function_pointer_select< + ::boost::type_traits::ice_or< + ::boost::is_reference::value + , ::boost::is_array::value + >::value + >::template result_ +{ +}; + +} // namespace detail + +#else // Borland C++ + +namespace detail { + +template +struct is_mem_fun_pointer_impl +{ + static T& m_t; + BOOST_STATIC_CONSTANT( + bool, value = + (1 == sizeof(type_traits::is_mem_fun_pointer_tester(m_t))) ); +}; + +template +struct is_mem_fun_pointer_impl +{ + BOOST_STATIC_CONSTANT(bool, value = false); +}; + +} // namespace detail + +#endif + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_function_pointer,T,::boost::detail::is_mem_fun_pointer_impl::value) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_member_function_pointer,void,false) +#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_member_function_pointer,void const,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_member_function_pointer,void volatile,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_member_function_pointer,void const volatile,false) +#endif + +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +} // namespace boost + +#include + +#endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/is_member_pointer.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/is_member_pointer.hpp new file mode 100644 index 0000000000..13a0ce567e --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/is_member_pointer.hpp @@ -0,0 +1,96 @@ + +// (C) Copyright Dave Abrahams, 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_TT_IS_MEMBER_POINTER_HPP_INCLUDED +#define BOOST_TT_IS_MEMBER_POINTER_HPP_INCLUDED + +#include + +#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(__BORLANDC__) +# include +#else +# include +# include +# include +# include +# include +# include +#endif + +// should be the last #include +#include + +namespace boost { + +#if defined(__BORLANDC__) +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) + +#elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) +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) + +#else // no partial template specialization + +namespace detail { + +template +::boost::type_traits::yes_type BOOST_TT_DECL is_member_pointer_tester(R T::*); +::boost::type_traits::no_type BOOST_TT_DECL is_member_pointer_tester(...); + +template +struct is_member_pointer_select + : ::boost::type_traits::false_result +{ +}; + +template <> +struct is_member_pointer_select +{ + template struct result_ + { + static T& make_t(); + BOOST_STATIC_CONSTANT( + bool, value = + (::boost::type_traits::ice_or< + (1 == sizeof(::boost::type_traits::is_mem_fun_pointer_tester(make_t()))), + (1 == sizeof(is_member_pointer_tester(make_t()))) + >::value) ); + }; +}; + +template +struct is_member_pointer_impl + : is_member_pointer_select< + ::boost::type_traits::ice_or< + ::boost::is_reference::value + , ::boost::is_array::value + >::value + >::template result_ +{ +}; + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_pointer,T,::boost::detail::is_member_pointer_impl::value) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_member_pointer,void,false) +#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_member_pointer,void const,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_member_pointer,void volatile,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_member_pointer,void const volatile,false) +#endif + +#endif // __BORLANDC__ + +} // namespace boost + +#include + +#endif // BOOST_TT_IS_MEMBER_POINTER_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/is_object.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/is_object.hpp new file mode 100644 index 0000000000..15a07da3d9 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/is_object.hpp @@ -0,0 +1,54 @@ + +// (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_TT_IS_OBJECT_HPP_INCLUDED +#define BOOST_TT_IS_OBJECT_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include + +// should be the last #include +#include + +namespace boost { + +namespace detail { + +template +struct is_object_impl +{ +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + 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)); +#else + 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 + >::value)); +#endif +}; + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_object,T,::boost::detail::is_object_impl::value) + +} // namespace boost + +#include + +#endif // BOOST_TT_IS_OBJECT_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/is_pointer.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/is_pointer.hpp new file mode 100644 index 0000000000..ad33176da2 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/is_pointer.hpp @@ -0,0 +1,132 @@ + +// (C) Copyright Dave Abrahams, 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_TT_IS_POINTER_HPP_INCLUDED +#define BOOST_TT_IS_POINTER_HPP_INCLUDED + +#include +#include +#include +#include + +#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +# include +# include +# include +# include +# include +#endif + +// should be the last #include +#include + +namespace boost { + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +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) +TT_AUX_BOOL_TRAIT_HELPER_PARTIAL_SPEC(is_pointer_helper,T* const,true) +TT_AUX_BOOL_TRAIT_HELPER_PARTIAL_SPEC(is_pointer_helper,T* volatile,true) +TT_AUX_BOOL_TRAIT_HELPER_PARTIAL_SPEC(is_pointer_helper,T* const volatile,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::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) + +#else // no partial template specialization + +namespace detail { + +struct pointer_helper +{ + pointer_helper(const volatile void*); +}; + +yes_type BOOST_TT_DECL is_pointer_tester(pointer_helper); +no_type BOOST_TT_DECL is_pointer_tester(...); + +template +struct is_pointer_select + : ::boost::type_traits::false_result +{ +}; + +template <> +struct is_pointer_select +{ + template struct result_ + { + static T& make_t(); + BOOST_STATIC_CONSTANT(bool, value = + (::boost::type_traits::ice_or< + (1 == sizeof(is_pointer_tester(make_t()))), + (1 == sizeof(type_traits::is_function_ptr_tester(make_t()))) + >::value)); + }; +}; + +template +struct is_pointer_impl + : is_pointer_select< + ::boost::type_traits::ice_or< + ::boost::is_reference::value + , ::boost::is_array::value + >::value + >::template result_ +{ +}; + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_pointer,T,::boost::detail::is_pointer_impl::value) + +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_pointer,void,false) +#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_pointer,void const,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_pointer,void volatile,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_pointer,void const volatile,false) +#endif + +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +} // namespace boost + +#include + +#endif // BOOST_TT_IS_POINTER_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/is_reference.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/is_reference.hpp new file mode 100644 index 0000000000..675519adbe --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/is_reference.hpp @@ -0,0 +1,95 @@ + +// (C) Copyright David Abrahams Steve Cleary, Beman Dawes, Howard +// Hinnant & John Maddock 2000-2002. 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_TT_IS_REFERENCE_HPP_INCLUDED +#define BOOST_TT_IS_REFERENCE_HPP_INCLUDED + +#include + +#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +# include +# include +#endif + +#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && defined(BOOST_MSVC) +# include +# include +#endif + +// should be the last #include +#include + +namespace boost { + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_reference,T,false) +BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_reference,T&,true) + +#if defined(__BORLANDC__) +// 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_reference,T& const,true) +BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_reference,T& volatile,true) +BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_reference,T& const volatile,true) +#endif + +#else + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable: 4181) +#endif + +namespace detail { + +using ::boost::type_traits::yes_type; +using ::boost::type_traits::no_type; +using ::boost::type_traits::wrap; + +template T&(* is_reference_helper1(wrap) )(wrap); +char is_reference_helper1(...); + +template no_type is_reference_helper2(T&(*)(wrap)); +yes_type is_reference_helper2(...); + +template +struct is_reference_impl +{ + BOOST_STATIC_CONSTANT( + bool, value = sizeof( + ::boost::detail::is_reference_helper2( + ::boost::detail::is_reference_helper1(::boost::type_traits::wrap()))) == 1 + ); +}; + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_reference,T,::boost::detail::is_reference_impl::value) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_reference,void,false) +#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_reference,void const,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_reference,void volatile,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_reference,void const volatile,false) +#endif + +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +} // namespace boost + +#include + +#endif // BOOST_TT_IS_REFERENCE_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/is_same.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/is_same.hpp new file mode 100644 index 0000000000..72c1abb25b --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/is_same.hpp @@ -0,0 +1,81 @@ + +// (C) Copyright Steve Cleary, Beman Dawes, Aleksey Gurtovoy, +// 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_TT_IS_SAME_HPP_INCLUDED +#define BOOST_TT_IS_SAME_HPP_INCLUDED + +// should be the last #include +#include + +namespace boost { + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +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) + +#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +namespace detail { + +#ifdef BOOST_MSVC +// the following VC6 specific implementation is *NOT* legal +// C++, but has the advantage that it works for incomplete +// types. + +template< typename T1 > +struct is_same_part_1 +{ + template struct part_2 { enum { value = false }; }; + template<> struct part_2 { enum { value = true }; }; +}; + +template< typename T1, typename T2 > +struct is_same_impl +{ + enum { value = detail::is_same_part_1::template part_2::value }; +}; + +#else // generic "no-partial-specialization" version + +template +::boost::type_traits::yes_type +BOOST_TT_DECL is_same_tester(T*, T*); + +::boost::type_traits::no_type +BOOST_TT_DECL is_same_tester(...); + +template +struct is_same_impl +{ + static T t; + static U u; + + BOOST_STATIC_CONSTANT(bool, value = + (::boost::type_traits::ice_and< + (sizeof(type_traits::yes_type) == sizeof(detail::is_same_tester(&t,&u))), + (::boost::is_reference::value == ::boost::is_reference::value), + (sizeof(T) == sizeof(U)) + >::value)); +}; + +#endif // BOOST_MSVC + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF2(is_same,T,U,(::boost::detail::is_same_impl::value)) + +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +} // namespace boost + +#include + +#endif // BOOST_TT_IS_SAME_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/is_scalar.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/is_scalar.hpp new file mode 100644 index 0000000000..555a46269a --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/is_scalar.hpp @@ -0,0 +1,47 @@ + +// (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_TT_IS_SCALAR_HPP_INCLUDED +#define BOOST_TT_IS_SCALAR_HPP_INCLUDED + +#include +#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)); +}; + +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_scalar,T,::boost::detail::is_scalar_impl::value) + +} // namespace boost + +#include + +#endif // BOOST_TT_IS_SCALAR_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/is_stateless.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/is_stateless.hpp new file mode 100644 index 0000000000..5845a00247 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/is_stateless.hpp @@ -0,0 +1,49 @@ + +// (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_TT_IS_STATELESS_HPP_INCLUDED +#define BOOST_TT_IS_STATELESS_HPP_INCLUDED + +#include +#include +#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) + +} // namespace boost + +#include + +#endif // BOOST_TT_IS_STATELESS_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/is_union.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/is_union.hpp new file mode 100644 index 0000000000..7043e41808 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/is_union.hpp @@ -0,0 +1,36 @@ + +// (C) Copyright Dave Abrahams, 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_TT_IS_UNION_HPP_INCLUDED +#define BOOST_TT_IS_UNION_HPP_INCLUDED + +#include +#include + +// should be the last #include +#include + +namespace boost { + +namespace detail { +template struct is_union_impl +{ + typedef typename remove_cv::type cvt; + BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_UNION(cvt)); +}; +} // namespace detail + +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_union,T,::boost::detail::is_union_impl::value) + +} // namespace boost + +#include + +#endif // BOOST_TT_IS_UNION_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/is_void.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/is_void.hpp new file mode 100644 index 0000000000..e60247c007 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/is_void.hpp @@ -0,0 +1,34 @@ + +// (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_TT_IS_VOID_HPP_INCLUDED +#define BOOST_TT_IS_VOID_HPP_INCLUDED + +#include + +// should be the last #include +#include + +namespace boost { + +//* is a type T void - is_void +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_void,T,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_void,void,true) + +#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 + +} // namespace boost + +#include + +#endif // BOOST_TT_IS_VOID_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/is_volatile.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/is_volatile.hpp new file mode 100644 index 0000000000..c573caabdb --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/is_volatile.hpp @@ -0,0 +1,112 @@ + +// (C) Copyright Dave Abrahams, 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_TT_IS_VOLATILE_HPP_INCLUDED +#define BOOST_TT_IS_VOLATILE_HPP_INCLUDED + +#include + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +# include +#else +# include +# include +# include +# include +#endif + +// should be the last #include +#include + +namespace boost { + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +//* is a type T declared volatile - is_volatile +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_volatile,T,::boost::detail::cv_traits_imp::is_volatile) +BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_volatile,T&,false) + +#if defined(__BORLANDC__) +// 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 + +#else + +namespace detail { + +using ::boost::type_traits::yes_type; +using ::boost::type_traits::no_type; + +yes_type is_volatile_tester(void const volatile*); +no_type is_volatile_tester(void const*); + +template +struct is_volatile_helper + : ::boost::type_traits::false_result +{ +}; + +template <> +struct is_volatile_helper +{ + template struct result_ + { + static T* t; + BOOST_STATIC_CONSTANT(bool, value = ( + sizeof(detail::yes_type) == sizeof(detail::is_volatile_tester(t)) + )); + }; +}; + +template <> +struct is_volatile_helper +{ + template struct result_ + { + static T t; + BOOST_STATIC_CONSTANT(bool, value = ( + sizeof(detail::yes_type) == sizeof(detail::is_volatile_tester(&t)) + )); + }; +}; + +template +struct is_volatile_impl + : is_volatile_helper< + is_reference::value + , is_array::value + >::template result_ +{ +}; + +} // namespace detail + +//* is a type T declared volatile - is_volatile +BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_volatile,T,::boost::detail::is_volatile_impl::value) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_volatile,void,false) +#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_volatile,void const,false) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_volatile,void volatile,true) +BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_volatile,void const volatile,true) +#endif + +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +} // namespace boost + +#include + +#endif // BOOST_TT_IS_VOLATILE_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/remove_bounds.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/remove_bounds.hpp new file mode 100644 index 0000000000..aa42381c4a --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/remove_bounds.hpp @@ -0,0 +1,34 @@ + +// (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_TT_REMOVE_BOUNDS_HPP_INCLUDED +#define BOOST_TT_REMOVE_BOUNDS_HPP_INCLUDED + +#include +#include + +// should be the last #include +#include + +namespace boost { + +BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_bounds,T,T) + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +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) +#endif + +} // namespace boost + +#include + +#endif // BOOST_TT_REMOVE_BOUNDS_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/remove_const.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/remove_const.hpp new file mode 100644 index 0000000000..339f25bc79 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/remove_const.hpp @@ -0,0 +1,71 @@ + +// (C) Copyright Dave Abrahams, 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_TT_REMOVE_CONST_HPP_INCLUDED +#define BOOST_TT_REMOVE_CONST_HPP_INCLUDED + +#include +#include +#include +#include + +#include + +// should be the last #include +#include + +namespace boost { + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +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; +}; + +} // namespace detail + +// * convert a type T to non-const type - remove_const + +BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_const,T,typename detail::remove_const_impl::type) +BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_const,T&,T&) +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]) + +#else + +BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_const,T,T) + +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +} // namespace boost + +#include + +#endif // BOOST_TT_REMOVE_CONST_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/remove_cv.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/remove_cv.hpp new file mode 100644 index 0000000000..50483e4836 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/remove_cv.hpp @@ -0,0 +1,45 @@ + +// (C) Copyright Dave Abrahams, 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_TT_REMOVE_CV_HPP_INCLUDED +#define BOOST_TT_REMOVE_CV_HPP_INCLUDED + +#include +#include +#include + +#include + +// should be the last #include +#include + +namespace boost { + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +// convert a type T to a non-cv-qualified type - remove_cv +BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_cv,T,typename detail::cv_traits_imp::unqualified_type) +BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_cv,T&,T&) +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]) + +#else + +// doesn't work +BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_cv,T,T) + +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +} // namespace boost + +#include + +#endif // BOOST_TT_REMOVE_CV_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/remove_pointer.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/remove_pointer.hpp new file mode 100644 index 0000000000..513bdcd23c --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/remove_pointer.hpp @@ -0,0 +1,34 @@ + +// (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_TT_REMOVE_POINTER_HPP_INCLUDED +#define BOOST_TT_REMOVE_POINTER_HPP_INCLUDED + +#include +#include + +// should be the last #include +#include + +namespace boost { + +BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_pointer,T,T) + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +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) +#endif + +} // namespace boost + +#include + +#endif // BOOST_TT_REMOVE_POINTER_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/remove_reference.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/remove_reference.hpp new file mode 100644 index 0000000000..b395cc3d9c --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/remove_reference.hpp @@ -0,0 +1,42 @@ + +// (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_TT_REMOVE_REFERENCE_HPP_INCLUDED +#define BOOST_TT_REMOVE_REFERENCE_HPP_INCLUDED + +#include +#include + +// should be the last #include +#include + +namespace boost { + +BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_reference,T,T) + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_reference,T&,T) + +#if defined(__BORLANDC__) +// 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) +#endif + +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +} // namespace boost + +#include + +#endif // BOOST_TT_REMOVE_REFERENCE_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/remove_volatile.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/remove_volatile.hpp new file mode 100644 index 0000000000..5316c6b7d3 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/remove_volatile.hpp @@ -0,0 +1,71 @@ + +// (C) Copyright Dave Abrahams, 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_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 { + +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +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; +}; + +} // namespace detail + +// * convert a type T to a non-volatile type - remove_volatile + +BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_volatile,T,typename detail::remove_volatile_impl::type) +BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_volatile,T&,T&) +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]) + +#else + +// doesn't work +BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_volatile,T,T) + +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +} // namespace boost + +#include + +#endif // BOOST_TT_REMOVE_VOLATILE_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/type_traits/type_with_alignment.hpp b/deal.II/contrib/boost/include/boost_local/type_traits/type_with_alignment.hpp new file mode 100644 index 0000000000..595d914bd6 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/type_traits/type_with_alignment.hpp @@ -0,0 +1,106 @@ + +// (C) Copyright 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. + +#ifndef BOOST_TT_TYPE_WITH_ALIGNMENT_INCLUDED +#define BOOST_TT_TYPE_WITH_ALIGNMENT_INCLUDED + +#include +#include +#include +#include +#include +#include +#include + +#include + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable: 4121) // alignment is sensitive to packing +#endif + +namespace boost { + +namespace detail { + +class alignment_dummy; +typedef void (*function_ptr)(); +typedef int (alignment_dummy::*member_ptr); +typedef int (alignment_dummy::*member_function_ptr)(); + +#define BOOST_TT_ALIGNMENT_TYPES BOOST_PP_TUPLE_TO_LIST( \ + 11, ( \ + char, short, int, long, float, double, long double \ + , void*, function_ptr, member_ptr, member_function_ptr)) + +#define BOOST_TT_CHOOSE_MIN_ALIGNMENT(R,P,I,T) \ + typename mpl::if_c< \ + alignment_of::value <= target, T, char>::type BOOST_PP_CAT(t,I); + +#define BOOST_TT_CHOOSE_T(R,P,I,T) T BOOST_PP_CAT(t,I); + +template +union lower_alignment +{ + 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_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 + +// This alignment method originally due to Brian Parker, implemented by David +// Abrahams, and then ported here by Doug Gregor. +template +class type_with_alignment +{ + typedef detail::lower_alignment t1; + typedef typename mpl::if_c< + ::boost::detail::is_aligned< ::boost::alignment_of::value,Align >::value + , t1 + , 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; +}; + +} // namespace boost + +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + +#endif // BOOST_TT_TYPE_WITH_ALIGNMENT_INCLUDED diff --git a/deal.II/contrib/boost/include/boost_local/utility/addressof.hpp b/deal.II/contrib/boost/include/boost_local/utility/addressof.hpp new file mode 100644 index 0000000000..a434b8e7d6 --- /dev/null +++ b/deal.II/contrib/boost/include/boost_local/utility/addressof.hpp @@ -0,0 +1,31 @@ +// Copyright (C) 2002 Brad King (brad.king@kitware.com) +// Doug Gregor (gregod@cs.rpi.edu) +// Peter Dimov +// +// Permission to copy, use, sell and distribute this software is granted +// provided this copyright notice appears in all copies. +// Permission to modify the code and to distribute modified code is granted +// provided this copyright notice appears in all copies, and a notice +// that the code was modified is included with the copyright notice. +// +// This software is provided "as is" without express or implied warranty, +// and with no claim as to its suitability for any purpose. + +// For more information, see http://www.boost.org + +#ifndef BOOST_UTILITY_ADDRESSOF_HPP +#define BOOST_UTILITY_ADDRESSOF_HPP + +namespace boost { + +// Do not make addressof() inline. Breaks MSVC 7. (Peter Dimov) + +template T* addressof(T& v) +{ + return reinterpret_cast( + &const_cast(reinterpret_cast(v))); +} + +} + +#endif // BOOST_UTILITY_ADDRESSOF_HPP