Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75778 - trunk/libs/phoenix/doc/starter_kit
From: joel_at_[hidden]
Date: 2011-12-03 01:07:08


Author: djowel
Date: 2011-12-03 01:07:06 EST (Sat, 03 Dec 2011)
New Revision: 75778
URL: http://svn.boost.org/trac/boost/changeset/75778

Log:
fixes for comments from Dave Abrahams.
Text files modified:
   trunk/libs/phoenix/doc/starter_kit/operator.qbk | 6 ++++++
   trunk/libs/phoenix/doc/starter_kit/values.qbk | 9 +++++----
   2 files changed, 11 insertions(+), 4 deletions(-)

Modified: trunk/libs/phoenix/doc/starter_kit/operator.qbk
==============================================================================
--- trunk/libs/phoenix/doc/starter_kit/operator.qbk (original)
+++ trunk/libs/phoenix/doc/starter_kit/operator.qbk 2011-12-03 01:07:06 EST (Sat, 03 Dec 2011)
@@ -40,6 +40,12 @@
     x[ref(i)] // illegal (x is not a phoenix primitive or expression)
     ref(x[ref(i)]) // illegal (x is not a phoenix primitive or expression)
 
+Why are the last two expression illegal? Although `operator[]` looks as
+much like a binary operator as `operator=` above it; the difference is
+that the former must be a member (i.e. `x` must have an `operator[]`
+that takes a phoenix primitive or expression as its argument). This will
+most likely not be the case.
+
 [blurb __tip__ Learn more about operators [link phoenix.modules.operator here.]]
 
 [heading First Practical Example]

Modified: trunk/libs/phoenix/doc/starter_kit/values.qbk
==============================================================================
--- trunk/libs/phoenix/doc/starter_kit/values.qbk (original)
+++ trunk/libs/phoenix/doc/starter_kit/values.qbk 2011-12-03 01:07:06 EST (Sat, 03 Dec 2011)
@@ -20,10 +20,11 @@
 
 [heading Lazy Evaluation]
 
-Confused? `val(3)` is a unary function, you say? Yes it is. However, read
-carefully: /"evaluates to a nullary function"/. `val(3)` evaluates to (returns) a
-nullary function. Aha! `val(3)` returns a function! So, since `val(3)` returns a
-function, you can invoke it. Example:
+Confused? `val` is a unary function and `val(3)` invokes it, you say?
+Yes. However, read carefully: /"evaluates to a nullary function"/.
+`val(3)` evaluates to (returns) a nullary function. Aha! `val(3)`
+returns a function! So, since `val(3)` returns a function, you can
+invoke it. Example:
 
     std::cout << val(3)() << std::endl;
 


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