]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Try to work around a bug in MS VC++. This is not pretty, but if it gets the job done...
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 5 Feb 2014 17:19:04 +0000 (17:19 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 5 Feb 2014 17:19:04 +0000 (17:19 +0000)
git-svn-id: https://svn.dealii.org/trunk@32413 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/grid/grid_tools.h
deal.II/source/grid/grid_tools.cc
deal.II/source/grid/grid_tools.inst.in

index e8de5d95abee4a6c417f2bccf03d5e0a754d304b..a439b3da7b1122c5b6367b12575f5009a0d94f52 100644 (file)
@@ -873,6 +873,23 @@ namespace GridTools
   fix_up_distorted_child_cells (const typename Triangulation<dim,spacedim>::DistortedCellList &distorted_cells,
                                 Triangulation<dim,spacedim> &triangulation);
 
+#ifdef _MSC_VER
+  // Microsoft's VC++ has a bug where it doesn't want to recognize that
+  // an implementation (definition) of the extract_boundary_mesh function
+  // matches a declaration. This can apparently only be avoided by
+  // doing some contortion with the return type using the following
+  // intermediate type. This is only used when using MS VC++ and uses
+  // the direct way of doing it otherwise
+  template <template <int,int> class Container, int dim, int spacedim>
+  struct ExtractBoundaryMesh
+  {
+      typedef
+          std::map<typename Container<dim-1,spacedim>::cell_iterator,
+              typename Container<dim,spacedim>::face_iterator>
+          return_type;
+  };
+#endif
+
   /**
    * This function implements a boundary
    * subgrid extraction.  Given a
@@ -960,8 +977,12 @@ namespace GridTools
    * curved boundaries.
    */
   template <template <int,int> class Container, int dim, int spacedim>
+#ifndef _MSC_VER
   std::map<typename Container<dim-1,spacedim>::cell_iterator,
       typename Container<dim,spacedim>::face_iterator>
+#else
+  typename ExtractBoundaryMesh<Container,dim,spacedim>::return_type
+#endif
       extract_boundary_mesh (const Container<dim,spacedim> &volume_mesh,
                              Container<dim-1,spacedim>     &surface_mesh,
                              const std::set<types::boundary_id> &boundary_ids
index ab5016e1ef43571d930cfed78f6700449c7cc49a..44cdca00d781c8571d26c6e24480819c18de17e5 100644 (file)
@@ -2083,8 +2083,12 @@ next_cell:
 
 
   template <template <int,int> class Container, int dim, int spacedim>
+#ifndef _MSC_VER
   std::map<typename Container<dim-1,spacedim>::cell_iterator,
       typename Container<dim,spacedim>::face_iterator>
+#else
+  typename ExtractBoundaryMesh<Container,dim,spacedim>::return_type
+#endif
       extract_boundary_mesh (const Container<dim,spacedim> &volume_mesh,
                              Container<dim-1,spacedim>     &surface_mesh,
                              const std::set<types::boundary_id> &boundary_ids)
index 8089c7dad665c1d58a7a25d95370bfa0869164cf..58e11454b75c7d8198c37a699f79d1480f79ea53 100644 (file)
@@ -265,8 +265,12 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS
     namespace GridTools \{
 
       template
+#ifndef _MSC_VER
        std::map<  Container<deal_II_dimension-1,deal_II_space_dimension>::cell_iterator,
                   Container<deal_II_dimension,deal_II_space_dimension>::face_iterator>
+#else
+  typename ExtractBoundaryMesh<Container,deal_II_dimension,deal_II_space_dimension>::return_type
+#endif
       extract_boundary_mesh (const Container<deal_II_dimension, deal_II_space_dimension> &mesh,
                             Container<deal_II_dimension-1,deal_II_space_dimension>  &boundary_mesh,
                             const std::set<types::boundary_id> &boundary_ids);

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.