
In article <c51662$3lh$1@sea.gmane.org>, "Edward Diener" <eddielee@tropicsoft.com> wrote:
In the first line of the next to last paragraph of the boost::bind deocumentation under the heading of "Using nested binds for function composition", it is stated:
"Sometimes it is necessary not to evaluate the first argument, but not to evaluate some of the other arguments, even when they are nested bind subexpressions. "
I believe this is confusing and that a much clearer explanation of what is meant would be:
"Although the first argument is, by default, not evaluated, all other arguments are. Sometimes it is necessary not to evaluate arguments subsequent to the first, even when they are nested bind subexpressions."
Except that's not true. All arguments are evaluated, that's how C++ works;
"Miro Jurisic" <macdev@meeroh.org> wrote in message news:macdev-71F793.14313807042004@sea.gmane.org... the
difference is that the first argument is the functor, and it's desirable to evaluate it, and the remaining arguments are arguments, and it's often desirable to defer their evaluation until the bound call is actually made.
I am referring to this line in the doc under 'Using nested binds for function composition': "Note that the first argument - the bound function object - is not evaluated, even when it's a function object that is produced by bind or a placeholder argument, so the example below does not work as expected."
That said, I agree, that part of the documentation should be clarified.
reason I know this material is that I spent 3 hours on a compiler error
The only that was
ostensibly explained in that paragraph, but the paragraph didn't make sense until I painfully discovered the material myself.
I await clarification for my apparent lack of understanding of the term 'evaluated' when it comes to the parameters which bind takes as arguments. Maybe the difference between 'evaluated' and 'called' needs better clarification. I know that I am slowly approaching the point of confusion regarding nested binds, although I thought I knew how they worked from practical experience with composition using nested binds.