Boost logo

Boost-Commit :

From: dgregor_at_[hidden]
Date: 2008-06-11 05:19:48


Author: dgregor
Date: 2008-06-11 05:19:48 EDT (Wed, 11 Jun 2008)
New Revision: 46316
URL: http://svn.boost.org/trac/boost/changeset/46316

Log:
Re-specify partial ordering of concept map templates
Text files modified:
   sandbox/committee/concepts/wording/wording.tex | 43 ++++++++++++++++++++++++++++-----------
   1 files changed, 31 insertions(+), 12 deletions(-)

Modified: sandbox/committee/concepts/wording/wording.tex
==============================================================================
--- sandbox/committee/concepts/wording/wording.tex (original)
+++ sandbox/committee/concepts/wording/wording.tex 2008-06-11 05:19:48 EDT (Wed, 11 Jun 2008)
@@ -2856,26 +2856,45 @@
 template partial specializations (\mbox{\ref{temp.class.spec.match}}).}
 
 \pnum
-\addedConcepts{If more than one concept map template matches a specific
+\addedCC{For two concept map templates, the first is at least as
+ specialized as the second if, given the following rewrite to two
+ class template partial specializations of an invented class template
+ \mbox{\tcode{X}}, the first class template partial specialization is
+ at least as specialized as the second according to the rules for
+ partial ordering of class template partial specializations
+ (\mbox{\ref{temp.class.order}}). The class template \mbox{\tcode{X}}
+ has the same template parameters as the concept corresponding to the
+ two concept map templates. The class template partial
+ specializations are constrained templates, even if the corresponding
+concept map templates have no requirements specified.}
+\begin{itemize}
+\additemCC{the first class template partial specialization has the
+ same template parameters and template arguments as the first concept
+ map template, and}
+\additemCC{the second function template has the same template
+ parameters and template arguments as the second concept map template.}
+\end{itemize}
+\removedCCC{If more than one concept map template matches a specific
 \mbox{\techterm{concept instance}}, partial ordering of concept map templates
 proceeds as partial ordering of class template specializations
-(\mbox{\ref{temp.class.order}}). \mbox{\enterexample}}
+(\mbox{\ref{temp.class.order}}).}
+\addedConcepts{\mbox{\enterexample}}
 \begin{codeblock}
 concept C<typename T> { }
-template<typename T> requires C<T> void f(T);
-
-template<typename T> concept_map C<T*> { /* ... */ } // \#1
-
 concept Ptr<typename T> { }
-concept_map Ptr<int*> { /* ... */ }
+template<typename T> concept_map Ptr<T*> { /* ... */ }
 
+template<typename T> requires Ptr<T*> concept_map C<T*> { /* ... */ } // \#1
 template<typename T> requires Ptr<T> concept_map C<T> { /* ... */ } // \#2
 
-void g(int* p)
-{
- f(g); // okay: concept map C<int*> instantiated from \#1, which is more specialized than \#2
-}
-\end{codeblock}
+template<typename T> class X;
+template<typename T> requires Ptr<T*> class X<T*>; // A
+template<typename T> requires Ptr<T> class X<T>; // B
+\end{codeblock}
+\addedCC{The concept map template \#1 is more specialized than the concept map
+template \#2 because the class template partial specialization A is
+more specialized than the class template partial specialization B
+according to the ordering rules for class template partial specializations.}
 \addedConcepts{\mbox{\exitexample}}
 
 % \addedConcepts{When writing a template


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