Boost logo

Boost-Commit :

From: dgregor_at_[hidden]
Date: 2008-08-16 13:47:00


Author: dgregor
Date: 2008-08-16 13:46:59 EDT (Sat, 16 Aug 2008)
New Revision: 48177
URL: http://svn.boost.org/trac/boost/changeset/48177

Log:
Moved most of the updates from the supplemental concepts paper into the updated foundational concepts paper
Text files modified:
   sandbox/committee/concepts/stdlib/clib-concepts.tex | 29 +++++++++++++-
   sandbox/committee/concepts/stdlib/clib-suppconcepts.tex | 80 ----------------------------------------
   2 files changed, 27 insertions(+), 82 deletions(-)

Modified: sandbox/committee/concepts/stdlib/clib-concepts.tex
==============================================================================
--- sandbox/committee/concepts/stdlib/clib-concepts.tex (original)
+++ sandbox/committee/concepts/stdlib/clib-concepts.tex 2008-08-16 13:46:59 EDT (Sat, 16 Aug 2008)
@@ -120,6 +120,12 @@
   used for concepts (\ref{utility.concepts}).
 
 \item Added a new concept \tcode{EquivalenceRelation}.
+
+\item Added a new concept \tcode{HasVirtualDestructor}.
+
+\item In the \tcode{FreeStoreAllocatable} concept, default the
+ implementations of operators \tcode{new[]} and \tcode{delete[]} to
+ the use \tcode{new} and \tcode{delete}, respectively.
 \end{itemize}
 
 \end{titlepage}
@@ -277,6 +283,7 @@
 
   // \ref{concept.destruct}, destruction:
   auto concept HasDestructor<typename T> @\textit{see below}@;
+ auto concept HasVirtualDestructor<typename T> @\textit{see below}@;
   auto concept NothrowDestructible<typename T> @\textit{see below}@;
   concept TriviallyDestructible<typename T> @\textit{see below}@;
 
@@ -1381,6 +1388,18 @@
 \end{itemdescr}
 
 \begin{itemdecl}
+concept HasVirtualDestructor<typename T> : HasDestructor<T> { }
+\end{itemdecl}
+
+\begin{itemdescr}
+\pnum
+\addedConcepts{\reallynote describes types with a virtual destructor.}
+
+\pnum
+\addedConcepts{\requires for every class type \mbox{\tcode{T}} that has a virtual destructor, a concept map \mbox{\tcode{HasVirtualDestructor<T>}} shall be implicitly defined in namespace \mbox{\tcode{std}}.}
+\end{itemdescr}
+
+\begin{itemdecl}
 auto concept NothrowDestructible<typename T> : HasDestructor<T> { }
 \end{itemdecl}
 
@@ -1578,9 +1597,15 @@
 \begin{itemdecl}
 auto concept FreeStoreAllocatable<typename T> {
   void* T::operator new(size_t size);
- void* T::operator new[](size_t size);
   void T::operator delete(void*);
- void T::operator delete[](void*);
+
+ void* T::operator new[](size_t size) {
+ return T::operator new(size);
+ }
+
+ void T::operator delete[](void* ptr) {
+ T::operator delete(ptr);
+ }
 
   void* T::operator new(size_t size, const nothrow_t&) {
     try {

Modified: sandbox/committee/concepts/stdlib/clib-suppconcepts.tex
==============================================================================
--- sandbox/committee/concepts/stdlib/clib-suppconcepts.tex (original)
+++ sandbox/committee/concepts/stdlib/clib-suppconcepts.tex 2008-08-16 13:46:59 EDT (Sat, 16 Aug 2008)
@@ -105,19 +105,6 @@
 
 \rSec1[utility.concepts]{Concepts}
 
-\editorial{Add the following to the \tcode{<concepts>} header synopsis:}
-\synopsis{Header \tcode{<concepts>}\ synopsis}
-\begin{codeblock}
-namespace std {
- // \ref{concept.operator}, operator concepts:
- auto concept HasComma<typename T, typename U> @\textit{see below}@;
-
- // \ref{concept.destruct}, destruction:
- concept TriviallyDestructible<typename T> @\textit{see below}@;
- @\addedConcepts{concept HasTrivialDestructor<typename T> \mbox{\textit{see below}};}@
-}
-\end{codeblock}
-
 \setcounter{section}{2}
 \editorial{Update [concept.support] as follows}
 \rSec2[concept.support]{Support concepts}
@@ -144,71 +131,4 @@
 \mbox{\tcode{std}}.
 \end{itemdescr}
 
-\editorial{Add to the end of [concept.destruct]}
-\setcounter{section}{6}
-\setcounter{Paras}{5}
-\color{addclr}
-\begin{itemdecl}
-concept HasVirtualDestructor<typename T> : HasDestructor<T> { }
-\end{itemdecl}
-
-\begin{itemdescr}
-\pnum
-\addedConcepts{\reallynote describes types with a virtual destructor.}
-
-\pnum
-\addedConcepts{\requires for every class type \mbox{\tcode{T}} that has a virtual destructor, a concept map \mbox{\tcode{HasVirtualDestructor<T>}} shall be implicitly defined in namespace \mbox{\tcode{std}}.}
-\end{itemdescr}
-
-\color{black}
-
-\editorial{Update [concept.memory] as follows}
-\setcounter{section}{8}
-\setcounter{Paras}{1}
-\begin{itemdecl}
-auto concept FreeStoreAllocatable<typename T> {
- void* T::operator new(size_t size);
- void T::operator delete(void*);
-
- void* T::operator new[](size_t size)@\removedConcepts{;}@ @\addedConcepts{\{}@
- @\addedConcepts{return T::operator new(size);}@
- @\addedConcepts{\}}@
-
- void T::operator delete[](void*)@\removedConcepts{;}@ @\addedConcepts{\{}@
- @\addedConcepts{T::operator delete(ptr);}@
- @\addedConcepts{\}}@
-
- void* T::operator new(size_t size, const nothrow_t&) {
- try {
- return T::operator new(size);
- } catch(...) {
- return 0;
- }
- }
-
- void* T::operator new[](size_t size, const nothrow_t&) {
- try {
- return T::operator new[](size);
- } catch(...) {
- return 0;
- }
- }
-
- void T::operator delete(void* ptr, const nothrow_t&) {
- T::operator delete(ptr);
- }
-
- void T::operator delete[](void* ptr, const nothrow_t&) {
- T::operator delete[](ptr);
- }
-}
-\end{itemdecl}
-
-\begin{itemdescr}
-\pnum
-\mbox{\reallynote} describes types for which objects and
-arrays of objects can be allocated on or freed from the free store with
-\mbox{\tcode{new}} and \mbox{\tcode{delete}}.
-\end{itemdescr}
-
 \end{document}


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk