
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday 19 May 2008 22:22 pm, Dean Michael Berris wrote:
For the special container types I've been pondering, aside from automatically waiting on contained futures there's the possibility of making standard algorithms more specialized for these container types (or via tag dispatch).
Perhaps having a special std::transform() implementation (the five argument version) that does a 'wait on any' future in the container and in a non-deterministic order apply a function on the contained future value that becomes available, and the result mapped to the appropriate location in the resulting container.
That's interesting. I can do that with ordinary containers/std::transform by using a poet::active_function from libpoet as the binary function passed to the transform algorithm. The active function's scheduler performs each add operation as the futures become ready. Example code attached. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFIMtvK5vihyNWuA4URApfIAJ0Uc9x8MJZ/mEubT12aKzmTVE5Y6wCg4Eyu iuYOLdFnfltTe3nnoYWd4m0= =r7As -----END PGP SIGNATURE-----