Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r48864 - sandbox/committee/concepts/stdlib
From: dgregor_at_[hidden]
Date: 2008-09-19 01:09:25


Author: dgregor
Date: 2008-09-19 01:09:25 EDT (Fri, 19 Sep 2008)
New Revision: 48864
URL: http://svn.boost.org/trac/boost/changeset/48864

Log:
Undo traits
Text files modified:
   sandbox/committee/concepts/stdlib/clib-concepts.tex | 92 ++++++++++++++++-----------------------
   1 files changed, 38 insertions(+), 54 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-09-19 01:09:25 EDT (Fri, 19 Sep 2008)
@@ -271,10 +271,6 @@
   concept True<bool> { }
   concept_map True<true> { }
 
- // \ref{concept.trait}, trait:
- concept Trait<template<typename X> class Trait, typename T> {}
-
-
   // \ref{concept.operator}, operator concepts:
   auto concept HasPlus<typename T, typename U> @\textit{see below}@;
   auto concept HasMinus<typename T, typename U> @\textit{see below}@;
@@ -825,24 +821,6 @@
 \mbox{\tcode{True}} concept.}
 \end{itemdescr}
 
-\rSec2[concept.trait]{Trait}
-
-\begin{itemdecl}
-auto concept Trait<template<typename X> class Tr, typename T>
-{
- typename tr = Tr<T>;
- requires DerivedFrom<tr, true_type>;
-}
-\end{itemdecl}
-
-\begin{itemdescr}
-\pnum
-\addedConcepts{\mbox{\reallynote} used to apply the unconstrained type
- trait template Tr to the type T, in constrained context. This
- ignores concept_maps and is safe only when the only constraints
- that T carries are non-remappble}
-\end{itemdescr}
-
 \rSec2[concept.operator]{Operator concepts}
 \begin{itemdecl}
 auto concept HasPlus<typename T, typename U> {
@@ -1444,13 +1422,7 @@
 \end{itemdescr}
 
 \begin{itemdecl}
-concept TriviallyEqualityComparable<typename T> { }
-
-template <EqualityComparable T>
-concept_map TriviallyEqualityComparable<T>
-requires Trait<has_trivial_compare, T>
-{ }
-
+concept TriviallyEqualityComparable<typename T> : EqualityComparable<T> { }
 \end{itemdecl}
 
 \begin{itemdescr}
@@ -1462,6 +1434,12 @@
 padding, i.e. the size of the type is the sum of the sizes of its
 elements. If padding exists, the comparison may provide false
 negatives, but never false positives. \mbox{\exitnote}}
+
+\pnum
+\addedConcepts{\mbox{\requires} for every integral, pointer, or enumeration type
+ \mbox{\tcode{T}}, a concept map
+ \mbox{\tcode{TriviallyEqualityComparable<T>}} shall be
+ defined in namespace \mbox{\tcode{std}}.}
 \end{itemdescr}
 
 \begin{itemdecl}
@@ -1549,17 +1527,18 @@
 \end{itemdescr}
 
 \begin{itemdecl}
-concept TriviallyDefaultConstructible<typename T> { }
-
-template <DefaultConstructible T>
-concept_map TriviallyDefaultConstructible<T>
-requires Trait<has_trivial_default_constructor, T>
-{ }
+concept TriviallyDefaultConstructible<typename T> : DefaultConstructible<T> { }
 \end{itemdecl}
 
 \begin{itemdescr}
 \pnum
 \addedConcepts{\mbox{\reallynote} describes types whose default constructor is trivial.}
+
+\pnum \addedConcepts{\mbox{\requires} for every type \mbox{\tcode{T}} that is
+ a trivial type (\mbox{\ref{basic.types}}) or a class type with a
+ trivial default constructor (\mbox{\ref{class.ctor}}), a concept map
+ \mbox{\tcode{TriviallyDefaultConstructible<T>}} shall be implicitly
+ defined in namespace \mbox{\tcode{std}}.}
 \end{itemdescr}
 
 \rSec2[concept.destruct]{Destruction}
@@ -1599,18 +1578,20 @@
 \end{itemdescr}
 
 \begin{itemdecl}
-concept TriviallyDestructible<typename T> { }
-
-template <NoThrowDestructible T>
-concept_map TriviallyDestructible<T>
-requires Trait<has_trivial_destructor, T>
-{ }
+concept TriviallyDestructible<typename T> : NothrowDestructible<T> { }
 \end{itemdecl}
 
 \begin{itemdescr}
 \pnum
 \addedConcepts{\mbox{\reallynote} describes types whose
 destructors do not need to be executed when the object is destroyed.}
+
+\pnum
+\addedConcepts{\mbox{\requires} for every type \mbox{\tcode{T}} that
+ is a trivial type ([basic.types]), reference, or class type with a
+ trivial destructor ([class.dtor]), a concept map
+ \mbox{\tcode{TriviallyDestructible<T>}} shall be implicitly
+ defined in namespace \mbox{\tcode{std}}.}
 \end{itemdescr}
 
 \rSec2[concept.copymove]{Copy and move}
@@ -1655,19 +1636,20 @@
 \end{itemdescr}
 
 \begin{itemdecl}
-concept TriviallyCopyConstructible<typename T> { }
-
-
-template <CopyConstructible T>
-concept_map TriviallyCopyConstructible<T>
-requires Trait<has_trivial_copy_constructor, T>
-{ }
+concept TriviallyCopyConstructible<typename T> : CopyConstructible<T> { }
 \end{itemdecl}
 
 \begin{itemdescr}
 \pnum
 \addedConcepts{\mbox{\reallynote} describes types whose copy
 constructor is equivalent to \mbox{\tcode{memcpy}}.}
+
+\pnum
+\addedConcepts{\mbox{\requires} for every type \mbox{\tcode{T}} that
+ is a trivial type ([basic.types]), a reference, or a class type with
+ a trivial copy constructor ([class.copy]), a concept map
+ \mbox{\tcode{TriviallyCopyConstructible<T>}}
+shall be implicitly defined in namespace \mbox{\tcode{std}}.}
 \end{itemdescr}
 
 \begin{itemdecl}
@@ -1718,18 +1700,20 @@
   requirement. See, e.g., the \tcode{IntegralLike} concept.}}
 
 \begin{itemdecl}
-concept TriviallyCopyAssignable<typename T> {}
-
-template <CopyAssignable T>
-concept_map TriviallyCopyAssignable<T>
-requires Trait<has_trivial_assign, T>
-{ }
+concept TriviallyCopyAssignable<typename T> : CopyAssignable<T> { }
 \end{itemdecl}
 
 \begin{itemdescr}
 \pnum
 \addedConcepts{\mbox{\reallynote} describes types whose copy-assignment
   operator is equivalent to \mbox{\tcode{memcpy}}.}
+
+\pnum
+\addedConcepts{\mbox{\requires} for every type \mbox{\tcode{T}} that
+ is a trivial type ([basic.types]) or a
+class type with a trivial copy assignment operator ([class.copy]), a
+concept map \mbox{\tcode{TriviallyCopyAssignable<T>}} shall be implicitly
+defined in namespace \mbox{\tcode{std}}.}
 \end{itemdescr}
 
 \begin{itemdecl}


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