]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Workaround for a bug in the boost foreign_ptr.hpp header [1]
authorMatthias Maier <tamiko@kyomu.43-1.org>
Wed, 31 Jul 2013 17:00:36 +0000 (17:00 +0000)
committerMatthias Maier <tamiko@kyomu.43-1.org>
Wed, 31 Jul 2013 17:00:36 +0000 (17:00 +0000)
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

deal.II/bundled/boost-1.49.0/include/boost/signals2/detail/foreign_ptr.hpp
deal.II/include/deal.II/dofs/dof_handler.h

index 3e2357b8e863c1d5a2183446e2b1f71e6110be97..50496b50df22bb8358ddf8c227011c0c5e399871 100644 (file)
 #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
     {
index 9e990e154e8538055504cc79ffae30ce64bd28cf..93d765a67071ac2145f96913c1ff29c77c897eca 100644 (file)
@@ -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>

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.