2
0
mirror of https://github.com/boostorg/lambda.git synced 2026-01-22 05:12:51 +00:00
Files
lambda/doc/lambda.xml
Eric Niebler 4def72c970 Merged revisions 42451-43517 via svnmerge from
https://svn.boost.org/svn/boost/trunk

................
  r42455 | johnmaddock | 2008-01-04 08:54:35 -0800 (Fri, 04 Jan 2008) | 1 line
  
  Fix typos.
................
  r42456 | eric_niebler | 2008-01-04 09:14:53 -0800 (Fri, 04 Jan 2008) | 1 line
  
  mark up borland and sun accumulators failures
................
  r42459 | andreas_huber69 | 2008-01-04 10:23:18 -0800 (Fri, 04 Jan 2008) | 1 line
  
  This should fix template parameter shadowing errors for gcc and Intel compilers.
................
  r42462 | bgubenko | 2008-01-04 15:55:43 -0800 (Fri, 04 Jan 2008) | 1 line
  
  mark Accumulators tests for gcc 4.2.1 affected by GCC Bugzilla Bug 33580
................
  r42471 | turkanis | 2008-01-04 20:51:49 -0800 (Fri, 04 Jan 2008) | 1 line
  
  merged changes from iostreams_dev, revisions 42441-42469; added 'std::' for Intel on Linux/Darwin; added STDCXX workaround for codecvt; fixed docs for invert.hpp
................
  r42473 | turkanis | 2008-01-04 23:35:44 -0800 (Fri, 04 Jan 2008) | 1 line
  
  new iostreams expected failures: stream_offset_64bit_test.cpp on Borland, and wide stream tests on gcc-3.4.2_hpux_pa_risc
................
  r42475 | andreas_huber69 | 2008-01-05 04:42:02 -0800 (Sat, 05 Jan 2008) | 1 line
  
  Added defaults for in_state_reaction template parameters and updated tests accordingly.
................
  r42476 | bemandawes | 2008-01-05 06:41:55 -0800 (Sat, 05 Jan 2008) | 1 line
  
  Disable Microsoft "secure" overloads in Dinkumware libraries since they cause compile errors with Intel versions 9 and 10
................
  r42478 | jurko | 2008-01-05 07:19:53 -0800 (Sat, 05 Jan 2008) | 1 line
  
  Typo corrections. Minor stylistic changes.
................
  r42479 | jurko | 2008-01-05 08:53:03 -0800 (Sat, 05 Jan 2008) | 1 line
  
  Updated Boost.Jam command line option texts. Minor stylistic changes.
................
  r42480 | jurko | 2008-01-05 08:55:36 -0800 (Sat, 05 Jan 2008) | 1 line
  
  Typo corrections. Minor stylistic changes.
................
  r42481 | jurko | 2008-01-05 08:56:42 -0800 (Sat, 05 Jan 2008) | 1 line
  
  Typo correction. Corrected an invalid command-line option name.
................
  r42482 | jurko | 2008-01-05 08:57:17 -0800 (Sat, 05 Jan 2008) | 1 line
  
  Corrected an invalid command-line option name reference.
................
  r42483 | jurko | 2008-01-05 08:58:01 -0800 (Sat, 05 Jan 2008) | 1 line
  
  Corrected an out-of-date comment listing all command-line options.
................
  r42484 | jurko | 2008-01-05 09:11:50 -0800 (Sat, 05 Jan 2008) | 1 line
  
  Corrected the used file suffix for the VERBATIM file type. Now the documentation is in sync with the 'customization' example. This also closes the Trac ticket 134. Minor stylistic changes.
................
  r42485 | jurko | 2008-01-05 09:46:45 -0800 (Sat, 05 Jan 2008) | 1 line
  
  Stylistic comment changes & typo corrections.
................
  r42486 | jurko | 2008-01-05 09:52:31 -0800 (Sat, 05 Jan 2008) | 1 line
  
  Stylistic comment changes & typo corrections in several files. Corrected an incorrect error message in boost-build/build/project.jam displayed when a --build-dir command-line option and a non top-level project build-dir attribute are specified.
................
  r42487 | jurko | 2008-01-05 09:54:02 -0800 (Sat, 05 Jan 2008) | 1 line
  
  Cleaned up some import rule calls.
................
  r42488 | jurko | 2008-01-05 10:02:23 -0800 (Sat, 05 Jan 2008) | 1 line
  
  Documentation wording cleaned up a bit.
................
  r42489 | jurko | 2008-01-05 10:13:10 -0800 (Sat, 05 Jan 2008) | 1 line
  
  Removed or simplified some import calls. Comment updates. Minor stylistic changes.
................
  r42490 | jurko | 2008-01-05 10:14:20 -0800 (Sat, 05 Jan 2008) | 2 lines
  
  Simplified the used make rules. Removed some dead code. Minor stylistic changes.
................
  r42492 | jurko | 2008-01-05 10:29:36 -0800 (Sat, 05 Jan 2008) | 1 line
  
  Removed trailing spaces and some empty lines.
................
  r42494 | jurko | 2008-01-05 12:02:24 -0800 (Sat, 05 Jan 2008) | 1 line
  
  Minor stylistic changes such as: comment typo corrections, wrapping lines to 80 characters, indentations, removing trailing spaces, etc.
................
  r42495 | jurko | 2008-01-05 12:06:15 -0800 (Sat, 05 Jan 2008) | 2 lines
  
  Cleaned up where the stage module is imported in tools/builtin.jam. Added a missing import in tools/stage.jam that causes errors with the previous fix. Minor stylistic changes in tools/stage.jam.
................
  r42496 | jurko | 2008-01-05 12:14:48 -0800 (Sat, 05 Jan 2008) | 1 line
  
  Comment cleanup.
................
  r42497 | jurko | 2008-01-05 12:37:44 -0800 (Sat, 05 Jan 2008) | 1 line
  
  Minor stylistic changes - cleaned up import calls, wrapped much text at 80 characters updated comments, typo corrections, removed trailing spaces, etc.
................
  r42498 | jurko | 2008-01-05 12:48:50 -0800 (Sat, 05 Jan 2008) | 1 line
  
  Renamed some Jamfile and project-root.jam references to Jamfile.jam and Jamroot.jam respectively.
................
  r42499 | jurko | 2008-01-05 13:37:15 -0800 (Sat, 05 Jan 2008) | 1 line
  
  Test code cleaned up a bit. No functional changes.
................
  r42502 | hkaiser | 2008-01-05 14:44:28 -0800 (Sat, 05 Jan 2008) | 1 line
  
  Wave: updated copyright messages to include the year 2008 (merged from release branch).
................
  r42504 | jurko | 2008-01-05 15:18:17 -0800 (Sat, 05 Jan 2008) | 1 line
  
  Refactored the test into two separate test functions. Made the 'directory names with dots' test use the expect_output_line() tool instead of a manual find, causing a better diagnostic to be displayed in case of a failure. Made one of the test Jam scripts more compact. Made the test use the Jamroot.jam file instead of project-root.jam.
................
  r42505 | bgubenko | 2008-01-05 15:35:05 -0800 (Sat, 05 Jan 2008) | 1 line
  
  mark up accumulators library test weighted_kurtosis for acc toolset
................
  r42506 | jurko | 2008-01-05 16:25:48 -0800 (Sat, 05 Jan 2008) | 1 line
  
  No functional changes but only stylistic changes such as: comment typo corrections, wrapping lines to 80 characters, indentations, removing trailing spaces, removing empty lines, made tests use Jamfile.jam and Jamroot.jam Boost Build script names, removed unnecessary module imports, etc.
................
  r42507 | jurko | 2008-01-05 16:53:09 -0800 (Sat, 05 Jan 2008) | 1 line
  
  No functional changes but only stylistic changes such as: comment typo corrections, wrapping lines to 80 characters, indentations, removing trailing spaces, removing empty lines, removed unnecessary module imports, etc.
................
  r42508 | jurko | 2008-01-05 22:15:39 -0800 (Sat, 05 Jan 2008) | 5 lines
  
  Refactored build-system.jam. Added many detailed comments.
  
  Test configuration module now gets loaded the same as all other configuration modules.
  
  In addition to being able to specify which user configuration to load, user may now also prevent loading the user configuration by specifying an empty file name for it.
................
  r42509 | jurko | 2008-01-05 22:50:56 -0800 (Sat, 05 Jan 2008) | 1 line
  
  Added a --test-config command-line option for specifying where the test configuration file should be loaded from instead of always being looked up in Boost Build's test folder. This allows non-test builds to not use test config when it exists on the system and different tests to use different test configurations when needed.
................
  r42510 | jurko | 2008-01-05 22:58:24 -0800 (Sat, 05 Jan 2008) | 1 line
  
  Specifying that a build uses test configuration no longer prevents toolset auto-configuration and therefore no longer causes --toolset options to be ignored.
................
  r42511 | jurko | 2008-01-05 23:13:28 -0800 (Sat, 05 Jan 2008) | 1 line
  
  Minor stylistic comment changes.
................
  r42512 | jurko | 2008-01-05 23:17:08 -0800 (Sat, 05 Jan 2008) | 1 line
  
  Added support for choosing the toolset and toolset version to be used 'by default' by Boost Build. Allows testing of default toolset functionality.
................
  r42513 | jurko | 2008-01-05 23:26:46 -0800 (Sat, 05 Jan 2008) | 1 line
  
  Upgraded the tool for testing that a certain line exists in the given output support so that it now also knows how to test that a certain line does not exist in the given output.
................
  r42514 | jurko | 2008-01-05 23:28:47 -0800 (Sat, 05 Jan 2008) | 1 line
  
  Added the --ignore-site-config option telling Boost.Build not to load the site configuration file.
................
  r42516 | jurko | 2008-01-06 00:16:34 -0800 (Sun, 06 Jan 2008) | 1 line
  
  Stylistic changes: typo corrections, comment alignments, output string updates, no functional changes, etc.
................
  r42527 | andreas_huber69 | 2008-01-06 05:49:31 -0800 (Sun, 06 Jan 2008) | 1 line
  
  Various doc updates.
................
  r42528 | danieljames | 2008-01-06 08:47:16 -0800 (Sun, 06 Jan 2008) | 2 lines
  
  Add Boost.Unordered and add to the documentation. Not fully integrated yet.
................
  r42529 | danieljames | 2008-01-06 08:48:36 -0800 (Sun, 06 Jan 2008) | 1 line
  
  Add more libraries that use Boost.Hash to its intro.
................
  r42530 | danieljames | 2008-01-06 08:49:11 -0800 (Sun, 06 Jan 2008) | 1 line
  
  Add Boost.Unordered to Boost.Hash's intro.
................
  r42531 | danieljames | 2008-01-06 08:59:18 -0800 (Sun, 06 Jan 2008) | 1 line
  
  Combine the 'container' and 'unordered' tests.
................
  r42532 | danieljames | 2008-01-06 08:59:49 -0800 (Sun, 06 Jan 2008) | 1 line
  
  Give the unordered exception test suite its own name.
................
  r42533 | danieljames | 2008-01-06 09:13:15 -0800 (Sun, 06 Jan 2008) | 1 line
  
  Add the contents of compile_tests.cpp to set_compile.cpp and map_compile.cpp
................
  r42534 | danieljames | 2008-01-06 09:16:51 -0800 (Sun, 06 Jan 2008) | 1 line
  
  Rename the test-suites to match other libraries' style.
................
  r42535 | danieljames | 2008-01-06 09:23:16 -0800 (Sun, 06 Jan 2008) | 2 lines
  
  Add forwarding html files for Boost.Unordered.
................
  r42536 | danieljames | 2008-01-06 09:40:32 -0800 (Sun, 06 Jan 2008) | 1 line
  
  Add Boost.Unordered to the regression tests.
................
  r42537 | eric_niebler | 2008-01-06 09:44:06 -0800 (Sun, 06 Jan 2008) | 1 line
  
  add myself as maintainer of accumulators
................
  r42538 | danieljames | 2008-01-06 09:45:18 -0800 (Sun, 06 Jan 2008) | 2 lines
  
  Add library identification.
................
  r42539 | danieljames | 2008-01-06 09:48:11 -0800 (Sun, 06 Jan 2008) | 2 lines
  
  Add the unordered library to the maintainers list.
................
  r42540 | danieljames | 2008-01-06 09:56:06 -0800 (Sun, 06 Jan 2008) | 2 lines
  
  Add unordered to the library list.
................
  r42544 | turkanis | 2008-01-06 10:32:05 -0800 (Sun, 06 Jan 2008) | 18 lines
  
  copy.hpp: 
  
      fix for Visual Age: std::min was passed arguments of different types; replaced std:: min with conditional
  
  detail/streambuf/indirect_streambuf.hpp: 
  
      removed trailing comma in enum definition
  
  test/combine_test.cpp:
  test/symmetric_filter_test.cpp:
  test/compose_test.cpp:
  test/close_test.cpp:
  test/invert_test.cpp:
  test/tee_test.cpp:
  test/restrict_test.cpp:
  test/Jamfile.v2:
  
      moved tests for close() into the test files for various adapters
................
  r42546 | jurko | 2008-01-06 12:06:33 -0800 (Sun, 06 Jan 2008) | 1 line
  
  Corrected a bug with the customized default toolset being read from the toolset module but defined in the build-system module. Effect was that customized default toolsets were getting ignored.
................
  r42547 | jurko | 2008-01-06 12:37:55 -0800 (Sun, 06 Jan 2008) | 1 line
  
  Simple code cleanup. Typo corrections.
................
  r42548 | jurko | 2008-01-06 12:43:25 -0800 (Sun, 06 Jan 2008) | 1 line
  
  Added support for tests configuring whether they want their Boost Build to ignore toolset requirements instead of always ignoring them. Minor stylistic changes.
................
  r42549 | jurko | 2008-01-06 12:56:20 -0800 (Sun, 06 Jan 2008) | 1 line
  
  Added new tests related to Boost Build's default toolset handling. They test that the correct default toolset gets use and that when it gets used that has no different status than any other explicitly specified toolset.
................
  r42563 | turkanis | 2008-01-06 17:26:52 -0800 (Sun, 06 Jan 2008) | 1 line
  
  marked restrict_test.cpp as failing on vacpp and stream_offset_64bit_test as failing on sun (iostreams)
................
  r42564 | turkanis | 2008-01-06 17:32:29 -0800 (Sun, 06 Jan 2008) | 1 line
  
  alphabetized the iostreams failures
................
  r42565 | turkanis | 2008-01-06 21:20:32 -0800 (Sun, 06 Jan 2008) | 5 lines
  
  merged changes from branches/iostreams_dev, revisions 42544-42544
  
  - added "slice" as an alias for "restrict", for platforms on which "restrict" is a keyword
  - attempted to configure file_descriptor for __IBMCPP__
  - added better error output to stream_offset_64bit_test.cpp
................
  r42566 | jurko | 2008-01-07 09:00:59 -0800 (Mon, 07 Jan 2008) | 1 line
  
  Corrected explicitly specified user-config file handling. Was not looking for the specified file in the regular path instead of the current folder and did not work with absolute paths.
................
  r42567 | jurko | 2008-01-07 10:15:13 -0800 (Mon, 07 Jan 2008) | 1 line
  
  Code cleanup. Converted to using True/False instead of 1/0. Changed to obey documented coding conventions regarding whitespace and function parameters. Renamed private member functions to use the __ name prefix.
................
  r42568 | jurko | 2008-01-07 10:38:28 -0800 (Mon, 07 Jan 2008) | 1 line
  
  Added a new configuration test making sure that the bug with not being able to process absolute user-config configuration file references never rears its ugly head again.
................
  r42570 | eric_niebler | 2008-01-07 11:06:31 -0800 (Mon, 07 Jan 2008) | 1 line
  
  s/order/tail/
................
  r42571 | eric_niebler | 2008-01-07 11:08:16 -0800 (Mon, 07 Jan 2008) | 1 line
  
  add missing includes, fix signed/unsigned warnings, clean-up trailing whitespace, fixes #1552
................
  r42572 | danieljames | 2008-01-07 11:40:32 -0800 (Mon, 07 Jan 2008) | 1 line
  
  Rename the exception tests so that they don't clash with the normal tests.
................
  r42573 | danieljames | 2008-01-07 11:41:05 -0800 (Mon, 07 Jan 2008) | 1 line
  
  Remove some development code.
................
  r42575 | danieljames | 2008-01-07 11:44:13 -0800 (Mon, 07 Jan 2008) | 3 lines
  
  Add missing 'use namespace std'. Which I should have done when I was told about
  them before. Sorry.
................
  r42576 | danieljames | 2008-01-07 11:46:27 -0800 (Mon, 07 Jan 2008) | 1 line
  
  Add support for multiple copyrights in the library info.
................
  r42578 | danieljames | 2008-01-07 11:51:02 -0800 (Mon, 07 Jan 2008) | 1 line
  
  Reneame the set and map compile tests so they'll be adjacent in the test results.
................
  r42580 | danieljames | 2008-01-07 12:06:15 -0800 (Mon, 07 Jan 2008) | 1 line
  
  Avoid some uses of an invalid pointer.
................
  r42581 | danieljames | 2008-01-07 12:07:12 -0800 (Mon, 07 Jan 2008) | 1 line
  
  Use the default location for the reference documentation.
................
  r42587 | danieljames | 2008-01-07 13:05:42 -0800 (Mon, 07 Jan 2008) | 5 lines
  
  Fix a bug which was causing the memory area stuff to fail.
  
  I should probably try to be less clever and use memory area's lower
  bounds as the key, and do the extra work required to get that working.
................
  r42588 | danieljames | 2008-01-07 13:07:43 -0800 (Mon, 07 Jan 2008) | 1 line
  
  Fix an off by one error.
................
  r42591 | danieljames | 2008-01-07 13:47:24 -0800 (Mon, 07 Jan 2008) | 1 line
  
  Merge in spell check.
................
  r42596 | turkanis | 2008-01-07 15:13:26 -0800 (Mon, 07 Jan 2008) | 5 lines
  
  merged changes from branches/iostreams_dev, revisions 42565-42595:
  
  - Simplified implementation with the help to the C-runtime function _get_osfhandle so that on Windows only a single HANDLE is stored and the POSIX-style implementation is never needed; added the handle_type on POSIX systems (typedef for int) and a function returning the underlying handle as an instance of handle_type
  - fixed the bug described in ticket Ticket #1551 (stream_buffer::seekpos ignores openmode parameter)
  - fixed test/operation_sequence_test.cpp file description
................
  r42598 | grafik | 2008-01-07 18:49:25 -0800 (Mon, 07 Jan 2008) | 1 line
  
  Mostly fix bad path calc for direct html from doxygen doc generation. (fixes #1562)
................
  r42600 | turkanis | 2008-01-07 19:49:23 -0800 (Mon, 07 Jan 2008) | 1 line
  
  merged changes from branches/iostreams_dev revisions 42595-42599; applied Dinkumware implementation of positioning functions to IBM Visual Age; simplified and corrected implementation
................
  r42602 | turkanis | 2008-01-07 20:20:38 -0800 (Mon, 07 Jan 2008) | 1 line
  
  removed unneeded headers, one of which (restrict.hpp) causes failures on IBM Visual Age
................
  r42603 | turkanis | 2008-01-07 20:52:54 -0800 (Mon, 07 Jan 2008) | 1 line
  
  removed spurious '.cpp' extension from test names (iostreams)
................
  r42612 | danieljames | 2008-01-08 05:59:01 -0800 (Tue, 08 Jan 2008) | 3 lines
  
  Merge in latest unordered developments (revisions 42607-42611).
................
  r42613 | jurko | 2008-01-08 06:40:24 -0800 (Tue, 08 Jan 2008) | 1 line
  
  Added a new test making sure properties conditioned on multiple different feature values are handled correctly. This especially includes testing the case when one of those features is <toolset> and the value given for it includes a toolset version.
................
  r42614 | jurko | 2008-01-08 07:21:15 -0800 (Tue, 08 Jan 2008) | 1 line
  
  Made some debugging messages more consistent.
................
  r42615 | eric_niebler | 2008-01-08 09:42:20 -0800 (Tue, 08 Jan 2008) | 1 line
  
  support for LaTeX formulas in Doxygen comments
................
  r42616 | eric_niebler | 2008-01-08 09:43:34 -0800 (Tue, 08 Jan 2008) | 1 line
  
  automatically generate png files from LaTeX formulas using doxygen
................
  r42617 | jurko | 2008-01-08 09:51:30 -0800 (Tue, 08 Jan 2008) | 1 line
  
  Comment correction.
................
  r42619 | danieljames | 2008-01-08 10:15:01 -0800 (Tue, 08 Jan 2008) | 1 line
  
  Merge: Another missing 'using namespace std'
................
  r42620 | eric_niebler | 2008-01-08 10:43:43 -0800 (Tue, 08 Jan 2008) | 1 line
  
  fix signed/unsigned warnings, clean up trailing whitespace
................
  r42624 | eric_niebler | 2008-01-08 13:40:52 -0800 (Tue, 08 Jan 2008) | 1 line
  
  disable iterator debugging for all msvc versions
................
  r42625 | turkanis | 2008-01-08 14:25:01 -0800 (Tue, 08 Jan 2008) | 1 line
  
  merged changes from branches/iostreams_dev, revisions 42602-42624: adding missing included to fix #1550; fix for positioning on IBM; fix for file_descriptor on POSIX; restructed the version range for the Borland workaround in large_file_test.cpp
................
  r42626 | jurko | 2008-01-08 17:09:26 -0800 (Tue, 08 Jan 2008) | 1 line
  
  Minor stylistic code indentation changes.
................
  r42627 | jurko | 2008-01-08 17:11:03 -0800 (Tue, 08 Jan 2008) | 1 line
  
  Tried trailing spaces. Minor comment typo corrections.
................
  r42628 | jurko | 2008-01-08 17:18:38 -0800 (Tue, 08 Jan 2008) | 1 line
  
  Remove trailing spaces. Removed an empty line.
................
  r42629 | jurko | 2008-01-08 20:05:29 -0800 (Tue, 08 Jan 2008) | 8 lines
  
  Updated the __ACTION_RULE__ to not return its action command output as a single string but instead split it into a list of output lines. This allows Jam code using this output to work correctly independently of what newline character combinations are in use. This was causing problems with Boost Build unit tests which can now be updated to pass.
  
  Consequences & checks:
    * Final __ACTION_RULE__ rule parameter has changed from output ? to output-lines *.
    * Updated corresponding Jam documentation.
    * Updated the all related Boost Build code.
    * No code on the Boost trunk uses this rule except for Boost Build itself.
................
  r42630 | jurko | 2008-01-08 20:15:35 -0800 (Tue, 08 Jan 2008) | 1 line
  
  Fixed a failing test by making it access action output using the __ACTION_RULE__ rule so it would not be affected by the level of debug output given by Boost Build/Jam.
................
  r42631 | jurko | 2008-01-08 20:30:25 -0800 (Tue, 08 Jan 2008) | 1 line
  
  Fixed a failing test by making it access its action results using the __ACTION_RULE__ rule. Now it works with the default debug level settings (i.e. no action output displayed).
................
  r42632 | grafik | 2008-01-08 20:31:58 -0800 (Tue, 08 Jan 2008) | 1 line
  
  Revert various changes that break backward compatibility, and also some minor edits.
................
  r42633 | grafik | 2008-01-08 20:34:12 -0800 (Tue, 08 Jan 2008) | 1 line
  
  Revert various changes that break backward compatibility, and also some minor edits.
................
  r42637 | jurko | 2008-01-09 06:36:37 -0800 (Wed, 09 Jan 2008) | 1 line
  
  Updated the test so it passes on Windows. Had to change it to enable action output logging and compensate for the fact that now action names are sent to the output as well. Minor stylistic changes.
................
  r42639 | jurko | 2008-01-09 09:03:45 -0800 (Wed, 09 Jan 2008) | 1 line
  
  Updated the test so it passes on Windows. Had to change it to enable action output logging and compensate for the fact that now action names are sent to the output as well. Minor stylistic changes.
................
  r42641 | eric_niebler | 2008-01-09 12:21:51 -0800 (Wed, 09 Jan 2008) | 1 line
  
  copy the png files to where fop will look for them when building pdf
................
  r42642 | eric_niebler | 2008-01-09 12:33:05 -0800 (Wed, 09 Jan 2008) | 1 line
  
  fix more signed/unsigned warnings
................
  r42644 | turkanis | 2008-01-09 15:13:57 -0800 (Wed, 09 Jan 2008) | 1 line
  
  marked stream_offset_64bit_test as an expected failure on vacpp (iostreams)
................
  r42645 | turkanis | 2008-01-09 15:16:17 -0800 (Wed, 09 Jan 2008) | 1 line
  
  replaced 2 occurrences of the identifier 'restrict' with BOOST_IOSTREAMS_RESTRICT
................
  r42646 | turkanis | 2008-01-09 19:27:51 -0800 (Wed, 09 Jan 2008) | 1 line
  
  added expected failures for Sun and IBM; removed a Borland intermittent failure; removed some obsolete toolsets (iostreams)
................
  r42647 | troyer | 2008-01-10 01:49:16 -0800 (Thu, 10 Jan 2008) | 1 line
  
  Optimizations for Boost.MPI
................
  r42648 | troyer | 2008-01-10 03:54:36 -0800 (Thu, 10 Jan 2008) | 1 line
  
  Undid backward-compatibility breaking change in pair serialization
................
  r42651 | johnmaddock | 2008-01-10 04:10:37 -0800 (Thu, 10 Jan 2008) | 1 line
  
  Apply patch from Issue #1187.
................
  r42657 | anthonyw | 2008-01-10 06:19:36 -0800 (Thu, 10 Jan 2008) | 1 line
  
  removed references to NULL
................
  r42658 | turkanis | 2008-01-10 10:50:19 -0800 (Thu, 10 Jan 2008) | 1 line
  
  marked up two moe expected failures for sun-5.7-5.8 (iostreams)
................
  r42664 | bgubenko | 2008-01-10 13:13:42 -0800 (Thu, 10 Jan 2008) | 1 line
  
  marked iostreams library compose_test for gcc-3.4.6_linux_ia64 : linking exceeds 10 min. limit
................
  r42665 | danieljames | 2008-01-10 14:25:35 -0800 (Thu, 10 Jan 2008) | 2 lines
  
  Initialise svnmerge for merging changes for unordered.
................
  r42666 | danieljames | 2008-01-10 14:30:46 -0800 (Thu, 10 Jan 2008) | 6 lines
  
  Merge latest unordered developments:
  
  Make simple_test test a little more.
  Use doubles for calculating max load factor.
  Some workarounds, mostly for Borland and running the tests.
................
  r42670 | turkanis | 2008-01-10 16:02:36 -0800 (Thu, 10 Jan 2008) | 1 line
  
  merged changes from branches/iostreams_dev, revisions 42645=42660; fix for Intel-darwin; removed dependence of file_descriptor_test and mapped_file_test on library boost_iostreams
................
  r42672 | turkanis | 2008-01-10 17:35:46 -0800 (Thu, 10 Jan 2008) | 1 line
  
  force static runtime-link for intel-darwin
................
  r42674 | johnmaddock | 2008-01-11 01:55:43 -0800 (Fri, 11 Jan 2008) | 1 line
  
  Fix bugs reported by Will Drewry: certain invalid regexes can cause the library to access invalid memory, changed to ensure that the correct exception is thrown long before this happens.
................
  r42676 | jurko | 2008-01-11 05:44:51 -0800 (Fri, 11 Jan 2008) | 1 line
  
  Removed the manual boost-build.jam file creation since that file already exists in the SVN repository and this only overwrote it with the same content minus the copyright notice. Removed a reference to the no longer existing boost_build_v2.html file.
................
  r42677 | johnmaddock | 2008-01-11 05:48:57 -0800 (Fri, 11 Jan 2008) | 1 line
  
  Update for Intel-10.1.
................
  r42684 | turkanis | 2008-01-11 11:12:22 -0800 (Fri, 11 Jan 2008) | 1 line
  
  another attempt to fix linking for compression tests on intel-darwin
................
  r42688 | turkanis | 2008-01-11 14:58:21 -0800 (Fri, 11 Jan 2008) | 1 line
  
  merged changes from iostreams_dev; fixes for IBM and more documentation
................
  r42689 | turkanis | 2008-01-11 18:45:55 -0800 (Fri, 11 Jan 2008) | 1 line
  
  more detailed note for vacpp (iostreams)
................
  r42691 | eric_niebler | 2008-01-11 22:43:28 -0800 (Fri, 11 Jan 2008) | 1 line
  
  new style transforms a-la proto v3
................
  r42693 | nesotto | 2008-01-12 04:38:57 -0800 (Sat, 12 Jan 2008) | 1 line
  
  doc fixes
................
  r42698 | danieljames | 2008-01-12 06:43:40 -0800 (Sat, 12 Jan 2008) | 9 lines
  
  Merge the latest unordered changes. These are concerned with getting the tests
  working on more compilers. The biggest change is that the exception tests have
  been changed to use a very simple exception testing mechanism on top of
  lightweight_test. This was because Boost.Test exception testing isn't working
  on several platforms. I'm trying to set this up so that I can use Boost.Test on
  compilers which it completely supports, and lightweight test on others.
  Boost.Test tests more than my simple exception testing code ever will so it's
  worth using where I can.
................
  r42700 | eric_niebler | 2008-01-12 09:09:17 -0800 (Sat, 12 Jan 2008) | 1 line
  
  missing includes
................
  r42701 | eric_niebler | 2008-01-12 09:40:40 -0800 (Sat, 12 Jan 2008) | 1 line
  
  more msvc-7.1-friendly default_context implementation, more missing headers
................
  r42706 | turkanis | 2008-01-12 12:19:42 -0800 (Sat, 12 Jan 2008) | 1 line
  
  corrected use of feature detection macros for AIX; simplified implementation slightly; updated docs
................
  r42707 | turkanis | 2008-01-12 12:20:35 -0800 (Sat, 12 Jan 2008) | 1 line
  
  removed intel-darwin sepcific code, since it didn't work
................
  r42708 | eric_niebler | 2008-01-12 13:19:45 -0800 (Sat, 12 Jan 2008) | 1 line
  
  port toy_spirit example to proto v3
................
  r42713 | turkanis | 2008-01-12 23:17:07 -0800 (Sat, 12 Jan 2008) | 1 line
  
  improved docs
................
  r42715 | nesotto | 2008-01-13 03:37:41 -0800 (Sun, 13 Jan 2008) | 1 line
  
  fixed #if to #ifdef
................
  r42722 | bgubenko | 2008-01-13 07:52:12 -0800 (Sun, 13 Jan 2008) | 1 line
  
  better note for iostreams library test compose_test on gcc-3.4.6_linux_ia64
................
  r42723 | bgubenko | 2008-01-13 08:12:37 -0800 (Sun, 13 Jan 2008) | 1 line
  
  marked up random library test random_test for gcc-3.4.6_linux_ia64
................
  r42724 | danieljames | 2008-01-13 08:19:26 -0800 (Sun, 13 Jan 2008) | 3 lines
  
  Merge in latest changes to Boost.Unordered. Some compiler workarounds and
  starting to clean up the tests a little.
................
  r42729 | eric_niebler | 2008-01-13 11:39:54 -0800 (Sun, 13 Jan 2008) | 1 line
  
  work around msvc-7.1 bug
................
  r42741 | eric_niebler | 2008-01-13 13:56:56 -0800 (Sun, 13 Jan 2008) | 1 line
  
  boost template instantiation depth on darwin
................
  r42745 | johnmaddock | 2008-01-14 01:46:12 -0800 (Mon, 14 Jan 2008) | 1 line
  
  Ooops, fix broken escape sequence.
................
  r42747 | johnmaddock | 2008-01-14 01:58:36 -0800 (Mon, 14 Jan 2008) | 1 line
  
  Fix documentation typos.
................
  r42750 | chris_kohlhoff | 2008-01-14 05:13:35 -0800 (Mon, 14 Jan 2008) | 2 lines
  
  Fix concept name in comment.
................
  r42751 | johnmaddock | 2008-01-14 05:17:09 -0800 (Mon, 14 Jan 2008) | 1 line
  
  Patch regex concept checks and TR1 library to work with VC9 + MS TR1 feature pack.
................
  r42752 | chris_kohlhoff | 2008-01-14 05:20:06 -0800 (Mon, 14 Jan 2008) | 2 lines
  
  Add missing broken pipe error.
................
  r42753 | chris_kohlhoff | 2008-01-14 05:21:37 -0800 (Mon, 14 Jan 2008) | 3 lines
  
  Don't include sys/time.h when compiling with aCC, as that header does not
  supply pselect(), which is needed for HP-UX/aCC to work correctly.
................
  r42754 | chris_kohlhoff | 2008-01-14 05:22:21 -0800 (Mon, 14 Jan 2008) | 2 lines
  
  Disable noisy and incorrect /Wp64 warnings generated by MSVC.
................
  r42755 | chris_kohlhoff | 2008-01-14 05:24:28 -0800 (Mon, 14 Jan 2008) | 3 lines
  
  Don't call epoll_wait/kevent if there are no old operations (where old means
  added prior to the last epoll_wait/kevent call) needing to be demultiplexed.
................
  r42756 | chris_kohlhoff | 2008-01-14 05:25:24 -0800 (Mon, 14 Jan 2008) | 2 lines
  
  Silence some integer truncation warnings.
................
  r42758 | chris_kohlhoff | 2008-01-14 05:27:52 -0800 (Mon, 14 Jan 2008) | 8 lines
  
  Silence some integer truncation warnings.
  
  Only perform the windows-bug workaround where we use a short timeout with
  GetQueuedCompletionStatus from one thread, i.e. the timer thread.
  
  Keep track of the number of OVERLAPPED-derived operations to ensure that
  they all get cleaned up when the io_service is destroyed.
................
  r42759 | chris_kohlhoff | 2008-01-14 05:29:08 -0800 (Mon, 14 Jan 2008) | 5 lines
  
  Check for truncation when converting buffer size from size_t to openssl's
  int argument.
  
  Try to fix possible thread-safety issues in SSL wrapper.
................
  r42766 | eric_niebler | 2008-01-14 08:49:32 -0800 (Mon, 14 Jan 2008) | 1 line
  
  register mpl::bool_ with typeof
................
  r42767 | dgregor | 2008-01-14 09:01:26 -0800 (Mon, 14 Jan 2008) | 1 line
  
  Improved suggestion for dealing with Qt MOC, from Niels Dekker
................
  r42771 | niels_dekker | 2008-01-14 10:17:30 -0800 (Mon, 14 Jan 2008) | 1 line
  
  Documented value_init workaround to compiler issues, added new introduction, updated to 2003 edition of C++ Standard -- reviewed by Fernando Cacciola
................
  r42773 | guwi17 | 2008-01-14 11:04:43 -0800 (Mon, 14 Jan 2008) | 2 lines
  
  - fixed typo
................
  r42776 | eric_niebler | 2008-01-14 12:26:58 -0800 (Mon, 14 Jan 2008) | 1 line
  
  add skip(), for specifying a skip regex
................
  r42778 | turkanis | 2008-01-14 12:47:17 -0800 (Mon, 14 Jan 2008) | 1 line
  
  overhaul of dual_use filters: close() is now called just once; suppressed Borland/Dinkumware warnings in mapped_file.hpp
................
  r42779 | niels_dekker | 2008-01-14 13:46:20 -0800 (Mon, 14 Jan 2008) | 1 line
  
  Minor "beautifications" of value_init documentation, inc. placing references in order of appearance
................
  r42780 | lbourdev | 2008-01-14 14:06:07 -0800 (Mon, 14 Jan 2008) | 3 lines
  
  Changed size_t to std::size_t
................
  r42781 | lbourdev | 2008-01-14 15:25:10 -0800 (Mon, 14 Jan 2008) | 3 lines
  
  GIL: Changing size_t to std::size_t
................
  r42788 | eric_niebler | 2008-01-14 22:46:39 -0800 (Mon, 14 Jan 2008) | 1 line
  
  code clean-up, begin updating the transform section in proto's docs
................
  r42789 | eric_niebler | 2008-01-14 23:46:51 -0800 (Mon, 14 Jan 2008) | 1 line
  
  try disabling iterator debugging for intel-win toolset
................
  r42797 | t_schwinger | 2008-01-15 11:46:10 -0800 (Tue, 15 Jan 2008) | 3 lines
  
  adds missing #include
................
  r42798 | niels_dekker | 2008-01-15 11:53:28 -0800 (Tue, 15 Jan 2008) | 1 line
  
  value_init doc + test: Added revision date.
................
  r42801 | jurko | 2008-01-15 13:13:52 -0800 (Tue, 15 Jan 2008) | 1 line
  
  Minor stylistic comment changes. Removed trailing spaces.
................
  r42804 | eric_niebler | 2008-01-15 14:06:51 -0800 (Tue, 15 Jan 2008) | 1 line
  
  document call<>, make<> and bind<>
................
  r42807 | turkanis | 2008-01-15 14:54:40 -0800 (Tue, 15 Jan 2008) | 1 line
  
  rewrote treatment of result_of in terms of a new (hopefully temporary) config macro BOOST_IOSTREAMS_NO_RESULT_OF; fixed docs
................
  r42811 | turkanis | 2008-01-15 17:14:04 -0800 (Tue, 15 Jan 2008) | 1 line
  
  reverted last change except for doc fixes; regression was result of test runner's local patch
................
  r42813 | turkanis | 2008-01-15 17:16:36 -0800 (Tue, 15 Jan 2008) | 1 line
  
  botched last commit
................
  r42814 | djenkins | 2008-01-15 22:39:34 -0800 (Tue, 15 Jan 2008) | 1 line
  
  missing include
................
  r42815 | niels_dekker | 2008-01-16 01:35:12 -0800 (Wed, 16 Jan 2008) | 1 line
  
  Added convenience class initialized_value, as announced at http://article.gmane.org/gmane.comp.lib.boost.devel/169833
................
  r42816 | niels_dekker | 2008-01-16 01:37:25 -0800 (Wed, 16 Jan 2008) | 1 line
  
  Added test and documentation for convenience class initialized_value, that was added with changeset [42815]
................
  r42817 | chris_kohlhoff | 2008-01-16 05:46:01 -0800 (Wed, 16 Jan 2008) | 2 lines
  
  Set the openssl callback function for getting a thread ID.
................
  r42818 | anthonyw | 2008-01-16 07:23:36 -0800 (Wed, 16 Jan 2008) | 1 line
  
  Provide tss_cleanup_implemented as a dummy function on Windows CE to allow tests to run
................
  r42821 | t_schwinger | 2008-01-16 11:16:37 -0800 (Wed, 16 Jan 2008) | 3 lines
  
  works around MSVC7.1 problems (hopefully)
................
  r42822 | t_schwinger | 2008-01-16 11:17:09 -0800 (Wed, 16 Jan 2008) | 3 lines
  
  attempts to fix Borland regressions
................
  r42823 | eric_niebler | 2008-01-16 11:24:33 -0800 (Wed, 16 Jan 2008) | 1 line
  
  document when<> and is_callable<>
................
  r42825 | turkanis | 2008-01-16 12:46:56 -0800 (Wed, 16 Jan 2008) | 1 line
  
  replaced __IBMCPP__ with _AIX
................
  r42827 | turkanis | 2008-01-16 16:50:14 -0800 (Wed, 16 Jan 2008) | 1 line
  
  added pgi to toolsets expected to fail seekawble_file_test (iostreams)
................
  r42836 | eric_niebler | 2008-01-17 14:47:54 -0800 (Thu, 17 Jan 2008) | 1 line
  
  stl_iterator does better error handling
................
  r42837 | jurko | 2008-01-17 17:14:17 -0800 (Thu, 17 Jan 2008) | 1 line
  
  Stylistic changes. Removed trailing spaces. Removed empty lines. Corrected comment typos and wording.
................
  r42839 | eric_niebler | 2008-01-17 23:56:31 -0800 (Thu, 17 Jan 2008) | 1 line
  
  tweaks for better doxygen-ated output
................
  r42840 | eric_niebler | 2008-01-17 23:56:59 -0800 (Thu, 17 Jan 2008) | 1 line
  
  updated reference section
................
  r42841 | eric_niebler | 2008-01-17 23:58:48 -0800 (Thu, 17 Jan 2008) | 1 line
  
  add back reference section, document user-defined transforms
................
  r42843 | t_schwinger | 2008-01-18 06:37:41 -0800 (Fri, 18 Jan 2008) | 3 lines
  
  makes member object support work with BCC
................
  r42851 | johnmaddock | 2008-01-18 08:56:57 -0800 (Fri, 18 Jan 2008) | 1 line
  
  Add needed <iostream> include.
................
  r42852 | johnmaddock | 2008-01-18 09:05:35 -0800 (Fri, 18 Jan 2008) | 1 line
  
  We don't have a tr1::hash functor if the std lib is the Apache version.
................
  r42853 | hkaiser | 2008-01-18 09:56:53 -0800 (Fri, 18 Jan 2008) | 1 line
  
  Wave: removed T_DEFINED token id from the library.
................
  r42855 | johnmaddock | 2008-01-18 10:18:17 -0800 (Fri, 18 Jan 2008) | 1 line
  
  Needs to #include <cstring> in order to use std::memset.
................
  r42856 | danieljames | 2008-01-18 11:35:55 -0800 (Fri, 18 Jan 2008) | 2 lines
  
  Merge in some changes to the unordered tests.
................
  r42857 | t_schwinger | 2008-01-18 12:05:56 -0800 (Fri, 18 Jan 2008) | 3 lines
  
  simplifies function_types markup
................
  r42858 | t_schwinger | 2008-01-18 12:52:06 -0800 (Fri, 18 Jan 2008) | 3 lines
  
  attempts to fix BCB 5.9 regression in synthesis/mem_func_ptr_cv_ptr_to_this test
................
  r42859 | t_schwinger | 2008-01-18 13:06:44 -0800 (Fri, 18 Jan 2008) | 3 lines
  
  attempts to fix pathscale failure 
................
  r42868 | niels_dekker | 2008-01-19 12:21:18 -0800 (Sat, 19 Jan 2008) | 1 line
  
  value_init_test now works around Borland 5.82 bug ("Error E2015: Ambiguity..." when using initialized_value), that is fixed with a newer compiler version
................
  r42869 | niels_dekker | 2008-01-19 12:52:04 -0800 (Sat, 19 Jan 2008) | 1 line
  
  Removed local named variable from     value_initialized::operator=, as Fernando Cacciola suggested me to avoid unnecessary named variables.
................
  r42873 | bemandawes | 2008-01-19 18:01:35 -0800 (Sat, 19 Jan 2008) | 1 line
  
  Remove extraneous defines since they are inherited from library build Jamfile
................
  r42877 | johnmaddock | 2008-01-20 01:42:35 -0800 (Sun, 20 Jan 2008) | 1 line
  
  Add include of <eh.h> for msvc.
................
  r42878 | igaztanaga | 2008-01-20 03:54:47 -0800 (Sun, 20 Jan 2008) | 5 lines
  
  Updated Interprocess and Intrusive:
  
  -> Added linear slist to intrusive
  -> Updated all allocators to version 2 allocators in Interprocess
  -> Optimized rbtree_best_fit size overhead to 1 std:size_t.
................
  r42881 | danieljames | 2008-01-20 09:37:21 -0800 (Sun, 20 Jan 2008) | 1 line
  
  Include <new> to get std::bad_alloc.
................
  r42882 | danieljames | 2008-01-20 10:55:57 -0800 (Sun, 20 Jan 2008) | 22 lines
  
  Merged revisions 42856-42881 via svnmerge from 
  https://svn.boost.org/svn/boost/branches/unordered/trunk
  
  ........
    r42880 | danieljames | 2008-01-20 16:10:43 +0000 (Sun, 20 Jan 2008) | 17 lines
    
    Simplify the tests a little:
    
    Add a parameter to random_values to control what sort of values it generates.
    This means that instead of using equivalent_object to test collisions (which
    was a total hack) we now just need another parameter.
    
    This requires some meta programming to act differently for maps and sets.
    Because of this pairs no longer need to be generated so remove the code for
    doing that (which doesn't work on some compilers).
    
    Remove the generator object, just call generate directly.
    
    Remove some of the tests using int containers, they didn't really add to
    anthing other than the compile time (some tests are timing out).
  ........
................
  r42884 | jurko | 2008-01-20 12:18:50 -0800 (Sun, 20 Jan 2008) | 5 lines
  
  Minor stylistic changes:
    * Removed trailing spaces.
    * Added a comment for code discovering the user's home-directories.
    * Removed a stale regex import.
    * Removed an old corpse 'identity' rule found inside the __test__ rule.
................
  r42890 | johnmaddock | 2008-01-21 01:41:17 -0800 (Mon, 21 Jan 2008) | 1 line
  
  Only disable wide character support for HP aCC: for gcc the logic is already taken care of in libstdcpp3.hpp.
................
  r42897 | hkaiser | 2008-01-21 08:13:31 -0800 (Mon, 21 Jan 2008) | 1 line
  
  Removed a duplicate entry.
................
  r42898 | rogeeff | 2008-01-21 09:02:53 -0800 (Mon, 21 Jan 2008) | 1 line
  
  changed output of booleans
................
  r42899 | johnmaddock | 2008-01-21 10:11:09 -0800 (Mon, 21 Jan 2008) | 1 line
  
  Updated type traits library so that everything compiles with -Wall -pedantic with GCC.
................
  r42904 | davedeakins | 2008-01-21 11:38:44 -0800 (Mon, 21 Jan 2008) | 1 line
  
  Don't include <eh.h> for WinCE (since WinCE does not have this header)
................
  r42906 | eric_niebler | 2008-01-21 12:39:35 -0800 (Mon, 21 Jan 2008) | 1 line
  
  minor clean-up
................
  r42909 | rogeeff | 2008-01-21 19:41:23 -0800 (Mon, 21 Jan 2008) | 1 line
  
  missing header
................
  r42911 | igaztanaga | 2008-01-22 08:49:22 -0800 (Tue, 22 Jan 2008) | 1 line
  
  Refactor some allocation code and fix instantiation problem in 64 bit platforms
................
  r42916 | eric_niebler | 2008-01-22 12:42:18 -0800 (Tue, 22 Jan 2008) | 1 line
  
  add concepts section to proto reference
................
  r42917 | hljin | 2008-01-22 14:10:48 -0800 (Tue, 22 Jan 2008) | 1 line
  
  GIL: fixed the problem with std::hex by adding #include <ios>
................
  r42918 | eric_niebler | 2008-01-22 18:23:15 -0800 (Tue, 22 Jan 2008) | 1 line
  
  proto works with boost 1.34.1
................
  r42929 | johnmaddock | 2008-01-23 08:08:44 -0800 (Wed, 23 Jan 2008) | 1 line
  
  Applies fix for issue #1598: added missing #include.
................
  r42931 | igaztanaga | 2008-01-23 11:34:39 -0800 (Wed, 23 Jan 2008) | 1 line
  
  Ticket #1593: [interprocess] 'streamoff' : is not a member of 'std'
................
  r42934 | andreas_huber69 | 2008-01-23 13:46:58 -0800 (Wed, 23 Jan 2008) | 1 line
  
  Fixes #1594
................
  r42935 | eric_niebler | 2008-01-23 13:57:47 -0800 (Wed, 23 Jan 2008) | 1 line
  
  fix dependency issue in Jamfile
................
  r42938 | jano_gaspar | 2008-01-23 15:04:57 -0800 (Wed, 23 Jan 2008) | 1 line
  
  circular_buffer: updated documentation
................
  r42939 | eric_niebler | 2008-01-23 15:25:24 -0800 (Wed, 23 Jan 2008) | 1 line
  
  fix quickbook scanner to recognize the [import ...] block
................
  r42943 | danieljames | 2008-01-23 15:39:59 -0800 (Wed, 23 Jan 2008) | 60 lines
  
  Merged revisions 42882-42941 via svnmerge from 
  https://svn.boost.org/svn/boost/branches/unordered/trunk
  
  ................
    r42887 | danieljames | 2008-01-20 21:32:04 +0000 (Sun, 20 Jan 2008) | 10 lines
    
    Merged revisions 42590-42664,42667-42697,42699-42723,42725-42855,42857-42881 via svnmerge from 
    https://svn.boost.org/svn/boost/trunk
    
    ........
      r42881 | danieljames | 2008-01-20 17:37:21 +0000 (Sun, 20 Jan 2008) | 1 line
      
      Include <new> to get std::bad_alloc.
    ........
  ................
    r42892 | danieljames | 2008-01-21 13:03:16 +0000 (Mon, 21 Jan 2008) | 1 line
    
    On some compilers the Rogue Wave/Apache stdcxx library doesn't have the normal std::distance, but instead has a variant that takes the result as the third parameter so it doesn't have to work out the type from the iterator.
  ................
    r42893 | danieljames | 2008-01-21 13:07:58 +0000 (Mon, 21 Jan 2008) | 1 line
    
    Fix a typo in the last commit.
  ................
    r42895 | danieljames | 2008-01-21 13:33:29 +0000 (Mon, 21 Jan 2008) | 1 line
    
    Remove tabs from the last checkin.
  ................
    r42896 | danieljames | 2008-01-21 15:51:40 +0000 (Mon, 21 Jan 2008) | 1 line
    
    Use Boost config to tell when we have a std::distance function. Also, no need for a macro.
  ................
    r42908 | danieljames | 2008-01-21 21:37:04 +0000 (Mon, 21 Jan 2008) | 1 line
    
    Use boost::long_long_type and boost::ulong_long_type.
  ................
    r42921 | danieljames | 2008-01-23 11:43:35 +0000 (Wed, 23 Jan 2008) | 1 line
    
    Remove some tabs.
  ................
    r42922 | danieljames | 2008-01-23 11:46:28 +0000 (Wed, 23 Jan 2008) | 2 lines
    
    Add missing include. Refs #1596
  ................
    r42923 | danieljames | 2008-01-23 11:52:47 +0000 (Wed, 23 Jan 2008) | 2 lines
    
    Always use void const* for the second parameter of allocate. Refs #1596.
  ................
    r42936 | danieljames | 2008-01-23 22:22:16 +0000 (Wed, 23 Jan 2008) | 1 line
    
    Use Boost style library name in the documentation.
  ................
    r42937 | danieljames | 2008-01-23 22:22:32 +0000 (Wed, 23 Jan 2008) | 1 line
    
    More tabs.
  ................
    r42941 | danieljames | 2008-01-23 23:35:01 +0000 (Wed, 23 Jan 2008) | 1 line
    
    Fix all the allocators.
  ................
................
  r42948 | turkanis | 2008-01-23 22:50:32 -0800 (Wed, 23 Jan 2008) | 1 line
  
  merged changes from iostreams_dev, revisions 42825-42947
................
  r42950 | t_schwinger | 2008-01-24 10:56:27 -0800 (Thu, 24 Jan 2008) | 3 lines
  
  correctsbroken compiler support for MPL
................
  r42951 | eric_niebler | 2008-01-24 13:06:23 -0800 (Thu, 24 Jan 2008) | 1 line
  
  peeker optimization looks inside independent sub-expressions
................
  r42952 | nesotto | 2008-01-24 14:22:35 -0800 (Thu, 24 Jan 2008) | 1 line
  
  test of output iterators
................
  r42953 | nesotto | 2008-01-24 14:26:36 -0800 (Thu, 24 Jan 2008) | 1 line
  
  output iterator test
................
  r42954 | nesotto | 2008-01-24 14:27:27 -0800 (Thu, 24 Jan 2008) | 1 line
  
  output iterators for ptr_containers 
................
  r42957 | t_schwinger | 2008-01-24 16:26:16 -0800 (Thu, 24 Jan 2008) | 3 lines
  
  simplifies preprocessing code
................
  r42958 | t_schwinger | 2008-01-24 16:28:15 -0800 (Thu, 24 Jan 2008) | 3 lines
  
  touched
................
  r42960 | noel_belcourt | 2008-01-24 20:41:16 -0800 (Thu, 24 Jan 2008) | 6 lines
  
  Changed the -soname and -shared options in intel-darwin.jam
  to use -dynamiclib and -install_name, as done in darwin.jam.
  Apparently the Intel compilers on the Mac support the same 
  options as gcc for setting the internal dynamic library name.
................
  r42963 | nesotto | 2008-01-24 23:52:14 -0800 (Thu, 24 Jan 2008) | 1 line
  
  renaming ...
................
  r42964 | nesotto | 2008-01-24 23:52:56 -0800 (Thu, 24 Jan 2008) | 1 line
  
  renaming
................
  r42965 | nesotto | 2008-01-24 23:54:28 -0800 (Thu, 24 Jan 2008) | 1 line
  
  renaming
................
  r42970 | turkanis | 2008-01-25 09:56:25 -0800 (Fri, 25 Jan 2008) | 1 line
  
  merged changes from iostreams_dev, revisions 42947-42962: fixed tickets 1003, 1139, 1140, 1149
................
  r42971 | noel_belcourt | 2008-01-25 11:52:47 -0800 (Fri, 25 Jan 2008) | 2 lines
  
  Fixed a typo to yesterdays patch.
................
  r42972 | dgregor | 2008-01-25 13:07:14 -0800 (Fri, 25 Jan 2008) | 2 lines
  
  Include <ios> to get std::boolalpha. Fixes #1586
................
  r42974 | igaztanaga | 2008-01-25 15:07:51 -0800 (Fri, 25 Jan 2008) | 4 lines
  
  1)Fixed gcc release mode warnings.
  2)Replaced throw with BOOST_RETHROW when BOOST_TRY is used.
  3)Fixed issues with singly linked lists
................
  r42976 | hkaiser | 2008-01-25 17:24:21 -0800 (Fri, 25 Jan 2008) | 2 lines
  
  Wave: Fixed a problem in flex_string::compare() (#include_next was non-functional).
................
  r42977 | hkaiser | 2008-01-25 17:36:20 -0800 (Fri, 25 Jan 2008) | 1 line
  
  Wave: Added new testcase.
................
  r42980 | hkaiser | 2008-01-25 17:44:32 -0800 (Fri, 25 Jan 2008) | 1 line
  
  Wave: Tweaked new testcase.
................
  r42982 | igaztanaga | 2008-01-26 03:52:25 -0800 (Sat, 26 Jan 2008) | 1 line
  
  Refactored common slist functions in a single class
................
  r42984 | noel_belcourt | 2008-01-26 10:35:59 -0800 (Sat, 26 Jan 2008) | 7 lines
  
  Fixes #416
  
  Fixed spelling of Jack Edmonds name and renamed files
  where necessary.  Updated the documentation as well.
  Tested changes by building/running tests in libs/graph/test.
................
  r42985 | noel_belcourt | 2008-01-26 10:51:28 -0800 (Sat, 26 Jan 2008) | 5 lines
  
  Fixes #640
  
  Corrected the mpl push_front html documentation.
................
  r42986 | eric_niebler | 2008-01-26 11:38:44 -0800 (Sat, 26 Jan 2008) | 1 line
  
  optimize repeated searches with patterns that have leading repeats
................
  r42987 | t_schwinger | 2008-01-26 13:50:14 -0800 (Sat, 26 Jan 2008) | 3 lines
  
  attempts to allow some preprocessing with VACPP (IBM)
................
  r42988 | noel_belcourt | 2008-01-26 14:21:57 -0800 (Sat, 26 Jan 2008) | 5 lines
  
  Fixes #1539
  
  Fixed typo in the random documentation.
................
  r42989 | noel_belcourt | 2008-01-26 15:06:24 -0800 (Sat, 26 Jan 2008) | 6 lines
  
  Fixes #965
  
  Patched the XML and will check to ensure the html
  page reflects this change.
................
  r42990 | eric_niebler | 2008-01-26 21:56:46 -0800 (Sat, 26 Jan 2008) | 1 line
  
  updated vcproj
................
  r42991 | eric_niebler | 2008-01-26 21:57:08 -0800 (Sat, 26 Jan 2008) | 1 line
  
  fix typo
................
  r42992 | johnmaddock | 2008-01-27 10:43:35 -0800 (Sun, 27 Jan 2008) | 1 line
  
  Extended leading repeat optimization to more cases.
................
  r42997 | vladimir_prus | 2008-01-28 09:59:27 -0800 (Mon, 28 Jan 2008) | 1 line
  
  Correct speliing of --build-dir in --help output
................
  r43000 | eric_niebler | 2008-01-28 12:03:41 -0800 (Mon, 28 Jan 2008) | 1 line
  
  update acknowledgement of john maddock
................
  r43001 | bgubenko | 2008-01-28 13:27:13 -0800 (Mon, 28 Jan 2008) | 1 line
  
  marked 2 asio library tests for gcc-4.2.1_hpux_ia64 (HP-UX 11.23 with gcc)
................
  r43002 | eric_niebler | 2008-01-28 14:55:30 -0800 (Mon, 28 Jan 2008) | 1 line
  
  doc more concepts, misc clean-up
................
  r43003 | eric_niebler | 2008-01-28 14:56:46 -0800 (Mon, 28 Jan 2008) | 1 line
  
  proto doxygen comments, misc clean-up
................
  r43006 | eric_niebler | 2008-01-28 18:20:45 -0800 (Mon, 28 Jan 2008) | 1 line
  
  more proto doxygen comments, update copyright
................
  r43007 | vladimir_prus | 2008-01-28 22:28:09 -0800 (Mon, 28 Jan 2008) | 1 line
  
  Retain top-level boost-build.jam
................
  r43008 | vladimir_prus | 2008-01-28 22:40:06 -0800 (Mon, 28 Jan 2008) | 4 lines
  
  Disable relinking when <target-os> is either windows or cygwin.
  
  Fixes #1062.
................
  r43009 | eric_niebler | 2008-01-28 23:03:03 -0800 (Mon, 28 Jan 2008) | 1 line
  
  add tests for deep_copy, make_expr, unpack_expr; fix bugs; update more copyrights
................
  r43012 | djenkins | 2008-01-29 08:41:12 -0800 (Tue, 29 Jan 2008) | 1 line
  
  fix typo
................
  r43013 | djenkins | 2008-01-29 08:43:51 -0800 (Tue, 29 Jan 2008) | 1 line
  
  update copyright and misc cleanup
................
  r43014 | bgubenko | 2008-01-29 09:47:01 -0800 (Tue, 29 Jan 2008) | 1 line
  
  marked interprocess library unusable on gcc-4.2.1_hpux_ia64 (until it is ported to HP-UX platform)
................
  r43016 | eric_niebler | 2008-01-29 13:02:52 -0800 (Tue, 29 Jan 2008) | 1 line
  
  make_expr and unpack_expr improvements, fix scary transform::arg_c bug
................
  r43018 | djenkins | 2008-01-29 19:39:02 -0800 (Tue, 29 Jan 2008) | 1 line
  
  use skip directive to simplify example
................
  r43023 | eric_niebler | 2008-01-30 14:10:13 -0800 (Wed, 30 Jan 2008) | 1 line
  
  finally, a make_expr() I can live with
................
  r43024 | eric_niebler | 2008-01-30 14:26:34 -0800 (Wed, 30 Jan 2008) | 1 line
  
  regenerated boostbook reference
................
  r43025 | niels_dekker | 2008-01-30 14:42:23 -0800 (Wed, 30 Jan 2008) | 1 line
  
  value_init: Removed aligned_storage::address() calls, to improve TR1 compatibility, as confirmed by John Maddock. Added internal helper function, wrapper_address(), as discussed with Fernando.
................
  r43026 | eric_niebler | 2008-01-30 15:03:36 -0800 (Wed, 30 Jan 2008) | 1 line
  
  minor tweak to make_expr result_of return type calculation
................
  r43031 | eric_niebler | 2008-01-30 23:36:28 -0800 (Wed, 30 Jan 2008) | 1 line
  
  simplify make_expr.hpp, user docs for make_expr()
................
  r43035 | eric_niebler | 2008-01-31 10:44:17 -0800 (Thu, 31 Jan 2008) | 1 line
  
  minor tweak to fusion value_of and value_at for expressions, for better interop with proto::unpack_expr
................
  r43037 | vladimir_prus | 2008-01-31 11:47:12 -0800 (Thu, 31 Jan 2008) | 1 line
  
  Build in MT mode (as long as wave links to boost.thread)
................
  r43038 | hkaiser | 2008-01-31 12:57:47 -0800 (Thu, 31 Jan 2008) | 1 line
  
  Wave: fixed expanding_function_like_macro()
................
  r43040 | eric_niebler | 2008-01-31 13:12:44 -0800 (Thu, 31 Jan 2008) | 1 line
  
  finish documentation for expression construction utilities
................
  r43041 | hkaiser | 2008-01-31 14:33:43 -0800 (Thu, 31 Jan 2008) | 1 line
  
  Wave: Added additional configuration possibility to allow control threading support.
................
  r43042 | hkaiser | 2008-01-31 14:48:56 -0800 (Thu, 31 Jan 2008) | 1 line
  
  Wave: Added additional configuration possibility to allow control threading support. Updated the documentation.
................
  r43043 | jurko | 2008-01-31 16:27:31 -0800 (Thu, 31 Jan 2008) | 1 line
  
  Reverted changes made in rev 43038 which seem to have been committed by mistake and include some user specific settings in it local to the comitter's environment while this file is intended to be used as generic template for actual user-config.jam files and do nothing in case user does not specify his own settings there.
................
  r43044 | jurko | 2008-01-31 16:44:23 -0800 (Thu, 31 Jan 2008) | 1 line
  
  Minor stylistic spacing changes. Remove trailing spaces.
................
  r43045 | jurko | 2008-01-31 16:46:50 -0800 (Thu, 31 Jan 2008) | 1 line
  
  Corrected outputting native Windows paths so that it works correctly for absolute paths without the drive letter being explicitly specified, e.g. \aaa\bbb or /aaa/bbb.
................
  r43046 | jurko | 2008-01-31 17:49:16 -0800 (Thu, 31 Jan 2008) | 1 line
  
  Added the missing end-of-line character when outputting DEBUG_SEARCH debug messages from file_build1(). This cleans up the -d+6 bjam output a lot.
................
  r43050 | eric_niebler | 2008-02-01 12:30:29 -0800 (Fri, 01 Feb 2008) | 1 line
  
  add future group example
................
  r43052 | noel_belcourt | 2008-02-01 18:41:23 -0800 (Fri, 01 Feb 2008) | 4 lines
  
  Fix a typo in pgi.jam that prevented shared libraries
  from being built correctly.
................
  r43054 | chris_kohlhoff | 2008-02-02 03:37:45 -0800 (Sat, 02 Feb 2008) | 4 lines
  
  Ensure that the workaround for the MSVC secure iterator problem is only
  used when compiling with MSVC. The workaround causes g++'s library debug
  mode to report errors due to the assignment from a singular iterator.
................
  r43055 | chris_kohlhoff | 2008-02-02 03:39:17 -0800 (Sat, 02 Feb 2008) | 2 lines
  
  Fix "possible loss of data" warning when building for Windows 2000 targets.
................
  r43056 | chris_kohlhoff | 2008-02-02 04:02:23 -0800 (Sat, 02 Feb 2008) | 3 lines
  
  The latest Windows SDKs don't support IPv6 when building for Windows 2000,
  so we need to use the SDK emulation in that case.
................
  r43057 | eric_niebler | 2008-02-02 04:27:16 -0800 (Sat, 02 Feb 2008) | 1 line
  
  port test to boost version 1.34.1
................
  r43061 | turkanis | 2008-02-02 14:10:46 -0800 (Sat, 02 Feb 2008) | 1 line
  
  merged changes from iostreams_dev, revisions 42962-43059: updated copyright notices
................
  r43080 | eric_niebler | 2008-02-03 10:40:03 -0800 (Sun, 03 Feb 2008) | 1 line
  
  fix bug found by L. Evans re: fusion and stateful function objects
................
  r43083 | johnmaddock | 2008-02-04 01:13:36 -0800 (Mon, 04 Feb 2008) | 1 line
  
  Added missing file.
................
  r43085 | johnmaddock | 2008-02-04 01:17:35 -0800 (Mon, 04 Feb 2008) | 1 line
  
  Removed dead file.
................
  r43087 | johnmaddock | 2008-02-04 01:20:46 -0800 (Mon, 04 Feb 2008) | 1 line
  
  Removed dead files.
................
  r43089 | johnmaddock | 2008-02-04 01:23:28 -0800 (Mon, 04 Feb 2008) | 1 line
  
  Removed dead files.
................
  r43094 | anthonyw | 2008-02-04 05:16:32 -0800 (Mon, 04 Feb 2008) | 1 line
  
  added test for duration overloads of timed_lock, and added missing implementation to win32 version
................
  r43101 | hkaiser | 2008-02-04 11:21:46 -0800 (Mon, 04 Feb 2008) | 1 line
  
  Wave: trying to fix stdcxx_gcc regression.
................
  r43103 | matias | 2008-02-04 13:01:06 -0800 (Mon, 04 Feb 2008) | 1 line
  
  hooking --> additional information in html docs
................
  r43106 | eric_niebler | 2008-02-04 18:09:51 -0800 (Mon, 04 Feb 2008) | 1 line
  
  fleshing out evaluation.qbk, document transforms of if_, not_, and_ and or_
................
  r43107 | eric_niebler | 2008-02-04 21:33:12 -0800 (Mon, 04 Feb 2008) | 1 line
  
  eliminate warnings under msvc's -W4
................
  r43111 | eric_niebler | 2008-02-04 22:03:01 -0800 (Mon, 04 Feb 2008) | 1 line
  
  fix typo
................
  r43112 | marshall | 2008-02-05 08:07:19 -0800 (Tue, 05 Feb 2008) | 1 line
  
  Fix typo (bug #1434)
................
  r43113 | marshall | 2008-02-05 08:15:35 -0800 (Tue, 05 Feb 2008) | 1 line
  
  Applied patch (fixes bug #1307)
................
  r43117 | dgregor | 2008-02-05 12:51:23 -0800 (Tue, 05 Feb 2008) | 1 line
  
  Fix add_vertex and add_vertices when the CSR graph has vertex properties
................
  r43118 | danieljames | 2008-02-05 12:57:02 -0800 (Tue, 05 Feb 2008) | 13 lines
  
  Merged revisions 42942-43116 via svnmerge from 
  https://svn.boost.org/svn/boost/branches/unordered/trunk
  
  ........
    r42975 | danieljames | 2008-01-26 00:29:32 +0000 (Sat, 26 Jan 2008) | 1 line
    
    Typedef some types before using them, to make life easier for Borland.
  ........
    r43116 | danieljames | 2008-02-05 20:47:44 +0000 (Tue, 05 Feb 2008) | 1 line
    
    Some compilers and libraries combinations have problems with deques of non-assingable types. Using a list instead.
  ........
................
  r43120 | eric_niebler | 2008-02-05 13:07:31 -0800 (Tue, 05 Feb 2008) | 1 line
  
  add missing #include
................
  r43121 | bemandawes | 2008-02-05 18:01:46 -0800 (Tue, 05 Feb 2008) | 1 line
  
  Add circular_buffer to the alphabetic list
................
  r43125 | t_schwinger | 2008-02-06 05:00:08 -0800 (Wed, 06 Feb 2008) | 3 lines
  
  attempts to make synthesis metafunctions work with sun compiler
................
  r43129 | danieljames | 2008-02-06 11:02:38 -0800 (Wed, 06 Feb 2008) | 2 lines
  
  In the boostbook navbar, link FAQ and people to the website.
................
  r43130 | eric_niebler | 2008-02-06 11:57:51 -0800 (Wed, 06 Feb 2008) | 1 line
  
  untabify
................
  r43132 | nesotto | 2008-02-06 14:46:19 -0800 (Wed, 06 Feb 2008) | 1 line
  
  cleanup to pass inspection report
................
  r43133 | nesotto | 2008-02-06 14:46:31 -0800 (Wed, 06 Feb 2008) | 1 line
  
  cleanup to pass inspection report
................
  r43134 | eric_niebler | 2008-02-06 14:57:57 -0800 (Wed, 06 Feb 2008) | 1 line
  
  add handy get() accessors on literal<> wrapper
................
  r43135 | nesotto | 2008-02-06 15:12:21 -0800 (Wed, 06 Feb 2008) | 1 line
  
  cleanup to pass inspection tool
................
  r43136 | eric_niebler | 2008-02-06 16:05:01 -0800 (Wed, 06 Feb 2008) | 1 line
  
  reasonably complete user docs for expression evaluation
................
  r43138 | eric_niebler | 2008-02-07 00:06:29 -0800 (Thu, 07 Feb 2008) | 1 line
  
  tweaks for doxygen 1.5.4, document matches<>
................
  r43141 | johnmaddock | 2008-02-07 01:55:41 -0800 (Thu, 07 Feb 2008) | 1 line
  
  Fix last checked version.
................
  r43143 | johnmaddock | 2008-02-07 02:03:16 -0800 (Thu, 07 Feb 2008) | 1 line
  
  Remove tabs.
................
  r43145 | johnmaddock | 2008-02-07 02:13:31 -0800 (Thu, 07 Feb 2008) | 1 line
  
  Fix min/max usage violation.
................
  r43147 | vladimir_prus | 2008-02-07 02:17:03 -0800 (Thu, 07 Feb 2008) | 2 lines
  
  Attempt to unbreak <library-file>
................
  r43148 | johnmaddock | 2008-02-07 02:24:29 -0800 (Thu, 07 Feb 2008) | 1 line
  
  Added comment to suppress inspect warning.
................
  r43150 | johnmaddock | 2008-02-07 02:29:59 -0800 (Thu, 07 Feb 2008) | 1 line
  
  Added fix for inspection report.
................
  r43152 | vladimir_prus | 2008-02-07 03:04:30 -0800 (Thu, 07 Feb 2008) | 4 lines
  
  Fix <framework> with no path.
  
  Patch from Jon Olsson.
................
  r43154 | bemandawes | 2008-02-07 05:22:34 -0800 (Thu, 07 Feb 2008) | 1 line
  
  Remove obsolete CVS scripts, add 1.35.0 SVN scripts, beginning of docs page
................
  r43155 | nesotto | 2008-02-07 06:41:04 -0800 (Thu, 07 Feb 2008) | 6 lines
  
  
  iterator_range disables msvc warning 4996
      <http://svn.boost.org/trac/boost/ticket/1565>
  
  [range] sub_range assignment issue
      <http://svn.boost.org/trac/boost/ticket/1284> 
................
  r43156 | nesotto | 2008-02-07 06:46:19 -0800 (Thu, 07 Feb 2008) | 1 line
  
  test
................
  r43157 | joaquin | 2008-02-07 08:29:27 -0800 (Thu, 07 Feb 2008) | 1 line
  
  updated according to latest regression tests results, fixed a broken link, typo
................
  r43159 | turkanis | 2008-02-07 09:07:28 -0800 (Thu, 07 Feb 2008) | 1 line
  
  added missing 'self.' qualification
................
  r43165 | dgregor | 2008-02-07 13:08:09 -0800 (Thu, 07 Feb 2008) | 1 line
  
  Support for non-blocking MPI operations in Python, from Andreas Kloeckner
................
  r43166 | dgregor | 2008-02-07 13:09:38 -0800 (Thu, 07 Feb 2008) | 1 line
  
  Note addition of nonblocking operations to the Python interface
................
  r43171 | nesotto | 2008-02-08 01:58:35 -0800 (Fri, 08 Feb 2008) | 1 line
  
  silence of warnings for unused arguments
................
  r43175 | nesotto | 2008-02-08 07:25:01 -0800 (Fri, 08 Feb 2008) | 1 line
  
  missing ) fixed
................
  r43176 | noel_belcourt | 2008-02-08 08:32:35 -0800 (Fri, 08 Feb 2008) | 14 lines
  
  Force PPC Darwin to use fork instead of vfork.  This change
  requires both the parent and child process to explicitly set
  the process group id. Vfork guarantees the child process 
  runs to the exec before it releases the parent process.  
  Now that we use fork instead of vfork, it's possible for the 
  parent to wait on the child process without having the child 
  setpgid on itself.  This eliminates spurious hangs on ppc
  darwin caused by either a race condition between vfork and
  execvp, or a bug in the vfork implementation.
  
  Added a test to ensure we don't try to read from the
  stderr pipe descriptor if the descriptor's not valid.
................
  r43177 | eric_niebler | 2008-02-08 09:11:57 -0800 (Fri, 08 Feb 2008) | 1 line
  
  reserve some c_type bits for dinkumware on windows, fixes #1625
................
  r43179 | noel_belcourt | 2008-02-08 09:53:50 -0800 (Fri, 08 Feb 2008) | 13 lines
  
  I've added the -single_module option to the intel-darwin.link.dll
  action to fix this linker error when linking dylibs:
  
  ld: common symbols not allowed with MH_DYLIB output format with the -multi_module option
  boost/bin.v2/libs/system/build/intel-darwin-9.1/debug/macosx-version-10.4/error_code.o 
    definition of common __ZGVZNK5boost6system14error_category7messageEiE1s (size 16)
  boost/bin.v2/libs/system/build/intel-darwin-9.1/debug/macosx-version-10.4/error_code.o 
    definition of common __ZZNK5boost6system14error_category7messageEiE1s (size 16)
  
  though I would note that the common symbols problem occurs in a number of
  other libraries (test, graph, spirit, ...) as well.
................
  r43188 | danieljames | 2008-02-09 04:29:02 -0800 (Sat, 09 Feb 2008) | 2 lines
  
  Fix a link in the intrusive redirect.
................
  r43189 | danieljames | 2008-02-09 04:37:00 -0800 (Sat, 09 Feb 2008) | 1 line
  
  Fix another redirect link.
................
  r43190 | danieljames | 2008-02-09 04:38:19 -0800 (Sat, 09 Feb 2008) | 1 line
  
  Update link to Jamfile, to link to the version 2 jamfile.
................
  r43191 | danieljames | 2008-02-09 04:39:06 -0800 (Sat, 09 Feb 2008) | 1 line
  
  Fix a link.
................
  r43192 | danieljames | 2008-02-09 04:45:32 -0800 (Sat, 09 Feb 2008) | 2 lines
  
  Add a forwarding header for hash/custom.html as Boost.Bimap links to it.
................
  r43193 | danieljames | 2008-02-09 05:02:45 -0800 (Sat, 09 Feb 2008) | 1 line
  
  Fix the link to the license.
................
  r43199 | eric_niebler | 2008-02-09 12:32:27 -0800 (Sat, 09 Feb 2008) | 1 line
  
  more doxygen comments, const-correctness tweak for fusion::at() on proto expression
................
  r43200 | eric_niebler | 2008-02-09 12:34:33 -0800 (Sat, 09 Feb 2008) | 1 line
  
  document how to access children of proto expressions
................
  r43204 | eric_niebler | 2008-02-09 22:57:24 -0800 (Sat, 09 Feb 2008) | 1 line
  
  fix oops in proto fusion interface
................
  r43205 | eric_niebler | 2008-02-09 23:02:54 -0800 (Sat, 09 Feb 2008) | 1 line
  
  suppress msvc warning
................
  r43206 | danieljames | 2008-02-10 01:55:03 -0800 (Sun, 10 Feb 2008) | 1 line
  
  Fix some broken links.
................
  r43207 | vladimir_prus | 2008-02-10 05:13:41 -0800 (Sun, 10 Feb 2008) | 4 lines
  
  Tolerate argc being zero.
  
  Patch from C. K. Jester-Young.
................
  r43209 | danieljames | 2008-02-10 06:56:22 -0800 (Sun, 10 Feb 2008) | 1 line
  
  Link to people pages on the website, as they've been removed from the download.
................
  r43210 | danieljames | 2008-02-10 07:02:17 -0800 (Sun, 10 Feb 2008) | 1 line
  
  Point links to the pages that used to be in 'more' to the site.
................
  r43212 | danieljames | 2008-02-10 08:10:16 -0800 (Sun, 10 Feb 2008) | 1 line
  
  Fix links on the home page as well.
................
  r43213 | danieljames | 2008-02-10 08:21:22 -0800 (Sun, 10 Feb 2008) | 1 line
  
  Generated documentation which is no longer generated.
................
  r43220 | eric_niebler | 2008-02-10 19:48:41 -0800 (Sun, 10 Feb 2008) | 1 line
  
  include config.hpp and workaround.hpp before uses of BOOST_WORKAROUND and BOOST_MSVC
................
  r43221 | chris_kohlhoff | 2008-02-11 05:59:44 -0800 (Mon, 11 Feb 2008) | 2 lines
  
  Need to define _XOPEN_SOURCE_EXTENDED when compiling for HP-UX.
................
  r43226 | djenkins | 2008-02-11 12:49:19 -0800 (Mon, 11 Feb 2008) | 1 line
  
  cleanup using local<> and skip()
................
  r43239 | turkanis | 2008-02-12 21:43:39 -0800 (Tue, 12 Feb 2008) | 1 line
  
  fixed return value of read(), to correctly handle eof
................
  r43240 | turkanis | 2008-02-12 21:47:44 -0800 (Tue, 12 Feb 2008) | 1 line
  
  merged changes from iostreams_dev, revisions 43059-43238: better debug output for mapped file; fixed large_file_test.cpp under UNICODE on Windows
................
  r43241 | turkanis | 2008-02-13 11:38:52 -0800 (Wed, 13 Feb 2008) | 1 line
  
  added markup for stdcxx failures (iostreams)
................
  r43243 | turkanis | 2008-02-13 11:42:10 -0800 (Wed, 13 Feb 2008) | 1 line
  
  switched from <wchar.h> to <cwchar>, for stdcxx (which is conforming in this case)
................
  r43246 | matias | 2008-02-14 09:33:12 -0800 (Thu, 14 Feb 2008) | 1 line
  
  remove local admonitions
................
  r43247 | matias | 2008-02-14 09:43:52 -0800 (Thu, 14 Feb 2008) | 1 line
  
  optional docs fixes
................
  r43248 | matias | 2008-02-14 09:44:21 -0800 (Thu, 14 Feb 2008) | 1 line
  
  redirect optional docs to new version
................
  r43251 | matias | 2008-02-14 10:08:16 -0800 (Thu, 14 Feb 2008) | 1 line
  
  conversion docs fixes
................
  r43252 | matias | 2008-02-14 10:09:34 -0800 (Thu, 14 Feb 2008) | 1 line
  
  redirect to new conversion docs
................
  r43253 | matias | 2008-02-14 10:19:34 -0800 (Thu, 14 Feb 2008) | 1 line
  
  redirect optional and numeric/conversion docs to new version
................
  r43254 | matias | 2008-02-14 11:03:55 -0800 (Thu, 14 Feb 2008) | 1 line
  
  bimap doc fixes
................
  r43255 | matias | 2008-02-14 11:05:04 -0800 (Thu, 14 Feb 2008) | 1 line
  
  fix tabs in files
................
  r43256 | matias | 2008-02-14 11:22:15 -0800 (Thu, 14 Feb 2008) | 1 line
  
  fix tabs in files
................
  r43260 | matias | 2008-02-14 13:24:11 -0800 (Thu, 14 Feb 2008) | 1 line
  
  add missing images
................
  r43262 | hkaiser | 2008-02-14 14:01:54 -0800 (Thu, 14 Feb 2008) | 1 line
  
  Fixed a whitespace insertion glitch, where whitespace got inserted unconditionally between two operators even if one of these was a comma.
................
  r43264 | hkaiser | 2008-02-14 15:52:33 -0800 (Thu, 14 Feb 2008) | 1 line
  
  Wave: More fixes to whitespace insertion engine.
................
  r43266 | hkaiser | 2008-02-15 06:35:36 -0800 (Fri, 15 Feb 2008) | 1 line
  
  Wave: More fixes to whitespace insertion engine.
................
  r43269 | pdimov | 2008-02-15 10:40:36 -0800 (Fri, 15 Feb 2008) | 1 line
  
  Added support for &&, ||
................
  r43272 | andreas_huber69 | 2008-02-16 02:13:08 -0800 (Sat, 16 Feb 2008) | 1 line
  
  Updated statechart markup
................
  r43274 | andreas_huber69 | 2008-02-16 02:19:49 -0800 (Sat, 16 Feb 2008) | 2 lines
  
  Silenced GCC 4.0.1 warning (patch supplied by Euan)
  <http://thread.gmane.org/gmane.comp.lib.boost.devel/171071>
................
  r43280 | jurko | 2008-02-16 08:50:42 -0800 (Sat, 16 Feb 2008) | 1 line
  
  Corrected comments related to the allowed linker & linker-type values. Minor stylistic changes.
................
  r43281 | jurko | 2008-02-16 08:53:33 -0800 (Sat, 16 Feb 2008) | 1 line
  
  Added support for compiling C++ programs without RTTI support using the gcc toolset.
................
  r43282 | jurko | 2008-02-16 09:03:54 -0800 (Sat, 16 Feb 2008) | 1 line
  
  Made the msvc toolset always explicitly enable or disable rtti support based on the <rtti> feature value instead of only setting it if <rtti>on and depending on it being disabled by default. The original behaviour did not work well with msvc 8.0 for which there was not way to disable rtti support as that compiler enables rtti support by default.
................
  r43283 | bemandawes | 2008-02-16 18:01:32 -0800 (Sat, 16 Feb 2008) | 1 line
  
  Show output of example program
................
  r43290 | hkaiser | 2008-02-17 08:45:08 -0800 (Sun, 17 Feb 2008) | 1 line
  
  Wave: Extended a workaround to newest Intel compiler version (Linux V10.1)
................
  r43292 | nesotto | 2008-02-17 08:49:38 -0800 (Sun, 17 Feb 2008) | 1 line
  
  support for comparinson operators
................
  r43293 | nesotto | 2008-02-17 08:50:02 -0800 (Sun, 17 Feb 2008) | 1 line
  
  support for comparison operators
................
  r43294 | hkaiser | 2008-02-17 09:00:20 -0800 (Sun, 17 Feb 2008) | 1 line
  
  Wave: Fixed test cases to reflect recent changes to whitespace insertion.
................
  r43296 | eric_niebler | 2008-02-17 12:53:18 -0800 (Sun, 17 Feb 2008) | 1 line
  
  proto documentation improvements
................
  r43299 | turkanis | 2008-02-17 21:48:13 -0800 (Sun, 17 Feb 2008) | 1 line
  
  merged changes from iostreams_dev, revisions 43243-43298: overhaul of category_of and close(): stringstream is now dual_seekable; standard file streams and string streams are closable; public Boost.Iostreams streams and streambufs are closable; close() pops filtering streams and streambufs
................
  r43300 | eric_niebler | 2008-02-17 22:16:27 -0800 (Sun, 17 Feb 2008) | 1 line
  
  remove dependence on boost.lambda, make numeric function objects work with std binders
................
  r43301 | chris_kohlhoff | 2008-02-18 05:31:26 -0800 (Mon, 18 Feb 2008) | 2 lines
  
  Fix printing of error messages.
................
  r43302 | chris_kohlhoff | 2008-02-18 05:33:23 -0800 (Mon, 18 Feb 2008) | 2 lines
  
  Only define _XOPEN_SOURCE_EXTENDED when building with gcc on HP-UX.
................
  r43303 | chris_kohlhoff | 2008-02-18 05:35:15 -0800 (Mon, 18 Feb 2008) | 3 lines
  
  Add missing #include of socket_types.hpp needed for the SSL unit tests
  to compile successfully on Windows.
................
  r43306 | eric_niebler | 2008-02-18 10:29:29 -0800 (Mon, 18 Feb 2008) | 1 line
  
  remove post_construct docs, fix link to boost.parameter library
................
  r43308 | niels_dekker | 2008-02-18 14:11:19 -0800 (Mon, 18 Feb 2008) | 1 line
  
  Fixed the assignment of value_initialized<T> for T being a C-style array. (The previous version would trigger a compile error in this case.)
................
  r43309 | niels_dekker | 2008-02-18 14:13:21 -0800 (Mon, 18 Feb 2008) | 1 line
  
  Tested the assignment of value_initialized<T>, for T being a C-style array. Related to the fix of changeset [43308]
................
  r43310 | eric_niebler | 2008-02-18 15:03:23 -0800 (Mon, 18 Feb 2008) | 1 line
  
  some doxygen comments for proto/traits.hpp
................
  r43311 | eric_niebler | 2008-02-18 21:56:52 -0800 (Mon, 18 Feb 2008) | 1 line
  
  more proto documentation tweaks, remove unnecessary result_of::arg_c instantiation
................
  r43312 | eric_niebler | 2008-02-18 23:14:37 -0800 (Mon, 18 Feb 2008) | 1 line
  
  fix droppable accumulators
................
  r43314 | eric_niebler | 2008-02-18 23:33:30 -0800 (Mon, 18 Feb 2008) | 1 line
  
  darn, back out bad droppable changes
................
  r43316 | pdimov | 2008-02-19 05:18:58 -0800 (Tue, 19 Feb 2008) | 1 line
  
  Fixes #1590.
................
  r43317 | pdimov | 2008-02-19 06:01:13 -0800 (Tue, 19 Feb 2008) | 1 line
  
  Fixes #1444.
................
  r43318 | pdimov | 2008-02-19 06:26:36 -0800 (Tue, 19 Feb 2008) | 1 line
  
  Fix #398, as long as the macros BOOST_NO_STD_TYPEINFO and BOOST_NO_IOSTREAM are defined. I don't know how Boost.Config needs to be changed to autodetect eVC4 and set these on its own.
................
  r43319 | pdimov | 2008-02-19 06:51:10 -0800 (Tue, 19 Feb 2008) | 1 line
  
  Fix #1641.
................
  r43320 | pdimov | 2008-02-19 06:59:28 -0800 (Tue, 19 Feb 2008) | 1 line
  
  Fix #1646.
................
  r43321 | pdimov | 2008-02-19 07:09:10 -0800 (Tue, 19 Feb 2008) | 1 line
  
  Fix #1642.
................
  r43322 | nesotto | 2008-02-19 07:10:05 -0800 (Tue, 19 Feb 2008) | 1 line
  
  fixed problem with operator()() when the value_type was abstract.
................
  r43323 | pdimov | 2008-02-19 07:40:58 -0800 (Tue, 19 Feb 2008) | 1 line
  
  Fix #1643.
................
  r43325 | turkanis | 2008-02-19 11:34:07 -0800 (Tue, 19 Feb 2008) | 1 line
  
  stringstreams are no longer closable; the semantics of close() for these devices was illconsidered
................
  r43328 | turkanis | 2008-02-19 16:09:06 -0800 (Tue, 19 Feb 2008) | 1 line
  
  menu fix from iostreams_dev
................
  r43329 | turkanis | 2008-02-19 19:20:17 -0800 (Tue, 19 Feb 2008) | 1 line
  
  markup for pgi-7.0 (iostreams)
................
  r43330 | bemandawes | 2008-02-20 05:46:49 -0800 (Wed, 20 Feb 2008) | 1 line
  
  Add .z7 archive generation
................
  r43332 | grafik | 2008-02-20 09:32:09 -0800 (Wed, 20 Feb 2008) | 1 line
  
  New readme page for now standalone release.
................
  r43334 | grafik | 2008-02-20 11:15:16 -0800 (Wed, 20 Feb 2008) | 1 line
  
  Fix link to getting started docs.
................
  r43335 | grafik | 2008-02-20 14:50:03 -0800 (Wed, 20 Feb 2008) | 1 line
  
  Add the <python.interpreter> to all requirements to allow other toolsets to use the currently configured python instead of relying on python being in the path.
................
  r43336 | grafik | 2008-02-20 15:01:43 -0800 (Wed, 20 Feb 2008) | 1 line
  
  Use the configured python interpreter instead of assuming it's in the path.
................
  r43337 | grafik | 2008-02-20 15:03:28 -0800 (Wed, 20 Feb 2008) | 1 line
  
  Add missing, and assumed, white background for screen rendering.
................
  r43338 | grafik | 2008-02-20 15:26:58 -0800 (Wed, 20 Feb 2008) | 1 line
  
  Doc cleanups.
................
  r43344 | eric_niebler | 2008-02-20 23:18:24 -0800 (Wed, 20 Feb 2008) | 1 line
  
  More Proto documentation
................
  r43346 | johnmaddock | 2008-02-21 02:37:59 -0800 (Thu, 21 Feb 2008) | 3 lines
  
  Fix typo in example.
  Added links to PDF versions of the docs.
  Regenerated all the docs to fix people links.
................
  r43347 | johnmaddock | 2008-02-21 03:53:59 -0800 (Thu, 21 Feb 2008) | 1 line
  
  Update main overview page.
................
  r43349 | bemandawes | 2008-02-21 04:46:11 -0800 (Thu, 21 Feb 2008) | 1 line
  
  Fix typo; .z7 should be .7z
................
  r43351 | johnmaddock | 2008-02-21 04:58:15 -0800 (Thu, 21 Feb 2008) | 1 line
  
  Added link to PDF docs, and regenerated.
................
  r43354 | johnmaddock | 2008-02-21 05:51:18 -0800 (Thu, 21 Feb 2008) | 1 line
  
  Added link to PDF docs, and regenerated.
................
  r43357 | johnmaddock | 2008-02-21 08:49:59 -0800 (Thu, 21 Feb 2008) | 1 line
  
  Added link to PDF docs.
................
  r43359 | johnmaddock | 2008-02-21 09:01:26 -0800 (Thu, 21 Feb 2008) | 1 line
  
  Regenerated docs to fix links.
................
  r43361 | bemandawes | 2008-02-21 12:11:32 -0800 (Thu, 21 Feb 2008) | 1 line
  
  Fix still another typo
................
  r43362 | eric_niebler | 2008-02-21 12:12:02 -0800 (Thu, 21 Feb 2008) | 1 line
  
  doxygen comments for proto::when<>
................
  r43363 | eric_niebler | 2008-02-21 16:42:12 -0800 (Thu, 21 Feb 2008) | 1 line
  
  fix crash when actions are in keep() expressions
................
  r43364 | eric_niebler | 2008-02-21 18:01:46 -0800 (Thu, 21 Feb 2008) | 1 line
  
  doxygen comments
................
  r43365 | grafik | 2008-02-21 21:26:39 -0800 (Thu, 21 Feb 2008) | 1 line
  
  Rename readme.html to index.html, and add forwarding index.htm for backward compatibility.
................
  r43368 | danieljames | 2008-02-22 01:21:22 -0800 (Fri, 22 Feb 2008) | 2 lines
  
  Update the index.html link in the navbar.
................
  r43371 | grafik | 2008-02-22 08:25:21 -0800 (Fri, 22 Feb 2008) | 1 line
  
  Remove obsolete getting started files. They where replaced by more/getting_started/*.
................
  r43377 | chris_kohlhoff | 2008-02-22 14:43:54 -0800 (Fri, 22 Feb 2008) | 2 lines
  
  Use the correct vector of timer queues when dispatching timers.
................
  r43390 | turkanis | 2008-02-22 16:05:49 -0800 (Fri, 22 Feb 2008) | 2 lines
  
  Ported change from iostreams_dev
................
  r43391 | turkanis | 2008-02-22 16:06:24 -0800 (Fri, 22 Feb 2008) | 2 lines
  
  Ported changes from iostreams_dev
................
  r43392 | turkanis | 2008-02-22 16:07:13 -0800 (Fri, 22 Feb 2008) | 1 line
  
  merged changes from iostreams_dev, revisions 43327-43389
................
  r43393 | turkanis | 2008-02-22 16:11:07 -0800 (Fri, 22 Feb 2008) | 1 line
  
  merged changes from iostreams_dev
................
  r43395 | turkanis | 2008-02-22 22:07:59 -0800 (Fri, 22 Feb 2008) | 1 line
  
  updated to test close() on filtering streambufs
................
  r43399 | turkanis | 2008-02-22 23:44:58 -0800 (Fri, 22 Feb 2008) | 1 line
  
  merged changes from iostreams_dev
................
  r43402 | bemandawes | 2008-02-23 06:04:02 -0800 (Sat, 23 Feb 2008) | 1 line
  
  Give the 1st and 2nd level index.html files a common look-and-feel.
................
  r43405 | vladimir_prus | 2008-02-24 04:59:04 -0800 (Sun, 24 Feb 2008) | 3 lines
  
  Recognize that fact, for that for intel-win, <runtime-debuggin>
  matters and should be added to the library name.
................
  r43409 | bemandawes | 2008-02-24 16:53:26 -0800 (Sun, 24 Feb 2008) | 1 line
  
  Fix html boo boo
................
  r43410 | schoepflin | 2008-02-25 00:37:10 -0800 (Mon, 25 Feb 2008) | 1 line
  
  Added missing template keyword.
................
  r43411 | t_schwinger | 2008-02-25 03:45:51 -0800 (Mon, 25 Feb 2008) | 3 lines
  
  removes unnecessary escaping
................
  r43412 | t_schwinger | 2008-02-25 03:47:59 -0800 (Mon, 25 Feb 2008) | 3 lines
  
  removes unnecessary comment
................
  r43416 | hkaiser | 2008-02-26 11:25:05 -0800 (Tue, 26 Feb 2008) | 1 line
  
  Wave: Fixed expanding_function_like_macro preprocessing hook.
................
  r43417 | danieljames | 2008-02-26 14:04:55 -0800 (Tue, 26 Feb 2008) | 2 lines
  
  Fix a link to Boost.Bimap.
................
  r43418 | danieljames | 2008-02-26 14:07:25 -0800 (Tue, 26 Feb 2008) | 2 lines
  
  Change another link that's no longer in the repository to link to the website.
................
  r43419 | hkaiser | 2008-02-26 14:36:36 -0800 (Tue, 26 Feb 2008) | 1 line
  
  Fixed a compilation problem on pathscale
................
  r43421 | eric_niebler | 2008-02-27 10:48:22 -0800 (Wed, 27 Feb 2008) | 1 line
  
  partially revert breaking change to independent sub-expressions until I can make a proper fix
................
  r43422 | danieljames | 2008-02-27 10:51:14 -0800 (Wed, 27 Feb 2008) | 1 line
  
  Fix broken copyright urls. Fixes #1573.
................
  r43423 | danieljames | 2008-02-27 11:22:01 -0800 (Wed, 27 Feb 2008) | 1 line
  
  Fix incorrect links to copyright of the form 'http:#www.boost.org
................
  r43424 | eric_niebler | 2008-02-27 11:39:43 -0800 (Wed, 27 Feb 2008) | 1 line
  
  fix bug in use_simple_repeat calculation
................
  r43428 | eric_niebler | 2008-02-27 16:03:15 -0800 (Wed, 27 Feb 2008) | 1 line
  
  add test case for use_simple_repeat fix
................
  r43433 | eric_niebler | 2008-02-28 14:47:12 -0800 (Thu, 28 Feb 2008) | 1 line
  
  fix oops
................
  r43434 | johnmaddock | 2008-02-29 01:49:42 -0800 (Fri, 29 Feb 2008) | 1 line
  
  Apply fixes to issue #1658 which fixes some broken URL's.
................
  r43435 | johnmaddock | 2008-02-29 01:58:30 -0800 (Fri, 29 Feb 2008) | 1 line
  
  Fix broken link as per report #1658.
................
  r43437 | chris_kohlhoff | 2008-02-29 04:57:57 -0800 (Fri, 29 Feb 2008) | 2 lines
  
  Add missing tie().
................
  r43438 | schoepflin | 2008-02-29 07:13:41 -0800 (Fri, 29 Feb 2008) | 2 lines
  
  Added expected failure markup for the test weighted_tail_variate_means on Tru64/CXX.
................
  r43441 | eric_niebler | 2008-03-01 11:32:56 -0800 (Sat, 01 Mar 2008) | 1 line
  
  add map_assign example
................
  r43458 | turkanis | 2008-03-02 22:20:14 -0800 (Sun, 02 Mar 2008) | 1 line
  
  merged changes from iostreams_dev, revisions 43399-43457
................
  r43461 | anthonyw | 2008-03-03 00:44:42 -0800 (Mon, 03 Mar 2008) | 1 line
  
  Test and fix for issue #1665
................
  r43464 | anthonyw | 2008-03-03 02:52:44 -0800 (Mon, 03 Mar 2008) | 1 line
  
  thread constructor now accepts up to three additional arguments to pass to thread function
................
  r43467 | danieljames | 2008-03-03 04:10:35 -0800 (Mon, 03 Mar 2008) | 2 lines
  
  Tell subversion that date_time.doc is a text file, not a word document.
................
  r43468 | danieljames | 2008-03-03 04:11:25 -0800 (Mon, 03 Mar 2008) | 1 line
  
  Fix license link in date_time.doc
................
  r43469 | chris_kohlhoff | 2008-03-03 05:21:05 -0800 (Mon, 03 Mar 2008) | 4 lines
  
  Disable use of CancelIo by default, due to the possibility of silent
  failure on some system configurations. Swallow error returned by CancelIoEx
  if there are no operations to be cancelled.
................
  r43470 | chris_kohlhoff | 2008-03-03 05:27:06 -0800 (Mon, 03 Mar 2008) | 2 lines
  
  Add missing 'boost_' prefix to helper namespace.
................
  r43471 | chris_kohlhoff | 2008-03-03 05:36:35 -0800 (Mon, 03 Mar 2008) | 2 lines
  
  Regenerate documentation.
................
  r43472 | chris_kohlhoff | 2008-03-03 06:05:35 -0800 (Mon, 03 Mar 2008) | 1 line
  
  Update copyright notices.
................
  r43473 | chris_kohlhoff | 2008-03-03 06:13:01 -0800 (Mon, 03 Mar 2008) | 2 lines
  
  Update copyright notices.
................
  r43476 | eric_niebler | 2008-03-03 11:44:54 -0800 (Mon, 03 Mar 2008) | 1 line
  
  add Map Assign example to documentation
................
  r43478 | eric_niebler | 2008-03-03 11:47:47 -0800 (Mon, 03 Mar 2008) | 1 line
  
  second attempt at fixing actions in independent expressions
................
  r43484 | eric_niebler | 2008-03-03 15:48:17 -0800 (Mon, 03 Mar 2008) | 1 line
  
  handle static regexes with actions nested in dynamic independent subexpressions
................
  r43485 | emildotchevski | 2008-03-03 17:41:17 -0800 (Mon, 03 Mar 2008) | 1 line
  
  boost exception
................
  r43496 | eric_niebler | 2008-03-04 10:51:07 -0800 (Tue, 04 Mar 2008) | 1 line
  
  rename numeric::empty to numeric::default_, fixes #1650
................
  r43501 | eric_niebler | 2008-03-04 11:31:57 -0800 (Tue, 04 Mar 2008) | 1 line
  
  eliminate msvc level 4 warnings, fixes #1631
................
  r43502 | eric_niebler | 2008-03-04 11:42:36 -0800 (Tue, 04 Mar 2008) | 1 line
  
  add Dave Jenkin's evil static/dynamic actions in keep test case
................
  r43503 | eric_niebler | 2008-03-04 13:09:47 -0800 (Tue, 04 Mar 2008) | 1 line
  
  work around msvc bug 331418, fixes #1652
................
  r43506 | eric_niebler | 2008-03-04 15:01:17 -0800 (Tue, 04 Mar 2008) | 1 line
  
  fix bad interaction between boyer-moore optimization and partial match feature, fixes #1564
................
  r43508 | eric_niebler | 2008-03-04 22:32:39 -0800 (Tue, 04 Mar 2008) | 1 line
  
  add BOOST_REVERSE_FOREACH, fixes #1071
................
  r43509 | eric_niebler | 2008-03-04 23:12:03 -0800 (Tue, 04 Mar 2008) | 1 line
  
  fix bug iterating over abstract base
................


[SVN r43519]
2008-03-05 20:37:04 +00:00

3453 lines
118 KiB
XML

<?xml version="1.0" encoding="ISO-Latin-1"?>
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
<library name="Lambda" dirname="lambda" id="lambda"
last-revision="$Date$"
xmlns:xi="http://www.w3.org/2001/XInclude">
<libraryinfo>
<author>
<firstname>Jaakko</firstname>
<surname>Järvi</surname>
<email>jarvi at cs tamu edu</email>
</author>
<copyright>
<year>1999</year>
<year>2000</year>
<year>2001</year>
<year>2002</year>
<year>2003</year>
<year>2004</year>
<holder>Jaakko Järvi</holder>
<holder>Gary Powell</holder>
</copyright>
<legalnotice>
<para>Use, modification and distribution is subject to the Boost
Software License, Version 1.0. (See accompanying file
<filename>LICENSE_1_0.txt</filename> or copy at <ulink
url="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</ulink>)</para>
</legalnotice>
<librarypurpose>Define small unnamed function objects at the actual call site, and more</librarypurpose>
<librarycategory name="category:higher-order"/>
</libraryinfo>
<title>Boost.Lambda</title>
<!-- -->
<section id="introduction">
<title>In a nutshell</title>
<para>
The Boost Lambda Library (BLL in the sequel) is a C++ template
library, which implements form of <emphasis>lambda abstractions</emphasis> for C++.
The term originates from functional programming and lambda calculus, where a lambda abstraction defines an unnamed function.
The primary motivation for the BLL is to provide flexible and
convenient means to define unnamed function objects for STL algorithms.
In explaining what the library is about, a line of code says more than a thousand words; the
following line outputs the elements of some STL container
<literal>a</literal> separated by spaces:
<programlisting><![CDATA[for_each(a.begin(), a.end(), std::cout << _1 << ' ');]]></programlisting>
The expression <literal><![CDATA[std::cout << _1 << ' ']]></literal> defines a unary function object.
The variable <literal>_1</literal> is the parameter of this function, a <emphasis>placeholder</emphasis> for the actual argument.
Within each iteration of <literal>for_each</literal>, the function is
called with an element of <literal>a</literal> as the actual argument.
This actual argument is substituted for the placeholder, and the <quote>body</quote> of the function is evaluated.
</para>
<para>The essence of BLL is letting you define small unnamed function objects, such as the one above, directly on the call site of an STL algorithm.
</para>
</section>
<section id="lambda.getting_started">
<title>Getting Started</title>
<section>
<title>Installing the library</title>
<para>
The library consists of include files only, hence there is no
installation procedure. The <literal>boost</literal> include directory
must be on the include path.
There are a number of include files that give different functionality:
<!-- TODO: tarkista vielä riippuvuudet-->
<itemizedlist>
<listitem><para>
<filename>lambda/lambda.hpp</filename> defines lambda expressions for different C++
operators, see <xref linkend="lambda.operator_expressions"/>.
</para></listitem>
<listitem><para>
<filename>lambda/bind.hpp</filename> defines <literal>bind</literal> functions for up to 9 arguments, see <xref linkend="lambda.bind_expressions"/>.</para></listitem>
<listitem><para>
<filename>lambda/if.hpp</filename> defines lambda function equivalents for if statements and the conditional operator, see <xref linkend="lambda.lambda_expressions_for_control_structures"/> (includes <filename>lambda.hpp</filename>).
</para></listitem>
<listitem><para>
<filename>lambda/loops.hpp</filename> defines lambda function equivalent for looping constructs, see <xref linkend="lambda.lambda_expressions_for_control_structures"/>.
</para></listitem>
<listitem><para>
<filename>lambda/switch.hpp</filename> defines lambda function equivalent for the switch statement, see <xref linkend="lambda.lambda_expressions_for_control_structures"/>.
</para></listitem>
<listitem><para>
<filename>lambda/construct.hpp</filename> provides tools for writing lambda expressions with constructor, destructor, new and delete invocations, see <xref linkend="lambda.construction_and_destruction"/> (includes <filename>lambda.hpp</filename>).
</para></listitem>
<listitem><para>
<filename>lambda/casts.hpp</filename> provides lambda versions of different casts, as well as <literal>sizeof</literal> and <literal>typeid</literal>, see <xref linkend="lambda.cast_expressions"/>.
</para></listitem>
<listitem><para>
<filename>lambda/exceptions.hpp</filename> gives tools for throwing and catching
exceptions within lambda functions, <xref linkend="lambda.exceptions"/> (includes
<filename>lambda.hpp</filename>).
</para></listitem>
<listitem><para>
<filename>lambda/algorithm.hpp</filename> and <filename>lambda/numeric.hpp</filename> (cf. standard <filename>algortihm</filename> and <filename>numeric</filename> headers) allow nested STL algorithm invocations, see <xref linkend="lambda.nested_stl_algorithms"/>.
</para></listitem>
</itemizedlist>
Any other header files in the package are for internal use.
Additionally, the library depends on two other Boost Libraries, the
<emphasis>Tuple</emphasis> <xref linkend="cit:boost::tuple"/> and the <emphasis>type_traits</emphasis> <xref linkend="cit:boost::type_traits"/> libraries, and on the <filename>boost/ref.hpp</filename> header.
</para>
<para>
All definitions are placed in the namespace <literal>boost::lambda</literal> and its subnamespaces.
</para>
</section>
<section>
<title>Conventions used in this document</title>
<para>In most code examples, we omit the namespace prefixes for names in the <literal moreinfo="none">std</literal> and <literal moreinfo="none">boost::lambda</literal> namespaces.
Implicit using declarations
<programlisting>
using namespace std;
using namespace boost::lambda;
</programlisting>
are assumed to be in effect.
</para>
</section>
</section>
<section>
<title>Introduction</title>
<section>
<title>Motivation</title>
<para>The Standard Template Library (STL)
<xref role="citation" linkend="cit:stepanov:94"/>, now part of the C++ Standard Library <xref role="citation" linkend="cit:c++:98"/>, is a generic container and algorithm library.
Typically STL algorithms operate on container elements via <emphasis>function objects</emphasis>. These function objects are passed as arguments to the algorithms.
</para>
<para>
Any C++ construct that can be called with the function call syntax
is a function object.
The STL contains predefined function objects for some common cases (such as <literal>plus</literal>, <literal>less</literal> and <literal>not1</literal>).
As an example, one possible implementation for the standard <literal>plus</literal> template is:
<programlisting>
<![CDATA[template <class T>
struct plus : public binary_function<T, T, T> {
T operator()(const T& i, const T& j) const {
return i + j;
}
};]]>
</programlisting>
The base class <literal><![CDATA[binary_function<T, T, T>]]></literal> contains typedefs for the argument and return types of the function object, which are needed to make the function object <emphasis>adaptable</emphasis>.
</para>
<para>
In addition to the basic function object classes, such as the one above,
the STL contains <emphasis>binder</emphasis> templates for creating a unary function object from an adaptable binary function object by fixing one of the arguments to a constant value.
For example, instead of having to explicitly write a function object class like:
<programlisting>
<![CDATA[class plus_1 {
int _i;
public:
plus_1(const int& i) : _i(i) {}
int operator()(const int& j) { return _i + j; }
};]]>
</programlisting>
the equivalent functionality can be achieved with the <literal moreinfo="none">plus</literal> template and one of the binder templates (<literal moreinfo="none">bind1st</literal>).
E.g., the following two expressions create function objects with identical functionalities;
when invoked, both return the result of adding <literal moreinfo="none">1</literal> to the argument of the function object:
<programlisting>
<![CDATA[plus_1(1)
bind1st(plus<int>(), 1)]]>
</programlisting>
The subexpression <literal><![CDATA[plus<int>()]]></literal> in the latter line is a binary function object which computes the sum of two integers, and <literal>bind1st</literal> invokes this function object partially binding the first argument to <literal>1</literal>.
As an example of using the above function object, the following code adds <literal>1</literal> to each element of some container <literal>a</literal> and outputs the results into the standard output stream <literal>cout</literal>.
<programlisting>
<![CDATA[transform(a.begin(), a.end(), ostream_iterator<int>(cout),
bind1st(plus<int>(), 1));]]>
</programlisting>
</para>
<para>
To make the binder templates more generally applicable, the STL contains <emphasis>adaptors</emphasis> for making
pointers or references to functions, and pointers to member functions,
adaptable.
Finally, some STL implementations contain function composition operations as
extensions to the standard <xref linkend="cit:sgi:02"/>.
</para>
<para>
All these tools aim at one goal: to make it possible to specify
<emphasis>unnamed functions</emphasis> in a call of an STL algorithm,
in other words, to pass code fragments as an argument to a function.
However, this goal is attained only partially.
The simple example above shows that the definition of unnamed functions
with the standard tools is cumbersome.
Complex expressions involving functors, adaptors, binders and
function composition operations tend to be difficult to comprehend.
In addition to this, there are significant restrictions in applying
the standard tools. E.g. the standard binders allow only one argument
of a binary function to be bound; there are no binders for
3-ary, 4-ary etc. functions.
</para>
<para>
The Boost Lambda Library provides solutions for the problems described above:
<itemizedlist>
<listitem>
<para>
Unnamed functions can be created easily with an intuitive syntax.
The above example can be written as:
<programlisting>
<![CDATA[transform(a.begin(), a.end(), ostream_iterator<int>(cout),
1 + _1);]]>
</programlisting>
or even more intuitively:
<programlisting>
<![CDATA[for_each(a.begin(), a.end(), cout << (1 + _1));]]>
</programlisting>
</para>
</listitem>
<listitem>
<para>
Most of the restrictions in argument binding are removed,
arbitrary arguments of practically any C++ function can be bound.
</para>
</listitem>
<listitem>
<para>
Separate function composition operations are not needed,
as function composition is supported implicitly.
</para>
</listitem>
</itemizedlist>
</para>
</section>
<section>
<title>Introduction to lambda expressions</title>
<para>
Lambda expression are common in functional programming languages.
Their syntax varies between languages (and between different forms of lambda calculus), but the basic form of a lambda expressions is:
<programlisting>
lambda x<subscript>1</subscript> ... x<subscript>n</subscript>.e
</programlisting>
<!-- $\lambda x_1 \cdots x_n . e$ -->
A lambda expression defines an unnamed function and consists of:
<itemizedlist>
<listitem>
<para>
the parameters of this function: <literal>x<subscript>1</subscript> ... x<subscript>n</subscript></literal>.
<!--$x_1 \cdots x_n$-->
</para>
</listitem>
<listitem>
<para>the expression e which computes the value of the function in terms of the parameters <literal>x<subscript>1</subscript> ... x<subscript>n</subscript></literal>.
</para>
</listitem>
</itemizedlist>
A simple example of a lambda expression is
<programlisting>
lambda x y.x+y
</programlisting>
Applying the lambda function means substituting the formal parameters with the actual arguments:
<programlisting>
(lambda x y.x+y) 2 3 = 2 + 3 = 5
</programlisting>
</para>
<para>
In the C++ version of lambda expressions the <literal>lambda x<subscript>1</subscript> ... x<subscript>n</subscript></literal> part is missing and the formal parameters have predefined names.
In the current version of the library,
there are three such predefined formal parameters,
called <emphasis>placeholders</emphasis>:
<literal>_1</literal>, <literal>_2</literal> and <literal>_3</literal>.
They refer to the first, second and third argument of the function defined
by the lambda expression.
For example, the C++ version of the definition
<programlisting>lambda x y.x+y</programlisting>
is
<programlisting>_1 + _2</programlisting>
</para>
<para>
Hence, there is no syntactic keyword for C++ lambda expressions.
The use of a placeholder as an operand implies that the operator invocation is a lambda expression.
However, this is true only for operator invocations.
Lambda expressions containing function calls, control structures, casts etc. require special syntactic constructs.
Most importantly, function calls need to be wrapped inside a <literal>bind</literal> function.
As an example, consider the lambda expression:
<programlisting>lambda x y.foo(x,y)</programlisting>
Rather than <literal>foo(_1, _2)</literal>, the C++ counterpart for this expression is:
<programlisting>bind(foo, _1, _2)</programlisting>
We refer to this type of C++ lambda expressions as <emphasis>bind expressions</emphasis>.
</para>
<para>A lambda expression defines a C++ function object, hence function application syntax is like calling any other function object, for instance: <literal>(_1 + _2)(i, j)</literal>.
</para>
<section id="lambda.partial_function_application">
<title>Partial function application</title>
<para>
A bind expression is in effect a <emphasis>partial function application</emphasis>.
In partial function application, some of the arguments of a function are bound to fixed values.
The result is another function, with possibly fewer arguments.
When called with the unbound arguments, this new function invokes the original function with the merged argument list of bound and unbound arguments.
</para>
<!-- <para>The underlying implementation of the BLL unifies the two types of lambda expressions (bind expressions and lambda expressions consisting of operator calls).
If operators are regarded as functions, it is easy to see that lambda expressions using operators are partial function applications as well.
E.g. the lambda expression <literal>_1 + 1</literal> can be seen as syntactic sugar for the pseudo code <literal>bind(operator+, _1, 1)</literal>.
</para>
-->
</section>
<section id="lambda.terminology">
<title>Terminology</title>
<para>
A lambda expression defines a function. A C++ lambda expression concretely constructs a function object, <emphasis>a functor</emphasis>, when evaluated. We use the name <emphasis>lambda functor</emphasis> to refer to such a function object.
Hence, in the terminology adopted here, the result of evaluating a lambda expression is a lambda functor.
</para>
</section>
</section>
</section>
<section id = "lambda.using_library">
<title>Using the library</title>
<para>
The purpose of this section is to introduce the basic functionality of the library.
There are quite a lot of exceptions and special cases, but discussion of them is postponed until later sections.
</para>
<section id = "lambda.introductory_examples">
<title>Introductory Examples</title>
<para>
In this section we give basic examples of using BLL lambda expressions in STL algorithm invocations.
We start with some simple expressions and work up.
First, we initialize the elements of a container, say, a <literal>list</literal>, to the value <literal>1</literal>:
<programlisting>
<![CDATA[list<int> v(10);
for_each(v.begin(), v.end(), _1 = 1);]]></programlisting>
The expression <literal>_1 = 1</literal> creates a lambda functor which assigns the value <literal>1</literal> to every element in <literal>v</literal>.<footnote>
<para>
Strictly taken, the C++ standard defines <literal>for_each</literal> as a <emphasis>non-modifying sequence operation</emphasis>, and the function object passed to <literal moreinfo="none">for_each</literal> should not modify its argument.
The requirements for the arguments of <literal>for_each</literal> are unnecessary strict, since as long as the iterators are <emphasis>mutable</emphasis>, <literal>for_each</literal> accepts a function object that can have side-effects on their argument.
Nevertheless, it is straightforward to provide another function template with the functionality of<literal>std::for_each</literal> but more fine-grained requirements for its arguments.
</para>
</footnote>
</para>
<para>
Next, we create a container of pointers and make them point to the elements in the first container <literal>v</literal>:
<programlisting>
<![CDATA[vector<int*> vp(10);
transform(v.begin(), v.end(), vp.begin(), &_1);]]></programlisting>
The expression <literal><![CDATA[&_1]]></literal> creates a function object for getting the address of each element in <literal>v</literal>.
The addresses get assigned to the corresponding elements in <literal>vp</literal>.
</para>
<para>
The next code fragment changes the values in <literal>v</literal>.
For each element, the function <literal>foo</literal> is called.
The original value of the element is passed as an argument to <literal>foo</literal>.
The result of <literal>foo</literal> is assigned back to the element:
<programlisting>
<![CDATA[int foo(int);
for_each(v.begin(), v.end(), _1 = bind(foo, _1));]]></programlisting>
</para>
<para>
The next step is to sort the elements of <literal>vp</literal>:
<programlisting>sort(vp.begin(), vp.end(), *_1 > *_2);</programlisting>
In this call to <literal>sort</literal>, we are sorting the elements by their contents in descending order.
</para>
<para>
Finally, the following <literal>for_each</literal> call outputs the sorted content of <literal>vp</literal> separated by line breaks:
<programlisting>
<![CDATA[for_each(vp.begin(), vp.end(), cout << *_1 << '\n');]]>
</programlisting>
Note that a normal (non-lambda) expression as subexpression of a lambda expression is evaluated immediately.
This may cause surprises.
For instance, if the previous example is rewritten as
<programlisting>
<![CDATA[for_each(vp.begin(), vp.end(), cout << '\n' << *_1);]]>
</programlisting>
the subexpression <literal><![CDATA[cout << '\n']]></literal> is evaluated immediately and the effect is to output a single line break, followed by the elements of <literal>vp</literal>.
The BLL provides functions <literal>constant</literal> and <literal>var</literal> to turn constants and, respectively, variables into lambda expressions, and can be used to prevent the immediate evaluation of subexpressions:
<programlisting>
<![CDATA[for_each(vp.begin(), vp.end(), cout << constant('\n') << *_1);]]>
</programlisting>
These functions are described more thoroughly in <xref linkend="lambda.delaying_constants_and_variables"/>
</para>
</section>
<section id="lambda.parameter_and_return_types">
<title>Parameter and return types of lambda functors</title>
<para>
During the invocation of a lambda functor, the actual arguments are substituted for the placeholders.
The placeholders do not dictate the type of these actual arguments.
The basic rule is that a lambda function can be called with arguments of any types, as long as the lambda expression with substitutions performed is a valid C++ expression.
As an example, the expression
<literal>_1 + _2</literal> creates a binary lambda functor.
It can be called with two objects of any types <literal>A</literal> and <literal>B</literal> for which <literal>operator+(A,B)</literal> is defined (and for which BLL knows the return type of the operator, see below).
</para>
<para>
C++ lacks a mechanism to query a type of an expression.
However, this precise mechanism is crucial for the implementation of C++ lambda expressions.
Consequently, BLL includes a somewhat complex type deduction system which uses a set of traits classes for deducing the resulting type of lambda functions.
It handles expressions where the operands are of built-in types and many of the expressions with operands of standard library types.
Many of the user defined types are covered as well, particularly if the user defined operators obey normal conventions in defining the return types.
</para>
<!-- TODO: move this forward, and just refer to it. -->
<para>
There are, however, cases when the return type cannot be deduced. For example, suppose you have defined:
<programlisting>C operator+(A, B);</programlisting>
The following lambda function invocation fails, since the return type cannot be deduced:
<programlisting>A a; B b; (_1 + _2)(a, b);</programlisting>
</para>
<para>
There are two alternative solutions to this.
The first is to extend the BLL type deduction system to cover your own types (see <xref linkend="lambda.extending"/>).
The second is to use a special lambda expression (<literal>ret</literal>) which defines the return type in place (see <xref linkend = "lambda.overriding_deduced_return_type"/>):
<programlisting><![CDATA[A a; B b; ret<C>(_1 + _2)(a, b);]]></programlisting>
</para>
<para>
For bind expressions, the return type can be defined as a template argument of the bind function as well:
<programlisting><![CDATA[bind<int>(foo, _1, _2);]]></programlisting>
<!--
A rare case, where the <literal><![CDATA[ret<type>(bind(...))]]></literal> syntax does not work, but
<literal><![CDATA[bind<type>(...)]]></literal> does, is explained in <xref linkend="lambda.nullary_functors_and_ret"/>.
-->
</para>
</section>
<section id="lambda.actual_arguments_to_lambda_functors">
<title>About actual arguments to lambda functors</title>
<!-- <para><emphasis>This section is no longer (or currently) relevant;
acual arguments can be non-const rvalues.
The section can, however, become relevant again, if in the future BLL will support
lambda functors with higher arities than 3.</emphasis></para> -->
<para>A general restriction for the actual arguments is that they cannot be non-const rvalues.
For example:
<programlisting>
int i = 1; int j = 2;
(_1 + _2)(i, j); // ok
(_1 + _2)(1, 2); // error (!)
</programlisting>
This restriction is not as bad as it may look.
Since the lambda functors are most often called inside STL-algorithms,
the arguments originate from dereferencing iterators and the dereferencing operators seldom return rvalues.
And for the cases where they do, there are workarounds discussed in
<xref linkend="lambda.rvalues_as_actual_arguments"/>.
</para>
</section>
<section id="lambda.storing_bound_arguments">
<title>Storing bound arguments in lambda functions</title>
<para>
By default, temporary const copies of the bound arguments are stored
in the lambda functor.
This means that the value of a bound argument is fixed at the time of the
creation of the lambda function and remains constant during the lifetime
of the lambda function object.
For example:
<programlisting>
int i = 1;
(_1 = 2, _1 + i)(i);
</programlisting>
The comma operator is overloaded to combine lambda expressions into a sequence;
the resulting unary lambda functor first assigns 2 to its argument,
then adds the value of <literal>i</literal> to it.
The value of the expression in the last line is 3, not 4.
In other words, the lambda expression that is created is
<literal>lambda x.(x = 2, x + 1)</literal> rather than
<literal>lambda x.(x = 2, x + i)</literal>.
</para>
<para>
As said, this is the default behavior for which there are exceptions.
The exact rules are as follows:
<itemizedlist>
<listitem>
<para>
The programmer can control the storing mechanism with <literal>ref</literal>
and <literal>cref</literal> wrappers <xref linkend="cit:boost::ref"/>.
Wrapping an argument with <literal>ref</literal>, or <literal>cref</literal>,
instructs the library to store the argument as a reference,
or as a reference to const respectively.
For example, if we rewrite the previous example and wrap the variable
<literal>i</literal> with <literal>ref</literal>,
we are creating the lambda expression <literal>lambda x.(x = 2, x + i)</literal>
and the value of the expression in the last line will be 4:
<programlisting>
i = 1;
(_1 = 2, _1 + ref(i))(i);
</programlisting>
Note that <literal>ref</literal> and <literal>cref</literal> are different
from <literal>var</literal> and <literal>constant</literal>.
While the latter ones create lambda functors, the former do not.
For example:
<programlisting>
int i;
var(i) = 1; // ok
ref(i) = 1; // not ok, ref(i) is not a lambda functor
</programlisting>
The functions <literal>ref</literal> and <literal>cref</literal> mostly
exist for historical reasons,
and <literal>ref</literal> can always
be replaced with <literal>var</literal>, and <literal>cref</literal> with
<literal>constant_ref</literal>.
See <xref linkend="lambda.delaying_constants_and_variables"/> for details.
The <literal>ref</literal> and <literal>cref</literal> functions are
general purpose utility functions in Boost, and hence defined directly
in the <literal moreinfo="none">boost</literal> namespace.
</para>
</listitem>
<listitem>
<para>
Array types cannot be copied, they are thus stored as const reference by default.
</para>
</listitem>
<listitem>
<para>
For some expressions it makes more sense to store the arguments as references.
For example, the obvious intention of the lambda expression
<literal>i += _1</literal> is that calls to the lambda functor affect the
value of the variable <literal>i</literal>,
rather than some temporary copy of it.
As another example, the streaming operators take their leftmost argument
as non-const references.
The exact rules are:
<itemizedlist>
<listitem>
<para>The left argument of compound assignment operators (<literal>+=</literal>, <literal>*=</literal>, etc.) are stored as references to non-const.</para>
</listitem>
<listitem>
<para>If the left argument of <literal><![CDATA[<<]]></literal> or <literal><![CDATA[>>]]></literal> operator is derived from an instantiation of <literal>basic_ostream</literal> or respectively from <literal>basic_istream</literal>, the argument is stored as a reference to non-const.
For all other types, the argument is stored as a copy.
</para>
</listitem>
<listitem>
<para>
In pointer arithmetic expressions, non-const array types are stored as non-const references.
This is to prevent pointer arithmetic making non-const arrays const.
</para>
</listitem>
</itemizedlist>
</para>
</listitem>
</itemizedlist>
</para>
</section>
</section>
<section id="lambda.le_in_details">
<title>Lambda expressions in details</title>
<para>
This section describes different categories of lambda expressions in details.
We devote a separate section for each of the possible forms of a lambda expression.
</para>
<section id="lambda.placeholders">
<title>Placeholders</title>
<para>
The BLL defines three placeholder types: <literal>placeholder1_type</literal>, <literal>placeholder2_type</literal> and <literal>placeholder3_type</literal>.
BLL has a predefined placeholder variable for each placeholder type: <literal>_1</literal>, <literal>_2</literal> and <literal>_3</literal>.
However, the user is not forced to use these placeholders.
It is easy to define placeholders with alternative names.
This is done by defining new variables of placeholder types.
For example:
<programlisting>boost::lambda::placeholder1_type X;
boost::lambda::placeholder2_type Y;
boost::lambda::placeholder3_type Z;
</programlisting>
With these variables defined, <literal>X += Y * Z</literal> is equivalent to <literal>_1 += _2 * _3</literal>.
</para>
<para>
The use of placeholders in the lambda expression determines whether the resulting function is nullary, unary, binary or 3-ary.
The highest placeholder index is decisive. For example:
<programlisting>
_1 + 5 // unary
_1 * _1 + _1 // unary
_1 + _2 // binary
bind(f, _1, _2, _3) // 3-ary
_3 + 10 // 3-ary
</programlisting>
Note that the last line creates a 3-ary function, which adds <literal>10</literal> to its <emphasis>third</emphasis> argument.
The first two arguments are discarded.
Furthermore, lambda functors only have a minimum arity.
One can always provide more arguments (up the number of supported placeholders)
that is really needed.
The remaining arguments are just discarded.
For example:
<programlisting>
int i, j, k;
_1(i, j, k) // returns i, discards j and k
(_2 + _2)(i, j, k) // returns j+j, discards i and k
</programlisting>
See
<xref linkend="lambda.why_weak_arity"/> for the design rationale behind this
functionality.
</para>
<para>
In addition to these three placeholder types, there is also a fourth placeholder type <literal>placeholderE_type</literal>.
The use of this placeholder is defined in <xref linkend="lambda.exceptions"/> describing exception handling in lambda expressions.
</para>
<para>When an actual argument is supplied for a placeholder, the parameter passing mode is always by reference.
This means that any side-effects to the placeholder are reflected to the actual argument.
For example:
<programlisting>
<![CDATA[int i = 1;
(_1 += 2)(i); // i is now 3
(++_1, cout << _1)(i) // i is now 4, outputs 4]]>
</programlisting>
</para>
</section>
<section id="lambda.operator_expressions">
<title>Operator expressions</title>
<para>
The basic rule is that any C++ operator invocation with at least one argument being a lambda expression is itself a lambda expression.
Almost all overloadable operators are supported.
For example, the following is a valid lambda expression:
<programlisting><![CDATA[cout << _1, _2[_3] = _1 && false]]></programlisting>
</para>
<para>
However, there are some restrictions that originate from the C++ operator overloading rules, and some special cases.
</para>
<section>
<title>Operators that cannot be overloaded</title>
<para>
Some operators cannot be overloaded at all (<literal>::</literal>, <literal>.</literal>, <literal>.*</literal>).
For some operators, the requirements on return types prevent them to be overloaded to create lambda functors.
These operators are <literal>->.</literal>, <literal>-></literal>, <literal>new</literal>, <literal>new[]</literal>, <literal>delete</literal>, <literal>delete[]</literal> and <literal>?:</literal> (the conditional operator).
</para>
</section>
<section id="lambda.assignment_and_subscript">
<title>Assignment and subscript operators</title>
<para>
These operators must be implemented as class members.
Consequently, the left operand must be a lambda expression. For example:
<programlisting>
int i;
_1 = i; // ok
i = _1; // not ok. i is not a lambda expression
</programlisting>
There is a simple solution around this limitation, described in <xref linkend="lambda.delaying_constants_and_variables"/>.
In short,
the left hand argument can be explicitly turned into a lambda functor by wrapping it with a special <literal>var</literal> function:
<programlisting>
var(i) = _1; // ok
</programlisting>
</para>
</section>
<section id="lambda.logical_operators">
<title>Logical operators</title>
<para>
Logical operators obey the short-circuiting evaluation rules. For example, in the following code, <literal>i</literal> is never incremented:
<programlisting>
bool flag = true; int i = 0;
(_1 || ++_2)(flag, i);
</programlisting>
</para>
</section>
<section id="lambda.comma_operator">
<title>Comma operator</title>
<para>
Comma operator is the <quote>statement separator</quote> in lambda expressions.
Since comma is also the separator between arguments in a function call, extra parenthesis are sometimes needed:
<programlisting>
for_each(a.begin(), a.end(), (++_1, cout &lt;&lt; _1));
</programlisting>
Without the extra parenthesis around <literal>++_1, cout &lt;&lt; _1</literal>, the code would be interpreted as an attempt to call <literal>for_each</literal> with four arguments.
</para>
<para>
The lambda functor created by the comma operator adheres to the C++ rule of always evaluating the left operand before the right one.
In the above example, each element of <literal>a</literal> is first incremented, then written to the stream.
</para>
</section>
<section id="lambda.function_call_operator">
<title>Function call operator</title>
<para>
The function call operators have the effect of evaluating the lambda
functor.
Calls with too few arguments lead to a compile time error.
</para>
</section>
<section id="lambda.member_pointer_operator">
<title>Member pointer operator</title>
<para>
The member pointer operator <literal>operator->*</literal> can be overloaded freely.
Hence, for user defined types, member pointer operator is no special case.
The built-in meaning, however, is a somewhat more complicated case.
The built-in member pointer operator is applied if the left argument is a pointer to an object of some class <literal>A</literal>, and the right hand argument is a pointer to a member of <literal>A</literal>, or a pointer to a member of a class from which <literal>A</literal> derives.
We must separate two cases:
<itemizedlist>
<listitem>
<para>The right hand argument is a pointer to a data member.
In this case the lambda functor simply performs the argument substitution and calls the built-in member pointer operator, which returns a reference to the member pointed to.
For example:
<programlisting>
<![CDATA[struct A { int d; };
A* a = new A();
...
(a ->* &A::d); // returns a reference to a->d
(_1 ->* &A::d)(a); // likewise]]>
</programlisting>
</para>
</listitem>
<listitem>
<para>
The right hand argument is a pointer to a member function.
For a built-in call like this, the result is kind of a delayed member function call.
Such an expression must be followed by a function argument list, with which the delayed member function call is performed.
For example:
<programlisting>
<![CDATA[struct B { int foo(int); };
B* b = new B();
...
(b ->* &B::foo) // returns a delayed call to b->foo
// a function argument list must follow
(b ->* &B::foo)(1) // ok, calls b->foo(1)
(_1 ->* &B::foo)(b); // returns a delayed call to b->foo,
// no effect as such
(_1 ->* &B::foo)(b)(1); // calls b->foo(1)]]>
</programlisting>
</para>
</listitem>
</itemizedlist>
</para>
</section>
</section>
<section id="lambda.bind_expressions">
<title>Bind expressions</title>
<para>
Bind expressions can have two forms:
<!-- TODO: shouldn't really be emphasis, but a variable or something-->
<programlisting>
bind(<parameter>target-function</parameter>, <parameter>bind-argument-list</parameter>)
bind(<parameter>target-member-function</parameter>, <parameter>object-argument</parameter>, <parameter>bind-argument-list</parameter>)
</programlisting>
A bind expression delays the call of a function.
If this <emphasis>target function</emphasis> is <emphasis>n</emphasis>-ary, then the <literal><emphasis>bind-argument-list</emphasis></literal> must contain <emphasis>n</emphasis> arguments as well.
In the current version of the BLL, <inlineequation>0 &lt;= n &lt;= 9</inlineequation> must hold.
For member functions, the number of arguments must be at most <inlineequation>8</inlineequation>, as the object argument takes one argument position.
Basically, the
<emphasis><literal>bind-argument-list</literal></emphasis> must be a valid argument list for the target function, except that any argument can be replaced with a placeholder, or more generally, with a lambda expression.
Note that also the target function can be a lambda expression.
The result of a bind expression is either a nullary, unary, binary or 3-ary function object depending on the use of placeholders in the <emphasis><literal>bind-argument-list</literal></emphasis> (see <xref linkend="lambda.placeholders"/>).
</para>
<para>
The return type of the lambda functor created by the bind expression can be given as an explicitly specified template parameter, as in the following example:
<programlisting>
bind&lt;<emphasis>RET</emphasis>&gt;(<emphasis>target-function</emphasis>, <emphasis>bind-argument-list</emphasis>)
</programlisting>
This is only necessary if the return type of the target function cannot be deduced.
</para>
<para>
The following sections describe the different types of bind expressions.
</para>
<section id="lambda.function_pointers_as_targets">
<title>Function pointers or references as targets</title>
<para>The target function can be a pointer or a reference to a function and it can be either bound or unbound. For example:
<programlisting>
<![CDATA[X foo(A, B, C); A a; B b; C c;
bind(foo, _1, _2, c)(a, b);
bind(&foo, _1, _2, c)(a, b);
bind(_1, a, b, c)(foo);]]>
</programlisting>
The return type deduction always succeeds with this type of bind expressions.
</para>
<para>
Note, that in C++ it is possible to take the address of an overloaded function only if the address is assigned to, or used as an initializer of, a variable, the type of which solves the amibiguity, or if an explicit cast expression is used.
This means that overloaded functions cannot be used in bind expressions directly, e.g.:
<programlisting>
<![CDATA[void foo(int);
void foo(float);
int i;
...
bind(&foo, _1)(i); // error
...
void (*pf1)(int) = &foo;
bind(pf1, _1)(i); // ok
bind(static_cast<void(*)(int)>(&foo), _1)(i); // ok]]>
</programlisting>
</para>
</section>
<section id="member_functions_as_targets">
<title>Member functions as targets</title>
<para>
The syntax for using pointers to member function in bind expression is:
<programlisting>
bind(<parameter>target-member-function</parameter>, <parameter>object-argument</parameter>, <parameter>bind-argument-list</parameter>)
</programlisting>
The object argument can be a reference or pointer to the object, the BLL supports both cases with a uniform interface:
<programlisting>
<![CDATA[bool A::foo(int) const;
A a;
vector<int> ints;
...
find_if(ints.begin(), ints.end(), bind(&A::foo, a, _1));
find_if(ints.begin(), ints.end(), bind(&A::foo, &a, _1));]]>
</programlisting>
Similarly, if the object argument is unbound, the resulting lambda functor can be called both via a pointer or a reference:
<programlisting>
<![CDATA[bool A::foo(int);
list<A> refs;
list<A*> pointers;
...
find_if(refs.begin(), refs.end(), bind(&A::foo, _1, 1));
find_if(pointers.begin(), pointers.end(), bind(&A::foo, _1, 1));]]>
</programlisting>
</para>
<!--%The exact rules for the object argument (whether it is bound, or supplied in the lambda function invoction) are as follows:
%If the target function is a pointer to a member function of some class \snip{A}, then the object argument must be an expression of type \snip{B}, where either
%\begin{itemize}
%\item \snip{B} = \snip{A} or there is an implicit conversion from \snip{B} to \snip{A}.
%\item \snip{B} = \snip{A*}.
%\item \snip{B} = \snip{C*}, where \snip{C} is any class derived form \snip{A}.
%\end{itemize}
%For example:
%\begin{alltt}
%struct A \{
% virtual void f();
% void fc() const;
%\};
%
%struct B : public A \{
% virtual void f();
%\};
%
%struct C \{
% operator A const() \{ return A(); \}
%\};
%
% A a; B b; C c;
% ...
% bind(&A::f, a)();
% bind(&A::f, b)(); // calls B::f
% bind(&A::fc, c)();
%
% bind(&A::f, &a)();
% bind(&A::f, &b)(); // calls B::f
% bind(&A::f, &c)(); // error: no conversion from C* \(\rightarrow\) A,
%\end{alltt}
-->
<para>
Even though the interfaces are the same, there are important semantic differences between using a pointer or a reference as the object argument.
The differences stem from the way <literal>bind</literal>-functions take their parameters, and how the bound parameters are stored within the lambda functor.
The object argument has the same parameter passing and storing mechanism as any other bind argument slot (see <xref linkend="lambda.storing_bound_arguments"/>); it is passed as a const reference and stored as a const copy in the lambda functor.
This creates some asymmetry between the lambda functor and the original member function, and between seemingly similar lambda functors. For example:
<programlisting>
class A {
int i; mutable int j;
public:
A(int ii, int jj) : i(ii), j(jj) {};
void set_i(int x) { i = x; };
void set_j(int x) const { j = x; };
};
</programlisting>
When a pointer is used, the behavior is what the programmer might expect:
<programlisting>
<![CDATA[A a(0,0); int k = 1;
bind(&A::set_i, &a, _1)(k); // a.i == 1
bind(&A::set_j, &a, _1)(k); // a.j == 1]]>
</programlisting>
Even though a const copy of the object argument is stored, the original object <literal>a</literal> is still modified.
This is since the object argument is a pointer, and the pointer is copied, not the object it points to.
When we use a reference, the behaviour is different:
<programlisting>
<![CDATA[A a(0,0); int k = 1;
bind(&A::set_i, a, _1)(k); // error; a const copy of a is stored.
// Cannot call a non-const function set_i
bind(&A::set_j, a, _1)(k); // a.j == 0, as a copy of a is modified]]>
</programlisting>
</para>
<para>
To prevent the copying from taking place, one can use the <literal>ref</literal> or <literal>cref</literal> wrappers (<literal>var</literal> and <literal>constant_ref</literal> would do as well):
<programlisting>
<![CDATA[bind(&A::set_i, ref(a), _1)(k); // a.j == 1
bind(&A::set_j, cref(a), _1)(k); // a.j == 1]]>
</programlisting>
</para>
<para>Note that the preceding discussion is relevant only for bound arguments.
If the object argument is unbound, the parameter passing mode is always by reference.
Hence, the argument <literal>a</literal> is not copied in the calls to the two lambda functors below:
<programlisting>
<![CDATA[A a(0,0);
bind(&A::set_i, _1, 1)(a); // a.i == 1
bind(&A::set_j, _1, 1)(a); // a.j == 1]]>
</programlisting>
</para>
</section>
<section id="lambda.members_variables_as_targets">
<title>Member variables as targets</title>
<para>
A pointer to a member variable is not really a function, but
the first argument to the <literal>bind</literal> function can nevertheless
be a pointer to a member variable.
Invoking such a bind expression returns a reference to the data member.
For example:
<programlisting>
<![CDATA[struct A { int data; };
A a;
bind(&A::data, _1)(a) = 1; // a.data == 1]]>
</programlisting>
The cv-qualifiers of the object whose member is accessed are respected.
For example, the following tries to write into a const location:
<programlisting>
<![CDATA[const A ca = a;
bind(&A::data, _1)(ca) = 1; // error]]>
</programlisting>
</para>
</section>
<section id="lambda.function_objects_as_targets">
<title>Function objects as targets</title>
<para>
Function objects, that is, class objects which have the function call
operator defined, can be used as target functions.
In general, BLL cannot deduce the return type of an arbitrary function object.
However, there are two methods for giving BLL this capability for a certain
function object class.
</para>
<simplesect>
<title>The result_type typedef</title>
<para>
The BLL supports the standard library convention of declaring the return type
of a function object with a member typedef named <literal>result_type</literal> in the
function object class.
Here is a simple example:
<programlisting>
<![CDATA[struct A {
typedef B result_type;
B operator()(X, Y, Z);
};]]>
</programlisting>
If a function object does not define a <literal>result_type</literal> typedef,
the method described below (<literal>sig</literal> template)
is attempted to resolve the return type of the
function object. If a function object defines both <literal>result_type</literal>
and <literal>sig</literal>, <literal>result_type</literal> takes precedence.
</para>
</simplesect>
<simplesect>
<title>The sig template</title>
<para>
Another mechanism that make BLL aware of the return type(s) of a function object is defining
member template struct
<literal><![CDATA[sig<Args>]]></literal> with a typedef
<literal>type</literal> that specifies the return type.
Here is a simple example:
<programlisting>
<![CDATA[struct A {
template <class Args> struct sig { typedef B type; }
B operator()(X, Y, Z);
};]]>
</programlisting>
The template argument <literal>Args</literal> is a
<literal>tuple</literal> (or more precisely a <literal>cons</literal> list)
type <xref linkend="cit:boost::tuple"/>, where the first element
is the function
object type itself, and the remaining elements are the types of
the arguments, with which the function object is being called.
This may seem overly complex compared to defining the <literal>result_type</literal> typedef.
Howver, there are two significant restrictions with using just a simple
typedef to express the return type:
<orderedlist>
<listitem>
<para>
If the function object defines several function call operators, there is no way to specify different result types for them.
</para>
</listitem>
<listitem>
<para>
If the function call operator is a template, the result type may
depend on the template parameters.
Hence, the typedef ought to be a template too, which the C++ language
does not support.
</para>
</listitem>
</orderedlist>
The following code shows an example, where the return type depends on the type
of one of the arguments, and how that dependency can be expressed with the
<literal>sig</literal> template:
<programlisting>
<![CDATA[struct A {
// the return type equals the third argument type:
template<class T1, class T2, class T3>
T3 operator()(const T1& t1, const T2& t2, const T3& t3) const;
template <class Args>
class sig {
// get the third argument type (4th element)
typedef typename
boost::tuples::element<3, Args>::type T3;
public:
typedef typename
boost::remove_cv<T3>::type type;
};
};]]>
</programlisting>
The elements of the <literal>Args</literal> tuple are always
non-reference types.
Moreover, the element types can have a const or volatile qualifier
(jointly referred to as <emphasis>cv-qualifiers</emphasis>), or both.
This is since the cv-qualifiers in the arguments can affect the return type.
The reason for including the potentially cv-qualified function object
type itself into the <literal>Args</literal> tuple, is that the function
object class can contain both const and non-const (or volatile, even
const volatile) function call operators, and they can each have a different
return type.
</para>
<para>
The <literal>sig</literal> template can be seen as a
<emphasis>meta-function</emphasis> that maps the argument type tuple to
the result type of the call made with arguments of the types in the tuple.
As the example above demonstrates, the template can end up being somewhat
complex.
Typical tasks to be performed are the extraction of the relevant types
from the tuple, removing cv-qualifiers etc.
See the Boost type_traits <xref linkend="cit:boost::type_traits"/> and
Tuple <xref linkend="cit:boost::type_traits"/> libraries
for tools that can aid in these tasks.
The <literal>sig</literal> templates are a refined version of a similar
mechanism first introduced in the FC++ library
<xref linkend="cit:fc++"/>.
</para>
</simplesect>
</section>
</section>
<section id="lambda.overriding_deduced_return_type">
<title>Overriding the deduced return type</title>
<para>
The return type deduction system may not be able to deduce the return types of some user defined operators or bind expressions with class objects.
<!-- (see the example in <xref linkend="lambda.parameter_and_return_types"/>).-->
A special lambda expression type is provided for stating the return type explicitly and overriding the deduction system.
To state that the return type of the lambda functor defined by the lambda expression <literal>e</literal> is <literal>T</literal>, you can write:
<programlisting><![CDATA[ret<T>(e);]]></programlisting>
The effect is that the return type deduction is not performed for the lambda expression <literal>e</literal> at all, but instead, <literal>T</literal> is used as the return type.
Obviously <literal>T</literal> cannot be an arbitrary type, the true result of the lambda functor must be implicitly convertible to <literal>T</literal>.
For example:
<programlisting>
<![CDATA[A a; B b;
C operator+(A, B);
int operator*(A, B);
...
ret<D>(_1 + _2)(a, b); // error (C cannot be converted to D)
ret<C>(_1 + _2)(a, b); // ok
ret<float>(_1 * _2)(a, b); // ok (int can be converted to float)
...
struct X {
Y operator(int)();
};
...
X x; int i;
bind(x, _1)(i); // error, return type cannot be deduced
ret<Y>(bind(x, _1))(i); // ok]]>
</programlisting>
For bind expressions, there is a short-hand notation that can be used instead of <literal>ret</literal>.
The last line could alternatively be written as:
<programlisting><![CDATA[bind<Z>(x, _1)(i);]]></programlisting>
This feature is modeled after the Boost Bind library <xref linkend="cit:boost::bind"/>.
</para>
<para>Note that within nested lambda expressions,
the <literal>ret</literal> must be used at each subexpression where
the deduction would otherwise fail.
For example:
<programlisting>
<![CDATA[A a; B b;
C operator+(A, B); D operator-(C);
...
ret<D>( - (_1 + _2))(a, b); // error
ret<D>( - ret<C>(_1 + _2))(a, b); // ok]]>
</programlisting>
</para>
<para>If you find yourself using <literal>ret</literal> repeatedly with the same types, it is worth while extending the return type deduction (see <xref linkend="lambda.extending"/>).
</para>
<section id="lambda.nullary_functors_and_ret">
<title>Nullary lambda functors and ret</title>
<para>
As stated above, the effect of <literal>ret</literal> is to prevent the return type deduction to be performed.
However, there is an exception.
Due to the way the C++ template instantiation works, the compiler is always forced to instantiate the return type deduction templates for zero-argument lambda functors.
This introduces a slight problem with <literal>ret</literal>, best described with an example:
<programlisting>
<![CDATA[struct F { int operator()(int i) const; };
F f;
...
bind(f, _1); // fails, cannot deduce the return type
ret<int>(bind(f, _1)); // ok
...
bind(f, 1); // fails, cannot deduce the return type
ret<int>(bind(f, 1)); // fails as well!]]>
</programlisting>
The BLL cannot deduce the return types of the above bind calls, as <literal>F</literal> does not define the typedef <literal>result_type</literal>.
One would expect <literal>ret</literal> to fix this, but for the nullary lambda functor that results from a bind expression (last line above) this does not work.
The return type deduction templates are instantiated, even though it would not be necessary and the result is a compilation error.
</para>
<para>The solution to this is not to use the <literal>ret</literal> function, but rather define the return type as an explicitly specified template parameter in the <literal>bind</literal> call:
<programlisting>
<![CDATA[bind<int>(f, 1); // ok]]>
</programlisting>
The lambda functors created with
<literal>ret&lt;<parameter>T</parameter>&gt;(bind(<parameter>arg-list</parameter>))</literal> and
<literal>bind&lt;<parameter>T</parameter>&gt;(<parameter>arg-list</parameter>)</literal> have the exact same functionality &mdash;
apart from the fact that for some nullary lambda functors the former does not work while the latter does.
</para>
</section>
</section>
<section id="lambda.delaying_constants_and_variables">
<title>Delaying constants and variables</title>
<para>
The unary functions <literal>constant</literal>,
<literal>constant_ref</literal> and <literal>var</literal> turn their argument into a lambda functor, that implements an identity mapping.
The former two are for constants, the latter for variables.
The use of these <emphasis>delayed</emphasis> constants and variables is sometimes necessary due to the lack of explicit syntax for lambda expressions.
For example:
<programlisting>
<![CDATA[for_each(a.begin(), a.end(), cout << _1 << ' ');
for_each(a.begin(), a.end(), cout << ' ' << _1);]]>
</programlisting>
The first line outputs the elements of <literal>a</literal> separated by spaces, while the second line outputs a space followed by the elements of <literal>a</literal> without any separators.
The reason for this is that neither of the operands of
<literal><![CDATA[cout << ' ']]></literal> is a lambda expression, hence <literal><![CDATA[cout << ' ']]></literal> is evaluated immediately.
To delay the evaluation of <literal><![CDATA[cout << ' ']]></literal>, one of the operands must be explicitly marked as a lambda expression.
This is accomplished with the <literal>constant</literal> function:
<programlisting>
<![CDATA[for_each(a.begin(), a.end(), cout << constant(' ') << _1);]]>
</programlisting>
The call <literal>constant(' ')</literal> creates a nullary lambda functor which stores the character constant <literal>' '</literal>
and returns a reference to it when invoked.
The function <literal>constant_ref</literal> is similar, except that it
stores a constant reference to its argument.
The <literal>constant</literal> and <literal>consant_ref</literal> are only
needed when the operator call has side effects, like in the above example.
</para>
<para>
Sometimes we need to delay the evaluation of a variable.
Suppose we wanted to output the elements of a container in a numbered list:
<programlisting>
<![CDATA[int index = 0;
for_each(a.begin(), a.end(), cout << ++index << ':' << _1 << '\n');
for_each(a.begin(), a.end(), cout << ++var(index) << ':' << _1 << '\n');]]>
</programlisting>
The first <literal>for_each</literal> invocation does not do what we want; <literal>index</literal> is incremented only once, and its value is written into the output stream only once.
By using <literal>var</literal> to make <literal>index</literal> a lambda expression, we get the desired effect.
<!-- Note that <literal>var</literal> accepts const objects as well, in which case
calling <literal>var</literal> equals calling <literal>constant_ref</literal>.-->
</para>
<para>
In sum, <literal>var(x)</literal> creates a nullary lambda functor,
which stores a reference to the variable <literal>x</literal>.
When the lambda functor is invoked, a reference to <literal>x</literal> is returned.
</para>
<simplesect>
<title>Naming delayed constants and variables</title>
<para>
It is possible to predefine and name a delayed variable or constant outside a lambda expression.
The templates <literal>var_type</literal>, <literal>constant_type</literal>
and <literal>constant_ref_type</literal> serve for this purpose.
They are used as:
<programlisting>
<![CDATA[var_type<T>::type delayed_i(var(i));
constant_type<T>::type delayed_c(constant(c));]]>
</programlisting>
The first line defines the variable <literal>delayed_i</literal> which is a delayed version of the variable <literal>i</literal> of type <literal>T</literal>.
Analogously, the second line defines the constant <literal>delayed_c</literal> as a delayed version of the constant <literal>c</literal>.
For example:
<programlisting>
int i = 0; int j;
for_each(a.begin(), a.end(), (var(j) = _1, _1 = var(i), var(i) = var(j)));
</programlisting>
is equivalent to:
<programlisting>
<![CDATA[int i = 0; int j;
var_type<int>::type vi(var(i)), vj(var(j));
for_each(a.begin(), a.end(), (vj = _1, _1 = vi, vi = vj));]]>
</programlisting>
</para>
<para>
Here is an example of naming a delayed constant:
<programlisting>
<![CDATA[constant_type<char>::type space(constant(' '));
for_each(a.begin(),a.end(), cout << space << _1);]]>
</programlisting>
</para>
</simplesect>
<simplesect>
<title>About assignment and subscript operators</title>
<para>
As described in <xref linkend="lambda.assignment_and_subscript"/>, assignment and subscripting operators are always defined as member functions.
This means, that for expressions of the form
<literal>x = y</literal> or <literal>x[y]</literal> to be interpreted as lambda expressions, the left-hand operand <literal>x</literal> must be a lambda expression.
Consequently, it is sometimes necessary to use <literal>var</literal> for this purpose.
We repeat the example from <xref linkend="lambda.assignment_and_subscript"/>:
<programlisting>
int i;
i = _1; // error
var(i) = _1; // ok
</programlisting>
</para>
<para>
Note that the compound assignment operators <literal>+=</literal>, <literal>-=</literal> etc. can be defined as non-member functions, and thus they are interpreted as lambda expressions even if only the right-hand operand is a lambda expression.
Nevertheless, it is perfectly ok to delay the left operand explicitly.
For example, <literal>i += _1</literal> is equivalent to <literal>var(i) += _1</literal>.
</para>
</simplesect>
</section>
<section id="lambda.lambda_expressions_for_control_structures">
<title>Lambda expressions for control structures</title>
<para>
BLL defines several functions to create lambda functors that represent control structures.
They all take lambda functors as parameters and return <literal>void</literal>.
To start with an example, the following code outputs all even elements of some container <literal>a</literal>:
<programlisting>
<![CDATA[for_each(a.begin(), a.end(),
if_then(_1 % 2 == 0, cout << _1));]]>
</programlisting>
</para>
<para>
The BLL supports the following function templates for control structures:
<programlisting>
if_then(condition, then_part)
if_then_else(condition, then_part, else_part)
if_then_else_return(condition, then_part, else_part)
while_loop(condition, body)
while_loop(condition) // no body case
do_while_loop(condition, body)
do_while_loop(condition) // no body case
for_loop(init, condition, increment, body)
for_loop(init, condition, increment) // no body case
switch_statement(...)
</programlisting>
The return types of all control construct lambda functor is
<literal>void</literal>, except for <literal>if_then_else_return</literal>,
which wraps a call to the conditional operator
<programlisting>
condition ? then_part : else_part
</programlisting>
The return type rules for this operator are somewhat complex.
Basically, if the branches have the same type, this type is the return type.
If the type of the branches differ, one branch, say of type
<literal>A</literal>, must be convertible to the other branch,
say of type <literal>B</literal>.
In this situation, the result type is <literal>B</literal>.
Further, if the common type is an lvalue, the return type will be an lvalue
too.
</para>
<para>
Delayed variables tend to be commonplace in control structure lambda expressions.
For instance, here we use the <literal>var</literal> function to turn the arguments of <literal>for_loop</literal> into lambda expressions.
The effect of the code is to add 1 to each element of a two-dimensional array:
<programlisting>
<![CDATA[int a[5][10]; int i;
for_each(a, a+5,
for_loop(var(i)=0, var(i)<10, ++var(i),
_1[var(i)] += 1));]]>
</programlisting>
<!--
As explained in <xref linkend="lambda.delaying_constants_and_variables"/>, we can avoid the repeated use of wrapping of <literal>var</literal> if we define it beforehand:
<programlisting>
<![CDATA[int i;
var_type<int>::type vi(var(i));
for_each(a, a+5,
for_loop(vi=0, vi<10, ++vi, _1[vi] += 6));]]>
</programlisting>
-->
</para>
<para>
The BLL supports an alternative syntax for control expressions, suggested
by Joel de Guzmann.
By overloading the <literal>operator[]</literal> we can
get a closer resemblance with the built-in control structures:
<programlisting>
<![CDATA[if_(condition)[then_part]
if_(condition)[then_part].else_[else_part]
while_(condition)[body]
do_[body].while_(condition)
for_(init, condition, increment)[body]]]>
</programlisting>
For example, using this syntax the <literal>if_then</literal> example above
can be written as:
<programlisting>
<![CDATA[for_each(a.begin(), a.end(),
if_(_1 % 2 == 0)[ cout << _1 ])]]>
</programlisting>
As more experience is gained, we may end up deprecating one or the other
of these syntaces.
</para>
<section id="lambda.switch_statement">
<title>Switch statement</title>
</section>
<para>
The lambda expressions for <literal>switch</literal> control structures are more complex since the number of cases may vary.
The general form of a switch lambda expression is:
<programlisting>
switch_statement(<parameter>condition</parameter>,
case_statement&lt;<parameter>label</parameter>&gt;(<parameter>lambda expression</parameter>),
case_statement&lt;<parameter>label</parameter>&gt;(<parameter>lambda expression</parameter>),
...
default_statement(<parameter>lambda expression</parameter>)
)
</programlisting>
The <literal><parameter>condition</parameter></literal> argument must be a lambda expression that creates a lambda functor with an integral return type.
The different cases are created with the <literal>case_statement</literal> functions, and the optional default case with the <literal>default_statement</literal> function.
The case labels are given as explicitly specified template arguments to <literal>case_statement</literal> functions and
<literal>break</literal> statements are implicitly part of each case.
For example, <literal><![CDATA[case_statement<1>(a)]]></literal>, where <literal>a</literal> is some lambda functor, generates the code:
<programlisting>
case 1:
<parameter>evaluate lambda functor</parameter> a;
break;
</programlisting>
The <literal>switch_statement</literal> function is specialized for up to 9 case statements.
</para>
<para>
As a concrete example, the following code iterates over some container <literal>v</literal> and ouptuts <quote>zero</quote> for each <literal>0</literal>, <quote>one</quote> for each <literal>1</literal>, and <quote>other: <parameter>n</parameter></quote> for any other value <parameter>n</parameter>.
Note that another lambda expression is sequenced after the <literal>switch_statement</literal> to output a line break after each element:
<programlisting>
<![CDATA[std::for_each(v.begin(), v.end(),
(
switch_statement(
_1,
case_statement<0>(std::cout << constant("zero")),
case_statement<1>(std::cout << constant("one")),
default_statement(cout << constant("other: ") << _1)
),
cout << constant("\n")
)
);]]>
</programlisting>
</para>
</section>
<section id="lambda.exceptions">
<title>Exceptions</title>
<para>
The BLL provides lambda functors that throw and catch exceptions.
Lambda functors for throwing exceptions are created with the unary function <literal>throw_exception</literal>.
The argument to this function is the exception to be thrown, or a lambda functor which creates the exception to be thrown.
A lambda functor for rethrowing exceptions is created with the nullary <literal>rethrow</literal> function.
</para>
<para>
Lambda expressions for handling exceptions are somewhat more complex.
The general form of a lambda expression for try catch blocks is as follows:
<programlisting>
try_catch(
<parameter>lambda expression</parameter>,
catch_exception&lt;<parameter>type</parameter>&gt;(<parameter>lambda expression</parameter>),
catch_exception&lt;<parameter>type</parameter>&gt;(<parameter>lambda expression</parameter>),
...
catch_all(<parameter>lambda expression</parameter>)
)
</programlisting>
The first lambda expression is the try block.
Each <literal>catch_exception</literal> defines a catch block where the
explicitly specified template argument defines the type of the exception
to catch.
The lambda expression within the <literal>catch_exception</literal> defines
the actions to take if the exception is caught.
Note that the resulting exception handlers catch the exceptions as
references, i.e., <literal>catch_exception&lt;T&gt;(...)</literal>
results in the catch block:
<programlisting>
catch(T&amp; e) { ... }
</programlisting>
The last catch block can alternatively be a call to
<literal>catch_exception&lt;<parameter>type</parameter>&gt;</literal>
or to
<literal>catch_all</literal>, which is the lambda expression equivalent to
<literal>catch(...)</literal>.
</para>
<para>
The <xref linkend="ex:exceptions"/> demonstrates the use of the BLL
exception handling tools.
The first handler catches exceptions of type <literal>foo_exception</literal>.
Note the use of <literal>_1</literal> placeholder in the body of the handler.
</para>
<para>
The second handler shows how to throw exceptions, and demonstrates the
use of the <emphasis>exception placeholder</emphasis> <literal>_e</literal>.
It is a special placeholder, which refers to the caught exception object
within the handler body.
Here we are handling an exception of type <literal>std::exception</literal>,
which carries a string explaining the cause of the exception.
This explanation can be queried with the zero-argument member
function <literal>what</literal>.
The expression
<literal>bind(&amp;std::exception::what, _e)</literal> creates the lambda
function for making that call.
Note that <literal>_e</literal> cannot be used outside of an exception handler lambda expression.
<!--Violating this rule is caught by the compiler.-->
The last line of the second handler constructs a new exception object and
throws that with <literal>throw exception</literal>.
Constructing and destructing objects within lambda expressions is
explained in <xref linkend="lambda.construction_and_destruction"/>
</para>
<para>
Finally, the third handler (<literal>catch_all</literal>) demonstrates
rethrowing exceptions.
</para>
<example id="ex:exceptions">
<title>Throwing and handling exceptions in lambda expressions.</title>
<programlisting>
<![CDATA[for_each(
a.begin(), a.end(),
try_catch(
bind(foo, _1), // foo may throw
catch_exception<foo_exception>(
cout << constant("Caught foo_exception: ")
<< "foo was called with argument = " << _1
),
catch_exception<std::exception>(
cout << constant("Caught std::exception: ")
<< bind(&std::exception::what, _e),
throw_exception(bind(constructor<bar_exception>(), _1)))
),
catch_all(
(cout << constant("Unknown"), rethrow())
)
)
);]]>
</programlisting>
</example>
</section>
<section id="lambda.construction_and_destruction">
<title>Construction and destruction</title>
<para>
Operators <literal>new</literal> and <literal>delete</literal> can be
overloaded, but their return types are fixed.
Particularly, the return types cannot be lambda functors,
which prevents them to be overloaded for lambda expressions.
It is not possible to take the address of a constructor,
hence constructors cannot be used as target functions in bind expressions.
The same is true for destructors.
As a way around these constraints, BLL defines wrapper classes for
<literal>new</literal> and <literal>delete</literal> calls,
as well as for constructors and destructors.
Instances of these classes are function objects, that can be used as
target functions of bind expressions.
For example:
<programlisting>
<![CDATA[int* a[10];
for_each(a, a+10, _1 = bind(new_ptr<int>()));
for_each(a, a+10, bind(delete_ptr(), _1));]]>
</programlisting>
The <literal>new_ptr&lt;int&gt;()</literal> expression creates
a function object that calls <literal>new int()</literal> when invoked,
and wrapping that inside <literal>bind</literal> makes it a lambda functor.
In the same way, the expression <literal>delete_ptr()</literal> creates
a function object that invokes <literal>delete</literal> on its argument.
Note that <literal>new_ptr&lt;<parameter>T</parameter>&gt;()</literal>
can take arguments as well.
They are passed directly to the constructor invocation and thus allow
calls to constructors which take arguments.
</para>
<para>
As an example of constructor calls in lambda expressions,
the following code reads integers from two containers <literal>x</literal>
and <literal>y</literal>,
constructs pairs out of them and inserts them into a third container:
<programlisting>
<![CDATA[vector<pair<int, int> > v;
transform(x.begin(), x.end(), y.begin(), back_inserter(v),
bind(constructor<pair<int, int> >(), _1, _2));]]>
</programlisting>
<xref linkend="table:constructor_destructor_fos"/> lists all the function
objects related to creating and destroying objects,
showing the expression to create and call the function object,
and the effect of evaluating that expression.
</para>
<table id="table:constructor_destructor_fos">
<title>Construction and destruction related function objects.</title>
<tgroup cols="2">
<thead>
<row>
<entry>Function object call</entry>
<entry>Wrapped expression</entry>
</row>
</thead>
<tbody>
<row>
<entry><literal>constructor&lt;T&gt;()(<parameter>arg_list</parameter>)</literal></entry>
<entry>T(<parameter>arg_list</parameter>)</entry>
</row>
<row>
<entry><literal>destructor()(a)</literal></entry>
<entry><literal>a.~A()</literal>, where <literal>a</literal> is of type <literal>A</literal></entry>
</row>
<row>
<entry><literal>destructor()(pa)</literal></entry>
<entry><literal>pa->~A()</literal>, where <literal>pa</literal> is of type <literal>A*</literal></entry>
</row>
<row>
<entry><literal>new_ptr&lt;T&gt;()(<parameter>arg_list</parameter>)</literal></entry>
<entry><literal>new T(<parameter>arg_list</parameter>)</literal></entry>
</row>
<row>
<entry><literal>new_array&lt;T&gt;()(sz)</literal></entry>
<entry><literal>new T[sz]</literal></entry>
</row>
<row>
<entry><literal>delete_ptr()(p)</literal></entry>
<entry><literal>delete p</literal></entry>
</row>
<row>
<entry><literal>delete_array()(p)</literal></entry>
<entry><literal>delete p[]</literal></entry>
</row>
</tbody>
</tgroup>
</table>
</section>
<section>
<title>Special lambda expressions</title>
<section>
<title>Preventing argument substitution</title>
<para>
When a lambda functor is called, the default behavior is to substitute
the actual arguments for the placeholders within all subexpressions.
This section describes the tools to prevent the substitution and
evaluation of a subexpression, and explains when these tools should be used.
</para>
<para>
The arguments to a bind expression can be arbitrary lambda expressions,
e.g., other bind expressions.
For example:
<programlisting>
int foo(int); int bar(int);
...
int i;
bind(foo, bind(bar, _1)(i);
</programlisting>
The last line makes the call <literal>foo(bar(i));</literal>
Note that the first argument in a bind expression, the target function,
is no exception, and can thus be a bind expression too.
The innermost lambda functor just has to return something that can be used
as a target function: another lambda functor, function pointer,
pointer to member function etc.
For example, in the following code the innermost lambda functor makes
a selection between two functions, and returns a pointer to one of them:
<programlisting>
int add(int a, int b) { return a+b; }
int mul(int a, int b) { return a*b; }
int(*)(int, int) add_or_mul(bool x) {
return x ? add : mul;
}
bool condition; int i; int j;
...
bind(bind(&amp;add_or_mul, _1), _2, _3)(condition, i, j);
</programlisting>
</para>
<section id="lambda.unlambda">
<title>Unlambda</title>
<para>A nested bind expression may occur inadvertently,
if the target function is a variable with a type that depends on a
template parameter.
Typically the target function could be a formal parameter of a
function template.
In such a case, the programmer may not know whether the target function is a lambda functor or not.
</para>
<para>Consider the following function template:
<programlisting>
<![CDATA[template<class F>
int nested(const F& f) {
int x;
...
bind(f, _1)(x);
...
}]]>
</programlisting>
Somewhere inside the function the formal parameter
<literal>f</literal> is used as a target function in a bind expression.
In order for this <literal>bind</literal> call to be valid,
<literal>f</literal> must be a unary function.
Suppose the following two calls to <literal>nested</literal> are made:
<programlisting>
<![CDATA[int foo(int);
int bar(int, int);
nested(&foo);
nested(bind(bar, 1, _1));]]>
</programlisting>
Both are unary functions, or function objects, with appropriate argument
and return types, but the latter will not compile.
In the latter call, the bind expression inside <literal>nested</literal>
will become:
<programlisting>
bind(bind(bar, 1, _1), _1)
</programlisting>
When this is invoked with <literal>x</literal>,
after substituitions we end up trying to call
<programlisting>
bar(1, x)(x)
</programlisting>
which is an error.
The call to <literal>bar</literal> returns int,
not a unary function or function object.
</para>
<para>
In the example above, the intent of the bind expression in the
<literal>nested</literal> function is to treat <literal>f</literal>
as an ordinary function object, instead of a lambda functor.
The BLL provides the function template <literal>unlambda</literal> to
express this: a lambda functor wrapped inside <literal>unlambda</literal>
is not a lambda functor anymore, and does not take part into the
argument substitution process.
Note that for all other argument types <literal>unlambda</literal> is
an identity operation, except for making non-const objects const.
</para>
<para>
Using <literal>unlambda</literal>, the <literal>nested</literal>
function is written as:
<programlisting>
<![CDATA[template<class F>
int nested(const F& f) {
int x;
...
bind(unlambda(f), _1)(x);
...
}]]>
</programlisting>
</para>
</section>
<section>
<title>Protect</title>
<para>
The <literal>protect</literal> function is related to unlambda.
It is also used to prevent the argument substitution taking place,
but whereas <literal>unlambda</literal> turns a lambda functor into
an ordinary function object for good, <literal>protect</literal> does
this temporarily, for just one evaluation round.
For example:
<programlisting>
int x = 1, y = 10;
(_1 + protect(_1 + 2))(x)(y);
</programlisting>
The first call substitutes <literal>x</literal> for the leftmost
<literal>_1</literal>, and results in another lambda functor
<literal>x + (_1 + 2)</literal>, which after the call with
<literal>y</literal> becomes <literal>x + (y + 2)</literal>,
and thus finally 13.
</para>
<para>
Primary motivation for including <literal>protect</literal> into the library,
was to allow nested STL algorithm invocations
(<xref linkend="lambda.nested_stl_algorithms"/>).
</para>
</section>
</section>
<section id="lambda.rvalues_as_actual_arguments">
<title>Rvalues as actual arguments to lambda functors</title>
<!-- <para><emphasis>This section and all of its subsections
are no longer (or currently) relevant;
acual arguments can be non-const rvalues and these workarounds are thus
not needed.
The section can, however, become relevant again, if in the future BLL will support
lambda functors with higher arities than 3.</emphasis></para> -->
<para>
Actual arguments to the lambda functors cannot be non-const rvalues.
This is due to a deliberate design decision: either we have this restriction,
or there can be no side-effects to the actual arguments.
There are ways around this limitation.
We repeat the example from section
<xref linkend="lambda.actual_arguments_to_lambda_functors"/> and list the
different solutions:
<programlisting>
int i = 1; int j = 2;
(_1 + _2)(i, j); // ok
(_1 + _2)(1, 2); // error (!)
</programlisting>
<orderedlist>
<listitem>
<para>
If the rvalue is of a class type, the return type of the function that
creates the rvalue should be defined as const.
Due to an unfortunate language restriction this does not work for
built-in types, as built-in rvalues cannot be const qualified.
</para>
</listitem>
<listitem>
<para>
If the lambda function call is accessible, the <literal>make_const</literal>
function can be used to <emphasis>constify</emphasis> the rvalue. E.g.:
<programlisting>
(_1 + _2)(make_const(1), make_const(2)); // ok
</programlisting>
Commonly the lambda function call site is inside a standard algorithm
function template, preventing this solution to be used.
</para>
</listitem>
<listitem>
<para>
If neither of the above is possible, the lambda expression can be wrapped
in a <literal>const_parameters</literal> function.
It creates another type of lambda functor, which takes its arguments as
const references. For example:
<programlisting>
const_parameters(_1 + _2)(1, 2); // ok
</programlisting>
Note that <literal>const_parameters</literal> makes all arguments const.
Hence, in the case were one of the arguments is a non-const rvalue,
and another argument needs to be passed as a non-const reference,
this approach cannot be used.
</para>
</listitem>
<listitem>
<para>If none of the above is possible, there is still one solution,
which unfortunately can break const correctness.
The solution is yet another lambda functor wrapper, which we have named
<literal>break_const</literal> to alert the user of the potential dangers
of this function.
The <literal>break_const</literal> function creates a lambda functor that
takes its arguments as const, and casts away constness prior to the call
to the original wrapped lambda functor.
For example:
<programlisting>
int i;
...
(_1 += _2)(i, 2); // error, 2 is a non-const rvalue
const_parameters(_1 += _2)(i, 2); // error, i becomes const
break_const(_1 += _2)(i, 2); // ok, but dangerous
</programlisting>
Note, that the results of <literal> break_const</literal> or
<literal>const_parameters</literal> are not lambda functors,
so they cannot be used as subexpressions of lambda expressions. For instance:
<programlisting>
break_const(_1 + _2) + _3; // fails.
const_parameters(_1 + _2) + _3; // fails.
</programlisting>
However, this kind of code should never be necessary,
since calls to sub lambda functors are made inside the BLL,
and are not affected by the non-const rvalue problem.
</para>
</listitem>
</orderedlist>
</para>
</section>
</section>
<section>
<title>Casts, sizeof and typeid</title>
<section id="lambda.cast_expressions">
<title>
Cast expressions
</title>
<para>
The BLL defines its counterparts for the four cast expressions
<literal>static_cast</literal>, <literal>dynamic_cast</literal>,
<literal>const_cast</literal> and <literal>reinterpret_cast</literal>.
The BLL versions of the cast expressions have the prefix
<literal>ll_</literal>.
The type to cast to is given as an explicitly specified template argument,
and the sole argument is the expression from which to perform the cast.
If the argument is a lambda functor, the lambda functor is evaluated first.
For example, the following code uses <literal>ll_dynamic_cast</literal>
to count the number of <literal>derived</literal> instances in the container
<literal>a</literal>:
<programlisting>
<![CDATA[class base {};
class derived : public base {};
vector<base*> a;
...
int count = 0;
for_each(a.begin(), a.end(),
if_then(ll_dynamic_cast<derived*>(_1), ++var(count)));]]>
</programlisting>
</para>
</section>
<section>
<title>Sizeof and typeid</title>
<para>
The BLL counterparts for these expressions are named
<literal>ll_sizeof</literal> and <literal>ll_typeid</literal>.
Both take one argument, which can be a lambda expression.
The lambda functor created wraps the <literal>sizeof</literal> or
<literal>typeid</literal> call, and when the lambda functor is called
the wrapped operation is performed.
For example:
<programlisting>
<![CDATA[vector<base*> a;
...
for_each(a.begin(), a.end(),
cout << bind(&type_info::name, ll_typeid(*_1)));]]>
</programlisting>
Here <literal>ll_typeid</literal> creates a lambda functor for
calling <literal>typeid</literal> for each element.
The result of a <literal>typeid</literal> call is an instance of
the <literal>type_info</literal> class, and the bind expression creates
a lambda functor for calling the <literal>name</literal> member
function of that class.
</para>
</section>
</section>
<section id="lambda.nested_stl_algorithms">
<title>Nesting STL algorithm invocations</title>
<para>
The BLL defines common STL algorithms as function object classes,
instances of which can be used as target functions in bind expressions.
For example, the following code iterates over the elements of a
two-dimensional array, and computes their sum.
<programlisting>
int a[100][200];
int sum = 0;
std::for_each(a, a + 100,
bind(ll::for_each(), _1, _1 + 200, protect(sum += _1)));
</programlisting>
The BLL versions of the STL algorithms are classes, which define the function call operator (or several overloaded ones) to call the corresponding function templates in the <literal>std</literal> namespace.
All these structs are placed in the subnamespace <literal>boost::lambda:ll</literal>.
<!--The supported algorithms are listed in <xref linkend="table:nested_algorithms"/>.-->
</para>
<para>
Note that there is no easy way to express an overloaded member function
call in a lambda expression.
This limits the usefulness of nested STL algorithms, as for instance
the <literal>begin</literal> function has more than one overloaded
definitions in container templates.
In general, something analogous to the pseudo-code below cannot be written:
<programlisting>
std::for_each(a.begin(), a.end(),
bind(ll::for_each(), _1.begin(), _1.end(), protect(sum += _1)));
</programlisting>
Some aid for common special cases can be provided though.
The BLL defines two helper function object classes,
<literal>call_begin</literal> and <literal>call_end</literal>,
which wrap a call to the <literal>begin</literal> and, respectively,
<literal>end</literal> functions of a container, and return the
<literal>const_iterator</literal> type of the container.
With these helper templates, the above code becomes:
<programlisting>
std::for_each(a.begin(), a.end(),
bind(ll::for_each(),
bind(call_begin(), _1), bind(call_end(), _1),
protect(sum += _1)));
</programlisting>
</para>
<!--
<table id="table:nested_algorithms">
<title>The nested STL algorithms.</title>
<tgroup cols="1">
<thead>
<trow><entry>Otsikko</entry></trow>
</thead>
<tbody>
<row><entry><literal>for_each</literal></entry></row>
<row><entry><literal>find</literal></entry></row>
<row><entry><literal>find_if</literal></entry></row>
<row><entry><literal>find_end</literal></entry></row>
<row><entry><literal>find_first_of</literal></entry></row>
<row><entry><literal>transform</literal></entry></row>
</tbody>
</tgroup>
</table>
-->
</section>
</section>
<!--
<section>
<title>Common gothcas</title>
calling member functions a.begin()
calling templated functions ...
</section>
-->
<section id="lambda.extending">
<title>Extending return type deduction system</title>
<para>
<!--The <xref linkend = "lambda.overriding_deduced_return_type"/> showed how to make BLL aware of the return type of a function object in bind expressions.-->
In this section, we explain how to extend the return type deduction system
to cover user defined operators.
In many cases this is not necessary,
as the BLL defines default return types for operators.
For example, the default return type for all comparison operators is
<literal>bool</literal>, and as long as the user defined comparison operators
have a bool return type, there is no need to write new specializations
for the return type deduction classes.
Sometimes this cannot be avoided, though.
</para>
<para>
The overloadable user defined operators are either unary or binary.
For each arity, there are two traits templates that define the
return types of the different operators.
Hence, the return type system can be extended by providing more
specializations for these templates.
The templates for unary functors are
<literal>
<![CDATA[plain_return_type_1<Action, A>]]>
</literal>
and
<literal>
<![CDATA[return_type_1<Action, A>]]>
</literal>, and
<literal>
<![CDATA[plain_return_type_2<Action, A, B>]]>
</literal>
and
<literal>
<![CDATA[return_type_2<Action, A, B>]]>
</literal>
respectively for binary functors.
</para>
<para>
The first parameter (<literal>Action</literal>) to all these templates
is the <emphasis>action</emphasis> class, which specifies the operator.
Operators with similar return type rules are grouped together into
<emphasis>action groups</emphasis>,
and only the action class and action group together define the operator
unambiguously.
As an example, the action type
<literal><![CDATA[arithmetic_action<plus_action>]]></literal> stands for
<literal>operator+</literal>.
The complete listing of different action types is shown in
<xref linkend="table:actions"/>.
</para>
<para>
The latter parameters, <literal>A</literal> in the unary case,
or <literal>A</literal> and <literal>B</literal> in the binary case,
stand for the argument types of the operator call.
The two sets of templates,
<literal>plain_return_type_<parameter>n</parameter></literal> and
<literal>return_type_<parameter>n</parameter></literal>
(<parameter>n</parameter> is 1 or 2) differ in the way how parameter types
are presented to them.
For the former templates, the parameter types are always provided as
non-reference types, and do not have const or volatile qualifiers.
This makes specializing easy, as commonly one specialization for each
user defined operator, or operator group, is enough.
On the other hand, if a particular operator is overloaded for different
cv-qualifications of the same argument types,
and the return types of these overloaded versions differ, a more fine-grained control is needed.
Hence, for the latter templates, the parameter types preserve the
cv-qualifiers, and are non-reference types as well.
The downside is, that for an overloaded set of operators of the
kind described above, one may end up needing up to
16 <literal>return_type_2</literal> specializations.
</para>
<para>
Suppose the user has overloaded the following operators for some user defined
types <literal>X</literal>, <literal>Y</literal> and <literal>Z</literal>:
<programlisting>
<![CDATA[Z operator+(const X&, const Y&);
Z operator-(const X&, const Y&);]]>
</programlisting>
Now, one can add a specialization stating, that if the left hand argument
is of type <literal>X</literal>, and the right hand one of type
<literal>Y</literal>, the return type of all such binary arithmetic
operators is <literal>Z</literal>:
<programlisting>
<![CDATA[namespace boost {
namespace lambda {
template<class Act>
struct plain_return_type_2<arithmetic_action<Act>, X, Y> {
typedef Z type;
};
}
}]]>
</programlisting>
Having this specialization defined, BLL is capable of correctly
deducing the return type of the above two operators.
Note, that the specializations must be in the same namespace,
<literal>::boost::lambda</literal>, with the primary template.
For brevity, we do not show the namespace definitions in the examples below.
</para>
<para>
It is possible to specialize on the level of an individual operator as well,
in addition to providing a specialization for a group of operators.
Say, we add a new arithmetic operator for argument types <literal>X</literal>
and <literal>Y</literal>:
<programlisting>
<![CDATA[X operator*(const X&, const Y&);]]>
</programlisting>
Our first rule for all arithmetic operators specifies that the return
type of this operator is <literal>Z</literal>,
which obviously is not the case.
Hence, we provide a new rule for the multiplication operator:
<programlisting>
<![CDATA[template<>
struct plain_return_type_2<arithmetic_action<multiply_action>, X, Y> {
typedef X type;
};]]>
</programlisting>
</para>
<para>
The specializations can define arbitrary mappings from the argument types
to the return type.
Suppose we have some mathematical vector type, templated on the element type:
<programlisting>
<![CDATA[template <class T> class my_vector;]]>
</programlisting>
Suppose the addition operator is defined between any two
<literal>my_vector</literal> instantiations,
as long as the addition operator is defined between their element types.
Furthermore, the element type of the resulting <literal>my_vector</literal>
is the same as the result type of the addition between the element types.
E.g., adding <literal><![CDATA[my_vector<int>]]></literal> and
<literal><![CDATA[my_vector<double>]]></literal> results in
<literal><![CDATA[my_vector<double>]]></literal>.
The BLL has traits classes to perform the implicit built-in and standard
type conversions between integral, floating point, and complex classes.
Using BLL tools, the addition operator described above can be defined as:
<programlisting>
<![CDATA[template<class A, class B>
my_vector<typename return_type_2<arithmetic_action<plus_action>, A, B>::type>
operator+(const my_vector<A>& a, const my_vector<B>& b)
{
typedef typename
return_type_2<arithmetic_action<plus_action>, A, B>::type res_type;
return my_vector<res_type>();
}]]>
</programlisting>
</para>
<para>
To allow BLL to deduce the type of <literal>my_vector</literal>
additions correctly, we can define:
<programlisting>
<![CDATA[template<class A, class B>
class plain_return_type_2<arithmetic_action<plus_action>,
my_vector<A>, my_vector<B> > {
typedef typename
return_type_2<arithmetic_action<plus_action>, A, B>::type res_type;
public:
typedef my_vector<res_type> type;
};]]>
</programlisting>
Note, that we are reusing the existing specializations for the
BLL <literal>return_type_2</literal> template,
which require that the argument types are references.
</para>
<!-- TODO: is an example of specifying the other level needed at all -->
<!-- TODO: comma operator is a special case for that -->
<table id = "table:actions">
<title>Action types</title>
<tgroup cols="2">
<tbody>
<row><entry><literal><![CDATA[+]]></literal></entry><entry><literal><![CDATA[arithmetic_action<plus_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[-]]></literal></entry><entry><literal><![CDATA[arithmetic_action<minus_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[*]]></literal></entry><entry><literal><![CDATA[arithmetic_action<multiply_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[/]]></literal></entry><entry><literal><![CDATA[arithmetic_action<divide_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[%]]></literal></entry><entry><literal><![CDATA[arithmetic_action<remainder_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[+]]></literal></entry><entry><literal><![CDATA[unary_arithmetic_action<plus_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[-]]></literal></entry><entry><literal><![CDATA[unary_arithmetic_action<minus_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[&]]></literal></entry><entry><literal><![CDATA[bitwise_action<and_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[|]]></literal></entry><entry><literal><![CDATA[bitwise_action<or_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[~]]></literal></entry><entry><literal><![CDATA[bitwise_action<not_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[^]]></literal></entry><entry><literal><![CDATA[bitwise_action<xor_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[<<]]></literal></entry><entry><literal><![CDATA[bitwise_action<leftshift_action_no_stream>]]></literal></entry></row>
<row><entry><literal><![CDATA[>>]]></literal></entry><entry><literal><![CDATA[bitwise_action<rightshift_action_no_stream>]]></literal></entry></row>
<row><entry><literal><![CDATA[&&]]></literal></entry><entry><literal><![CDATA[logical_action<and_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[||]]></literal></entry><entry><literal><![CDATA[logical_action<or_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[!]]></literal></entry><entry><literal><![CDATA[logical_action<not_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[<]]></literal></entry><entry><literal><![CDATA[relational_action<less_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[>]]></literal></entry><entry><literal><![CDATA[relational_action<greater_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[<=]]></literal></entry><entry><literal><![CDATA[relational_action<lessorequal_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[>=]]></literal></entry><entry><literal><![CDATA[relational_action<greaterorequal_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[==]]></literal></entry><entry><literal><![CDATA[relational_action<equal_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[!=]]></literal></entry><entry><literal><![CDATA[relational_action<notequal_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[+=]]></literal></entry><entry><literal><![CDATA[arithmetic_assignment_action<plus_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[-=]]></literal></entry><entry><literal><![CDATA[arithmetic_assignment_action<minus_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[*=]]></literal></entry><entry><literal><![CDATA[arithmetic_assignment_action<multiply_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[/=]]></literal></entry><entry><literal><![CDATA[arithmetic_assignment_action<divide_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[%=]]></literal></entry><entry><literal><![CDATA[arithmetic_assignment_action<remainder_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[&=]]></literal></entry><entry><literal><![CDATA[bitwise_assignment_action<and_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[=|]]></literal></entry><entry><literal><![CDATA[bitwise_assignment_action<or_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[^=]]></literal></entry><entry><literal><![CDATA[bitwise_assignment_action<xor_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[<<=]]></literal></entry><entry><literal><![CDATA[bitwise_assignment_action<leftshift_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[>>=]]></literal></entry><entry><literal><![CDATA[bitwise_assignment_action<rightshift_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[++]]></literal></entry><entry><literal><![CDATA[pre_increment_decrement_action<increment_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[--]]></literal></entry><entry><literal><![CDATA[pre_increment_decrement_action<decrement_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[++]]></literal></entry><entry><literal><![CDATA[post_increment_decrement_action<increment_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[--]]></literal></entry><entry><literal><![CDATA[post_increment_decrement_action<decrement_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[&]]></literal></entry><entry><literal><![CDATA[other_action<address_of_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[*]]></literal></entry><entry><literal><![CDATA[other_action<contents_of_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[,]]></literal></entry><entry><literal><![CDATA[other_action<comma_action>]]></literal></entry></row>
<row><entry><literal><![CDATA[->*]]></literal></entry><entry><literal><![CDATA[other_action<member_pointer_action>]]></literal></entry></row>
</tbody>
</tgroup>
</table>
</section>
<section>
<title>Practical considerations</title>
<section>
<title>Performance</title>
<para>In theory, all overhead of using STL algorithms and lambda functors
compared to hand written loops can be optimized away, just as the overhead
from standard STL function objects and binders can.
Depending on the compiler, this can also be true in practice.
We ran two tests with the GCC 3.0.4 compiler on 1.5 GHz Intel Pentium 4.
The optimization flag -03 was used.
</para>
<para>
In the first test we compared lambda functors against explicitly written
function objects.
We used both of these styles to define unary functions which multiply the
argument repeatedly by itself.
We started with the identity function, going up to
x<superscript>5</superscript>.
The expressions were called inside a <literal>std::transform</literal> loop,
reading the argument from one <literal><![CDATA[std::vector<int>]]></literal>
and placing the result into another.
The length of the vectors was 100 elements.
The running times are listed in
<xref linkend="table:increasing_arithmetic_test"/>.
We can observe that there is no significant difference between the
two approaches.
</para>
<para>
In the second test we again used <literal>std::transform</literal> to
perform an operation to each element in a 100-element long vector.
This time the element type of the vectors was <literal>double</literal>
and we started with very simple arithmetic expressions and moved to
more complex ones.
The running times are listed in <xref linkend="table:ll_vs_stl_test"/>.
Here, we also included classic STL style unnamed functions into tests.
We do not show these expressions, as they get rather complex.
For example, the
last expression in <xref linkend="table:ll_vs_stl_test"/> written with
classic STL tools contains 7 calls to <literal>compose2</literal>,
8 calls to <literal>bind1st</literal>
and altogether 14 constructor invocations for creating
<literal>multiplies</literal>, <literal>minus</literal>
and <literal>plus</literal> objects.
In this test the BLL expressions are a little slower (roughly 10% on average,
less than 14% in all cases)
than the corresponding hand-written function objects.
The performance hit is a bit greater with classic STL expressions,
up to 27% for the simplest expressios.
</para>
<para>
The tests suggest that the BLL does not introduce a loss of performance
compared to STL function objects.
With a reasonable optimizing compiler, one should expect the performance characteristics be comparable to using classic STL.
Moreover, with simple expressions the performance can be expected to be close
to that of explicitly written function objects.
<!-- We repeated both tests with the KAI C++ 4.0f compiler (using +K2 -O3 flags),
generally considered a good optimizing compiler.
We do not list the results here, since the running times for the two alternatives in the first test were essentially the same, just as the running times
for the three different alternatives in the second test.
These tests suggest there to be no performance penalty at all
with a good optimizing compiler.
-->
Note however, that evaluating a lambda functor consist of a sequence of calls to small functions that are declared inline.
If the compiler fails to actually expand these functions inline,
the performance can suffer.
The running time can more than double if this happens.
Although the above tests do not include such an expression, we have experienced
this for some seemingly simple expressions.
<table id = "table:increasing_arithmetic_test">
<title>Test 1</title>
<caption>CPU time of expressions with integer multiplication written as a lambda expression and as a traditional hand-coded function object class.
The running times are expressed in arbitrary units.</caption>
<tgroup cols="3">
<thead>
<row>
<entry>expression</entry><entry>lambda expression</entry><entry>hand-coded function object</entry></row>
</thead>
<tbody>
<row>
<entry>x</entry><entry>240</entry><entry>230</entry>
</row>
<row>
<entry>x*x</entry><entry>340</entry><entry>350</entry>
</row>
<row>
<entry>x*x*x</entry><entry>770</entry><entry>760</entry>
</row>
<row>
<entry>x*x*x*x</entry><entry>1180</entry><entry>1210</entry>
</row>
<row>
<entry>x*x*x*x*x</entry><entry>1950</entry><entry>1910</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
<!--
16:19:49 bench [601] ./arith.out 100 1000000
Number of elements = 100
L1 : 240
L2 : 340
L3 : 770
L4 : 1180
L5 : 1950
P2 : 1700
P3 : 2130
P4 : 2530
P5 : 3000
F1 : 230
F2 : 350
F3 : 760
F4 : 1210
F5 : 1910
Number of elements = 100
Number of outer_iters = 1000000
L1 : 330
L2 : 350
L3 : 470
L4 : 620
L5 : 1660
LP : 1230
C1 : 370
C2 : 370
C3 : 500
C4 : 670
C5 : 1660
CP : 1770
F1 : 290
F2 : 310
F3 : 420
F4 : 600
F5 : 1460
FP : 1040
-->
<para>
<table id = "table:ll_vs_stl_test">
<title>Test 2</title>
<caption>CPU time of arithmetic expressions written as lambda
expressions, as classic STL unnamed functions (using <literal>compose2</literal>, <literal>bind1st</literal> etc.) and as traditional hand-coded function object classes.
Using BLL terminology,
<literal>a</literal> and <literal>b</literal> are bound arguments in the expressions, and <literal>x</literal> is open.
All variables were of types <literal>double</literal>.
The running times are expressed in arbitrary units.</caption>
<tgroup cols="4">
<thead>
<row>
<entry>expression</entry><entry>lambda expression</entry><entry>classic STL expression</entry><entry>hand-coded function object</entry></row>
</thead>
<tbody>
<row>
<entry>ax</entry><entry>330</entry><entry>370</entry><entry>290</entry>
</row>
<row>
<entry>-ax</entry><entry>350</entry><entry>370</entry><entry>310</entry>
</row>
<row>
<entry>ax-(a+x)</entry><entry>470</entry><entry>500</entry><entry>420</entry>
</row>
<row>
<entry>(ax-(a+x))(a+x)</entry><entry>620</entry><entry>670</entry><entry>600</entry>
</row>
<row>
<entry>((ax) - (a+x))(bx - (b+x))(ax - (b+x))(bx - (a+x))</entry><entry>1660</entry><entry>1660</entry><entry>1460</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
<para>Some additional performance testing with an earlier version of the
library is described
<xref linkend="cit:jarvi:00"/>.
</para>
</section>
<section>
<title>About compiling</title>
<para>The BLL uses templates rather heavily, performing numerous recursive instantiations of the same templates.
This has (at least) three implications:
<itemizedlist>
<listitem>
<para>
While it is possible to write incredibly complex lambda expressions, it probably isn't a good idea.
Compiling such expressions may end up requiring a lot of memory
at compile time, and being slow to compile.
</para>
</listitem>
<listitem>
<para>
The types of lambda functors that result from even the simplest lambda expressions are cryptic.
Usually the programmer doesn't need to deal with the lambda functor types at all, but in the case of an error in a lambda expression, the compiler usually outputs the types of the lambda functors involved.
This can make the error messages very long and difficult to interpret, particularly if the compiler outputs the whole chain of template instantiations.
</para>
</listitem>
<listitem>
<para>
The C++ Standard suggests a template nesting level of 17 to help detect infinite recursion.
Complex lambda templates can easily exceed this limit.
Most compilers allow a greater number of nested templates, but commonly require the limit explicitly increased with a command line argument.
</para>
</listitem>
</itemizedlist></para>
</section>
<section>
<title>Portability</title>
<para>
The BLL works with the following compilers, that is, the compilers are capable of compiling the test cases that are included with the BLL:
<itemizedlist>
<listitem>GCC 3.0.4
</listitem>
<listitem>KCC 4.0f with EDG 2.43.1
</listitem>
<listitem>GCC 2.96 (fails with one test case, the <filename>exception_test.cpp</filename> results in an internal compiler error.
)
</listitem>
</itemizedlist>
</para>
<section>
<title>Test coverage</title>
<para>The following list describes the test files included and the features that each file covers:
<itemizedlist>
<listitem>
<para>
<filename>bind_tests_simple.cpp</filename> : Bind expressions of different arities and types of target functions: function pointers, function objects and member functions.
Function composition with bind expressions.</para>
</listitem>
<listitem>
<para><filename>bind_tests_simple_function_references.cpp</filename> :
Repeats all tests from <filename moreinfo="none">bind_tests_simple.cpp</filename> where the target function is a function pointer, but uses function references instead.
</para></listitem>
<listitem>
<para><filename>bind_tests_advanced.cpp</filename> : Contains tests for nested bind expressions, <literal>unlambda</literal>, <literal>protect</literal>, <literal>const_parameters</literal> and <literal>break_const</literal>.
Tests passing lambda functors as actual arguments to other lambda functors, currying, and using the <literal>sig</literal> template to specify the return type of a function object.
</para>
</listitem>
<listitem>
<para>
<filename>operator_tests_simple.cpp</filename> :
Tests using all operators that are overloaded for lambda expressions, that is, unary and binary arithmetic,
bitwise,
comparison,
logical,
increment and decrement,
compound,
assignment,
subscrict,
address of,
dereference, and comma operators.
The streaming nature of shift operators is tested, as well as pointer arithmetic with plus and minus operators.
</para>
</listitem>
<listitem>
<para><filename>member_pointer_test.cpp</filename> : The pointer to member operator is complex enough to warrant a separate test file.
</para>
</listitem>
<listitem>
<para>
<filename>control_structures.cpp</filename> :
Tests for the looping and if constructs.
</para></listitem>
<listitem>
<para>
<filename>switch_construct.cpp</filename> :
Includes tests for all supported arities of the switch statement, both with and without the default case.
</para>
</listitem>
<listitem>
<para>
<filename>exception_test.cpp</filename> :
Includes tests for throwing exceptions and for try/catch constructs with varying number of catch blocks.
</para>
</listitem>
<listitem>
<para>
<filename>constructor_tests.cpp</filename> :
Contains tests for <literal>constructor</literal>, <literal>destructor</literal>, <literal>new_ptr</literal>, <literal>delete_ptr</literal>, <literal>new_array</literal> and <literal>delete_array</literal>.
</para>
</listitem>
<listitem>
<para>
<filename>cast_test.cpp</filename> : Tests for the four cast expressions, as well as <filename>typeid</filename> and <literal>sizeof</literal>.
</para>
</listitem>
<listitem>
<para>
<filename>extending_return_type_traits.cpp</filename> : Tests extending the return type deduction system for user defined types.
Contains several user defined operators and the corresponding specializations for the return type deduction templates.
</para>
</listitem>
<listitem>
<para>
<filename>is_instance_of_test.cpp</filename> : Includes tests for an internally used traits template, which can detect whether a given type is an instance of a certain template or not.
</para></listitem>
<listitem>
<para>
<filename>bll_and_function.cpp</filename> :
Contains tests for using <literal>boost::function</literal> together with lambda functors.
</para></listitem>
</itemizedlist>
</para>
</section>
</section>
</section>
<section>
<title>Relation to other Boost libraries</title>
<section>
<title>Boost Function</title>
<para>Sometimes it is convenient to store lambda functors in variables.
However, the types of even the simplest lambda functors are long and unwieldy, and it is in general unfeasible to declare variables with lambda functor types.
<emphasis>The Boost Function library</emphasis> <xref linkend="cit:boost::function"/> defines wrappers for arbitrary function objects, for example
lambda functors; and these wrappers have types that are easy to type out.
For example:
<programlisting>
<![CDATA[boost::function<int(int, int)> f = _1 + _2;
boost::function<int&(int&)> g = (_1 += 10);
int i = 1, j = 2;
f(i, j); // returns 3
g(i); // sets i to = 11;]]>
</programlisting>
The return and parameter types of the wrapped function object must be written explicilty as the template argument to the wrapper template <literal>boost::function</literal>; even when lambda functors, which otherwise have generic parameters, are wrapped.
Wrapping a function object with <literal>boost::function</literal> introduces a performance cost comparable to virtual function dispatch, though virtual functions are not actually used.
Note that storing lambda functors inside <literal>boost::function</literal>
introduces a danger.
Certain types of lambda functors may store references to the bound
arguments, instead as taking copies of the arguments of the lambda expression.
When temporary lambda functor objects are used
in STL algorithm invocations this is always safe, as the lambda functor gets
destructed immediately after the STL algortihm invocation is completed.
However, a lambda functor wrapped inside <literal>boost::function</literal>
may continue to exist longer, creating the possibility of dangling references.
For example:
<programlisting>
<![CDATA[int* sum = new int();
*sum = 0;
boost::function<int&(int)> counter = *sum += _1;
counter(5); // ok, *sum = 5;
delete sum;
counter(3); // error, *sum does not exist anymore]]>
</programlisting>
</para>
</section>
<section>
<title>Boost Bind</title>
<para>
<emphasis>The Boost Bind</emphasis> <xref linkend="cit:boost::bind"/> library has partially overlapping functionality with the BLL.
Basically, the Boost Bind library (BB in the sequel) implements the bind expression part of BLL.
There are, however, some semantical differerences.
</para>
<para>
The BLL and BB evolved separately, and have different implementations.
This means that the bind expressions from the BB cannot be used within
bind expressions, or within other type of lambda expressions, of the BLL.
The same holds for using BLL bind expressions in the BB.
The libraries can coexist, however, as
the names of the BB library are in <literal>boost</literal> namespace,
whereas the BLL names are in <literal>boost::lambda</literal> namespace.
</para>
<para>
The BLL requires a compiler that is reasonably conformant to the
C++ standard, whereas the BB library is more portable, and works with
a larger set of compilers.
</para>
<para>
The following two sections describe what are the semantic differences
between the bind expressions in BB and BLL.
</para>
<section>
<title>First argument of bind expression</title>
In BB the first argument of the bind expression, the target function,
is treated differently from the other arguments,
as no argument substitution takes place within that argument.
In BLL the first argument is not a special case in this respect.
For example:
<programlisting>
<![CDATA[template<class F>
int foo(const F& f) {
int x;
..
bind(f, _1)(x);
...
}]]>
</programlisting>
<programlisting>
<![CDATA[int bar(int, int);
nested(bind(bar, 1, _1));]]>
</programlisting>
The bind expression inside <literal>foo</literal> becomes:
<programlisting>
bind(bind(bar, 1, _1), _1)(x)
</programlisting>
The BLL interpretes this as:
<programlisting>
bar(1, x)(x)
</programlisting>
whereas the BB library as
<programlisting>
bar(1, x)
</programlisting>
To get this functionality in BLL, the bind expression inside the <literal moreinfo="none">foo</literal> function can be written as:
<programlisting>
bind(unlambda(f), _1)(x);
</programlisting>
as explained in <xref linkend = "lambda.unlambda"/>.
</section>
<para>
The BB library supports up to nine placeholders, while the BLL
defines only three placeholders.
The rationale for not providing more, is that the highest arity of the
function objects accepted by any STL algorithm is two.
The placeholder count is easy to increase in the BB library.
In BLL it is possible, but more laborous.
The BLL currently passes the actual arguments to the lambda functors
internally just as they are and does not wrap them inside a tuple object.
The reason for this is that some widely used compilers are not capable
of optimizing the intermediate tuple objects away.
The creation of the intermediate tuples would cause a significant
performance hit, particularly for the simplest (and thus the most common)
lambda functors.
We are working on a hybrid approach, which will allow more placeholders
but not compromise the performance of simple lambda functors.
</para>
</section>
</section>
<section>
<title>Contributors</title>
The main body of the library was written by Jaakko Järvi and Gary Powell.
We've got outside help, suggestions and ideas from Jeremy Siek, Peter Higley, Peter Dimov, Valentin Bonnard, William Kempf.
We would particularly like to mention Joel de Guzmann and his work with
Phoenix which has influenced BLL significantly, making it considerably simpler
to extend the library with new features.
</section>
<section>
<title>Rationale for some of the design decisions</title>
<section id="lambda.why_weak_arity">
<title>
Lambda functor arity
</title>
<para>
The highest placeholder index in a lambda expression determines the arity of the resulting function object.
However, this is just the minimal arity, as the function object can take arbitrarily many arguments; those not needed are discarded.
Consider the two bind expressions and their invocations below:
<programlisting>
bind(g, _3, _3, _3)(x, y, z);
bind(g, _1, _1, _1)(x, y, z);
</programlisting>
This first line discards arguments <literal>x</literal> and
<literal>y</literal>, and makes the call:
<programlisting>
g(z, z, z)
</programlisting>
whereas the second line discards arguments <literal>y</literal> and
<literal>z</literal>, and calls:
<programlisting>
g(x, x, x)
</programlisting>
In earlier versions of the library, the latter line resulted in a compile
time error.
This is basically a tradeoff between safety and flexibility, and the issue
was extensively discussed during the Boost review period of the library.
The main points for the <emphasis>strict arity</emphasis> checking
was that it might
catch a programming error at an earlier time and that a lambda expression that
explicitly discards its arguments is easy to write:
<programlisting>
(_3, bind(g, _1, _1, _1))(x, y, z);
</programlisting>
This lambda expression takes three arguments.
The left-hand argument of the comma operator does nothing, and as comma
returns the result of evaluating the right-hand argument we end up with
the call
<literal>g(x, x, x)</literal>
even with the strict arity.
</para>
<para>
The main points against the strict arity checking were that the need to
discard arguments is commonplace, and should therefore be straightforward,
and that strict arity checking does not really buy that much more safety,
particularly as it is not symmetric.
For example, if the programmer wanted to write the expression
<literal>_1 + _2</literal> but mistakenly wrote <literal>_1 + 2</literal>,
with strict arity checking, the complier would spot the error.
However, if the erroneous expression was <literal>1 + _2</literal> instead,
the error would go unnoticed.
Furthermore, weak arity checking simplifies the implementation a bit.
Following the recommendation of the Boost review, strict arity checking
was dropped.
</para>
</section>
</section>
<bibliography>
<biblioentry id="cit:stepanov:94">
<abbrev>STL94</abbrev>
<authorgroup>
<author>
<surname>Stepanov</surname>
<firstname>A. A.</firstname>
</author>
<author>
<surname>Lee</surname>
<firstname>M.</firstname>
</author>
</authorgroup>
<title>The Standard Template Library</title>
<orgname>Hewlett-Packard Laboratories</orgname>
<pubdate>1994</pubdate>
<bibliomisc>
<ulink url="http://www.hpl.hp.com/techreports">www.hpl.hp.com/techreports</ulink>
</bibliomisc>
</biblioentry>
<biblioentry id="cit:sgi:02">
<abbrev>SGI02</abbrev>
<title>The SGI Standard Template Library</title>
<pubdate>2002</pubdate>
<bibliomisc><ulink url="http://www.sgi.com/tech/stl/">www.sgi.com/tech/stl/</ulink></bibliomisc>
</biblioentry>
<biblioentry id="cit:c++:98">
<abbrev>C++98</abbrev>
<title>International Standard, Programming Languages &ndash; C++</title>
<subtitle>ISO/IEC:14882</subtitle>
<pubdate>1998</pubdate>
</biblioentry>
<biblioentry id="cit:jarvi:99">
<abbrev>Jär99</abbrev>
<articleinfo>
<author>
<surname>Järvi</surname>
<firstname>Jaakko</firstname>
</author>
<title>C++ Function Object Binders Made Easy</title>
</articleinfo>
<title>Lecture Notes in Computer Science</title>
<volumenum>1977</volumenum>
<publishername>Springer</publishername>
<pubdate>2000</pubdate>
</biblioentry>
<biblioentry id="cit:jarvi:00">
<abbrev>Jär00</abbrev>
<author>
<surname>Järvi</surname>
<firstname>Jaakko</firstname>
</author>
<author>
<firstname>Gary</firstname>
<surname>Powell</surname>
</author>
<title>The Lambda Library : Lambda Abstraction in C++</title>
<orgname>Turku Centre for Computer Science</orgname>
<bibliomisc>Technical Report </bibliomisc>
<issuenum>378</issuenum>
<pubdate>2000</pubdate>
<bibliomisc><ulink url="http://www.tucs.fi/Publications/techreports/TR378.php">www.tucs.fi/publications</ulink></bibliomisc>
</biblioentry>
<biblioentry id="cit:jarvi:01">
<abbrev>Jär01</abbrev>
<author>
<surname>Järvi</surname>
<firstname>Jaakko</firstname>
</author>
<author>
<firstname>Gary</firstname>
<surname>Powell</surname>
</author>
<title>The Lambda Library : Lambda Abstraction in C++</title>
<confgroup>
<conftitle>Second Workshop on C++ Template Programming</conftitle>
<address>Tampa Bay, OOPSLA'01</address>
</confgroup>
<pubdate>2001</pubdate>
<bibliomisc><ulink url="http://www.oonumerics.org/tmpw01/">www.oonumerics.org/tmpw01/</ulink></bibliomisc>
</biblioentry>
<biblioentry id="cit:jarvi:03">
<abbrev>Jär03</abbrev>
<articleinfo>
<author>
<surname>Järvi</surname>
<firstname>Jaakko</firstname>
</author>
<author>
<firstname>Gary</firstname>
<surname>Powell</surname>
</author>
<author>
<firstname>Andrew</firstname>
<surname>Lumsdaine</surname>
</author>
<title>The Lambda Library : unnamed functions in C++</title>
</articleinfo>
<title>Software - Practice and Expreience</title>
<volumenum>33:259-291</volumenum>
<pubdate>2003</pubdate>
</biblioentry>
<biblioentry id="cit:boost::tuple">
<abbrev>tuple</abbrev>
<title>The Boost Tuple Library</title>
<bibliomisc><ulink url="http://www.boost.org/libs/tuple/doc/tuple_users_guide.html">www.boost.org/libs/tuple/doc/tuple_users_guide.html</ulink>
</bibliomisc>
<pubdate>2002</pubdate>
</biblioentry>
<biblioentry id="cit:boost::type_traits">
<abbrev>type_traits</abbrev>
<title>The Boost type_traits</title>
<bibliomisc><ulink url="http://www.boost.org/libs/type_traits/index.htm">www.boost.org/libs/type_traits/</ulink>
</bibliomisc>
<pubdate>2002</pubdate>
</biblioentry>
<biblioentry id="cit:boost::ref">
<abbrev>ref</abbrev>
<title>Boost ref</title>
<bibliomisc><ulink url="http://www.boost.org/libs/bind/ref.html">www.boost.org/libs/bind/ref.html</ulink>
</bibliomisc>
<pubdate>2002</pubdate>
</biblioentry>
<biblioentry id="cit:boost::bind">
<abbrev>bind</abbrev>
<title>Boost Bind Library</title>
<bibliomisc><ulink url="http://www.boost.org/libs/bind/bind.html">www.boost.org/libs/bind/bind.html</ulink>
</bibliomisc>
<pubdate>2002</pubdate>
</biblioentry>
<biblioentry id="cit:boost::function">
<abbrev>function</abbrev>
<title>Boost Function Library</title>
<bibliomisc><ulink url="http://www.boost.org/libs/function/">www.boost.org/libs/function/</ulink>
</bibliomisc>
<pubdate>2002</pubdate>
</biblioentry>
<biblioentry id="cit:fc++">
<abbrev>fc++</abbrev>
<title>The FC++ library: Functional Programming in C++</title>
<author>
<surname>Smaragdakis</surname>
<firstname>Yannis</firstname>
</author>
<author>
<firstname>Brian</firstname>
<surname>McNamara</surname>
</author>
<bibliomisc><ulink url="http://www.cc.gatech.edu/~yannis/fc++/">www.cc.gatech.edu/~yannis/fc++/</ulink>
</bibliomisc>
<pubdate>2002</pubdate>
</biblioentry>
</bibliography>
</library>