From: bangerth Date: Tue, 13 Jan 2009 14:13:48 +0000 (+0000) Subject: Detect whether compiler supports C++0x and if so enable it through the compatibility... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=239bbfd947f7d74185ab0588860b8ffd71030e4f;p=dealii-svn.git Detect whether compiler supports C++0x and if so enable it through the compatibility header files. git-svn-id: https://svn.dealii.org/trunk@18206 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/aclocal.m4 b/deal.II/aclocal.m4 index 6b0114f363..1bbf090ed0 100644 --- a/deal.II/aclocal.m4 +++ b/deal.II/aclocal.m4 @@ -489,6 +489,26 @@ AC_DEFUN(DEAL_II_SET_CXX_FLAGS, dnl dnl BOOST uses long long, so don't warn about this CXXFLAGSG="$CXXFLAGSG -Wno-long-long" + dnl See whether the gcc we use already supports C++0x features. + dnl + OLD_CXXFLAGS="$CXXFLAGS" + CXXFLAGS=-std=c++0x + + AC_MSG_CHECKING(whether compiler supports C++0x) + AC_TRY_COMPILE([], [;], + [ + AC_MSG_RESULT(yes) + CXXFLAGSG="$CXXFLAGSG -std=c++0x" + CXXFLAGSO="$CXXFLAGSO -std=c++0x" + AC_DEFINE(DEAL_II_CAN_USE_CXX0X, 1, + [Defined if the compiler we use supports the upcoming C++0x standard.]) + ], + [ + AC_MSG_RESULT(no) + ]) + CXXFLAGS="${OLD_CXXFLAGS}" + + dnl On some gcc 4.3 snapshots, a 'const' qualifier on a return type triggers a dnl warning. This is unfortunate, since we happen to stumble on this dnl in some of our template trickery with iterator classes. If necessary, diff --git a/deal.II/base/include/base/config.h.in b/deal.II/base/include/base/config.h.in index 6f1354ec43..816a099780 100644 --- a/deal.II/base/include/base/config.h.in +++ b/deal.II/base/include/base/config.h.in @@ -65,6 +65,9 @@ floating point computations on cygwin systems. */ #undef DEAL_II_BROKEN_SOCKETS +/* Defined if the compiler we use supports the upcoming C++0x standard. */ +#undef DEAL_II_CAN_USE_CXX0X + /* Backward compatibility support for functions and classes that do not take an explicit mapping variable, but rather use a default Q1 mapping instead */ diff --git a/deal.II/base/include/base/std_cxx0x/array.h b/deal.II/base/include/base/std_cxx0x/array.h index 925aae66d1..6a85658473 100644 --- a/deal.II/base/include/base/std_cxx0x/array.h +++ b/deal.II/base/include/base/std_cxx0x/array.h @@ -15,17 +15,22 @@ #include -#include +#ifdef DEAL_II_CAN_USE_CXX0X -DEAL_II_NAMESPACE_OPEN +# include + +#else + +#include +DEAL_II_NAMESPACE_OPEN namespace std_cxx0x { using boost::array; } - - DEAL_II_NAMESPACE_CLOSE #endif + +#endif diff --git a/deal.II/base/include/base/std_cxx0x/bind.h b/deal.II/base/include/base/std_cxx0x/bind.h index baf313a724..d866ec9610 100644 --- a/deal.II/base/include/base/std_cxx0x/bind.h +++ b/deal.II/base/include/base/std_cxx0x/bind.h @@ -15,11 +15,23 @@ #include -#include +#ifdef DEAL_II_CAN_USE_CXX0X + +# include DEAL_II_NAMESPACE_OPEN +// in boost, the placeholders _1, _2, ... are in the global namespace. in +// C++0x, they are in namespace std::placeholders, which makes them awkward to +// use. import them into the deal.II namespace +using namespace std::placeholders; +DEAL_II_NAMESPACE_CLOSE + +#else + +#include +DEAL_II_NAMESPACE_OPEN namespace std_cxx0x { using boost::bind; @@ -27,8 +39,8 @@ namespace std_cxx0x using boost::cref; using boost::reference_wrapper; } - - DEAL_II_NAMESPACE_CLOSE #endif + +#endif diff --git a/deal.II/base/include/base/std_cxx0x/function.h b/deal.II/base/include/base/std_cxx0x/function.h index e17704a4b1..39e7aec27d 100644 --- a/deal.II/base/include/base/std_cxx0x/function.h +++ b/deal.II/base/include/base/std_cxx0x/function.h @@ -15,17 +15,22 @@ #include -#include +#ifdef DEAL_II_CAN_USE_CXX0X -DEAL_II_NAMESPACE_OPEN +# include + +#else + +#include +DEAL_II_NAMESPACE_OPEN namespace std_cxx0x { using boost::function; } - - DEAL_II_NAMESPACE_CLOSE #endif + +#endif diff --git a/deal.II/base/include/base/std_cxx0x/shared_ptr.h b/deal.II/base/include/base/std_cxx0x/shared_ptr.h index 0c5e032f83..69238ae88b 100644 --- a/deal.II/base/include/base/std_cxx0x/shared_ptr.h +++ b/deal.II/base/include/base/std_cxx0x/shared_ptr.h @@ -15,17 +15,22 @@ #include -#include +#ifdef DEAL_II_CAN_USE_CXX0X -DEAL_II_NAMESPACE_OPEN +# include + +#else + +#include +DEAL_II_NAMESPACE_OPEN namespace std_cxx0x { using boost::shared_ptr; } - - DEAL_II_NAMESPACE_CLOSE #endif + +#endif diff --git a/deal.II/base/include/base/std_cxx0x/tuple.h b/deal.II/base/include/base/std_cxx0x/tuple.h index 86ecd219ec..5fa0e0808e 100644 --- a/deal.II/base/include/base/std_cxx0x/tuple.h +++ b/deal.II/base/include/base/std_cxx0x/tuple.h @@ -15,23 +15,40 @@ #include -#include +#ifdef DEAL_II_CAN_USE_CXX0X -DEAL_II_NAMESPACE_OPEN +# include + +#else +#include + +DEAL_II_NAMESPACE_OPEN namespace std_cxx0x { using boost::tuple; using boost::get; - - namespace tuples + + // boost::tuples::length has been renamed + // by the standard to std::tuple_size + template + struct tuple_size + { + static const std::size_t value = boost::tuples::length::value; + }; + + // similarly, boost::tuples::element has + // been renamed by the standard to + // std::tuple_element + template + struct tuple_element { - using namespace boost::tuples; - } + typedef boost::tuples::element type; + }; } - - DEAL_II_NAMESPACE_CLOSE #endif + +#endif diff --git a/deal.II/base/include/base/thread_management.h b/deal.II/base/include/base/thread_management.h index f1696b0a13..0a912d50e1 100644 --- a/deal.II/base/include/base/thread_management.h +++ b/deal.II/base/include/base/thread_management.h @@ -953,7 +953,7 @@ namespace Threads * for each number of arguments. */ template ::value> + int length = std_cxx0x::tuple_size::value> struct fun_ptr_helper; @@ -981,7 +981,7 @@ namespace Threads template struct fun_ptr_helper { - typedef RT (type) (typename std_cxx0x::tuples::element<0,ArgList>::type); + typedef RT (type) (typename std_cxx0x::tuple_element<0,ArgList>::type); }; @@ -995,8 +995,8 @@ namespace Threads template struct fun_ptr_helper { - typedef RT (type) (typename std_cxx0x::tuples::element<0,ArgList>::type, - typename std_cxx0x::tuples::element<1,ArgList>::type); + typedef RT (type) (typename std_cxx0x::tuple_element<0,ArgList>::type, + typename std_cxx0x::tuple_element<1,ArgList>::type); }; @@ -1010,9 +1010,9 @@ namespace Threads template struct fun_ptr_helper { - typedef RT (type) (typename std_cxx0x::tuples::element<0,ArgList>::type, - typename std_cxx0x::tuples::element<1,ArgList>::type, - typename std_cxx0x::tuples::element<2,ArgList>::type); + typedef RT (type) (typename std_cxx0x::tuple_element<0,ArgList>::type, + typename std_cxx0x::tuple_element<1,ArgList>::type, + typename std_cxx0x::tuple_element<2,ArgList>::type); }; @@ -1026,10 +1026,10 @@ namespace Threads template struct fun_ptr_helper { - typedef RT (type) (typename std_cxx0x::tuples::element<0,ArgList>::type, - typename std_cxx0x::tuples::element<1,ArgList>::type, - typename std_cxx0x::tuples::element<2,ArgList>::type, - typename std_cxx0x::tuples::element<3,ArgList>::type); + typedef RT (type) (typename std_cxx0x::tuple_element<0,ArgList>::type, + typename std_cxx0x::tuple_element<1,ArgList>::type, + typename std_cxx0x::tuple_element<2,ArgList>::type, + typename std_cxx0x::tuple_element<3,ArgList>::type); }; @@ -1043,11 +1043,11 @@ namespace Threads template struct fun_ptr_helper { - typedef RT (type) (typename std_cxx0x::tuples::element<0,ArgList>::type, - typename std_cxx0x::tuples::element<1,ArgList>::type, - typename std_cxx0x::tuples::element<2,ArgList>::type, - typename std_cxx0x::tuples::element<3,ArgList>::type, - typename std_cxx0x::tuples::element<4,ArgList>::type); + typedef RT (type) (typename std_cxx0x::tuple_element<0,ArgList>::type, + typename std_cxx0x::tuple_element<1,ArgList>::type, + typename std_cxx0x::tuple_element<2,ArgList>::type, + typename std_cxx0x::tuple_element<3,ArgList>::type, + typename std_cxx0x::tuple_element<4,ArgList>::type); }; @@ -1061,12 +1061,12 @@ namespace Threads template struct fun_ptr_helper { - typedef RT (type) (typename std_cxx0x::tuples::element<0,ArgList>::type, - typename std_cxx0x::tuples::element<1,ArgList>::type, - typename std_cxx0x::tuples::element<2,ArgList>::type, - typename std_cxx0x::tuples::element<3,ArgList>::type, - typename std_cxx0x::tuples::element<4,ArgList>::type, - typename std_cxx0x::tuples::element<5,ArgList>::type); + typedef RT (type) (typename std_cxx0x::tuple_element<0,ArgList>::type, + typename std_cxx0x::tuple_element<1,ArgList>::type, + typename std_cxx0x::tuple_element<2,ArgList>::type, + typename std_cxx0x::tuple_element<3,ArgList>::type, + typename std_cxx0x::tuple_element<4,ArgList>::type, + typename std_cxx0x::tuple_element<5,ArgList>::type); }; @@ -1080,13 +1080,13 @@ namespace Threads template struct fun_ptr_helper { - typedef RT (type) (typename std_cxx0x::tuples::element<0,ArgList>::type, - typename std_cxx0x::tuples::element<1,ArgList>::type, - typename std_cxx0x::tuples::element<2,ArgList>::type, - typename std_cxx0x::tuples::element<3,ArgList>::type, - typename std_cxx0x::tuples::element<4,ArgList>::type, - typename std_cxx0x::tuples::element<5,ArgList>::type, - typename std_cxx0x::tuples::element<6,ArgList>::type); + typedef RT (type) (typename std_cxx0x::tuple_element<0,ArgList>::type, + typename std_cxx0x::tuple_element<1,ArgList>::type, + typename std_cxx0x::tuple_element<2,ArgList>::type, + typename std_cxx0x::tuple_element<3,ArgList>::type, + typename std_cxx0x::tuple_element<4,ArgList>::type, + typename std_cxx0x::tuple_element<5,ArgList>::type, + typename std_cxx0x::tuple_element<6,ArgList>::type); }; @@ -1100,14 +1100,14 @@ namespace Threads template struct fun_ptr_helper { - typedef RT (type) (typename std_cxx0x::tuples::element<0,ArgList>::type, - typename std_cxx0x::tuples::element<1,ArgList>::type, - typename std_cxx0x::tuples::element<2,ArgList>::type, - typename std_cxx0x::tuples::element<3,ArgList>::type, - typename std_cxx0x::tuples::element<4,ArgList>::type, - typename std_cxx0x::tuples::element<5,ArgList>::type, - typename std_cxx0x::tuples::element<6,ArgList>::type, - typename std_cxx0x::tuples::element<7,ArgList>::type); + typedef RT (type) (typename std_cxx0x::tuple_element<0,ArgList>::type, + typename std_cxx0x::tuple_element<1,ArgList>::type, + typename std_cxx0x::tuple_element<2,ArgList>::type, + typename std_cxx0x::tuple_element<3,ArgList>::type, + typename std_cxx0x::tuple_element<4,ArgList>::type, + typename std_cxx0x::tuple_element<5,ArgList>::type, + typename std_cxx0x::tuple_element<6,ArgList>::type, + typename std_cxx0x::tuple_element<7,ArgList>::type); }; @@ -1121,15 +1121,15 @@ namespace Threads template struct fun_ptr_helper { - typedef RT (type) (typename std_cxx0x::tuples::element<0,ArgList>::type, - typename std_cxx0x::tuples::element<1,ArgList>::type, - typename std_cxx0x::tuples::element<2,ArgList>::type, - typename std_cxx0x::tuples::element<3,ArgList>::type, - typename std_cxx0x::tuples::element<4,ArgList>::type, - typename std_cxx0x::tuples::element<5,ArgList>::type, - typename std_cxx0x::tuples::element<6,ArgList>::type, - typename std_cxx0x::tuples::element<7,ArgList>::type, - typename std_cxx0x::tuples::element<8,ArgList>::type); + typedef RT (type) (typename std_cxx0x::tuple_element<0,ArgList>::type, + typename std_cxx0x::tuple_element<1,ArgList>::type, + typename std_cxx0x::tuple_element<2,ArgList>::type, + typename std_cxx0x::tuple_element<3,ArgList>::type, + typename std_cxx0x::tuple_element<4,ArgList>::type, + typename std_cxx0x::tuple_element<5,ArgList>::type, + typename std_cxx0x::tuple_element<6,ArgList>::type, + typename std_cxx0x::tuple_element<7,ArgList>::type, + typename std_cxx0x::tuple_element<8,ArgList>::type); }; @@ -1144,16 +1144,16 @@ namespace Threads template struct fun_ptr_helper { - typedef RT (type) (typename std_cxx0x::tuples::element<0,ArgList>::type, - typename std_cxx0x::tuples::element<1,ArgList>::type, - typename std_cxx0x::tuples::element<2,ArgList>::type, - typename std_cxx0x::tuples::element<3,ArgList>::type, - typename std_cxx0x::tuples::element<4,ArgList>::type, - typename std_cxx0x::tuples::element<5,ArgList>::type, - typename std_cxx0x::tuples::element<6,ArgList>::type, - typename std_cxx0x::tuples::element<7,ArgList>::type, - typename std_cxx0x::tuples::element<8,ArgList>::type, - typename std_cxx0x::tuples::element<9,ArgList>::type); + typedef RT (type) (typename std_cxx0x::tuple_element<0,ArgList>::type, + typename std_cxx0x::tuple_element<1,ArgList>::type, + typename std_cxx0x::tuple_element<2,ArgList>::type, + typename std_cxx0x::tuple_element<3,ArgList>::type, + typename std_cxx0x::tuple_element<4,ArgList>::type, + typename std_cxx0x::tuple_element<5,ArgList>::type, + typename std_cxx0x::tuple_element<6,ArgList>::type, + typename std_cxx0x::tuple_element<7,ArgList>::type, + typename std_cxx0x::tuple_element<8,ArgList>::type, + typename std_cxx0x::tuple_element<9,ArgList>::type); }; @@ -1777,12 +1777,12 @@ namespace Threads inline Thread - operator() (typename std_cxx0x::tuples::element<0,ArgList>::type arg1) + operator() (typename std_cxx0x::tuple_element<0,ArgList>::type arg1) { return ThreadStarter::start_thread (std_cxx0x::bind (function, - internal::maybe_make_ref::type>::act(arg1))); + internal::maybe_make_ref::type>::act(arg1))); } private: @@ -1808,14 +1808,14 @@ namespace Threads inline Thread - operator() (typename std_cxx0x::tuples::element<0,ArgList>::type arg1, - typename std_cxx0x::tuples::element<1,ArgList>::type arg2) + operator() (typename std_cxx0x::tuple_element<0,ArgList>::type arg1, + typename std_cxx0x::tuple_element<1,ArgList>::type arg2) { return ThreadStarter::start_thread (std_cxx0x::bind (function, - internal::maybe_make_ref::type>::act(arg1), - internal::maybe_make_ref::type>::act(arg2))); + internal::maybe_make_ref::type>::act(arg1), + internal::maybe_make_ref::type>::act(arg2))); } private: @@ -1841,16 +1841,16 @@ namespace Threads inline Thread - operator() (typename std_cxx0x::tuples::element<0,ArgList>::type arg1, - typename std_cxx0x::tuples::element<1,ArgList>::type arg2, - typename std_cxx0x::tuples::element<2,ArgList>::type arg3) + operator() (typename std_cxx0x::tuple_element<0,ArgList>::type arg1, + typename std_cxx0x::tuple_element<1,ArgList>::type arg2, + typename std_cxx0x::tuple_element<2,ArgList>::type arg3) { return ThreadStarter::start_thread (std_cxx0x::bind (function, - internal::maybe_make_ref::type>::act(arg1), - internal::maybe_make_ref::type>::act(arg2), - internal::maybe_make_ref::type>::act(arg3))); + internal::maybe_make_ref::type>::act(arg1), + internal::maybe_make_ref::type>::act(arg2), + internal::maybe_make_ref::type>::act(arg3))); } private: @@ -1876,18 +1876,18 @@ namespace Threads inline Thread - operator() (typename std_cxx0x::tuples::element<0,ArgList>::type arg1, - typename std_cxx0x::tuples::element<1,ArgList>::type arg2, - typename std_cxx0x::tuples::element<2,ArgList>::type arg3, - typename std_cxx0x::tuples::element<3,ArgList>::type arg4) + operator() (typename std_cxx0x::tuple_element<0,ArgList>::type arg1, + typename std_cxx0x::tuple_element<1,ArgList>::type arg2, + typename std_cxx0x::tuple_element<2,ArgList>::type arg3, + typename std_cxx0x::tuple_element<3,ArgList>::type arg4) { return ThreadStarter::start_thread (std_cxx0x::bind (function, - internal::maybe_make_ref::type>::act(arg1), - internal::maybe_make_ref::type>::act(arg2), - internal::maybe_make_ref::type>::act(arg3), - internal::maybe_make_ref::type>::act(arg4))); + internal::maybe_make_ref::type>::act(arg1), + internal::maybe_make_ref::type>::act(arg2), + internal::maybe_make_ref::type>::act(arg3), + internal::maybe_make_ref::type>::act(arg4))); } private: @@ -1913,20 +1913,20 @@ namespace Threads inline Thread - operator() (typename std_cxx0x::tuples::element<0,ArgList>::type arg1, - typename std_cxx0x::tuples::element<1,ArgList>::type arg2, - typename std_cxx0x::tuples::element<2,ArgList>::type arg3, - typename std_cxx0x::tuples::element<3,ArgList>::type arg4, - typename std_cxx0x::tuples::element<4,ArgList>::type arg5) + operator() (typename std_cxx0x::tuple_element<0,ArgList>::type arg1, + typename std_cxx0x::tuple_element<1,ArgList>::type arg2, + typename std_cxx0x::tuple_element<2,ArgList>::type arg3, + typename std_cxx0x::tuple_element<3,ArgList>::type arg4, + typename std_cxx0x::tuple_element<4,ArgList>::type arg5) { return ThreadStarter::start_thread (std_cxx0x::bind (function, - internal::maybe_make_ref::type>::act(arg1), - internal::maybe_make_ref::type>::act(arg2), - internal::maybe_make_ref::type>::act(arg3), - internal::maybe_make_ref::type>::act(arg4), - internal::maybe_make_ref::type>::act(arg5))); + internal::maybe_make_ref::type>::act(arg1), + internal::maybe_make_ref::type>::act(arg2), + internal::maybe_make_ref::type>::act(arg3), + internal::maybe_make_ref::type>::act(arg4), + internal::maybe_make_ref::type>::act(arg5))); } private: @@ -1952,22 +1952,22 @@ namespace Threads inline Thread - operator() (typename std_cxx0x::tuples::element<0,ArgList>::type arg1, - typename std_cxx0x::tuples::element<1,ArgList>::type arg2, - typename std_cxx0x::tuples::element<2,ArgList>::type arg3, - typename std_cxx0x::tuples::element<3,ArgList>::type arg4, - typename std_cxx0x::tuples::element<4,ArgList>::type arg5, - typename std_cxx0x::tuples::element<5,ArgList>::type arg6) + operator() (typename std_cxx0x::tuple_element<0,ArgList>::type arg1, + typename std_cxx0x::tuple_element<1,ArgList>::type arg2, + typename std_cxx0x::tuple_element<2,ArgList>::type arg3, + typename std_cxx0x::tuple_element<3,ArgList>::type arg4, + typename std_cxx0x::tuple_element<4,ArgList>::type arg5, + typename std_cxx0x::tuple_element<5,ArgList>::type arg6) { return ThreadStarter::start_thread (std_cxx0x::bind (function, - internal::maybe_make_ref::type>::act(arg1), - internal::maybe_make_ref::type>::act(arg2), - internal::maybe_make_ref::type>::act(arg3), - internal::maybe_make_ref::type>::act(arg4), - internal::maybe_make_ref::type>::act(arg5), - internal::maybe_make_ref::type>::act(arg6))); + internal::maybe_make_ref::type>::act(arg1), + internal::maybe_make_ref::type>::act(arg2), + internal::maybe_make_ref::type>::act(arg3), + internal::maybe_make_ref::type>::act(arg4), + internal::maybe_make_ref::type>::act(arg5), + internal::maybe_make_ref::type>::act(arg6))); } private: @@ -1993,24 +1993,24 @@ namespace Threads inline Thread - operator() (typename std_cxx0x::tuples::element<0,ArgList>::type arg1, - typename std_cxx0x::tuples::element<1,ArgList>::type arg2, - typename std_cxx0x::tuples::element<2,ArgList>::type arg3, - typename std_cxx0x::tuples::element<3,ArgList>::type arg4, - typename std_cxx0x::tuples::element<4,ArgList>::type arg5, - typename std_cxx0x::tuples::element<5,ArgList>::type arg6, - typename std_cxx0x::tuples::element<6,ArgList>::type arg7) + operator() (typename std_cxx0x::tuple_element<0,ArgList>::type arg1, + typename std_cxx0x::tuple_element<1,ArgList>::type arg2, + typename std_cxx0x::tuple_element<2,ArgList>::type arg3, + typename std_cxx0x::tuple_element<3,ArgList>::type arg4, + typename std_cxx0x::tuple_element<4,ArgList>::type arg5, + typename std_cxx0x::tuple_element<5,ArgList>::type arg6, + typename std_cxx0x::tuple_element<6,ArgList>::type arg7) { return ThreadStarter::start_thread (std_cxx0x::bind (function, - internal::maybe_make_ref::type>::act(arg1), - internal::maybe_make_ref::type>::act(arg2), - internal::maybe_make_ref::type>::act(arg3), - internal::maybe_make_ref::type>::act(arg4), - internal::maybe_make_ref::type>::act(arg5), - internal::maybe_make_ref::type>::act(arg6), - internal::maybe_make_ref::type>::act(arg7))); + internal::maybe_make_ref::type>::act(arg1), + internal::maybe_make_ref::type>::act(arg2), + internal::maybe_make_ref::type>::act(arg3), + internal::maybe_make_ref::type>::act(arg4), + internal::maybe_make_ref::type>::act(arg5), + internal::maybe_make_ref::type>::act(arg6), + internal::maybe_make_ref::type>::act(arg7))); } private: @@ -2036,26 +2036,26 @@ namespace Threads inline Thread - operator() (typename std_cxx0x::tuples::element<0,ArgList>::type arg1, - typename std_cxx0x::tuples::element<1,ArgList>::type arg2, - typename std_cxx0x::tuples::element<2,ArgList>::type arg3, - typename std_cxx0x::tuples::element<3,ArgList>::type arg4, - typename std_cxx0x::tuples::element<4,ArgList>::type arg5, - typename std_cxx0x::tuples::element<5,ArgList>::type arg6, - typename std_cxx0x::tuples::element<6,ArgList>::type arg7, - typename std_cxx0x::tuples::element<7,ArgList>::type arg8) + operator() (typename std_cxx0x::tuple_element<0,ArgList>::type arg1, + typename std_cxx0x::tuple_element<1,ArgList>::type arg2, + typename std_cxx0x::tuple_element<2,ArgList>::type arg3, + typename std_cxx0x::tuple_element<3,ArgList>::type arg4, + typename std_cxx0x::tuple_element<4,ArgList>::type arg5, + typename std_cxx0x::tuple_element<5,ArgList>::type arg6, + typename std_cxx0x::tuple_element<6,ArgList>::type arg7, + typename std_cxx0x::tuple_element<7,ArgList>::type arg8) { return ThreadStarter::start_thread (std_cxx0x::bind (function, - internal::maybe_make_ref::type>::act(arg1), - internal::maybe_make_ref::type>::act(arg2), - internal::maybe_make_ref::type>::act(arg3), - internal::maybe_make_ref::type>::act(arg4), - internal::maybe_make_ref::type>::act(arg5), - internal::maybe_make_ref::type>::act(arg6), - internal::maybe_make_ref::type>::act(arg7), - internal::maybe_make_ref::type>::act(arg8))); + internal::maybe_make_ref::type>::act(arg1), + internal::maybe_make_ref::type>::act(arg2), + internal::maybe_make_ref::type>::act(arg3), + internal::maybe_make_ref::type>::act(arg4), + internal::maybe_make_ref::type>::act(arg5), + internal::maybe_make_ref::type>::act(arg6), + internal::maybe_make_ref::type>::act(arg7), + internal::maybe_make_ref::type>::act(arg8))); } private: @@ -2081,28 +2081,28 @@ namespace Threads inline Thread - operator() (typename std_cxx0x::tuples::element<0,ArgList>::type arg1, - typename std_cxx0x::tuples::element<1,ArgList>::type arg2, - typename std_cxx0x::tuples::element<2,ArgList>::type arg3, - typename std_cxx0x::tuples::element<3,ArgList>::type arg4, - typename std_cxx0x::tuples::element<4,ArgList>::type arg5, - typename std_cxx0x::tuples::element<5,ArgList>::type arg6, - typename std_cxx0x::tuples::element<6,ArgList>::type arg7, - typename std_cxx0x::tuples::element<7,ArgList>::type arg8, - typename std_cxx0x::tuples::element<8,ArgList>::type arg9) + operator() (typename std_cxx0x::tuple_element<0,ArgList>::type arg1, + typename std_cxx0x::tuple_element<1,ArgList>::type arg2, + typename std_cxx0x::tuple_element<2,ArgList>::type arg3, + typename std_cxx0x::tuple_element<3,ArgList>::type arg4, + typename std_cxx0x::tuple_element<4,ArgList>::type arg5, + typename std_cxx0x::tuple_element<5,ArgList>::type arg6, + typename std_cxx0x::tuple_element<6,ArgList>::type arg7, + typename std_cxx0x::tuple_element<7,ArgList>::type arg8, + typename std_cxx0x::tuple_element<8,ArgList>::type arg9) { return ThreadStarter::start_thread (std_cxx0x::bind (function, - internal::maybe_make_ref::type>::act(arg1), - internal::maybe_make_ref::type>::act(arg2), - internal::maybe_make_ref::type>::act(arg3), - internal::maybe_make_ref::type>::act(arg4), - internal::maybe_make_ref::type>::act(arg5), - internal::maybe_make_ref::type>::act(arg6), - internal::maybe_make_ref::type>::act(arg7), - internal::maybe_make_ref::type>::act(arg8), - internal::maybe_make_ref::type>::act(arg9))); + internal::maybe_make_ref::type>::act(arg1), + internal::maybe_make_ref::type>::act(arg2), + internal::maybe_make_ref::type>::act(arg3), + internal::maybe_make_ref::type>::act(arg4), + internal::maybe_make_ref::type>::act(arg5), + internal::maybe_make_ref::type>::act(arg6), + internal::maybe_make_ref::type>::act(arg7), + internal::maybe_make_ref::type>::act(arg8), + internal::maybe_make_ref::type>::act(arg9))); } private: diff --git a/deal.II/configure b/deal.II/configure index aabb889d72..ad5ecb513e 100755 --- a/deal.II/configure +++ b/deal.II/configure @@ -3896,6 +3896,68 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ CXXFLAGSG="$CXXFLAGSG -Wno-long-long" + OLD_CXXFLAGS="$CXXFLAGS" + CXXFLAGS=-std=c++0x + + { echo "$as_me:$LINENO: checking whether compiler supports C++0x" >&5 +echo $ECHO_N "checking whether compiler supports C++0x... $ECHO_C" >&6; } + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + CXXFLAGSG="$CXXFLAGSG -std=c++0x" + CXXFLAGSO="$CXXFLAGSO -std=c++0x" + +cat >>confdefs.h <<\_ACEOF +#define DEAL_II_CAN_USE_CXX0X 1 +_ACEOF + + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CXXFLAGS="${OLD_CXXFLAGS}" + + CXXFLAGS="-Wreturn-type -Werror" { echo "$as_me:$LINENO: checking whether qualifiers in return types lead to a warning" >&5 echo $ECHO_N "checking whether qualifiers in return types lead to a warning... $ECHO_C" >&6; }