|
Boost-Commit : |
From: dgregor_at_[hidden]
Date: 2008-05-07 20:10:35
Author: dgregor
Date: 2008-05-07 20:10:35 EDT (Wed, 07 May 2008)
New Revision: 45205
URL: http://svn.boost.org/trac/boost/changeset/45205
Log:
Provide a resolution for concepts issue 11
Text files modified:
sandbox/committee/concepts/issues/issues/issue11.xml | 60 ++++++++++++++++++++++++++++++++++++++++
1 files changed, 60 insertions(+), 0 deletions(-)
Modified: sandbox/committee/concepts/issues/issues/issue11.xml
==============================================================================
--- sandbox/committee/concepts/issues/issues/issue11.xml (original)
+++ sandbox/committee/concepts/issues/issues/issue11.xml 2008-05-07 20:10:35 EDT (Wed, 07 May 2008)
@@ -26,4 +26,64 @@
</p>
</discussion>
+<resolution>
+ <p><tt>Semiregular</tt> can be very useful for describing types that
+ used in <tt>valarray</tt> and <tt>complex</tt>, if we
+ add <tt>DefaultConstructible</tt> and <tt>Addressable</tt> to
+ it. <tt>Semiregular</tt> then describes types that can be
+ initialized and assigned in a natural way, and from there we add
+ equality into <tt>Regular</tt>. </p>
+
+ <p>Change the definition of <tt>Semiregular</tt> in [concept.regular] as follows:</p>
+
+ <pre>
+auto concept Semiregular<typename T>
+ : CopyConstructible<T>, CopyAssignable<T>, HeapAllocatable<T><ins>, DefaultConstructible<T>, Addressable<T></ins> {
+ requires SameType<CopyAssignable<T>::result_type, T&><del>;</del><ins>&&</ins>
+ <ins>SameType<Addressable<T>::pointer, T*> &&</ins>
+ <ins>SameType<Addressable<T const>::pointer, T const*></ins>
+
+ <ins>requires EqualityComparable<T>
+ axiom InitializationConsistency(T x) {
+ (T() = x) == T(x);
+ }</ins>
+}
+ </pre>
+
+ <p>Add the following paragraph after the description of <tt>Semiregular</tt> in [concept.regular]:</p>
+
+ <ol start="2">
+ <li><ins>[ <i>Note</i>: The <tt>InitializationConsistency</tt>
+ rule states that there shall not be any subtle differences in
+ the semantics of initialization versus assignment. This gives
+ an implementation considerable flexibility in how data are
+ initialized.</ins>/
+ <p>
+ <ins>[ <i>Example</i>: An implementation is allowed to initialize data by allocating storage using the new operator
+(which implies a call to the default constructor for the element) and then assigning each element its value. Or the
+ implementation can allocate raw storage and use the copy constructor to initialize the element. -- <i>end example</i> ] -- <i>end note</i>]</ins></p> </li>
+ </ol>
+
+ <p>Change the definition of the <tt>Regular</tt> concept in [concept.regular] as follows:</p>
+
+ <pre>
+auto concept Regular<typename T>
+: Semiregular<T><del>, DefaultConstructible<T></del>, EqualityComparable<T> { }
+ </pre>
+
+ <ol start="2">
+ <li><i>Note</i>: describes semi-regular types that <del>are default constructible,</del> have equality comparison operators<del>, and can be
+ allocated on the heap</del>. </li>
+ </ol>
+
+ <p>Modify the definition of the <tt>InputIterator</tt> concept in [input.iterators] as follows:</p>
+
+ <pre>
+concept InputIterator<typename X> : <del>Semiregular<X>,</del> <ins>CopyConstructible<T>, CopyAssignable<T>, HeapAllocatable<T>,</ins> EqualityComparable<X> {
+ <ins>requires SameType<CopyAssignable<T>::result_type, T&>;</ins>
+ <i>// ...</i>
+}
+ </pre>
+</resolution>
+
</issue>
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