Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r79630 - in sandbox/type_erasure: boost/type_erasure libs/type_erasure/example
From: steven_at_[hidden]
Date: 2012-07-20 19:46:28


Author: steven_watanabe
Date: 2012-07-20 19:46:27 EDT (Fri, 20 Jul 2012)
New Revision: 79630
URL: http://svn.boost.org/trac/boost/changeset/79630

Log:
Clarify the behavior of concept_interface for composite concepts.
Text files modified:
   sandbox/type_erasure/boost/type_erasure/concept_interface.hpp | 12 +++++++++++-
   sandbox/type_erasure/libs/type_erasure/example/compose.cpp | 4 +++-
   2 files changed, 14 insertions(+), 2 deletions(-)

Modified: sandbox/type_erasure/boost/type_erasure/concept_interface.hpp
==============================================================================
--- sandbox/type_erasure/boost/type_erasure/concept_interface.hpp (original)
+++ sandbox/type_erasure/boost/type_erasure/concept_interface.hpp 2012-07-20 19:46:27 EDT (Fri, 20 Jul 2012)
@@ -18,10 +18,20 @@
  * The @ref concept_interface class can be specialized to
  * add behavior to an @ref any.
  *
+ * @ref concept_interface can be specialized for either
+ * primitive or composite concepts. If a concept @c C1
+ * contains another concept @c C2, then the library guarantees
+ * that the specialization of @ref concept_interface for
+ * C2 is a base class of the specialization for C1.
+ * This means that C1 can safely override members of C2.
+ *
  * \tparam Concept The concept that we're specializing
- * @ref concept_interface for.
+ * @ref concept_interface for. One of its
+ * placeholders should be @c ID.
  * \tparam Base The base of this class. Specializations of @ref
  * concept_interface must inherit publicly from this type.
+ * The metafunctions @ref derived and @ref rebind_any
+ * can also be applied to @c Base.
  * \tparam ID The placeholder representing this type.
  * \tparam Enable A dummy parameter that can be used for SFINAE.
  */

Modified: sandbox/type_erasure/libs/type_erasure/example/compose.cpp
==============================================================================
--- sandbox/type_erasure/libs/type_erasure/example/compose.cpp (original)
+++ sandbox/type_erasure/libs/type_erasure/example/compose.cpp 2012-07-20 19:46:27 EDT (Fri, 20 Jul 2012)
@@ -38,7 +38,9 @@
 /*`
     Now, `arithmetic` can be used just like any
     of the base concepts. We can even specialize
- __concept_interface for it.
+ __concept_interface for it if we want to
+ add to or override the behavior of the base
+ concepts.
 */
 //]
 


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