]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Avoid invalid cast from one to another DoFHandler type.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 14 Jan 2014 16:08:14 +0000 (16:08 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 14 Jan 2014 16:08:14 +0000 (16:08 +0000)
git-svn-id: https://svn.dealii.org/trunk@32204 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/dofs/dof_accessor.templates.h

index e3dc97f94b54c3801994e039de04000c0d89a133..327146e3f59630a48c1d3ce60fa7a78946fd8c7a 100644 (file)
@@ -1,7 +1,7 @@
 // ---------------------------------------------------------------------
 // $Id$
 //
-// Copyright (C) 1999 - 2013 by the deal.II authors
+// Copyright (C) 1999 - 2014 by the deal.II authors
 //
 // This file is part of the deal.II library.
 //
@@ -77,7 +77,8 @@ template <int structdim, class DH, bool lda>
 template <int dim2, class DH2, bool lda2>
 inline
 DoFAccessor<structdim,DH,lda>::DoFAccessor (const DoFAccessor<dim2, DH2, lda2> &other)
-  : BaseClass(other), dof_handler(const_cast<DH *>(other.dof_handler))
+  : BaseClass(other),
+    dof_handler(0)
 {
   Assert (false, ExcInvalidObject());
 }
@@ -88,7 +89,8 @@ template <int structdim, class DH, bool lda>
 template <bool lda2>
 inline
 DoFAccessor<structdim,DH,lda>::DoFAccessor (const DoFAccessor<structdim, DH, lda2> &other)
-  : BaseClass(other), dof_handler(const_cast<DH *>(other.dof_handler))
+  : BaseClass(other),
+    dof_handler(const_cast<DH *>(other.dof_handler))
 {
 }
 

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.