Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r79607 - in sandbox/type_erasure/libs/type_erasure: doc example
From: steven_at_[hidden]
Date: 2012-07-19 14:55:01


Author: steven_watanabe
Date: 2012-07-19 14:55:00 EDT (Thu, 19 Jul 2012)
New Revision: 79607
URL: http://svn.boost.org/trac/boost/changeset/79607

Log:
Clarify the reference rebinding example.
Text files modified:
   sandbox/type_erasure/libs/type_erasure/doc/type_erasure.qbk | 1 +
   sandbox/type_erasure/libs/type_erasure/example/references.cpp | 7 ++++++-
   2 files changed, 7 insertions(+), 1 deletions(-)

Modified: sandbox/type_erasure/libs/type_erasure/doc/type_erasure.qbk
==============================================================================
--- sandbox/type_erasure/libs/type_erasure/doc/type_erasure.qbk (original)
+++ sandbox/type_erasure/libs/type_erasure/doc/type_erasure.qbk 2012-07-19 14:55:00 EDT (Thu, 19 Jul 2012)
@@ -19,6 +19,7 @@
 [def __constructible [classref boost::type_erasure::constructible constructible]]
 [def __destructible [classref boost::type_erasure::destructible destructible]]
 [def __copy_constructible [classref boost::type_erasure::copy_constructible copy_constructible]]
+[def __assignable [classref boost::type_erasure::assignable assignable]]
 [def __typeid_ [classref boost::type_erasure::typeid_ typeid_]]
 [def __relaxed_match [classref boost::type_erasure::relaxed_match relaxed_match]]
 [def __binding [classref boost::type_erasure::binding binding]]

Modified: sandbox/type_erasure/libs/type_erasure/example/references.cpp
==============================================================================
--- sandbox/type_erasure/libs/type_erasure/example/references.cpp (original)
+++ sandbox/type_erasure/libs/type_erasure/example/references.cpp 2012-07-19 14:55:00 EDT (Thu, 19 Jul 2012)
@@ -40,7 +40,7 @@
 void references2() {
     //[references2
     /*`
- References are not assignable. Just like a built-in C++ reference,
+ References cannot be rebound. Just like a built-in C++ reference,
         once you've initialized it you can't change it to point to
         something else.
         ``
@@ -48,6 +48,11 @@
             any<typeid_<>, _self&> x(i), y(j);
             x = y; // error
         ``
+
+ [note As with any other operation, `x = y` for references
+ acts on `i` and `j`. Assignment like this is legal
+ if __assignable`<>` is in the Concept, but `x` would
+ still hold a reference to `i`.]
     */
     //]
 }


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