From eabe944284cbc8b8d7a59ef79c09ef224bf39c1e Mon Sep 17 00:00:00 2001 From: Matthias Maier <tamiko@kyomu.43-1.org> Date: Wed, 31 Jul 2013 17:00:36 +0000 Subject: [PATCH] Workaround for a bug in the boost foreign_ptr.hpp header [1] It is invalid to forward declare things in the std namespace. This works with libstdc++ by accident but not with libc++ that uses inline namespace features. [1] https://svn.boost.org/trac/boost/ticket/6655 git-svn-id: https://svn.dealii.org/branches/branch_port_to_libcxx@30200 0785d39b-7218-0410-832d-ea1e28bc413d --- .../boost/signals2/detail/foreign_ptr.hpp | 21 ++++++++++++------- deal.II/include/deal.II/dofs/dof_handler.h | 1 + 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/deal.II/bundled/boost-1.49.0/include/boost/signals2/detail/foreign_ptr.hpp b/deal.II/bundled/boost-1.49.0/include/boost/signals2/detail/foreign_ptr.hpp index 3e2357b8e8..50496b50df 100644 --- a/deal.II/bundled/boost-1.49.0/include/boost/signals2/detail/foreign_ptr.hpp +++ b/deal.II/bundled/boost-1.49.0/include/boost/signals2/detail/foreign_ptr.hpp @@ -18,14 +18,6 @@ #include <boost/smart_ptr/bad_weak_ptr.hpp> #include <boost/utility/swap.hpp> -#if !defined(BOOST_INTEL_STDCXX0X) -namespace std -{ - template<typename T> class shared_ptr; - template<typename T> class weak_ptr; -} -#endif - namespace boost { template<typename T> class shared_ptr; @@ -39,10 +31,20 @@ namespace boost { typedef boost::shared_ptr<T> shared_type; }; + +// Workaround for a bug in boost: +// https://svn.boost.org/trac/boost/ticket/6655 +// +// It should be save to depend on DEAL macros at this point as this header +// should only be used by deal.II and dependend projects... +// +// - Maier, 2013 +#ifdef DEAL_II_CAN_USE_CXX11 template<typename T> struct weak_ptr_traits<std::weak_ptr<T> > { typedef std::shared_ptr<T> shared_type; }; +#endif template<typename SharedPtr> struct shared_ptr_traits {}; @@ -51,10 +53,13 @@ namespace boost { typedef boost::weak_ptr<T> weak_type; }; +// as above +#ifdef DEAL_II_CAN_USE_CXX11 template<typename T> struct shared_ptr_traits<std::shared_ptr<T> > { typedef std::weak_ptr<T> weak_type; }; +#endif namespace detail { diff --git a/deal.II/include/deal.II/dofs/dof_handler.h b/deal.II/include/deal.II/dofs/dof_handler.h index 9e990e154e..93d765a670 100644 --- a/deal.II/include/deal.II/dofs/dof_handler.h +++ b/deal.II/include/deal.II/dofs/dof_handler.h @@ -23,6 +23,7 @@ #include <deal.II/base/exceptions.h> #include <deal.II/base/smartpointer.h> #include <deal.II/base/index_set.h> +#include <deal.II/base/std_cxx1x/shared_ptr.h> #include <deal.II/dofs/block_info.h> #include <deal.II/dofs/dof_iterator_selector.h> #include <deal.II/dofs/number_cache.h> -- 2.39.5