From 0ad078fc91fbb3ce9e8eb684b74337d143e099de Mon Sep 17 00:00:00 2001 From: bangerth Date: Tue, 9 Apr 2013 19:11:44 +0000 Subject: [PATCH] Make sure it is possible to create default-constructed objects of type Triangulation<1>::face_iterator. git-svn-id: https://svn.dealii.org/trunk@29227 0785d39b-7218-0410-832d-ea1e28bc413d --- .../deal.II/grid/tria_accessor.templates.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/deal.II/include/deal.II/grid/tria_accessor.templates.h b/deal.II/include/deal.II/grid/tria_accessor.templates.h index 87eec9623a..5379e3a5af 100644 --- a/deal.II/include/deal.II/grid/tria_accessor.templates.h +++ b/deal.II/include/deal.II/grid/tria_accessor.templates.h @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------- // $Id$ // -// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors +// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -2042,16 +2042,22 @@ TriaAccessor (const Triangulation<1,spacedim> *tria, template inline TriaAccessor<0, 1, spacedim>:: -TriaAccessor (const Triangulation<1,spacedim> *, - const int, - const int, +TriaAccessor (const Triangulation<1,spacedim> *tria, + const int level, + const int index, const AccessorData *) : - tria (0), + tria (tria), vertex_kind (interior_vertex), global_vertex_index (numbers::invalid_unsigned_int) { - Assert (false, ExcInternalError()); + // in general, calling this constructor should yield an error -- users should + // instead call the one immediately above. however, if you create something + // like Triangulation<1>::face_iterator() then this calls the default constructor + // of the iterator which calls the accessor with argument list (0,-2,-2,0), so + // in this particular case accept this call and create an object that corresponds + // to the default constructed (invalid) vertex accessor + Assert ((level == -2) && (index == -2), ExcInternalError()); } -- 2.39.5