
On Wednesday 02 November 2005 09:36, Reece Dunn wrote:
Thorsten Schuett wrote:
On Tuesday 01 November 2005 20:11, Peter Dimov wrote: [snip]
However, the active lambda stuff could possibly be done as an extension of Boost.Lambda using Spirit/Phoenix sugar:
future< int > = active<>[ _1 = _1 + 2 ];
This doesn't work; your active<> doesn't take any arguments, so you can't use _1. It is possible to make this:
future<int> f1 = active( bind( f, 1, 2 ) ); future<int> f2 = active( bind( &X::f, &x, 1, 2 ) );
What is the point of adding the active-Wrapper? The bind already returns a nullary function.
future<int> f1 = bind( f, 1, 2 );
should be sufficient.
Just wondering.
I suppose you could make future take a bind/function and then make that run on a thread. One of Herb's points was that you could grep for *active* to find the places where you gain concurrency and for *wait* where you lose it. For example:
future< int > val = active { ... } // gain concurrency // ... std::cout << "value = " << val.wait(); // lose concurrency I watched his presentation yesterday and I don't really buy this argument. MS is selling IDEs. It shouldn't be that hard to extend the search dialog to allow the user to express "complex queries" on the source code.
- Find all const functions in template classes - Find all "gain concurrency" points - Find all "lose concurrency" points IMHO, the "active" keyword is redundant. Thorsten