From 75afed7f174047d39cd5cf991a98ab3593a5472e Mon Sep 17 00:00:00 2001
From: Peter Dimov
The C++ Standard allows, in 5.3.5/5, pointers to incomplete class types to - be deleted with a delete-expression. When the class has a non-trivial +
The C++ Standard allows, in 5.3.5/5, pointers to incomplete class types to be + deleted with a delete-expression. When the class has a non-trivial destructor, or a class-specific operator delete, the behavior is undefined. Some compilers issue a warning when an incomplete type is deleted, but unfortunately, not all do, and programmers sometimes ignore or disable @@ -75,10 +75,10 @@ template<class T> struct checked_deleter { typedef void result_type; typedef T * argument_type; - void operator()(T * p); + void operator()(T * p) const; }; -
Requires: T must be a complete type. The expression delete p @@ -94,10 +94,10 @@ template<class T> struct checked_array_deleter { typedef void result_type; typedef T * argument_type; - void operator()(T * p); + void operator()(T * p) const; }; -
void checked_array_deleter<T>::operator()(T * p);
+void checked_array_deleter<T>::operator()(T * p) const;
Requires: T must be a complete type. The expression delete [] p @@ -111,14 +111,14 @@ template<class T> struct checked_array_deleter
The function templates checked_delete and checked_array_delete were originally part of <boost/utility.hpp>, and the - documentation acknowledged Beman Dawes, Dave Abrahams, Vladimir Prus, - Rainer Deyke, John Maddock, and others as contributors. + documentation acknowledged Beman Dawes, Dave Abrahams, Vladimir Prus, Rainer + Deyke, John Maddock, and others as contributors.
- Copyright © 2002 by Peter Dimov. Permission to copy, use, modify, sell - and distribute this document is granted provided this copyright notice appears - in all copies. This document is provided "as is" without express or implied + Copyright © 2002 by Peter Dimov. Permission to copy, use, modify, sell and + distribute this document is granted provided this copyright notice appears in + all copies. This document is provided "as is" without express or implied warranty, and with no claim as to its suitability for any purpose.