From: kanschat Date: Fri, 18 Sep 2009 23:29:12 +0000 (+0000) Subject: Assert pointer nonzero in dereferencing operators X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3dbc1b5a8b8bc8099b885a7c25b0056aff12816c;p=dealii-svn.git Assert pointer nonzero in dereferencing operators git-svn-id: https://svn.dealii.org/trunk@19477 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/include/base/smartpointer.h b/deal.II/base/include/base/smartpointer.h index 9ee58bc564..8b2ad54bcb 100644 --- a/deal.II/base/include/base/smartpointer.h +++ b/deal.II/base/include/base/smartpointer.h @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors +// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -50,7 +50,7 @@ DEAL_II_NAMESPACE_OPEN * SmartPointer is a mutable pointer. * * @ingroup memory - * @author Guido Kanschat, Wolfgang Bangerth, 1998 - 2005 + * @author Guido Kanschat, Wolfgang Bangerth, 1998 - 2009 */ template class SmartPointer @@ -299,6 +299,7 @@ template inline T & SmartPointer::operator * () const { + Assert(t != 0, ExcNotInitialized()); return *t; } @@ -308,6 +309,7 @@ template inline T * SmartPointer::operator -> () const { + Assert(t != 0, ExcNotInitialized()); return t; }