Compare commits

...
Author SHA1 Message Date
Andrey Semashev 2b2f7ea7f8 Boost.Log merged to trunk.
[SVN r83860]
2013-04-13 12:30:25 +00:00
Rene Rivera 1366765788 Cleanup release tags.
[SVN r44323]
2008-04-12 05:21:54 +00:00
Rene Rivera b88b35c816 Cleanup release tags.
[SVN r44253]
2008-04-12 03:40:37 +00:00
nobody f8d6db30ae This commit was manufactured by cvs2svn to create tag
'Version_1_30_2'.

[SVN r19685]
2003-08-18 18:40:31 +00:00
Aleksey Gurtovoy ba4e1cbe3c bump up BOOST_VERSION
[SVN r19684]
2003-08-18 18:40:30 +00:00
Aleksey Gurtovoy a29540d880 compile notes for the 1.30.2 release
[SVN r19683]
2003-08-18 18:30:42 +00:00
Dave Abrahams d3f5cd1a02 Updated RC_1_30_0 mailing_lists page to match HEAD
Added "Project-Specific" link to the main page.
Added pointer from user's list summary to project-specific lists.


[SVN r19677]
2003-08-18 11:43:13 +00:00
Dave Abrahams a310f82be7 Updated RC_1_30_0 mailing_lists page to match HEAD
Added "Project-Specific" link to the main page.
Added pointer from user's list summary to project-specific lists.


[SVN r19676]
2003-08-18 11:43:12 +00:00
Dave Abrahams c18cdd4aab Advertise hourly boost snapshots
[SVN r19674]
2003-08-18 04:09:15 +00:00
Aleksey Gurtovoy 298e1b0b40 merge fixes from the main trunk
[SVN r19673]
2003-08-18 03:12:00 +00:00
Aleksey Gurtovoy 5fb7343ca7 merge changes from the main trunk to get in sync with the header
[SVN r19669]
2003-08-17 21:02:53 +00:00
Aleksey Gurtovoy ca86ff56e9 merged libs/libs fix + other stuff from the main trunk
[SVN r19668]
2003-08-17 20:59:24 +00:00
Dave Abrahams 4dcbe29188 Fix relative path bug
[SVN r19666]
2003-08-17 19:54:16 +00:00
Dave Abrahams e55f6dec63 Fix the GCC workaround!
[SVN r19647]
2003-08-16 18:48:23 +00:00
Dave Abrahams 5ce7277487 Preserve PATH from environment
[SVN r19644]
2003-08-16 16:46:27 +00:00
Dave Abrahams a077c332b5 Fixed runtime library choice, since STLPort offers only multithreaded builds
[SVN r19642]
2003-08-16 15:23:40 +00:00
Dave Abrahams c597dca588 Don't build dynamic libs on windows
[SVN r19637]
2003-08-16 14:08:01 +00:00
Dave Abrahams ae738cd9a7 Fixed misplace facet-support requirement
[SVN r19634]
2003-08-16 12:08:19 +00:00
Dave Abrahams 646cf60711 merged from trunk
[SVN r19631]
2003-08-16 02:09:27 +00:00
Dave Abrahams afa0d4d6cc Updated for 1.30.2
[SVN r19630]
2003-08-16 01:37:46 +00:00
Dave Abrahams f0fe7b68dd Correctly signal that wchar_t is not a distinct type when emulating vc6.
[SVN r19628]
2003-08-16 01:14:18 +00:00
Dave Abrahams 0b3d605bdc Fix facet support for intel-win32
[SVN r19625]
2003-08-16 00:18:24 +00:00
Fernando Cacciola c0de0fbf8d New fix for std swap (for gcc >= 3.3)
[SVN r19624]
2003-08-15 21:27:29 +00:00
Fernando Cacciola f806214e1c Fix couple of typos
[SVN r19623]
2003-08-15 21:23:47 +00:00
Dave Abrahams 7f28ed0cf2 Fix mistaken workaround with
BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS.  It breaks GCC.


[SVN r19622]
2003-08-15 20:55:25 +00:00
Dave Abrahams aa74a37230 Fix locale support for metrowerks
[SVN r19621]
2003-08-15 18:39:57 +00:00
Aleksey Gurtovoy eabcdd94ff Fix in links to error log
[SVN r19618]
2003-08-15 08:34:18 +00:00
Dave Abrahams 42b1828ad3 Fixes for optional_test:
Added missing #include

      Upgraded to the latest intel-win32-tools.jam in order to handle
      intel5 compatibility.


[SVN r19595]
2003-08-14 14:40:41 +00:00
Aleksey Gurtovoy 32cada467d bug fix
[SVN r19594]
2003-08-14 14:02:32 +00:00
Aleksey Gurtovoy 4f3c36ac66 links fix
[SVN r19586]
2003-08-14 11:59:52 +00:00
Samuel Krempp f0169652c1 merged MSVC7.1 fixes in the main trunk into the branch for 1_30_2 release
[SVN r19585]
2003-08-14 11:32:01 +00:00
Aleksey Gurtovoy 0604556d66 merged changes from the main trunk
[SVN r19584]
2003-08-14 11:07:49 +00:00
nobody ae9b9acb4d This commit was manufactured by cvs2svn to create branch 'RC_1_30_0'.
[SVN r19583]
2003-08-14 11:06:27 +00:00
Martin Wille 1c45d451ee need -lrt, always
[SVN r19580]
2003-08-14 09:33:34 +00:00
John Maddock 5cd896c7d8 Selectively merged changes in the main trunk into the branch for 1.30.2 release.
[SVN r19569]
2003-08-13 11:32:18 +00:00
Dave Abrahams e557f6f7be update revision date
[SVN r19552]
2003-08-12 13:43:35 +00:00
Dave Abrahams d3e879eeee Added ALERT about 1.30.1 problems
[SVN r19551]
2003-08-12 13:42:37 +00:00
Douglas Gregor 8519839a9d Stupid fix, from mainline
[SVN r19490]
2003-08-08 22:15:43 +00:00
Dave Abrahams 392fcc44cf Add reference to the anonymous CVS mirror
[SVN r19442]
2003-08-04 17:55:27 +00:00
Dave Abrahams 451a979fcc Updates for Boost 1.30.1
[SVN r19440]
2003-08-04 17:38:10 +00:00
Dave Abrahams 4066fdffdf Added Python 2.3 note.
[SVN r19438]
2003-08-04 17:01:29 +00:00
John Maddock 28692f38e2 Added minor gcc 3.3 fixes (warning suppression)
[SVN r19415]
2003-08-03 11:59:11 +00:00
Jeff Garland c0a21fc2e6 add missing file
[SVN r19405]
2003-08-02 18:03:00 +00:00
Dave Abrahams eef5c4dee2 merged from trunk
[SVN r19404]
2003-08-02 16:20:49 +00:00
Joel de Guzman 04657e963f final missing
[SVN r19399]
2003-08-02 01:18:33 +00:00
Joel de Guzman cbe04148e3 removed makefile remnant
[SVN r19397]
2003-08-01 19:41:34 +00:00
Joel de Guzman 07f2a7be0c Spirit 1.6.1
[SVN r19396]
2003-08-01 19:23:50 +00:00
Joel de Guzman cfe0300b88 Spirit 1.6.1
[SVN r19395]
2003-08-01 19:04:14 +00:00
Joel de Guzman 0a156adc20 Spirit 1.6.1
[SVN r19394]
2003-08-01 18:28:40 +00:00
Joel de Guzman c6b627d20a Spirit 1.6.1
[SVN r19393]
2003-08-01 18:21:18 +00:00
Joel de Guzman 3bbf23200c Spirit 1.6.1
[SVN r19392]
2003-08-01 17:55:28 +00:00
Dave Abrahams 4755ea2a7f Backport bugfix from trunk
[SVN r19362]
2003-07-30 12:20:30 +00:00
Daniel Frey fc95c6d601 Merged fix for gcc 2.95.2 from HEAD
[SVN r19221]
2003-07-19 20:55:22 +00:00
nobody 1e54ddf121 This commit was manufactured by cvs2svn to create branch 'RC_1_30_0'.
[SVN r19219]
2003-07-19 20:39:43 +00:00
Aleksey Gurtovoy c0ebe62642 fix
[SVN r19210]
2003-07-19 10:07:20 +00:00
Aleksey Gurtovoy 6526a2f376 fix failure links
[SVN r19209]
2003-07-19 09:52:17 +00:00
nobody 4b1e83a967 This commit was manufactured by cvs2svn to create branch 'RC_1_30_0'.
[SVN r19207]
2003-07-19 08:29:29 +00:00
Douglas Gregor ed9aa2c94b VC 7.1 does not handle the operator== conversions correctly, either
[SVN r19177]
2003-07-18 04:04:54 +00:00
Douglas Gregor c3df3f1136 Update Borland C++ version number in enable_if check
[SVN r19176]
2003-07-18 04:00:02 +00:00
nobody f1ac7ae023 This commit was manufactured by cvs2svn to create branch 'RC_1_30_0'.
[SVN r19146]
2003-07-16 10:53:07 +00:00
Dave Abrahams 28d0075abb unused variable warning patch
[SVN r19130]
2003-07-15 19:35:14 +00:00
Dave Abrahams 6160b9babf merged from trunk
[SVN r18264]
2003-04-16 14:32:58 +00:00
Terje Slettebø 3776f0c8cf no message
[SVN r18238]
2003-04-12 08:02:14 +00:00
Terje Slettebø 44b122ea61 Merged from trunk
[SVN r18237]
2003-04-11 22:15:04 +00:00
Dave Abrahams 9131f3994c merged from trunk
[SVN r18086]
2003-03-25 17:59:32 +00:00
Dave Abrahams 9fea687b66 merged from trunk
[SVN r18084]
2003-03-25 17:42:39 +00:00
Dave Abrahams cf5334e845 merged from trunk
[SVN r18082]
2003-03-25 17:28:13 +00:00
Dave Abrahams a81954b4cf merged from trunk
[SVN r18070]
2003-03-24 02:13:22 +00:00
Dave Abrahams 4d5abd4b64 merged from trunk
[SVN r18054]
2003-03-22 17:29:34 +00:00
Dave Abrahams d4442108c8 merged from trunk
[SVN r18052]
2003-03-22 15:18:14 +00:00
Dave Abrahams 59a1228c6d merged from trunk
[SVN r18050]
2003-03-22 15:01:39 +00:00
Dave Abrahams 95fd033564 merged from trunk
[SVN r18048]
2003-03-22 14:38:59 +00:00
Dave Abrahams 1a31de3d06 merged from trunk
[SVN r18046]
2003-03-22 13:38:03 +00:00
Dave Abrahams 14f5f251b2 merged from trunk
[SVN r18033]
2003-03-20 15:38:58 +00:00
Dave Abrahams b25ac4ac30 fix typo
[SVN r18025]
2003-03-20 02:53:47 +00:00
Ralf W. Grosse-Kunstleve af997682a4 pyconfig.h included first only under Tru64/cxx
[SVN r18022]
2003-03-20 00:27:16 +00:00
Joel de Guzman 42c5d1c1fd Bump to v1.6.0
[SVN r18020]
2003-03-19 23:18:39 +00:00
Terje Slettebø 0b7402ec32 BOOST_MSVC<=1200 fix from Terje
[SVN r18019]
2003-03-19 21:25:45 +00:00
Samuel Krempp 80b6e7ef2a from trunk
[SVN r18015]
2003-03-19 19:24:48 +00:00
Samuel Krempp a10ff74647 (from trunk)
. BOOST_BAD_ISDIGIT  renamed  BOOST_NO_LOCALE_ISDIGIT  (this macro was aready the one being checked in the eginning of the file)


[SVN r18011]
2003-03-19 17:05:20 +00:00
Beman Dawes 9402f908fd Borland fix from Alisdair Meredith
[SVN r18007]
2003-03-19 14:12:21 +00:00
Beman Dawes 683346d0f3 finalize release 1.30.0 date
[SVN r18006]
2003-03-19 13:09:37 +00:00
Thomas Witt 77b56f4ab8 Schedule update.
[SVN r18005]
2003-03-19 12:59:51 +00:00
Joel de Guzman 3931cb6858 various patches for vc7.1 and comeau 4.3
[SVN r18004]
2003-03-19 12:51:44 +00:00
John Maddock 8979c7b7b9 Fixed bug that effect some searches
[SVN r18003]
2003-03-19 12:19:14 +00:00
Beman Dawes ac7246865f BOOST_MSVC<=1200 fix from Terje
[SVN r18002]
2003-03-19 12:14:32 +00:00
Ralf W. Grosse-Kunstleve a615c44487 restore Codewarrior builds
[SVN r17998]
2003-03-19 07:04:07 +00:00
Bruno da Silva de Oliveira 20677ec175 - Updated to reflect changes in declarations.py
[SVN r17997]
2003-03-19 05:55:28 +00:00
nobody abdb470397 This commit was manufactured by cvs2svn to create branch 'RC_1_30_0'.
[SVN r17996]
2003-03-19 05:54:27 +00:00
Bruno da Silva de Oliveira c5d8c2a9ec - Fixed bug where the PointerDeclaration of functions and methods didn't have the & operator
[SVN r17994]
2003-03-19 05:03:49 +00:00
Bruno da Silva de Oliveira 9f7a1d2564 - Unit tests for the examples
[SVN r17992]
2003-03-19 03:08:53 +00:00
Bruno da Silva de Oliveira d482ebade7 - Fixed bug where an union that was a class member crashed pyste (unions are still not exported)
- Added support for int, double, float and long operators


[SVN r17991]
2003-03-19 02:57:31 +00:00
Bruno da Silva de Oliveira d0f4b4d6aa - Unit tests for the examples
[SVN r17990]
2003-03-19 02:55:30 +00:00
nobody dea8a66feb This commit was manufactured by cvs2svn to create branch 'RC_1_30_0'.
[SVN r17988]
2003-03-19 02:47:30 +00:00
Ralf W. Grosse-Kunstleve 16982e0deb special code only for gcc <= 2.96
[SVN r17986]
2003-03-19 02:40:15 +00:00
Dave Abrahams 57289f8cb2 Commit Terje's changes
[SVN r17982]
2003-03-18 23:55:14 +00:00
Ralf W. Grosse-Kunstleve 67bd168cbd fix for Visual C++ >= 7.1 as per David Abrahams
[SVN r17978]
2003-03-18 22:31:12 +00:00
Ralf W. Grosse-Kunstleve 6f313e1df8 gcc 2.96 compatibility
[SVN r17977]
2003-03-18 20:57:46 +00:00
Dave Abrahams 0ff7474a24 Add funcptr FAQ
[SVN r17974]
2003-03-18 14:40:09 +00:00
Joel de Guzman fc71595dac using boost/throw_exception
[SVN r17973]
2003-03-18 14:11:17 +00:00
Markus Schöpflin 18fc6a6c91 Merged fix from trunk to branch.
[SVN r17971]
2003-03-18 08:49:54 +00:00
Bruno da Silva de Oliveira f68aa38a8d - Fixed bugs in Linux
[SVN r17969]
2003-03-18 05:16:01 +00:00
Ralf W. Grosse-Kunstleve ffcc9e7dcb minor fix: declared inline after being used
[SVN r17968]
2003-03-18 04:07:29 +00:00
Aleksey Gurtovoy 3bc5fbc0b2 revert to 1.5 revision
[SVN r17967]
2003-03-17 20:20:56 +00:00
Beman Dawes 7306a82e34 completed change lib name to boost_filesystem
[SVN r17960]
2003-03-17 15:34:55 +00:00
Beman Dawes ed1753d7f5 change lib name to boost_filesystem
[SVN r17959]
2003-03-17 15:33:04 +00:00
Fernando Cacciola 41b85ef4bb Merged to RC
[SVN r17957]
2003-03-17 13:42:06 +00:00
Beman Dawes 0c9911ed19 Add build information (Victor Wagner)
[SVN r17950]
2003-03-17 02:18:12 +00:00
Beman Dawes 0fb398b832 Add filesystem library
[SVN r17949]
2003-03-17 02:14:14 +00:00
Beman Dawes ad5e1f11d1 Borland fixes (Alisdair Meredith)
[SVN r17948]
2003-03-17 01:39:15 +00:00
Douglas Gregor cddbb683ab Remove useless ifndef/else/endif block
[SVN r17943]
2003-03-15 23:19:48 +00:00
Joel de Guzman f0faec203d touch
[SVN r17938]
2003-03-15 22:57:03 +00:00
Joel de Guzman 860540df92 Metrowerks patch
[SVN r17937]
2003-03-15 22:41:46 +00:00
Bruno da Silva de Oliveira 453a48f094 - Fixed bug where the permission bits were being copied to the tmp file
[SVN r17934]
2003-03-15 02:51:51 +00:00
nobody 26a5bfb2d7 This commit was manufactured by cvs2svn to create branch 'RC_1_30_0'.
[SVN r17932]
2003-03-14 23:39:05 +00:00
Bruno da Silva de Oliveira c1ebcfae73 - Fixed definition of private default implementations
[SVN r17930]
2003-03-14 23:36:44 +00:00
Bruno da Silva de Oliveira 564cd82a7b - Now generating wrappers for protected and private virtual methods
[SVN r17927]
2003-03-14 21:43:33 +00:00
Terje Slettebø dc0c25fede Updated Changes section
[SVN r17922]
2003-03-14 20:32:51 +00:00
Terje Slettebø a2709a02c8 no message
[SVN r17921]
2003-03-14 20:17:47 +00:00
John Maddock e7ddd1e09b merged from main trunk
[SVN r17914]
2003-03-14 13:02:11 +00:00
Markus Schöpflin a2abbe53ee Merged typename fix from trunk to branch.
[SVN r17913]
2003-03-14 13:00:11 +00:00
John Maddock 89698bd1c0 Merged from main truck
[SVN r17910]
2003-03-14 12:18:04 +00:00
Terje Slettebø 716666a3da Removed superfluous */ in description
[SVN r17909]
2003-03-14 07:55:00 +00:00
Joel de Guzman 4769a26d83 Borland Patches
[SVN r17903]
2003-03-14 02:55:31 +00:00
nobody 6e2c7a0af3 This commit was manufactured by cvs2svn to create branch 'RC_1_30_0'.
[SVN r17902]
2003-03-14 02:49:25 +00:00
Terje Slettebø e53db92a61 Updated description
[SVN r17898]
2003-03-13 22:01:48 +00:00
Beman Dawes e9a9a7c079 overloading fix + less permissive wide character support
[SVN r17893]
2003-03-13 17:27:06 +00:00
Fernando Cacciola c329cc3b79 Alignment bug fixed
[SVN r17892]
2003-03-13 15:38:04 +00:00
Aleksey Gurtovoy 34347f80d0 merge fixes from the main trunk
[SVN r17888]
2003-03-13 12:34:25 +00:00
Aleksey Gurtovoy 4c6052a97c merge fixes from the main trunk
[SVN r17887]
2003-03-13 12:28:49 +00:00
Aleksey Gurtovoy 4be4c45b65 merge fixes from the main trunk
[SVN r17886]
2003-03-13 12:13:40 +00:00
Joel de Guzman edfad2bdf1 tweaks
[SVN r17884]
2003-03-13 10:32:04 +00:00
Joel de Guzman db639ce43a CodeWarrior patch
[SVN r17883]
2003-03-13 10:21:18 +00:00
Joel de Guzman 8245f38a78 merge from main
[SVN r17880]
2003-03-13 09:44:25 +00:00
Martin Wille ed9b11bf55 Merged reduction of number of objects being create during a test run from trunk to branch
[SVN r17878]
2003-03-13 08:06:37 +00:00
Paul Mensonides ec2c0198af fixed result reversal
[SVN r17876]
2003-03-13 07:12:20 +00:00
Bruno da Silva de Oliveira 7605ab864f no message
[SVN r17874]
2003-03-13 00:58:17 +00:00
Beman Dawes c3b06d99e4 BOOST_NO_STD_WSTRING
[SVN r17872]
2003-03-13 00:36:13 +00:00
Ralf W. Grosse-Kunstleve e3fe593207 adjustment for MIPSpro
[SVN r17864]
2003-03-12 22:59:46 +00:00
Beman Dawes f0446650c0 update from Kevlin and Terje
[SVN r17861]
2003-03-12 21:33:16 +00:00
Beman Dawes 4885b60fc8 Add request for path::swap member function (Geurt Vos)
[SVN r17858]
2003-03-12 16:20:41 +00:00
Vladimir Prus 53bd4863c2 Merge 1.30.
[SVN r17857]
2003-03-12 15:50:37 +00:00
Vladimir Prus 6d8b6ecb6b Merged 1.3.
[SVN r17856]
2003-03-12 15:46:56 +00:00
Ronald Garcia 847c8df172 Fixed broken patch.
[SVN r17855]
2003-03-12 15:44:35 +00:00
Markus Schöpflin 79fb48a4c0 Merged fix for VA6 from trunk to branch.
[SVN r17852]
2003-03-12 15:20:39 +00:00
Beman Dawes e062c29966 is_polymorphic font, 2 spelling errors (Fredrik Blomqvist)
[SVN r17850]
2003-03-12 14:51:23 +00:00
nobody c1d26fec8e This commit was manufactured by cvs2svn to create branch 'RC_1_30_0'.
[SVN r17843]
2003-03-12 13:51:19 +00:00
Dave Abrahams 1fe4daed83 opaque pointer conversions from Gottfried.Ganssauge@haufe.de
Acknowledgements for all


[SVN r17839]
2003-03-12 13:38:18 +00:00
nobody ee5c259d55 This commit was manufactured by cvs2svn to create branch 'RC_1_30_0'.
[SVN r17837]
2003-03-12 13:29:13 +00:00
Markus Schöpflin 2e67848b97 Merged fix for regression test failure for VA6 from trunk to branch
[SVN r17832]
2003-03-12 10:49:11 +00:00
Bruno da Silva de Oliveira 2bfff9a121 - first RC version
[SVN r17827]
2003-03-12 03:40:44 +00:00
nobody ef08358b0f This commit was manufactured by cvs2svn to create branch 'RC_1_30_0'.
[SVN r17826]
2003-03-12 01:39:29 +00:00
Beman Dawes 8b240385ec just use links leaf() for releative URL
[SVN r17822]
2003-03-12 00:11:27 +00:00
Beman Dawes 638bb0d6e5 Improved presentation (Gennadiy)
[SVN r17821]
2003-03-11 20:37:10 +00:00
Beman Dawes 592601742c fix windows if drive not c:
[SVN r17820]
2003-03-11 19:20:54 +00:00
Beman Dawes 112feafc04 fix broken bookmarks
[SVN r17819]
2003-03-11 19:15:40 +00:00
Beman Dawes 986d0ae384 procedure fixes (Martin Wille) plus FAQ entry
[SVN r17814]
2003-03-11 14:13:37 +00:00
Joel de Guzman c1ad44efae more
[SVN r17807]
2003-03-11 09:07:54 +00:00
Ralf W. Grosse-Kunstleve 509f69ebec adjustment for Itanium2
[SVN r17803]
2003-03-11 01:32:03 +00:00
Ralf W. Grosse-Kunstleve d10f297b0c pyconfig.h must be included before any system header (as per Python docs; essential for Python 2.3 under Tru64 Unix)
[SVN r17799]
2003-03-10 17:25:52 +00:00
William E. Kempf 50c71baca2 Fixed typo: conditin.hpp.
[SVN r17798]
2003-03-10 15:30:29 +00:00
Martin Wille b81bc1aaed Merged bug fix from trunk to branch
[SVN r17797]
2003-03-10 09:04:37 +00:00
Hartmut Kaiser d6be0274a2 Added template parameter for file_position type.
[SVN r17793]
2003-03-09 21:51:49 +00:00
Hartmut Kaiser 574b116c53 Lexer now returnes the matched token value. (This is for input iterators)
[SVN r17792]
2003-03-09 21:34:18 +00:00
Ralf W. Grosse-Kunstleve c29fff6846 non-template function make_function1 must be inline
[SVN r17791]
2003-03-09 17:26:06 +00:00
Beman Dawes 82053cd865 allow fs::native args, empty subinclude path
[SVN r17787]
2003-03-08 21:44:07 +00:00
Dave Abrahams d299b64b5b Fix for older EDGs
[SVN r17786]
2003-03-08 12:36:18 +00:00
Raoul Gough d547850251 Merge --enable-auto-image-base change to 1.30 release branch
[SVN r17785]
2003-03-08 10:06:21 +00:00
Dave Abrahams b3056bb9c5 Remove flotsam
[SVN r17783]
2003-03-08 08:53:19 +00:00
Dave Abrahams 92b21c7470 Remove flotsam
[SVN r17782]
2003-03-08 08:51:45 +00:00
Ralf W. Grosse-Kunstleve aa8811d92e missing raw_function.hpp added; struct is_reference_to_class definition moved up
[SVN r17781]
2003-03-08 08:44:38 +00:00
Aleksey Gurtovoy 4984a02701 SGI MIPSpro fix
[SVN r17780]
2003-03-08 07:10:07 +00:00
Dave Abrahams a91cb8a45a Fix for Python 2.3 long->int conversion behavior change
[SVN r17779]
2003-03-08 05:28:54 +00:00
nobody b1d41dba34 This commit was manufactured by cvs2svn to create branch 'RC_1_30_0'.
[SVN r17778]
2003-03-08 03:53:20 +00:00
Dave Abrahams be1ec59180 Added dangling_reference FAQ
Various idiomatic MPL cleanups in indirect_traits.hpp
raw_function support
Patches for CWPro7.2
Patches to pass tests under Python 2.3 with the new bool type.
Tests for member operators returning const objects
Fixes for testing Boost.Python under Cygwin


[SVN r17777]
2003-03-08 03:53:19 +00:00
Ralf W. Grosse-Kunstleve 147dffd1ca MIPSpro compatibility
[SVN r17776]
2003-03-08 01:47:40 +00:00
Aleksey Gurtovoy 35c86461b0 fix Borland failures
[SVN r17775]
2003-03-08 01:17:47 +00:00
Vladimir Prus 7ba6b914f7 Merge 1.2.
[SVN r17771]
2003-03-07 18:02:14 +00:00
Beman Dawes c7343a151e VC++ 7.1 RC3 fix (Carl Daniel)
[SVN r17769]
2003-03-07 17:29:26 +00:00
Vladimir Prus 59ebd068c6 Merge of 1.48 to RC_1_30_0.
[SVN r17766]
2003-03-07 16:17:25 +00:00
Beman Dawes b5439a6289 revert cr->nl changes; not needed on this particular file
[SVN r17764]
2003-03-07 15:36:56 +00:00
Beman Dawes 8f50a1cc34 Header dependencies removed
[SVN r17762]
2003-03-07 15:08:57 +00:00
Martin Wille 5d7beedee0 Merged removal of files not needed for Boost from trunc to RC_1_30_0
[SVN r17761]
2003-03-07 12:16:55 +00:00
Martin Wille 91f7b8efb0 Merged removal of unnecessary files from trunk to branch
[SVN r17759]
2003-03-07 12:00:29 +00:00
Joel de Guzman f07d53b442 *** empty log message ***
[SVN r17751]
2003-03-07 05:07:02 +00:00
Beman Dawes acfbfd61f9 add merged_to tag instructions
[SVN r17750]
2003-03-06 18:45:03 +00:00
Hartmut Kaiser eca9658526 Fixed iterator_traits problem.
[SVN r17749]
2003-03-06 18:26:14 +00:00
Beman Dawes 7b718f0448 now fixes suggested be merged from trunk to branch
[SVN r17747]
2003-03-06 18:04:22 +00:00
Hartmut Kaiser 65b74abc93 Removed the cpp sample.
[SVN r17743]
2003-03-06 16:57:24 +00:00
Douglas Gregor cc7f1408bb Mention documentation changes
[SVN r17740]
2003-03-05 23:25:34 +00:00
Douglas Gregor abc945228a Added links to PDF & man page documentation
[SVN r17739]
2003-03-05 23:21:53 +00:00
Douglas Gregor 5dc3d16d53 Make this a forwarding header to the BoostBook-generated documentation
[SVN r17738]
2003-03-05 16:26:01 +00:00
Douglas Gregor de7c39ba30 HTML documentation for Boost 1.30.0 release. Generated from BoostBook sources
[SVN r17737]
2003-03-05 16:11:37 +00:00
Markus Schöpflin 03e81a0889 Copyright updated.
[SVN r17733]
2003-03-05 15:31:06 +00:00
Markus Schöpflin 43ffbe4eb5 Fixed the way the path for the Visual Age toolset can the
specified. Now it should be possible to specify more than one derived
toolset in the bjam command line and still get the correct result.


[SVN r17732]
2003-03-05 15:27:27 +00:00
Joel de Guzman 738eac36f5 removed #include group.hpp
[SVN r17727]
2003-03-05 07:24:55 +00:00
Joel de Guzman ab55dadaff removed grouping.ipp
[SVN r17726]
2003-03-05 07:16:26 +00:00
Joel de Guzman e9fa73ca80 updates
[SVN r17725]
2003-03-05 06:13:50 +00:00
Joel de Guzman c6d3ea169d tweaks
[SVN r17723]
2003-03-05 01:32:20 +00:00
Joel de Guzman a72f7d2c96 tweaks
[SVN r17722]
2003-03-05 01:23:15 +00:00
Joel de Guzman b85577be83 fixed debug print bug
[SVN r17721]
2003-03-05 01:06:26 +00:00
Joel de Guzman 7e8de045e4 removed grouping stuff + tweaks
[SVN r17719]
2003-03-04 23:13:51 +00:00
Joel de Guzman d33ba18cfa removed grouping stuff
[SVN r17717]
2003-03-04 15:30:20 +00:00
Joel de Guzman 764cc6c7ac Removed Grouping Stuff
[SVN r17715]
2003-03-04 15:25:35 +00:00
Dave Abrahams 7a533536ed Workaround for vc7 bug
[SVN r17709]
2003-03-03 17:24:07 +00:00
Jaakko Järvi d815852797 patch of patch
[SVN r17707]
2003-03-03 16:53:26 +00:00
nobody 8591b99aa1 This commit was manufactured by cvs2svn to create branch 'RC_1_30_0'.
[SVN r17693]
2003-03-01 19:43:06 +00:00
151 changed files with 3266 additions and 2421 deletions
+161 -173
View File
@@ -1,171 +1,111 @@
[submodule "format"]
path = libs/format
url = ../format.git
fetchRecurseSubmodules = on-demand
[submodule "ublas"]
path = libs/numeric/ublas
url = ../ublas.git
fetchRecurseSubmodules = on-demand
[submodule "smart_ptr"]
path = libs/smart_ptr
url = ../smart_ptr.git
fetchRecurseSubmodules = on-demand
[submodule "integer"]
path = libs/integer
url = ../integer.git
fetchRecurseSubmodules = on-demand
[submodule "compose"]
path = libs/compose
url = ../compose.git
fetchRecurseSubmodules = on-demand
[submodule "random"]
path = libs/random
url = ../random.git
fetchRecurseSubmodules = on-demand
[submodule "utility"]
path = libs/utility
url = ../utility.git
fetchRecurseSubmodules = on-demand
[submodule "rational"]
path = libs/rational
url = ../rational.git
fetchRecurseSubmodules = on-demand
[submodule "timer"]
path = libs/timer
url = ../timer.git
fetchRecurseSubmodules = on-demand
[submodule "functional"]
path = libs/functional
url = ../functional.git
fetchRecurseSubmodules = on-demand
[submodule "conversion"]
path = libs/conversion
url = ../conversion.git
fetchRecurseSubmodules = on-demand
[submodule "config"]
path = libs/config
url = ../config.git
fetchRecurseSubmodules = on-demand
[submodule "array"]
path = libs/array
url = ../array.git
fetchRecurseSubmodules = on-demand
[submodule "type_traits"]
path = libs/type_traits
url = ../type_traits.git
fetchRecurseSubmodules = on-demand
[submodule "iterator"]
path = libs/iterator
url = ../iterator.git
fetchRecurseSubmodules = on-demand
[submodule "regex"]
path = libs/regex
url = ../regex.git
fetchRecurseSubmodules = on-demand
[submodule "graph"]
path = libs/graph
url = ../graph.git
fetchRecurseSubmodules = on-demand
[submodule "static_assert"]
path = libs/static_assert
url = ../static_assert.git
fetchRecurseSubmodules = on-demand
[submodule "function"]
path = libs/function
url = ../function.git
fetchRecurseSubmodules = on-demand
[submodule "concept_check"]
path = libs/concept_check
url = ../concept_check.git
fetchRecurseSubmodules = on-demand
[submodule "detail"]
path = libs/detail
url = ../detail.git
fetchRecurseSubmodules = on-demand
[submodule "disjoint_sets"]
path = libs/disjoint_sets
url = ../disjoint_sets.git
fetchRecurseSubmodules = on-demand
[submodule "property_map"]
path = libs/property_map
url = ../property_map.git
fetchRecurseSubmodules = on-demand
[submodule "python"]
path = libs/python
url = ../python.git
fetchRecurseSubmodules = on-demand
[submodule "test"]
path = libs/test
url = ../test.git
fetchRecurseSubmodules = on-demand
[submodule "any"]
path = libs/any
url = ../any.git
fetchRecurseSubmodules = on-demand
[submodule "crc"]
path = libs/crc
url = ../crc.git
fetchRecurseSubmodules = on-demand
[submodule "pool"]
path = libs/pool
url = ../pool.git
fetchRecurseSubmodules = on-demand
[submodule "thread"]
path = libs/thread
url = ../thread.git
fetchRecurseSubmodules = on-demand
[submodule "tuple"]
path = libs/tuple
url = ../tuple.git
fetchRecurseSubmodules = on-demand
[submodule "tokenizer"]
path = libs/tokenizer
url = ../tokenizer.git
fetchRecurseSubmodules = on-demand
[submodule "math"]
path = libs/math
url = ../math.git
fetchRecurseSubmodules = on-demand
[submodule "build"]
path = tools/build
url = ../build.git
fetchRecurseSubmodules = on-demand
[submodule "compatibility"]
path = libs/compatibility
url = ../compatibility.git
[submodule "tokenizer"]
path = libs/tokenizer
url = ../tokenizer.git
fetchRecurseSubmodules = on-demand
[submodule "utility"]
path = libs/utility
url = ../utility.git
fetchRecurseSubmodules = on-demand
[submodule "integer"]
path = libs/integer
url = ../integer.git
fetchRecurseSubmodules = on-demand
[submodule "python"]
path = libs/python
url = ../python.git
fetchRecurseSubmodules = on-demand
[submodule "compose"]
path = libs/compose
url = ../compose.git
fetchRecurseSubmodules = on-demand
[submodule "function"]
path = libs/function
url = ../function.git
fetchRecurseSubmodules = on-demand
[submodule "math"]
path = libs/math
url = ../math.git
fetchRecurseSubmodules = on-demand
[submodule "crc"]
path = libs/crc
url = ../crc.git
fetchRecurseSubmodules = on-demand
[submodule "rational"]
path = libs/rational
url = ../rational.git
fetchRecurseSubmodules = on-demand
[submodule "regex"]
path = libs/regex
url = ../regex.git
fetchRecurseSubmodules = on-demand
[submodule "iterator"]
path = libs/iterator
url = ../iterator.git
fetchRecurseSubmodules = on-demand
[submodule "array"]
path = libs/array
url = ../array.git
fetchRecurseSubmodules = on-demand
[submodule "random"]
path = libs/random
url = ../random.git
fetchRecurseSubmodules = on-demand
[submodule "dynamic_bitset"]
path = libs/dynamic_bitset
url = ../dynamic_bitset.git
fetchRecurseSubmodules = on-demand
[submodule "format"]
path = libs/format
url = ../format.git
fetchRecurseSubmodules = on-demand
[submodule "pool"]
path = libs/pool
url = ../pool.git
fetchRecurseSubmodules = on-demand
[submodule "bind"]
path = libs/bind
url = ../bind.git
fetchRecurseSubmodules = on-demand
[submodule "date_time"]
path = libs/date_time
url = ../date_time.git
[submodule "any"]
path = libs/any
url = ../any.git
fetchRecurseSubmodules = on-demand
[submodule "thread"]
path = libs/thread
url = ../thread.git
fetchRecurseSubmodules = on-demand
[submodule "timer"]
path = libs/timer
url = ../timer.git
fetchRecurseSubmodules = on-demand
[submodule "disjoint_sets"]
path = libs/disjoint_sets
url = ../disjoint_sets.git
fetchRecurseSubmodules = on-demand
[submodule "test"]
path = libs/test
url = ../test.git
fetchRecurseSubmodules = on-demand
[submodule "graph"]
path = libs/graph
url = ../graph.git
fetchRecurseSubmodules = on-demand
[submodule "detail"]
path = libs/detail
url = ../detail.git
fetchRecurseSubmodules = on-demand
[submodule "multi_array"]
path = libs/multi_array
url = ../multi_array.git
fetchRecurseSubmodules = on-demand
[submodule "signals"]
path = libs/signals
url = ../signals.git
fetchRecurseSubmodules = on-demand
[submodule "preprocessor"]
path = libs/preprocessor
url = ../preprocessor.git
fetchRecurseSubmodules = on-demand
[submodule "lambda"]
path = libs/lambda
url = ../lambda.git
fetchRecurseSubmodules = on-demand
[submodule "io"]
path = libs/io
url = ../io.git
fetchRecurseSubmodules = on-demand
[submodule "dynamic_bitset"]
path = libs/dynamic_bitset
url = ../dynamic_bitset.git
fetchRecurseSubmodules = on-demand
[submodule "mpl"]
path = libs/mpl
url = ../mpl.git
@@ -174,39 +114,87 @@
path = libs/exception
url = ../exception.git
fetchRecurseSubmodules = on-demand
[submodule "statechart"]
path = libs/statechart
url = ../statechart.git
fetchRecurseSubmodules = on-demand
[submodule "variant"]
path = libs/variant
url = ../variant.git
fetchRecurseSubmodules = on-demand
[submodule "interval"]
path = libs/numeric/interval
url = ../interval.git
[submodule "spirit"]
path = libs/spirit
url = ../spirit.git
fetchRecurseSubmodules = on-demand
[submodule "optional"]
path = libs/optional
url = ../optional.git
fetchRecurseSubmodules = on-demand
[submodule "bcp"]
path = tools/bcp
url = ../bcp.git
[submodule "property_map"]
path = libs/property_map
url = ../property_map.git
fetchRecurseSubmodules = on-demand
[submodule "spirit"]
path = libs/spirit
url = ../spirit.git
[submodule "interval"]
path = libs/numeric/interval
url = ../interval.git
fetchRecurseSubmodules = on-demand
[submodule "inspect"]
path = tools/inspect
url = ../inspect.git
[submodule "ublas"]
path = libs/numeric/ublas
url = ../ublas.git
fetchRecurseSubmodules = on-demand
[submodule "boostbook"]
path = tools/boostbook
url = ../boostbook.git
[submodule "config"]
path = libs/config
url = ../config.git
fetchRecurseSubmodules = on-demand
[submodule "type_traits"]
path = libs/type_traits
url = ../type_traits.git
fetchRecurseSubmodules = on-demand
[submodule "lambda"]
path = libs/lambda
url = ../lambda.git
fetchRecurseSubmodules = on-demand
[submodule "conversion"]
path = libs/conversion
url = ../conversion.git
fetchRecurseSubmodules = on-demand
[submodule "concept_check"]
path = libs/concept_check
url = ../concept_check.git
fetchRecurseSubmodules = on-demand
[submodule "io"]
path = libs/io
url = ../io.git
fetchRecurseSubmodules = on-demand
[submodule "signals"]
path = libs/signals
url = ../signals.git
fetchRecurseSubmodules = on-demand
[submodule "functional"]
path = libs/functional
url = ../functional.git
fetchRecurseSubmodules = on-demand
[submodule "static_assert"]
path = libs/static_assert
url = ../static_assert.git
fetchRecurseSubmodules = on-demand
[submodule "filesystem"]
path = libs/filesystem
url = ../filesystem.git
fetchRecurseSubmodules = on-demand
[submodule "tuple"]
path = libs/tuple
url = ../tuple.git
fetchRecurseSubmodules = on-demand
[submodule "date_time"]
path = libs/date_time
url = ../date_time.git
fetchRecurseSubmodules = on-demand
[submodule "compatibility"]
path = libs/compatibility
url = ../compatibility.git
fetchRecurseSubmodules = on-demand
[submodule "inspect"]
path = tools/inspect
url = ../inspect.git
fetchRecurseSubmodules = on-demand
[submodule "preprocessor"]
path = libs/preprocessor
url = ../preprocessor.git
fetchRecurseSubmodules = on-demand
[submodule "log"]
path = libs/log
url = ../log.git
fetchRecurseSubmodules = on-demand
-1
View File
@@ -11,7 +11,6 @@
project boost
: requirements <include>.
: usage-requirements <include>.
;
build-project libs/test/build ;
+1 -1
View File
@@ -11,4 +11,4 @@
path-global BOOST_ROOT : $($(gTOP)) ;
# The current version of Boost.
BOOST_VERSION ?= 1.31.0 ;
BOOST_VERSION ?= 1.30.2 ;
+5 -5
View File
@@ -1,16 +1,16 @@
BOOST_ROOT = $(.boost-build-file:D) ;
if --v2 in $(ARGV)
{
if $(JAM_VERSION:J="") < 030105
if $(JAM_VERSION:J="") < 030103
{
ECHO "error: Boost.Jam 3.1.5 or later required" ;
EXIT ;
ECHO "error: Boost.Jam 3.1.3 or later required" ;
EXIT ;
}
else
{
JAMFILE = [Jj]amfile.v2 ;
boost-build tools/build/kernel ;
}
boost-build tools/build/new ;
}
}
else
{
-859
View File
@@ -1,859 +0,0 @@
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<meta name="Template"
content="C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\html.dot">
<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
<title></title>
</head>
<body bgcolor="#FFFFFF" link="#0000FF" vlink="#800080">
<h2 align="center">A Proposal for the Boost Directory Structure</h2>
<p align="center">By John Maddock.</p>
<p>The following proposal consists of three sections: A list of
requirements and objectives that the chosen structure must meet,
a set of tools to facilitate working with boost, and an actual
proposal for a structure that meets those requirements. In the
past I have argued vociferously for a &quot;do as little as
possible&quot; approach, however I have somewhat surprised myself
by coming out in favour of a radical reorganisation here. In many
ways though, the proposed directory structure is less important
than its ability to meet the requirements listed below, nor is it
the only structure that could arguably meet these requirements (especially
as some requirements are contradictory). Finally a couple of
caveats: All opinions expressed herein are my own; all ideas
expressed herein belong to over people (especially the good ones!).
Where possible credits are given, but my memory is far from
infallible so speak up if you've been missed out.</p>
<h2 align="center">Requirements</h2>
<h3>Consistency</h3>
<blockquote>
<p><b>Comment</b>: this should speak for itself.</p>
</blockquote>
<h3>Discoverability</h3>
<p>That is a casual user browsing the directory structure should
be able to immediately tell what belongs where.</p>
<blockquote>
<p><b>Rationale</b>: some users read the documentation,
others wander around aimlessly saying: &quot;I wonder what's
in here?&quot;, speak up if you recognise anyone!</p>
<p><b>Rationale</b>: automated tools should be able to glean
most of the information they need direct from the directory
structure.</p>
<p><b>Comment</b>: This is probably the most important
requirement and guides the choice of many others.</p>
</blockquote>
<h3>Boost is a single library</h3>
<blockquote>
<p>From an end users perspective boost should appear to be a
single library, with a single integrated build process etc.</p>
<p><b>Rationale</b>: This makes life much more comfortable
for end uses.</p>
</blockquote>
<h3>Boost is a collection of separate libraries</h3>
<blockquote>
<p><b>Rationale</b>: some libraries have an existence of
their own outside of boost, this should be able to continue.</p>
<p><b>Rationale</b>: different developers maintain individual
boost libraries.</p>
<p><b>Rationale</b>: as boost grows it may be necessary to
split the library into multiple zip file downloads, each
download should encapsulate one domain, and provide all the
files necessary for that domain (that may mean that some
files appear in more than one zip file).</p>
<p><b>Rationale</b>: some users will want to split off (and
maybe freeze) those parts of boost that are being used by a
particular project. These sub-libraries can then be checked
into the users own version control system (for example into a
local cvs repository as a vendor branch), and maintained
alongside the users own source for that project.</p>
<p><b>Implication:</b> that there exists some mechanism for
locating and separating off all the files associated with a
particular boost library, this should also take into account
dependencies (both for headers and for binary dependencies).</p>
</blockquote>
<h3>Individual boost libraries can be checked out from the cvs
repository</h3>
<blockquote>
<p>For example &quot;<code>cvs checkout regex</code>&quot;
would check out the regex library alone.</p>
<p><b>Rationale</b>: This makes maintenance much easier
especially when working with cvs-branches.</p>
<p><b>Implication</b>: we could isolate libraries into
separate directories, however that's only a partial solution
which takes no account of library dependencies (something
that's likely to become increasingly important). A better
solution is to use cvs module-aliases: as a test case I've
defined the regex library as a module-alias (this seems to
work very well). In this case I had to specify dependencies
by hand (an error prone process), much better would be a tool
that produced a list of library aliases to insert directly
into the cvs modules file.</p>
</blockquote>
<h3>Boost libraries can have dependencies to other libraries</h3>
<blockquote>
<p>There are three kinds of dependency possible:</p>
<ol>
<li>Libraries may depend upon the headers from other
boost libraries; these dependencies can be worked out
automatically.</li>
<li>Libraries may depend upon binaries from other boost
libraries; these dependencies can be worked out
automatically (hint: if library X depends upon header
H, and header H is from a library Y which has
mandatory source code associated with it, then there
is a binary dependency from X to Y).</li>
<li>Some domain specific libraries may depend upon third
party libraries (the python library for example).
These dependencies can not be deduced, and will
require meta-data to describe.</li>
</ol>
<p><b>Rationale: </b>these dependencies already exist in the
boost library.</p>
</blockquote>
<h3>Usable &quot;as is&quot;</h3>
<blockquote>
<p>That is the library should be usable directly from the
checked out cvs tree, or the extracted zip file, without a
mandatory install process.</p>
<p><b>Rationale:</b> For single user installations it is
sufficient and often easier to work directly from the zip/cvs
structure.</p>
<p><b>Rationale: </b>For &quot;occasional developers&quot;
this simplifies their ability to port/debug parts of the
library, and then submit patches based on changes made,
without having to get involved with &quot;wrapper compilers&quot;
and other tools that have been suggested, which may or may
not function on their platform with their toolset.</p>
<p><b>Implication:</b> that all header files are located
together, and not split between multiple library paths.</p>
<p><b>Comments:</b> during the recent discussion it was
suggested splitting the header files into separate
directories under &quot;boost-root/src/libname/boost&quot;,
however this involves specifying a large number of -I options
on the command line in order to be able to use boost direct
from the cvs tree. One suggested workaround was to use a
wrapper-compiler to pass the long list of includes to the
compiler semi-automatically. However some compilers are
integrated with their respective IDE's (this would make boost
almost impossible to use from that IDE), other platforms/compilers
have a restricted command line length (mingw32 is a
particular culprit), the command line in such cases could
easily become longer than the maximum permitted.</p>
</blockquote>
<h3>Header include mechanism reflects library name</h3>
<blockquote>
<p>We currently use:</p>
<p><code>#include &lt;boost/something.hpp&gt;</code></p>
<p>which immediately informs a casual browser of the code
that something.hpp is a part of the boost library and
separates it from:</p>
<p><code>#include &lt;rw/thread.h&gt; // this is Rogue Wave
library</code></p>
<p><b>Rationale</b>: This has worked well up to now and
should be continued.</p>
<p><b>Implication</b>: The boost-root/boost/ directory must
continue to exist (although there are possible arguments in
favour of making it boost-root/include/boost).</p>
</blockquote>
<h3>Libraries can have &quot;non-end user&quot; header files.</h3>
<blockquote>
<p>There are several kinds of header that come into this
category:</p>
<blockquote>
<p><b>Power user headers</b>: headers that should only be
used by experts.</p>
<p><b>Headers for library reuse</b>: these headers can be
used by other boost libraries, but should not be used by
end users.</p>
<p><b>Domain specific headers</b>: large domain specific
libraries may have a large number of headers that should
not make it into the main boost-root/boost/ header
directory (graph for example).</p>
<p><b>Implementation headers</b>: libraries may have
headers that contain implementation code, these headers
should never be included by anything except other headers
<i>in this library</i>.</p>
</blockquote>
<p><b>Implication: </b>the main header directory may contain
sub-directories as follows:</p>
<blockquote>
<p>boost-root/boost/library-name/ for all non-end user
headers, including domain specific headers.</p>
<p>boost-root/boost/library-name/detail/ for all
implementation detail headers.</p>
</blockquote>
</blockquote>
<h3>Libraries can be combined into domains</h3>
<blockquote>
<p>For example we may want to combine multiple math-related
libraries into a single &quot;numeric&quot; domain. In this
case each library in the domain would have it's own directory
under the domain name directory - for example headers for the
rational library may end up in boost-root/boost/numeric/rational/.</p>
<p><b>Rationale</b>: the aim here is to prevent the number of
top level libraries growing to an unmanageable number, and to
allow a logical group of libraries to be accessed with a
single name (for cvs checkouts or for building part of boost).</p>
</blockquote>
<h3>Root directory name reflects boost version</h3>
<blockquote>
<p>That is the name of the root directory in the zip file
reflects the boost version number &quot;boost_1_1_9/&quot;
etc, subsequent directories - like the boost header file
directory - then split off from this.</p>
<p><b>Rationale: </b>Allows developers to have multiple
versions coexisting on their machine within a single
directory structure, developers can switch between versions
with a by changing their compilers include and library search
paths only.</p>
</blockquote>
<h3>Consistent handling of development code</h3>
<blockquote>
<p>If there exists development or non-reviewed code in the
cvs tree then it should not interfere with release code or
exist in the same directory tree as the release code. Nor
should development code appear in zip files.</p>
<p><b>Rationale</b>: developers will typically work with
either the latest release code, or the latest development
code, they should be able to switch between them fairly
easily.</p>
<p><b>Rationale</b>: end users don't generally need to see
development code, it unnecessarily duplicates what's already
in the library and may lead to confusion as to what's release
code and what's still in development.</p>
<p><b>Implication</b>: There are a couple of ways of dealing
with this.</p>
<blockquote>
<p><b>Method 1</b>: provide a subdirectory &quot;<code>boost-root/development/library-name/</code>&quot;
that internally mirrors the directory structure of <code>boost-root/</code>,
to contain development code for library &quot;library-name&quot;.
This has the advantage of being easy to work with, but
requires setting multiple include and library search
paths, it also complicates multiple development versions
of the same library (for example multiple ports to new
platforms may proceed in parallel).</p>
<p><b>Method 2</b>: provide a separate top-level CVS
directory for development code, development code could
then be checked out with &quot;<code>cvs checkout
development&quot;</code> instead of &quot;<code>cvs
checkout boost&quot;</code>, otherwise this method is the
same as Method 1 above, and has the same pros and cons.</p>
<p><b>Method 3</b>: use a cvs branch for development work.
This allows multiple development efforts to proceed in
parallel, but may be harder to work with and keep in
synch with the main branch.</p>
</blockquote>
<p>Ideally<b> </b>I see no reason why either method 1 or 2
can't coexist with method 3, depending which method is easier
for the task in hand. Personally I prefer (2) to (1), but
that's just personal preference.</p>
</blockquote>
<h3>Mandatory Source code is centrally located</h3>
<blockquote>
<p>That is that there is some central directory (let's call
it boost-root/src/) that contains all mandatory source files
for a particular library in its sub-directories: boost-root/src/library1/,
boost-root/src/library2/ etc.</p>
<p><b>Rationale: </b>This ensures that the source is easily
discoverable by the user; for example if a user suspects that
there may be a bug in library X, and decides to try and debug
the problem, they may want to add all the source code for
library X directly to their project to facilitate debugging.
(I appreciate that the build process <i>may</i> provide
debugging versions of the library, but it is still often
easier to add the source direct to the IDE's project,
depending upon how well the IDE handles debugging of external
libraries).</p>
<p><b>Rationale: </b>some IDE's have search paths for source
files as well as headers etc, this structure shortens the
paths to mandatory source files (this is more of a feature
request than a requirement).</p>
</blockquote>
<h3>Directories containing documentation contain an index.html
file, and nothing but documentation</h3>
<blockquote>
<p><b>Rationale</b>: Some file browsers (KFM for example)
will automatically display documentation when they see either
index.htm or index.html in the current directory. Any other
files located in that directory effectively become &quot;hidden&quot;
from the user. Whether this is an annoyance or a great
feature depends upon your point of view. Separating
documentation into it's own sub-directory solves this problem
(it happens to make installation of the documentation easier
as well).</p>
<p><b>Footnote</b>: actually KFM is usually quite intelligent
about displaying documentation, however it does sometimes get
it wrong.</p>
</blockquote>
<h3>Boost supports an integrated build process</h3>
<blockquote>
<p><b>Rationale</b>: Currently most boost libraries are
&quot;headers only&quot;, those that are not have their own
build processes or none at all. This is confusing for the end
user, especially as boost is likely to get much larger.</p>
</blockquote>
<h3>Boost supports building of separate sub-libraries</h3>
<blockquote>
<p><b>Rationale</b>: Building boost as a single monolithic
library is likely to put end users off - especially as boost
grows in size - few users will use all of boost in a single
project (even if they use all of it at some time or another).</p>
<p><b>Implication</b>: Build each boost library separately
using a consistent naming scheme incorporating the library
name and the compiler name: libboost_timer_gcc.so, libboost_regex_gcc.so,
lib_boost_thread_gcc.so etc. Provide a monolithic version of
the library as an option for those that want a simple life (this
is mainly more appropriate for static libraries where unused
library code doesn't make it into the executable).</p>
</blockquote>
<h3>Boost supports multiple compiler build options.</h3>
<blockquote>
<p><b>Rationale</b>: some compilers ship with multiple run-time
libraries. For example the Borland C++ compiler comes with 6
different runtimes, any third party libraries must be built
with the same runtime options as the executable to which it
will be linked, failure to observe this rule leads to hard to
track down runtime crashes.</p>
<p><b>Implication</b>: boost libraries must each be built
multiple times with the same runtime variants that the
compiler ships with. As before name mangling separates the
variants: </p>
</blockquote>
<pre> boost_regex_bc55_cw.lib
boost_regex_bc55_cwi.lib
boost_regex_bc55_cwi.dll
boost_regex_bc55_cwm.lib
boost_regex_bc55_cwmi.lib
boost_regex_bc55_cwmi.dll
boost_regex_bc55_cp.lib
boost_regex_bc55_cpi.lib
boost_regex_bc55_cpi.dll</pre>
<blockquote>
<p>(for non-Borland users the suffixes chosen here reflect
the names of Borland's own runtime libraries).</p>
</blockquote>
<h3>Boost's build system uses the minimal amount of meta-data
required.</h3>
<blockquote>
<p><b>Rationale</b>: some meta-data is likely to be required,
but to reduce maintenance requirements this should be as
small as possible. Generally speaking the smaller the meta-data
requirement the more likely it is that the build system is in
synch with the library. The worst case would be hand-crafted
makefiles (hard to maintain), the best case no meta-data at
all; for example the directory structure describes the
library well enough that makefiles (or their equivalent) can
be automatically generated.</p>
</blockquote>
<h3>Boost supports installation to a central location</h3>
<blockquote>
<p><b>Rationale</b>: most unix variants more or less require
an install step before using third party libraries, this also
allows network installs (for multiple compilers and/or
platforms if required), from a single source tree.</p>
</blockquote>
<blockquote>
<p><b>Implication</b>: Keep the boost directory structure as
close as possible to the install structure to simplify the
installation process (strictly speaking this is not an
absolute requirement, but cross-platform installation is hard
enough with making it any harder than it needs to be). The
easiest way is to keep the documentation/header/build trees
separate.</p>
</blockquote>
<h3>The boost directory structure should be &quot;optimally
branched&quot;</h3>
<blockquote>
<p>This is a nebulous requirement that is based as much on
personal preference as anything else.</p>
<p><b>Rationale</b>: the directory structure is more &quot;discoverable&quot;
if it branches consistently - that is with no directories
with a massive number of entries.</p>
<p><b>Implication</b>: where appropriate combine related
libraries into domains.</p>
<p><b>Implication</b>: avoid directories with a single sub-directory
entry (redundancy).</p>
</blockquote>
<h2 align="center">Proposed tools to aid boost management (build
system)</h2>
<p>While writing the requirements above one theme kept
reoccurring; that of interdependency of boost libraries, and the
need for an automated tool to deal with this problem. In fact
from a code-reuse point of view, we need a library that describes
the boost library and determines library dependencies that can
then be reused in multiple tools. In my view the gains in ease of
management, and automatic generation of makefiles etc, means that
these tools should be developed regardless of the actual
directory structure chosen (although the code will probably be
dependent upon the directory structure chosen).</p>
<h3>Dependency library</h3>
<blockquote>
<p>This library would define two types:</p>
<p><b>Library</b>: defines the files that belong to a
particular library, plus header file dependencies and a list
of binary dependencies to other boost libraries.</p>
<p><b>Libraries</b>: a collection of Library objects, also
maintains a database of which header belongs to which library
(used to calculate binary dependencies).</p>
<p>As far as is possible, these types should be able to load
themselves directly from the boost directory structure, with
only a minimal amount of meta-data used to describe the
unusual cases.</p>
</blockquote>
<h3>Paths library</h3>
<p>In order for the dependency library to do it's job it is
necessary to iterate over a directory structure, join and split
path names, and convert path names to/from a platform specific
format. For example to insert relative-paths into makefiles which
may be used on platforms other than the one on which the makefile
is generated. Some, but by no means all, of this functionality is
already covered by Dietmar Kühl's dir_it library.</p>
<h3>Automatic alias generation</h3>
<p>This is a short program that just iterates through a Libraries
collection and prints out the dependencies, so that the result
can be cut and pasted into the cvs modules file.</p>
<h3>Boost distiller</h3>
<p>This is almost the same program as the alias generator, but
copies files to a new location instead of printing them out. Used
to &quot;distil&quot; out a subset of the boost library (including
dependencies). This can be used to: split boost into multiple (domain
specific) zip files for easier download, or split out that subset
of boost that is being used by a particular project (for
integration with the project without getting the whole of boost).</p>
<h3>Build system</h3>
<p>By combining the description of the boost library contained in
a Libraries object with a description of the compiler/platform in
use, it is possible to do one of two things: directly build the
library, or output compiler/platform specific makefiles for
distribution with boost. For brevity I'm going to skip over a
description of this here - my pencil and paper sketch has a list
of around 14 points of variation between compilers, and another
list of 7 options for each compiler configuration (release, debug,
static, dynamic etc). Probably even this fairly long list is not
complete.</p>
<p>I'm assuming that the build system will probably output
makefiles in the first instance; apart from anything else, most
compilers come with some kind of make, using this avoids the need
for the end user to have to build/install any tools that do not
ship with their compiler. Here I'm assuming that the boost
library maintainers periodically generate the makefiles, and then
ship them with the library.</p>
<h2 align="center">The directory structure</h2>
<table border="0" cellpadding="7" cellspacing="1" width="100%">
<tr>
<td valign="top" width="6%">&nbsp;</td>
<td valign="top" width="44%" bgcolor="#008080">Directory</td>
<td valign="top" width="43%" bgcolor="#008080">Description</td>
<td valign="top" width="7%">&nbsp;</td>
</tr>
<tr>
<td valign="top" width="6%">&nbsp;</td>
<td valign="top" width="44%" bgcolor="#C0C0C0">Boost-root/boost/</td>
<td valign="top" width="43%" bgcolor="#C0C0C0">All entry
point boost headers, mainly these should be called &quot;library-name.hpp&quot;</td>
<td valign="top" width="7%">&nbsp;</td>
</tr>
<tr>
<td valign="top" width="6%">&nbsp;</td>
<td valign="top" width="44%" bgcolor="#C0C0C0">Boost-root/boost/library-name/</td>
<td valign="top" width="43%" bgcolor="#C0C0C0">All domain
specific headers, all &quot;expert-user&quot; non-entry
point headers.</td>
<td valign="top" width="7%">&nbsp;</td>
</tr>
<tr>
<td valign="top" width="6%">&nbsp;</td>
<td valign="top" width="44%" bgcolor="#C0C0C0">Boost-root/boost/library-name/detail/</td>
<td valign="top" width="43%" bgcolor="#C0C0C0">All
implementation private headers.</td>
<td valign="top" width="7%">&nbsp;</td>
</tr>
<tr>
<td valign="top" width="6%">&nbsp;</td>
<td valign="top" width="44%" bgcolor="#C0C0C0">Boost-root/src/library-name/</td>
<td valign="top" width="43%" bgcolor="#C0C0C0">All
mandatory source files.</td>
<td valign="top" width="7%">&nbsp;</td>
</tr>
<tr>
<td valign="top" width="6%">&nbsp;</td>
<td valign="top" width="44%" bgcolor="#C0C0C0">Boost-root/src/library-name/config/</td>
<td valign="top" width="43%" bgcolor="#C0C0C0">Any
private configuration code (for example autoconf scripts),
if these grow then we could move to an integrated
configure system in Boost-root/config/ but that isn't
currently necessary.</td>
<td valign="top" width="7%">&nbsp;</td>
</tr>
<tr>
<td valign="top" width="6%">&nbsp;</td>
<td valign="top" width="44%" bgcolor="#C0C0C0">Boost-root/src/library-name/build/</td>
<td valign="top" width="43%" bgcolor="#C0C0C0">Temporary
location for private build systems, until the boost-wide
integrated build comes on line.</td>
<td valign="top" width="7%">&nbsp;</td>
</tr>
<tr>
<td valign="top" width="6%">&nbsp;</td>
<td valign="top" width="44%" bgcolor="#C0C0C0">Boost-root/docs/</td>
<td valign="top" width="43%" bgcolor="#C0C0C0">All common
documentation.</td>
<td valign="top" width="7%">&nbsp;</td>
</tr>
<tr>
<td valign="top" width="6%">&nbsp;</td>
<td valign="top" width="44%" bgcolor="#C0C0C0">Boost-root/docs/library-name/</td>
<td valign="top" width="43%" bgcolor="#C0C0C0">All
documentation for &quot;library-name&quot;; must include
an index.htm file.</td>
<td valign="top" width="7%">&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td valign="top" bgcolor="#C0C0C0">Boost-root/licence</td>
<td bgcolor="#C0C0C0">A &quot;generic&quot; boost licence
that describes the minimal guarantees made by all boost
libraries (free for commercial use etc), with sub-directories
for those boost libraries that have their own licences (currently
just regex and graph, but this number is likely to grow).</td>
<td>&nbsp;</td>
</tr>
<tr>
<td valign="top" width="6%">&nbsp;</td>
<td valign="top" width="44%" bgcolor="#C0C0C0">Boost-root/tests/library-name/</td>
<td valign="top" width="43%" bgcolor="#C0C0C0">All test
programs for &quot;library-name&quot;. These may be
either: a single (multi-file) test program, multiple
single file test programs, or multiple sub-directories (one
for each test program).</td>
<td valign="top" width="7%">&nbsp;</td>
</tr>
<tr>
<td valign="top" width="6%">&nbsp;</td>
<td valign="top" width="44%" bgcolor="#C0C0C0">Boost-root/examples/library-name/</td>
<td valign="top" width="43%" bgcolor="#C0C0C0">All
example programs for &quot;library-name&quot;. These may
be either: a single (multi-file) example program,
multiple single file example programs, or multiple sub-directories
(one for each example program).</td>
<td valign="top" width="7%">&nbsp;</td>
</tr>
<tr>
<td valign="top" width="6%">&nbsp;</td>
<td valign="top" width="44%" bgcolor="#C0C0C0">Boost-root/tools/tool-name/</td>
<td valign="top" width="43%" bgcolor="#C0C0C0">Contains
all files required to build and use the specified tool (makefile
generators etc).</td>
<td valign="top" width="7%">&nbsp;</td>
</tr>
<tr>
<td valign="top" width="6%">&nbsp;</td>
<td valign="top" width="44%" bgcolor="#C0C0C0">Boost-root/build/</td>
<td valign="top" width="43%" bgcolor="#C0C0C0">The boost
build system. Consists of a collection of makefiles (one
for each supported compiler), plus subdirectories: libs/
for built libraries, bin/ for built dll's (win32 only)
and obj/ for object files.</td>
<td valign="top" width="7%">&nbsp;</td>
</tr>
</table>
<p>&nbsp;</p>
<p>There are a couple of myths surrounding this structure that
need exploding:</p>
<h4>It is hard to check in new libraries to the cvs repository</h4>
<p>Not true: if the submission arrives as a zip file containing
the directory structure described above, then the command:</p>
<p><code>cvs import boost library-name library-name-sub</code></p>
<p>will import the whole of the <i>current</i> directory tree and
&quot;intermingle&quot; it with the existing boost tree in the
repository.</p>
<p>There is one caveat to this however: if the imported source
contains some files that were already in the boost directory tree
(probably not a common situation), then an additional merge and
resolve conflicts step arises:</p>
<p>On the main branch working copy:</p>
<p><code>cvs checkout -jlibrary-name-sub boost</code></p>
<p>Resolve any conflicts, and then:</p>
<p><code>cvs commit</code></p>
<p>The latter two steps should not be necessary in most cases,
and occur whatever directory structure is used (it is probably
easier in most cases to resolve such conflicts manually before
importing the new sources).</p>
<h4>It is hard to checkout or to commit individual boost
libraries.</h4>
<p>By using cvs aliases (defined in the modules file) this
situation does not arise, just specify the module/alias name when
performing a checkout/commit.</p>
<h2 align="center">Migrating to the new structure</h2>
<p>This is probably the hardest and most painful part of the
whole process. I'm going to suggest a migration method as follows:</p>
<ol>
<li>Instigate a moratorium on cvs commits.</li>
<li>Copy the files to the new structure and commit the
changes, leaving the boost-root/libs/ directory in place
for now.</li>
<li>Fix html links, and documentation descriptions of file
locations.</li>
<li>Fix any library specific scripts/makefiles.</li>
<li>Publish the new structure (as a zip-file beta
distribution) and ask boost users/authors to check that
everything looks OK.</li>
<li>Delete the boost-root/libs/ directory (actually this is
quite hard, as cvs has no method for removing whole
directory trees).</li>
<li>Lift the moratorium on changes.</li>
<li>Publish the next boost revision with the new structure.</li>
</ol>
<p>The whole process described above is quite likely to take 1-2
weeks, during which no changes can be committed; this is going to
require a fair amount of co-ordination between developers (actually
this applies to any major change to the directory structure,
irrespective of what the change is).</p>
<p>You will note that I haven't mentioned a time scale for the
associated tools that I have suggested, probably these will need
to be developed after the directory structure changes - although
I believe it is possible to develop a minimal subset (the library
description and alias generator) before making the changes if
that is required.</p>
<p>&nbsp;</p>
<p>There were a couple of other directory structures that were
evaluated while preparing this document:</p>
<p><i>The &quot;half way house structure&quot;:</i></p>
<p>This is the same as the current structure, but moves mandatory
source files to boost-root/src/libname. This is easier to migrate
to from the current structure, but was felt to be neither one
thing nor the other.</p>
<p><i>The &quot;skinny root structure&quot;:</i></p>
<p>This was proposed by John David, and Lois Goldthwaite, and
moves the contents of the current boost-root/libs/ directory into
boost-root/boost/. My main objection to this proposal is that it
is less &quot;discoverable&quot; than the one presented here - my
immediate reaction was &quot;where has everything gone&quot; - I
also dislike mixing headers and non-headers in the same tree.
However I'm prepared to accept that this could just be due to
personal bias.</p>
<h2 align="center">Acknowledgements</h2>
<p>The following people have had their ideas reused,
reconstituted and reformulated :-)</p>
<p>Beman Dawes, Ed Brey, Walter E. Brown, John (EBo) David, Jeff
Garland, Lois Goldthwaite, Jens Maurer, Jeff Squyres, Gary Powell
and Daryle Walker.</p>
<p>
<hr>
<p>
<h2 align="center">An Alternative Directory Structure</h2>
<p align="center">By Jens Maurer</p>
I favor the following structure, which puts different emphasis on the
some of the requirements.
<p>
<table border="1">
<tr>
<th>Directory</th>
<th>Description</th>
</tr>
<tr>
<td>Boost-root/include/boost/</td>
<td>All entry-point boost headers, mainly these should be called
"library-name.hpp".</td>
</tr>
<tr>
<td>Boost-root/include/boost/.../</td>
<td>Domain-specific subdirectory; the "..." can be empty or
arbitrarily nested while observing the "optimally branched"
requirement.</td>
</tr>
<tr>
<td>Boost-root/include/boost/.../library-name/</td>
<td>All domain-specific headers, all "expert-user" non-entry point
headers.</td>
</tr>
<tr>
<td>Boost-root/include/boost/.../library-name/detail/</td>
<td>All implementation private headers.</td>
</tr>
<tr>
<td>Boost-root/libs/.../</td>
<td>Main directory for a given subdomain; the "..." can be empty or
arbitrarily nested while observing the "optimally branched"
requirement. The "..." must correspond to some "..." in the header
tree. The directory should contain a "index.html" which links to all
libraries and subdomains contained.</td>
</tr>
<tr>
<td>Boost-root/libs/.../library-name/</td>
<td>Main directory for a given library.</td>
</tr>
<tr>
<td>Boost-root/libs/.../library-name/src/</td>
<td>All mandatory source files for the library.</td>
</tr>
<tr>
<td>Boost-root/libs/.../library-name/build/</td>
<td>Temporary location for private build system, until the boost-wide
integrated build becomes available.</td>
</tr>
<tr>
<td>Boost-root/libs/.../library-name/config/</td>
<td>Any private configuration code (for example, autoconf
scripts).</td>
</tr>
<tr>
<td>Boost-root/libs/.../library-name/doc/</td>
<td>All documentation for the library.</td>
</tr>
<tr>
<td>Boost-root/libs/.../library-name/test/</td>
<td>All regression tests for the library, suitable for the regression
test suite. Due to test execution time constraints, not all of the tests
may actually be added to "regression.cfg".</td>
</tr>
<tr>
<td>Boost-root/libs/.../library-name/example/</td>
<td>All example programs for "library-name". These may be either: a
single (multi-file) example program, multiple single file example
programs, or multiple sub-directories (one for each example
program).</td>
</tr>
<tr>
<td>Boost-root/tools/tool-name/</td>
<td>Contains all files required to build and use the specified tool
(makefile generators etc).</td>
</tr>
<tr>
<td>Boost-root/build</td>
<td>The boost build system (user front-end; tools go in the "tools"
hierarchy). Details still hazy.</td>
</tr>
<tr>
<td>Boost-root/more/license.html</td>
<td>A "generic" boost license that describes the minimal guarantee
provided by all boost libraries. This should get a prominent link on
the main boost page.</td>
</tr>
</table>
<p>
Note that the "include" path component contains only one subdirectory
"boost" and thus violates the "optimally branched" requirement. It
helps with discoverability, though, because people know what to expect
under any directory named "include", i.e. header files.
</body>
</html>
-4
View File
@@ -1,4 +0,0 @@
project boost/doc ;
import boostbook : boostbook ;
boostbook doc : src/boost.xml ;
+40
View File
@@ -0,0 +1,40 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Boost.Any</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="index.html" title="The Boost C++ Libraries"><link rel="previous" href="index.html" title="The Boost C++ Libraries"><link rel="next" href="ch01s02.html" title="Examples"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"><link rel="section" href="any.html#id2878869" title="Introduction"><link rel="section" href="ch01s02.html" title="Examples"><link rel="section" href="any.reference.html" title="Reference"><link rel="section" href="ch01s04.html" title="Acknowledgements"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="any"></a>Boost.Any</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Kevlin</span> <span class="surname">Henney</span></h3></div></div><div><p class="copyright">Copyright © 2001 Kevlin Henney</p></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="any.html#id2878869">Introduction</a></dt><dt><a href="ch01s02.html">Examples</a></dt><dt><a href="any.reference.html">Reference</a></dt><dd><dl><dt><a href="any.reference.html#any.ValueType">ValueType requirements</a></dt><dt><a href="any.reference.html#header.boost.any.hpp">Header &lt;boost/any.hpp&gt;</a></dt></dl></dd><dt><a href="ch01s04.html">Acknowledgements</a></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2878869"></a>Introduction</h2></div></div><div></div></div><p>There are times when a generic (in the sense of
<span class="emphasis"><em>general</em></span> as opposed to
<span class="emphasis"><em>template-based programming</em></span>) type is needed:
variables that are truly variable, accommodating values of many
other more specific types rather than C++'s normal strict and
static types. We can distinguish three basic kinds of generic
type:</p><div class="itemizedlist"><ul type="disc"><li><p>Converting types that can hold one of a number of
possible value types, e.g. <tt class="computeroutput">int</tt> and
<tt class="computeroutput">string</tt>, and freely convert between them, for
instance interpreting <tt class="computeroutput">5</tt> as <tt class="computeroutput">&quot;5&quot;</tt> or
vice-versa. Such types are common in scripting and other
interpreted
languages.
<tt class="computeroutput">boost::lexical_cast</tt>
supports such conversion functionality.</p></li><li><p>
Discriminated types that contain values of different types but
do not attempt conversion between them, i.e. <tt class="computeroutput">5</tt> is
held strictly as an <tt class="computeroutput">int</tt> and is not implicitly
convertible either to <tt class="computeroutput">&quot;5&quot;</tt> or to
<tt class="computeroutput">5.0</tt>. Their indifference to interpretation but
awareness of type effectively makes them safe, generic
containers of single values, with no scope for surprises from
ambiguous conversions.</p></li><li><p>
Indiscriminate types that can refer to anything but are
oblivious to the actual underlying type, entrusting all forms
of access and interpretation to the programmer. This niche is
dominated by <tt class="computeroutput">void *</tt>, which offers plenty of scope
for surprising, undefined behavior.</p></li></ul></div><p>The <tt class="computeroutput"><a href="class.boost.any.html" title="Class any">boost::any</a></tt> class
(based on the class of the same name described in <a href="http://www.two-sdg.demon.co.uk/curbralan/papers/ValuedConversions.pdf" target="_top">&quot;Valued
Conversions&quot;</a> by Kevlin Henney, <span class="emphasis"><em>C++
Report</em></span> 12(7), July/August 2000) is a variant value type
based on the second category. It supports copying of any value
type and safe checked extraction of that value strictly against
its type. A similar design, offering more appropriate operators,
can be used for a generalized function adaptor,
<tt class="computeroutput">any_function</tt>, a generalized iterator adaptor,
<tt class="computeroutput">any_iterator</tt>, and other object types that need
uniform runtime treatment but support only compile-time template
parameter conformance.</p></div></div><table width="100%"><tr><td align="left"><small></small></td><td align="right"><small></small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="index.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="index.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="ch01s02.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">The Boost C++ Libraries </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Examples</td></tr></table></div></body></html>
+29
View File
@@ -0,0 +1,29 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Reference</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="any.html" title="Boost.Any"><link rel="previous" href="ch01s02.html" title="Examples"><link rel="next" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"><link rel="subsection" href="any.reference.html#any.ValueType" title="ValueType requirements"><link rel="subsection" href="any.reference.html#header.boost.any.hpp" title="Header &lt;boost/any.hpp&gt;"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="any.reference"></a>Reference</h2></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="any.ValueType"></a><span class="emphasis"><em>ValueType</em></span> requirements</h3></div></div><div></div></div><p>Values are strongly informational objects for which
identity is not significant, i.e. the focus is principally on
their state content and any behavior organized around
that. Another distinguishing feature of values is their
granularity: normally fine-grained objects representing simple
concepts in the system such as quantities.</p><p>As the emphasis of a value lies in its state not its
identity, values can be copied and typically assigned one to
another, requiring the explicit or implicit definition of a
public copy constructor and public assignment operator. Values
typically live within other scopes, i.e. within objects or
blocks, rather than on the heap. Values are therefore normally
passed around and manipulated directly as variables or through
references, but not as pointers that emphasize identity and
indirection.</p><p>The specific requirements on value types to be used in an
<tt class="computeroutput"><a href="class.boost.any.html" title="Class any">any</a></tt>
are:</p><div class="itemizedlist"><ul type="disc" compact><li>A <span class="emphasis"><em>ValueType</em></span> is
<span class="emphasis"><em>CopyConstructible</em></span> [20.1.3].</li><li>A <span class="emphasis"><em>ValueType</em></span> is
optionally <span class="emphasis"><em>Assignable</em></span> [23.1]. The strong
exception-safety guarantee is required for all forms of
assignment.</li><li>The destructor for a
<span class="emphasis"><em>ValueType</em></span> upholds the no-throw
exception-safety guarantee.</li></ul></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="header.boost.any.hpp"></a>Header &lt;<a href="../../boost/any.hpp" target="_top">boost/any.hpp</a>&gt;</h3></div></div><div></div></div><pre class="synopsis"><span class="bold"><b>namespace</b></span> boost {
  <a href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><span class="bold"><b>class</b></span> bad_any_cast;</a>
  <a href="class.boost.any.html" title="Class any"><span class="bold"><b>class</b></span> any;</a>
  <a href="id2827840.html" title="Function any_cast"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> ValueType&gt; ValueType any_cast(<span class="bold"><b>const</b></span> any &amp;)</a>;
  <a href="id2827840.html" title="Function any_cast"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> ValueType&gt; <span class="bold"><b>const</b></span> ValueType * any_cast(<span class="bold"><b>const</b></span> any *)</a>;
  <a href="id2827840.html" title="Function any_cast"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> ValueType&gt; ValueType * any_cast(any *)</a>;
}</pre></div></div><table width="100%"><tr><td align="left"><small></small></td><td align="right"><small>Copyright © 2001 Kevlin Henney</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch01s02.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="any.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="class.boost.bad_any_cast.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Examples </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Class bad_any_cast</td></tr></table></div></body></html>
+100
View File
@@ -0,0 +1,100 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Examples</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="any.html" title="Boost.Any"><link rel="previous" href="any.html" title="Boost.Any"><link rel="next" href="any.reference.html" title="Reference"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2814007"></a>Examples</h2></div></div><div></div></div><p>The following code demonstrates the syntax for using
implicit conversions to and copying of any objects:</p><pre class="programlisting">
#include &lt;list&gt;
#include &lt;boost/any.hpp&gt;
using <a href="id2827840.html" title="Function any_cast">boost::any_cast</a>;
typedef std::list&lt;<a href="class.boost.any.html" title="Class any">boost::any</a>&gt; many;
void append_int(many &amp; values, int value)
{
<a href="class.boost.any.html" title="Class any">boost::any</a> to_append = value;
values.push_back(to_append);
}
void append_string(many &amp; values, const std::string &amp; value)
{
values.push_back(value);
}
void append_char_ptr(many &amp; values, const char * value)
{
values.push_back(value);
}
void append_any(many &amp; values, const <a href="class.boost.any.html" title="Class any">boost::any</a> &amp; value)
{
values.push_back(value);
}
void append_nothing(many &amp; values)
{
values.push_back(<a href="class.boost.any.html" title="Class any">boost::any</a>());
}
</pre><p>The following predicates follow on from the previous
definitions and demonstrate the use of queries on any
objects:</p><pre class="programlisting">
bool is_empty(const <a href="class.boost.any.html" title="Class any">boost::any</a> &amp; operand)
{
return operand.<a href="class.boost.any.html#id2827762">empty</a>();
}
bool is_int(const <a href="class.boost.any.html" title="Class any">boost::any</a> &amp; operand)
{
return operand.<a href="class.boost.any.html#id2827796">type</a>() == typeid(int);
}
bool is_char_ptr(const <a href="class.boost.any.html" title="Class any">boost::any</a> &amp; operand)
{
try
{
<a href="id2827840.html" title="Function any_cast">any_cast</a>&lt;const char *&gt;(operand);
return true;
}
catch(const <a href="class.boost.bad_any_cast.html" title="Class bad_any_cast">boost::bad_any_cast</a> &amp;)
{
return false;
}
}
bool is_string(const <a href="class.boost.any.html" title="Class any">boost::any</a> &amp; operand)
{
return <a href="id2827840.html" title="Function any_cast">any_cast</a>&lt;std::string&gt;(&amp;operand);
}
void count_all(many &amp; values, std::ostream &amp; out)
{
out &lt;&lt; &quot;#empty == &quot;
&lt;&lt; std::count_if(values.begin(), values.end(), is_empty) &lt;&lt; std::endl;
out &lt;&lt; &quot;#int == &quot;
&lt;&lt; std::count_if(values.begin(), values.end(), is_int) &lt;&lt; std::endl;
out &lt;&lt; &quot;#const char * == &quot;
&lt;&lt; std::count_if(values.begin(), values.end(), is_char_ptr) &lt;&lt; std::endl;
out &lt;&lt; &quot;#string == &quot;
&lt;&lt; std::count_if(values.begin(), values.end(), is_string) &lt;&lt; std::endl;
}
</pre><p>The following type, patterned after the OMG's Property Service, defines name-value pairs for arbitrary value types:</p><pre class="programlisting">
struct property
{
property();
property(const std::string &amp;, const <a href="class.boost.any.html" title="Class any">boost::any</a> &amp;);
std::string name;
<a href="class.boost.any.html" title="Class any">boost::any</a> value;
};
typedef std::list&lt;property&gt; properties;
</pre><p>The following base class demonstrates one approach to
runtime polymorphism based callbacks that also require arbitrary
argument types. The absence of virtual member templates requires
that different solutions have different trade-offs in terms of
efficiency, safety, and generality. Using a checked variant type
offers one approach:</p><pre class="programlisting">
class consumer
{
public:
virtual void notify(const <a href="class.boost.any.html" title="Class any">any</a> &amp;) = 0;
...
};
</pre></div><table width="100%"><tr><td align="left"><small></small></td><td align="right"><small>Copyright © 2001 Kevlin Henney</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="any.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="any.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="any.reference.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Boost.Any </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Reference</td></tr></table></div></body></html>
+2
View File
@@ -0,0 +1,2 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Acknowledgements</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="any.html" title="Boost.Any"><link rel="previous" href="id2827840.html" title="Function any_cast"><link rel="next" href="function.html" title="Boost.Function"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2812847"></a>Acknowledgements</h2></div></div><div></div></div><p>Doug Gregor ported the documentation to the BoostBook format.</p></div><table width="100%"><tr><td align="left"><small></small></td><td align="right"><small>Copyright © 2001 Kevlin Henney</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="id2827840.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="any.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="function.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Function any_cast </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Boost.Function</td></tr></table></div></body></html>
+575
View File
@@ -0,0 +1,575 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Tutorial</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="signals.html" title="Boost.Signals"><link rel="previous" href="signals.html" title="Boost.Signals"><link rel="next" href="signals.reference.html" title="Reference"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"><link rel="subsection" href="ch04s02.html#id2888202" title="How to Read this Tutorial"><link rel="subsection" href="ch04s02.html#id2888275" title="Compatibility Note"><link rel="subsection" href="ch04s02.html#id2888425" title="Hello, World! (Beginner)"><link rel="subsection" href="ch04s02.html#id2888584" title="Calling multiple slots"><link rel="subsection" href="ch04s02.html#id2889063" title="Passing values to and from slots"><link rel="subsection" href="ch04s02.html#id2890060" title="Connection Management"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2888195"></a>Tutorial</h2></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2888202"></a>How to Read this Tutorial</h3></div></div><div></div></div><p>This tutorial is not meant to be read linearly. Its top-level
structure roughly separates different concepts in the library
(e.g., handling calling multiple slots, passing values to and from
slots) and in each of these concepts the basic ideas are presented
first and then more complex uses of the library are described
later. Each of the sections is marked <span class="emphasis"><em>Beginner</em></span>,
<span class="emphasis"><em>Intermediate</em></span>, or <span class="emphasis"><em>Advanced</em></span> to help guide the
reader. The <span class="emphasis"><em>Beginner</em></span> sections include information that all
library users should know; one can make good use of the Signals
library after having read only the <span class="emphasis"><em>Beginner</em></span> sections. The
<span class="emphasis"><em>Intermediate</em></span> sections build on the <span class="emphasis"><em>Beginner</em></span>
sections with slightly more complex uses of the library. Finally,
the <span class="emphasis"><em>Advanced</em></span> sections detail very advanced uses of the
Signals library, that often require a solid working knowledge of
the <span class="emphasis"><em>Beginner</em></span> and <span class="emphasis"><em>Intermediate</em></span> topics; most users
will not need to read the <span class="emphasis"><em>Advanced</em></span> sections.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2888275"></a>Compatibility Note</h3></div></div><div></div></div><p>Boost.Signals has two syntactical forms: the preferred form and
the compatibility form. The preferred form fits more closely with the
C++ language and reduces the number of separate template parameters
that need to be considered, often improving readability; however, the
preferred form is not supported on all platforms due to compiler
bugs. The compatible form will work on all compilers supported by
Boost.Signals. Consult the table below to determine which syntactic
form to use for your compiler. Users of Boost.Function, please note
that the preferred syntactic form in Signals is equivalent to that of
Function's preferred syntactic form.</p><p>If your compiler does not appear in this list, please try the
preferred syntax and report your results to the Boost list so that
we can keep this table up-to-date.</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th align="left">Preferred syntax</th><th align="left">Portable syntax</th></tr></thead><tbody><tr><td align="left"><div class="itemizedlist"><ul type="disc"><li><p>GNU C++ 2.95.x, 3.0.x, 3.1.x</p></li><li><p>Comeau C++ 4.2.45.2</p></li><li><p>SGI MIPSpro 7.3.0</p></li><li><p>Intel C++ 5.0, 6.0</p></li><li><p>Compaq's cxx 6.2</p></li></ul></div></td><td align="left"><div class="itemizedlist"><ul type="disc"><li><p><span class="emphasis"><em>Any compiler supporting the preferred syntax</em></span></p></li><li><p>Microsoft Visual C++ 6.0, 7.0</p></li><li><p>Borland C++ 5.5.1</p></li><li><p>Sun WorkShop 6 update 2 C++ 5.3</p></li><li><p>Metrowerks CodeWarrior 8.1</p></li></ul></div></td></tr></tbody></table></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2888425"></a>Hello, World! (Beginner)</h3></div></div><div></div></div><p>The following example writes &quot;Hello, World!&quot; using signals and
slots. First, we create a signal <tt class="computeroutput">sig</tt>, a signal that
takes no arguments and has a void return value. Next, we connect
the <tt class="computeroutput">hello</tt> function object to the signal using the
<tt class="computeroutput">connect</tt> method. Finally, use the signal
<tt class="computeroutput">sig</tt> like a function to call the slots, which in turns
invokes <tt class="computeroutput">HelloWorld::operator()</tt> to print &quot;Hello,
World!&quot;.</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th align="left">Preferred syntax</th><th align="left">Portable syntax</th></tr></thead><tbody><tr><td align="left"><pre class="programlisting">
struct HelloWorld
{
void operator()() const
{
std::cout &lt;&lt; &quot;Hello, World!&quot; &lt;&lt; std::endl;
}
};
// ...
// Signal with no arguments and a void return value
<a href="class.boost.signal.html" title="Class template signal">boost::signal</a>&lt;void ()&gt; sig;
// Connect a HelloWorld slot
HelloWorld hello;
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(hello);
// Call all of the slots
sig();
</pre></td><td align="left"><pre class="programlisting">
struct HelloWorld
{
void operator()() const
{
std::cout &lt;&lt; &quot;Hello, World!&quot; &lt;&lt; std::endl;
}
};
// ...
// Signal with no arguments and a void return value
<a href="class.boost.signalN.html" title="Class template signalN">boost::signal0</a>&lt;void&gt; sig;
// Connect a HelloWorld slot
HelloWorld hello;
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(hello);
// Call all of the slots
sig();
</pre></td></tr></tbody></table></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2888584"></a>Calling multiple slots</h3></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2888590"></a>Connecting multiple slots (Beginner)</h4></div></div><div></div></div><p>Calling a single slot from a signal isn't very interesting, so
we can make the Hello, World program more interesting by splitting
the work of printing &quot;Hello, World!&quot; into two completely separate
slots. The first slot will print &quot;Hello&quot; and may look like
this:</p><pre class="programlisting">
struct Hello
{
void operator()() const
{
std::cout &lt;&lt; &quot;Hello&quot;;
}
};
</pre><p>The second slot will print &quot;, World!&quot; and a newline, to complete
the program. The second slot may look like this:</p><pre class="programlisting">
struct World
{
void operator()() const
{
std::cout &lt;&lt; &quot;, World!&quot; &lt;&lt; std::endl;
}
};
</pre><p>Like in our previous example, we can create a signal
<tt class="computeroutput">sig</tt> that takes no arguments and has a
<tt class="computeroutput">void</tt> return value. This time, we connect both a
<tt class="computeroutput">hello</tt> and a <tt class="computeroutput">world</tt> slot to the same
signal, and when we call the signal both slots will be called.</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th align="left">Preferred syntax</th><th align="left">Portable syntax</th></tr></thead><tbody><tr><td align="left"><pre class="programlisting">
<a href="class.boost.signal.html" title="Class template signal">boost::signal</a>&lt;void ()&gt; sig;
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(Hello());
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(World());
sig();
</pre></td><td align="left"><pre class="programlisting">
<a href="class.boost.signalN.html" title="Class template signalN">boost::signal0</a>&lt;void&gt; sig;
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(Hello());
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(World());
sig();
</pre></td></tr></tbody></table></div><p>Now, if you compile and run this program, you might see
something strange. It is possible that the output will look like
this:</p><pre class="programlisting">
, World!
Hello
</pre><p>The underlying reason is that the ordering of signals isn't
guaranteed. The signal is free to call either the
<tt class="computeroutput">Hello</tt> slot or the <tt class="computeroutput">World</tt> slot first, but
every slot will be called unless something bad (e.g., an exception)
occurs. Read on to learn how to control the ordering so that
&quot;Hello, World!&quot; always prints as expected.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2888807"></a>Ordering slot call groups (Intermediate)</h4></div></div><div></div></div><p>Slots are free to have side effects, and that can mean that some
slots will have to be called before others. The Boost.Signals
library allows slots to be placed into groups that are ordered in
some way. For our Hello, World program, we want &quot;Hello&quot; to be
printed before &quot;, World!&quot;, so we put &quot;Hello&quot; into a group that must
be executed before the group that &quot;, World!&quot; is in. To do this, we
can supply an extra parameter at the beginning of the
<tt class="computeroutput">connect</tt> call that specifies the group. Group values
are, by default, <tt class="computeroutput">int</tt>s, and are ordered by the integer
&lt; relation. Here's how we construct Hello, World:</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th align="left">Preferred syntax</th><th align="left">Portable syntax</th></tr></thead><tbody><tr><td align="left"><pre class="programlisting">
<a href="class.boost.signal.html" title="Class template signal">boost::signal</a>&lt;void ()&gt; sig;
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(0, Hello());
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(1, World());
sig();
</pre></td><td align="left"><pre class="programlisting">
<a href="class.boost.signalN.html" title="Class template signalN">boost::signal0</a>&lt;void&gt; sig;
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(0, Hello());
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(1, World());
sig();
</pre></td></tr></tbody></table></div><p>This program will correctly print &quot;Hello, World!&quot;, because the
<tt class="computeroutput">Hello</tt> object is in group 0, which precedes group 1
where the <tt class="computeroutput">World</tt> object resides.</p><p>The group parameter is, in fact, optional. We omitted it in the
first Hello, World example because it was unnecessary when all of
the slots are independent. So what happens if we mix calls to
connect that use the group parameter and those that don't? The
&quot;unnamed&quot; slots (i.e., those that have been connected without
specifying a group name) go into a separate group that is special
in that it follows all other groups. So if we add a new slot to our
example like this:</p><pre class="programlisting">
struct GoodMorning
{
void operator()() const
{
std::cout &lt;&lt; &quot;... and good morning!&quot; &lt;&lt; std::endl;
}
};
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(GoodMorning());
</pre><p>... we will get the result we wanted:</p><pre class="programlisting">
Hello, World!
... and good morning!
</pre><p>The last interesting point with groups of slots is the behavior
when multiple slots are connected in the same group. Within groups,
calls to slots are unordered: if we connect slots <tt class="computeroutput">A</tt>
and <tt class="computeroutput">B</tt> to the same signal with the same group name,
either <tt class="computeroutput">A</tt> or <tt class="computeroutput">B</tt> will be called first (but
both will be called). This is the same behavior we saw before with
the second version of Hello, World, where the slots could be called
in the wrong order, mangling the output.</p></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2889063"></a>Passing values to and from slots</h3></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2889069"></a>Slot Arguments (Beginner)</h4></div></div><div></div></div><p>Signals can propagate arguments to each of the slots they call.
For instance, a signal that propagates mouse motion events might
want to pass along the new mouse coordinates and whether the mouse
buttons are pressed.</p><p>As an example, we'll create a signal that passes two
<tt class="computeroutput">float</tt> arguments to its slots. Then we'll create a few
slots that print the results of various arithmetic operations on
these values.</p><pre class="programlisting">
void print_sum(float x, float y)
{
std::cout &lt;&lt; &quot;The sum is &quot; &lt;&lt; x+y &lt;&lt; std::endl;
}
void print_product(float x, float y)
{
std::cout &lt;&lt; &quot;The product is &quot; &lt;&lt; x*y &lt;&lt; std::endl;
}
void print_difference(float x, float y)
{
std::cout &lt;&lt; &quot;The difference is &quot; &lt;&lt; x-y &lt;&lt; std::endl;
}
void print_quotient(float x, float y)
{
std::cout &lt;&lt; &quot;The quotient is &quot; &lt;&lt; x/y &lt;&lt; std::endl;
}
</pre><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th align="left">Preferred syntax</th><th align="left">Portable syntax</th></tr></thead><tbody><tr><td align="left"><pre class="programlisting">
<a href="class.boost.signal.html" title="Class template signal">boost::signal</a>&lt;void (float, float)&gt; sig;
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(&amp;print_sum);
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(&amp;print_product);
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(&amp;print_difference);
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(&amp;print_quotient);
sig(5, 3);
</pre></td><td align="left"><pre class="programlisting">
<a href="class.boost.signalN.html" title="Class template signalN">boost::signal2</a>&lt;void, float, float&gt; sig;
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(&amp;print_sum);
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(&amp;print_product);
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(&amp;print_difference);
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(&amp;print_quotient);
sig(5, 3);
</pre></td></tr></tbody></table></div><p>This program will print out something like the following,
although the ordering of the lines may differ:</p><pre class="programlisting">
The sum is 8
The difference is 2
The product is 15
The quotient is 1.66667
</pre><p>So any values that are given to <tt class="computeroutput">sig</tt> when it is
called like a function are passed to each of the slots. We have to
declare the types of these values up front when we create the
signal. The type <tt class="computeroutput"><a href="class.boost.signal.html" title="Class template signal">boost::signal</a>&lt;void (float,
float)&gt;</tt> means that the signal has a <tt class="computeroutput">void</tt>
return value and takes two <tt class="computeroutput">float</tt> values. Any slot
connected to <tt class="computeroutput">sig</tt> must therefore be able to take two
<tt class="computeroutput">float</tt> values.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2889329"></a>Signal Return Values (Advanced)</h4></div></div><div></div></div><p>Just as slots can receive arguments, they can also return
values. These values can then be returned back to the caller of the
signal through a <span class="emphasis"><em>combiner</em></span>. The combiner is a mechanism
that can take the results of calling slots (there many be no
results or a hundred; we don't know until the program runs) and
coalesces them into a single result to be returned to the caller.
The single result is often a simple function of the results of the
slot calls: the result of the last slot call, the maximum value
returned by any slot, or a container of all of the results are some
possibilities.</p><p>We can modify our previous arithmetic operations example
slightly so that the slots all return the results of computing the
product, quotient, sum, or difference. Then the signal itself can
return a value based on these results to be printed:</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th align="left">Preferred syntax</th><th align="left">Portable syntax</th></tr></thead><tbody><tr><td align="left"><pre class="programlisting">
float compute_product(float x, float y) { return x*y; }
float compute_quotient(float x, float y) { return x/y; }
float compute_sum(float x, float y) { return x+y; }
float compute_difference(float x, float y) { return x-y; }
<a href="class.boost.signal.html" title="Class template signal">boost::signal</a>&lt;float (float x, float y)&gt; sig;
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(&amp;compute_product);
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(&amp;compute_quotient);
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(&amp;compute_sum);
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(&amp;compute_difference);
std::cout &lt;&lt; sig(5, 3) &lt;&lt; std::endl;
</pre></td><td align="left"><pre class="programlisting">
float compute_product(float x, float y) { return x*y; }
float compute_quotient(float x, float y) { return x/y; }
float compute_sum(float x, float y) { return x+y; }
float compute_difference(float x, float y) { return x-y; }
<a href="class.boost.signalN.html" title="Class template signalN">boost::signal2</a>&lt;float, float, float&gt; sig;
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(&amp;compute_product);
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(&amp;compute_quotient);
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(&amp;compute_sum);
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(&amp;compute_difference);
std::cout &lt;&lt; sig(5, 3) &lt;&lt; std::endl;
</pre></td></tr></tbody></table></div><p>This example program will output either <tt class="computeroutput">8</tt>,
<tt class="computeroutput">1.6667</tt>, <tt class="computeroutput">15</tt>, or <tt class="computeroutput">2</tt>, depending
on the order that the signals are called. This is because the
default behavior of a signal that has a return type
(<tt class="computeroutput">float</tt>, the first template argument given to the
<tt class="computeroutput"><a href="class.boost.signal.html" title="Class template signal">boost::signal</a></tt> class template) is to call all slots and
then return the result returned by the last slot called. This
behavior is admittedly silly for this example, because slots have
no side effects and the result is essentially randomly chosen from
the slots.</p><p>A more interesting signal result would be the maximum of the
values returned by any slot. To do this, we create a custom
combiner that looks like this:</p><pre class="programlisting">
template&lt;typename T&gt;
struct maximum
{
typedef T result_type;
template&lt;typename InputIterator&gt;
T operator()(InputIterator first, InputIterator last) const
{
// If there are no slots to call, just return the
// default-constructed value
if (first == last)
return T();
T max_value = *first++;
while (first != last) {
if (max_value &lt; *first)
max_value = *first;
++first;
}
return max_value;
}
};
</pre><p>The <tt class="computeroutput">maximum</tt> class template acts as a function
object. Its result type is given by its template parameter, and
this is the type it expects to be computing the maximum based on
(e.g., <tt class="computeroutput">maximum&lt;float&gt;</tt> would find the maximum
<tt class="computeroutput">float</tt> in a sequence of <tt class="computeroutput">float</tt>s). When a
<tt class="computeroutput">maximum</tt> object is invoked, it is given an input
iterator sequence <tt class="computeroutput">[first, last)</tt> that includes the
results of calling all of the slots. <tt class="computeroutput">maximum</tt> uses this
input iterator sequence to calculate the maximum element, and
returns that maximum value.</p><p>We actually use this new function object type by installing it
as a combiner for our signal. The combiner template argument
follows the signal's calling signature:</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th align="left">Preferred syntax</th><th align="left">Portable syntax</th></tr></thead><tbody><tr><td align="left"><pre class="programlisting">
<a href="class.boost.signal.html" title="Class template signal">boost::signal</a>&lt;float (float x, float y),
maximum&lt;float&gt; &gt; sig;
</pre></td><td align="left"><pre class="programlisting">
<a href="class.boost.signalN.html" title="Class template signalN">boost::signal2</a>&lt;float, float, float,
maximum&lt;float&gt; &gt; sig;
</pre></td></tr></tbody></table></div><p>Now we can connect slots that perform arithmetic functions and
use the signal:</p><pre class="programlisting">
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(&amp;compute_quotient);
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(&amp;compute_product);
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(&amp;compute_sum);
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(&amp;compute_difference);
std::cout &lt;&lt; sig(5, 3) &lt;&lt; std::endl;
</pre><p>The output of this program will be <tt class="computeroutput">15</tt>, because
regardless of the order in which the slots are called, the product
of 5 and 3 will be larger than the quotient, sum, or
difference.</p><p>In other cases we might want to return all of the values
computed by the slots together, in one large data structure. This
is easily done with a different combiner:</p><pre class="programlisting">
template&lt;typename Container&gt;
struct aggregate_values
{
typedef Container result_type;
template&lt;typename InputIterator&gt;
Container operator()(InputIterator first, InputIterator last) const
{
return Container(first, last);
}
};
</pre><p>
Again, we can create a signal with this new combiner:
</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th align="left">Preferred syntax</th><th align="left">Portable syntax</th></tr></thead><tbody><tr><td align="left"><pre class="programlisting">
<a href="class.boost.signal.html" title="Class template signal">boost::signal</a>&lt;float (float, float),
aggregate_values&lt;std::vector&lt;float&gt; &gt; &gt; sig;
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(&amp;compute_quotient);
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(&amp;compute_product);
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(&amp;compute_sum);
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(&amp;compute_difference);
std::vector&lt;float&gt; results = sig(5, 3);
std::copy(results.begin(), results.end(),
std::ostream_iterator&lt;float&gt;(cout, &quot; &quot;));
</pre></td><td align="left"><pre class="programlisting">
<a href="class.boost.signalN.html" title="Class template signalN">boost::signal2</a>&lt;float, float, float,
aggregate_values&lt;std::vector&lt;float&gt; &gt; &gt; sig;
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(&amp;compute_quotient);
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(&amp;compute_product);
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(&amp;compute_sum);
sig.<a href="class.boost.signalN.html#id2841744">connect</a>(&amp;compute_difference);
std::vector&lt;float&gt; results = sig(5, 3);
std::copy(results.begin(), results.end(),
std::ostream_iterator&lt;float&gt;(cout, &quot; &quot;));
</pre></td></tr></tbody></table></div><p>The output of this program will contain 15, 8, 1.6667, and 2
(but not necessarily in that order). It is interesting here that
the first template argument for the <tt class="computeroutput">signal</tt> class,
<tt class="computeroutput">float</tt>, is not actually the return type of the signal.
Instead, it is the return type used by the connected slots and will
also be the <tt class="computeroutput">value_type</tt> of the input iterators passed
to the combiner. The combiner itself is a function object and its
<tt class="computeroutput">result_type</tt> member type becomes the return type of the
signal.</p><p>The input iterators passed to the combiner transform dereference
operations into slot calls. Combiners therefore have the option to
invoke only some slots until some particular criterion is met. For
instance, in a distributed computing system, the combiner may ask
each remote system whether it will handle the request. Only one
remote system needs to handle a particular request, so after a
remote system accepts the work we do not want to ask any other
remote systems to perform the same task. Such a combiner need only
check the value returned when dereferencing the iterator, and
return when the value is acceptable. The following combiner returns
the first non-NULL pointer to a <tt class="computeroutput">FulfilledRequest</tt> data
structure, without asking any later slots to fulfill the
request:</p><pre class="programlisting">
struct DistributeRequest {
typedef FulfilledRequest* result_type;
template&lt;typename InputIterator&gt;
result_type operator()(InputIterator first, InputIterator last) const
{
while (first != last) {
if (result_type fulfilled = *first)
return fulfilled;
++first;
}
return 0;
}
};
</pre></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2890060"></a>Connection Management</h3></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2890066"></a>Disconnecting Slots (Beginner)</h4></div></div><div></div></div><p>Slots aren't expected to exist indefinately after they are
connected. Often slots are only used to receive a few events and
are then disconnected, and the programmer needs control to decide
when a slot should no longer be connected.</p><p>The entry point for managing connections explicitly is the
<tt class="computeroutput"><a href="id2890015.html" title="Class connection">boost::signals::connection</a></tt> class. The
<tt class="computeroutput"><a href="id2890015.html" title="Class connection">connection</a></tt> class uniquely represents the connection
between a particular signal and a particular slot. The
<tt class="computeroutput"><a href="id2890015.html#id2893725">connected</a>()</tt> method checks if the signal and slot are
still connected, and the <tt class="computeroutput"><a href="id2890015.html#id2908738">disconnect()</a></tt> method
disconnects the signal and slot if they are connected before it is
called. Each call to the signal's <tt class="computeroutput">connect()</tt> method
returns a connection object, which can be used to determine if the
connection still exists or to disconnect the signal and slot.</p><pre class="programlisting">
boost::signals::connection c = sig.<a href="class.boost.signalN.html#id2841744">connect</a>(HelloWorld());
if (c.<a href="class.boost.signalN.html#id2841744">connect</a>ed()) {
<span class="emphasis"><em>// c is still connected to the signal</em></span>
sig(); <span class="emphasis"><em>// Prints &quot;Hello, World!&quot;</em></span>
}
c.disconnect(); <span class="emphasis"><em>// Disconnect the HelloWorld object</em></span>
assert(!c.<a href="class.boost.signalN.html#id2841744">connect</a>ed()); <span class="emphasis"><em>c isn't connected any more</em></span>
sig(); <span class="emphasis"><em>// Does nothing: there are no connected slots</em></span>
</pre></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2890208"></a>Scoped connections (Intermediate)</h4></div></div><div></div></div><p>The <tt class="computeroutput">boost::signals::scoped_connection</tt> class
references a signal/slot connection that will be disconnected when
the <tt class="computeroutput">scoped_connection</tt> class goes out of scope. This
ability is useful when a connection need only be temporary,
e.g.,</p><pre class="programlisting">
{
boost::signals::scoped_connection c = sig.<a href="class.boost.signalN.html#id2841744">connect</a>(ShortLived());
sig(); <span class="emphasis"><em>// will call ShortLived function object</em></span>
}
sig(); <span class="emphasis"><em>// ShortLived function object no longer connected to sig</em></span>
</pre></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2890264"></a>Automatic connection management (Intermediate)</h4></div></div><div></div></div><p>Boost.Signals can automatically track the lifetime of objects
involved in signal/slot connections, including automatic
disconnection of slots when objects involved in the slot call are
destroyed. For instance, consider a simple news delivery service,
where clients connect to a news provider that then sends news to
all connected clients as information arrives. The news delivery
service may be constructed like this: </p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th align="left">Preferred syntax</th><th align="left">Portable syntax</th></tr></thead><tbody><tr><td align="left"><pre class="programlisting">
class NewsItem { /* ... */ };
boost::signal&lt;void (const NewsItem&amp; latestNews)&gt; deliverNews;
</pre></td><td align="left"><pre class="programlisting">
class NewsItem { /* ... */ };
boost::signal1&lt;void, const NewsItem&amp;&gt; deliverNews;
</pre></td></tr></tbody></table></div><p>Clients that wish to receive news updates need only connect a
function object that can receive news items to the
<tt class="computeroutput">deliverNews</tt> signal. For instance, we may have a
special message area in our application specifically for news,
e.g.,:</p><pre class="programlisting">
struct NewsMessageArea : public MessageArea
{
public:
// ...
void displayNews(const NewsItem&amp; news) const
{
messageText = news.text();
update();
}
};
// ...
NewsMessageArea newsMessageArea = new NewsMessageArea(/* ... */);
// ...
deliverNews.<a href="class.boost.signalN.html#id2841744">connect</a>(boost::bind(&amp;NewsMessageArea::displayNews,
newsMessageArea, _1));
</pre><p>However, what if the user closes the news message area,
destroying the <tt class="computeroutput">newsMessageArea</tt> object that
<tt class="computeroutput">deliverNews</tt> knows about? Most likely, a segmentation
fault will occur. However, with Boost.Signals one need only make
<tt class="computeroutput">NewsMessageArea</tt> <span class="emphasis"><em>trackable</em></span>, and the slot
involving <tt class="computeroutput">newsMessageArea</tt> will be disconnected when
<tt class="computeroutput">newsMessageArea</tt> is destroyed. The
<tt class="computeroutput">NewsMessageArea</tt> class is made trackable by deriving
publicly from the <tt class="computeroutput">boost::signals::trackable</tt> class,
e.g.:</p><pre class="programlisting">
struct NewsMessageArea : public MessageArea, public boost::signals::trackable
{
// ...
};
</pre><p>At this time there is a significant limitation to the use of
<tt class="computeroutput">trackable</tt> objects in making slot connections: function
objects built using Boost.Bind are understood, such that pointers
or references to <tt class="computeroutput">trackable</tt> objects passed to
<tt class="computeroutput">boost::bind</tt> will be found and tracked.</p><p><span class="bold"><b>Warning</b></span>: User-defined function objects and function
objects from other libraries (e.g., Boost.Function or Boost.Lambda)
do not implement the required interfaces for <tt class="computeroutput">trackable</tt>
object detection, and <span class="emphasis"><em>will silently ignore any bound trackable
objects</em></span>. Future versions of the Boost libraries will address
this limitation.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2890510"></a>When can disconnections occur? (Intermediate)</h4></div></div><div></div></div><p>Signal/slot disconnections occur when any of these conditions
occur:</p><div class="itemizedlist"><ul type="disc"><li><p>The connection is explicitly disconnected via the connection's
<tt class="computeroutput">disconnect</tt> method directly, or indirectly via the
signal's <tt class="computeroutput">disconnect</tt> method or
<tt class="computeroutput">scoped_connection</tt>'s destructor.</p></li><li><p>A <tt class="computeroutput">trackable</tt> object bound to the slot is
destroyed.</p></li><li><p>The signal is destroyed.</p></li></ul></div><p>These events can occur at any time without disrupting a signal's
calling sequence. If a signal/slot connection is disconnected at
any time during a signal's calling sequence, the calling sequence
will still continue but will not invoke the disconnected slot.
Additionally, a signal may be destroyed while it is in a calling
sequence, and which case it will complete its slot call sequence
but may not be accessed directly.</p><p>Signals may be invoked recursively (e.g., a signal A calls a
slot B that invokes signal A...). The disconnection behavior does
not change in the recursive case, except that the slot calling
sequence includes slot calls for all nested invocations of the
signal.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2890595"></a>Passing slots (Intermediate)</h4></div></div><div></div></div><p>Slots in the Boost.Signals library are created from arbitrary
function objects, and therefore have no fixed type. However, it is
commonplace to require that slots be passed through interfaces that
cannot be templates. Slots can be passed via the
<tt class="computeroutput">slot_type</tt> for each particular signal type and any
function object compatible with the signature of the signal can be
passed to a <tt class="computeroutput">slot_type</tt> parameter. For instance:</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th align="left">Preferred syntax</th><th align="left">Portable syntax</th></tr></thead><tbody><tr><td align="left"><pre class="programlisting">
class Button
{
typedef boost::signal&lt;void (int x, int y)&gt; OnClick;
public:
void doOnClick(const OnClick::slot_type&amp; slot);
private:
OnClick onClick;
};
void Button::doOnClick(const OnClick::slot_type&amp; slot)
{
onClick.<a href="class.boost.signalN.html#id2841744">connect</a>(slot);
}
void printCoordinates(long x, long y)
{
std::cout &lt;&lt; &quot;(&quot; &lt;&lt; x &lt;&lt; &quot;, &quot; &lt;&lt; y &lt;&lt; &quot;)\n&quot;;
}
void f(Button&amp; button)
{
button.doOnClick(&amp;printCoordinates);
}
</pre></td><td align="left"><pre class="programlisting">
class Button
{
typedef <a href="class.boost.signalN.html" title="Class template signalN">boost::signal2</a>&lt;void, int x, int y&gt; OnClick;
public:
void doOnClick(const OnClick::slot_type&amp; slot);
private:
OnClick onClick;
};
void Button::doOnClick(const OnClick::slot_type&amp; slot)
{
onClick.<a href="class.boost.signalN.html#id2841744">connect</a>(slot);
}
void printCoordinates(long x, long y)
{
std::cout &lt;&lt; &quot;(&quot; &lt;&lt; x &lt;&lt; &quot;, &quot; &lt;&lt; y &lt;&lt; &quot;)\n&quot;;
}
void f(Button&amp; button)
{
button.doOnClick(&amp;printCoordinates);
}
</pre></td></tr></tbody></table></div><p>The <tt class="computeroutput">doOnClick</tt> method is now functionally equivalent
to the <tt class="computeroutput">connect</tt> method of the <tt class="computeroutput">onClick</tt>
signal, but the details of the <tt class="computeroutput">doOnClick</tt> method can be
hidden in an implementation detail file.</p></div></div></div><table width="100%"><tr><td align="left"><small></small></td><td align="right"><small>Copyright © 2001-2003 Douglas Gregor</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="signals.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="signals.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="signals.reference.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Boost.Signals </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Reference</td></tr></table></div></body></html>
+27
View File
@@ -0,0 +1,27 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Frequently Asked Questions</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="signals.html" title="Boost.Signals"><link rel="previous" href="id2830650.html" title="Class last_value&lt;void&gt;"><link rel="next" href="ch04s05.html" title="Design Overview"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2895619"></a>Frequently Asked Questions</h2></div></div><div></div></div><div class="qandaset"><dl><dt>1. <a href="ch04s04.html#id2895627">Don't noncopyable signal semantics mean that a class
with a signal member will be noncopyable as well?</a></dt><dt>2. <a href="ch04s04.html#id2895654">Is Boost.Signals thread-safe?</a></dt><dt>3. <a href="ch04s04.html#id2895679">How do I get Boost.Signals to work with Qt?</a></dt></dl><table border="0" summary="Q and A Set"><col align="left" width="1%"><tbody><tr class="question"><td align="left" valign="top"><a name="id2895627"></a><a name="id2895630"></a><b>1. </b></td><td align="left" valign="top"><p>Don't noncopyable signal semantics mean that a class
with a signal member will be noncopyable as well?</p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p>No. The compiler will not be able to generate a copy
constructor or copy assignment operator for your class if it
has a signal as a member, but you are free to write your own
copy constructor and/or copy assignment operator. Just don't
try to copy the signal.</p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2895654"></a><a name="id2895657"></a><b>2. </b></td><td align="left" valign="top"><p>Is Boost.Signals thread-safe?</p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p>No. Using Boost.Signals in a multithreaded concept is
very dangerous, and it is very likely that the results will be
less than satisfying. Boost.Signals will support thread safety
in the future.</p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2895679"></a><a name="id2895682"></a><b>3. </b></td><td align="left" valign="top"><p>How do I get Boost.Signals to work with Qt?</p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p>When building with Qt, the Moc keywords
<tt class="computeroutput">signals</tt> and <tt class="computeroutput">slots</tt> are defined using
preprocessor macros, causing programs using Boost.Signals and
Qt together to fail to compile. Although this is a problem
with Qt and not Boost.Signals, a user can use the two systems
together by defining the <tt class="computeroutput">BOOST_SIGNALS_NAMESPACE</tt>
macro to some other identifier (e.g., <tt class="computeroutput">signalslib</tt>)
when building and using the Boost.Signals library. Then the
namespace of the Boost.Signals library will be
<tt class="computeroutput">boost::BOOST_SIGNALS_NAMESPACE</tt> instead of
<tt class="computeroutput">boost::signals</tt>. To retain the original namespace
name in translation units that do not interact with Qt, you
can use a namespace alias:</p><pre class="programlisting">
namespace boost {
namespace signals = BOOST_SIGNALS_NAMESPACE;
}
</pre></td></tr></tbody></table></div></div><table width="100%"><tr><td align="left"><small></small></td><td align="right"><small>Copyright © 2001-2003 Douglas Gregor</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="id2830650.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="signals.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="ch04s05.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Class last_value&lt;void&gt; </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Design Overview</td></tr></table></div></body></html>
+102
View File
@@ -0,0 +1,102 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Design Overview</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="signals.html" title="Boost.Signals"><link rel="previous" href="ch04s04.html" title="Frequently Asked Questions"><link rel="next" href="ch04s06.html" title="Design Rationale"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"><link rel="subsection" href="ch04s05.html#id2895772" title="Type Erasure"><link rel="subsection" href="ch04s05.html#id2895860" title="connection class"><link rel="subsection" href="ch04s05.html#id2895993" title="Slot Call Iterator"><link rel="subsection" href="ch04s05.html#id2896236" title="visit_each function template"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2895766"></a>Design Overview</h2></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2895772"></a>Type Erasure</h3></div></div><div></div></div><p>&quot;Type erasure&quot;, where static type information is eliminated
by the use of dynamically dispatched interfaces, is used
extensively within the Boost.Signals library to reduce the amount
of code generated by template instantiation. Each signal must
manage a list of slots and their associated connections, along
with a <tt class="computeroutput">std::map</tt> to map from group identifiers to
their associated connections. However, instantiating this map for
every token type, and perhaps within each translation unit (for
some popular template instantiation strategies) increase compile
time overhead and space overhead.</p><p> To combat this so-called &quot;template bloat&quot;, we use
Boost.Function and Boost.Any to store unknown types and
operations. Then, all of the code for handling the list of slots
and the mapping from slot identifiers to connections is factored
into the class <tt class="computeroutput">signal_base</tt>
that deals exclusively with the <tt class="computeroutput">any</tt> and
<tt class="computeroutput"><a href="class.boost.function.html" title="Class template function">function</a></tt> objects, hiding the
actual implementations using the well-known pimpl idiom. The
actual <tt class="computeroutput"><a href="class.boost.signalN.html" title="Class template signalN">signalN</a></tt> class templates
deal only with code that will change depending on the number of
arguments or which is inherently template-dependent (such as
connection).</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2895860"></a><tt class="computeroutput">connection</tt> class</h3></div></div><div></div></div><p> The <tt class="computeroutput"><a href="id2890015.html" title="Class connection">connection</a></tt> class is
central to the behavior of the Boost.Signals library. It is the
only entity within the Boost.Signals system that has knowledge of
all objects that are associated by a given connection. To be
specific, the <tt class="computeroutput"><a href="id2890015.html" title="Class connection">connection</a></tt> class
itself is merely a thin wrapper over a
<tt class="computeroutput">shared_ptr</tt> to a
<tt class="computeroutput">basic_connection</tt> object.</p><p> <tt class="computeroutput"><a href="id2890015.html" title="Class connection">connection</a></tt> objects are
stored by all participants in the Signals system: each
<tt class="computeroutput"><a href="id2852290.html" title="Class trackable">trackable</a></tt> object contains a
list of <tt class="computeroutput"><a href="id2890015.html" title="Class connection">connection</a></tt> objects
describing all connections it is a part of; similarly, all signals
contain a set of pairs that define a slot. The pairs consist of a
slot function object (generally a Boost.Function object) and a
<tt class="computeroutput"><a href="id2890015.html" title="Class connection">connection</a></tt> object (that will
disconnect on destruction). Finally, the mapping from slot groups
to slots is based on the key value in a
<tt class="computeroutput">std::multimap</tt> (the stored data
in the <tt class="computeroutput">std::multimap</tt> is the
slot pair).</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2895993"></a>Slot Call Iterator</h3></div></div><div></div></div><p> The slot call iterator is conceptually a stack of iterator
adaptors that modify the behavior of the underlying iterator
through the list of slots. The following table describes the type
and behavior of each iterator adaptor required. Note that this is
only a conceptual model: the implementation collapses all these
layers into a single iterator adaptor because several popular
compilers failed to compile the implementation of the conceptual
model.</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th align="left">Iterator Adaptor</th><th align="left">Purpose</th></tr></thead><tbody><tr><td align="left"><p>Slot List Iterator</p></td><td align="left"><p>An iterator through the list of slots
connected to a signal. The <tt class="computeroutput">value_type</tt> of this
iterator will be
<tt class="computeroutput">std::pair&lt;any,
connection&gt;</tt>, where the
<tt class="computeroutput"><a href="class.boost.any.html" title="Class any">any</a></tt> contains an
instance of the slot function type.</p></td></tr><tr><td align="left"><p>Filter Iterator Adaptor</p></td><td align="left"><p>This filtering iterator adaptor filters out
slots that have been disconnected, so we never see a
disconnected slot in later stages.</p></td></tr><tr><td align="left"><p>Projection Iterator Adaptor</p></td><td align="left"><p>The projection iterator adaptor returns a
reference to the first member of the pair that constitutes
a connected slot (e.g., just the
<tt class="computeroutput"><a href="class.boost.any.html" title="Class any">boost::any</a></tt> object that
holds the slot function).</p></td></tr><tr><td align="left"><p>Transform Iterator Adaptor</p></td><td align="left"><p>This transform iterator adaptor performs an
<tt class="computeroutput"><a href="id2827840.html" title="Function any_cast">any_cast</a></tt> to
extract a reference to the slot function with the
appropriate slot function type.</p></td></tr><tr><td align="left"><p>Transform Iterator Adaptor</p></td><td align="left"><p>This transform iterator adaptor calls the
function object returned by dereferencing the underlying
iterator with the set of arguments given to the signal
itself, and returns the result of that slot
call.</p></td></tr><tr><td align="left"><p>Input Caching Iterator Adaptor</p></td><td align="left"><p>This iterator adaptor caches the result of
dereferencing the underlying iterator. Therefore,
dereferencing this iterator multiple times will only
result in the underlying iterator being dereferenced once;
thus, a slot can only be called once but its result can be
used multiple times.</p></td></tr><tr><td align="left"><p>Slot Call Iterator</p></td><td align="left"><p>Iterates over calls to each slot.</p></td></tr></tbody></table></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2896236"></a><tt class="computeroutput">visit_each</tt> function template</h3></div></div><div></div></div><p> The <tt class="computeroutput"><a href="id2905241.html" title="Function template visit_each">visit_each</a></tt>
function template is a mechanism for discovering objects that are
stored within another object. Function template
<tt class="computeroutput"><a href="id2905241.html" title="Function template visit_each">visit_each</a></tt> takes three
arguments: an object to explore, a visitor function object that is
invoked with each subobject, and the <tt class="computeroutput">int</tt> 0. </p><p> The third parameter is merely a temporary solution to the
widespread lack of proper function template partial ordering. The
primary <tt class="computeroutput"><a href="id2905241.html" title="Function template visit_each">visit_each</a></tt>
function template specifies this third parameter type to be
<tt class="computeroutput">long</tt>, whereas any user specializations must specify
their third parameter to be of type <tt class="computeroutput">int</tt>. Thus, even
though a broken compiler cannot tell the ordering between, e.g., a
match against a parameter <tt class="computeroutput">T</tt> and a parameter
<tt class="computeroutput">A&lt;T&gt;</tt>, it can determine that the conversion from
the integer 0 to <tt class="computeroutput">int</tt> is better than the conversion to
<tt class="computeroutput">long</tt>. The ordering determined by this conversion thus
achieves partial ordering of the function templates in a limited,
but successful, way. The following example illustrates the use of
this technique:</p><pre class="programlisting">
template&lt;typename&gt; class A {};
template&lt;typename T&gt; void foo(T, long);
template&lt;typename T&gt; void foo(A&lt;T&gt;, int);
A&lt;T&gt; at;
foo(at, 0);
</pre><p> In this example, we assume that our compiler can not tell
that <tt class="computeroutput">A&lt;T&gt;</tt> is a better match than
<tt class="computeroutput">T</tt>, and therefore assume that the function templates
cannot be ordered based on that parameter. Then the conversion
from 0 to <tt class="computeroutput">int</tt> is better than the conversion from 0 to
<tt class="computeroutput">long</tt>, and the second function template is
chosen. </p></div></div><table width="100%"><tr><td align="left"><small></small></td><td align="right"><small>Copyright © 2001-2003 Douglas Gregor</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch04s04.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="signals.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="ch04s06.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Frequently Asked Questions </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Design Rationale</td></tr></table></div></body></html>
+269
View File
@@ -0,0 +1,269 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Design Rationale</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="signals.html" title="Boost.Signals"><link rel="previous" href="ch04s05.html" title="Design Overview"><link rel="next" href="ch04s07.html" title="Testsuite"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"><link rel="subsection" href="ch04s06.html#id2896415" title="Choice of Slot Definitions"><link rel="subsection" href="ch04s06.html#id2896550" title="User-level Connection Management"><link rel="subsection" href="ch04s06.html#id2811980" title="Combiner Interface"><link rel="subsection" href="ch04s06.html#id2897087" title="Connection Interfaces: += operator"><link rel="subsection" href="ch04s06.html#id2897291" title="trackable rationale"><link rel="subsection" href="ch04s06.html#id2897506" title="Comparison with other Signal/Slot implementations"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2896408"></a>Design Rationale</h2></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2896415"></a>Choice of Slot Definitions</h3></div></div><div></div></div><p> The definition of a slot differs amongst signals and slots
libraries. Within Boost.Signals, a slot is defined in a very loose
manner: it can be any function object that is callable given
parameters of the types specified by the signal, and whose return
value is convertible to the result type expected by the
signal. However, alternative definitions have associated pros and
cons that were considered prior to the construction of
Boost.Signals.</p><div class="itemizedlist"><ul type="disc"><li><p><span class="bold"><b>Slots derive from a specific base
class</b></span>: generally a scheme such as this will require
all user-defined slots to derive from some library-specified
<tt class="computeroutput">Slot</tt> abstract class that defines a virtual
function calling the slot. Adaptors can be used to convert a
definition such as this to a definition similar to that used
by Boost.Signals, but the use of a large number of small
adaptor classes containing virtual functions has been found to
cause an unacceptable increase in the size of executables
(polymorphic class types require more code than
non-polymorphic types).</p><p> This approach does have the benefit of simplicity of
implementation and user interface, from an object-oriented
perspective.</p></li><li><p><span class="bold"><b>Slots constructed from a set of
primitives</b></span>: in this scheme the slot can have a
limited set of types (often derived from a common abstract
base class) that are constructed from some library-defined set
of primitives that often include conversions from free
function pointers and member function pointers, and a limited
set of binding capabilities. Such an approach is reasonably
simple and cover most common cases, but it does not allow a
large degree of flexibility in slot construction. Libraries
for function object composition have become quite advanced and
it is out of the scope of a signals and slots library to
encorporate such enhancements. Thus Boost.Signals does not
include argument binding or function object composition
primitives, but instead provides a hook (via the
<tt class="computeroutput"><a href="id2905241.html" title="Function template visit_each">visit_each</a></tt>
mechanism) that allows existing binder/composition libraries
to provide the necessary information to Signals.</p></li></ul></div><p> Users not satisfied with the slot definition choice may opt
to replace the default slot function type with an alternative that
meets their specific needs.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2896550"></a>User-level Connection Management</h3></div></div><div></div></div><p> Users need to have fine control over the connection of
signals to slots and their eventual disconnection. The approach
taken by Boost.Signals is to return a
<tt class="computeroutput"><a href="id2890015.html" title="Class connection">connection</a></tt> object that enables
connected/disconnected query, manual disconnection, and an
automatic disconnection on destruction mode. Some other possible
interfaces include:</p><div class="itemizedlist"><ul type="disc"><li><p><span class="bold"><b>Pass slot to
disconnect</b></span>: in this interface model, the
disconnection of a slot connected with
<tt class="computeroutput">sig.<a href="class.boost.signalN.html#id2841744">connect</a>(slot)</tt> is
performed via
<tt class="computeroutput">sig.<a href="class.boost.signalN.html#id2846925">disconnect</a>(slot)</tt>. Internally,
a linear search using slot comparison is performed and the
slot, if found, is removed from the list. Unfortunately,
querying connectedness will generally also end up as
linear-time operations. This model also fails for
implementation reasons when slots become more complex than
simple function pointers, member function pointers and a
limited set of compositions and argument binders: to match the
slot given in the call to
<tt class="computeroutput"><a href="class.boost.signalN.html#id2846925">disconnect</a></tt> with an
existing slot we would need to be able to compare arbitrary
function objects, which is not feasible.</p></li><li><p><span class="bold"><b>Pass a token to
disconnect</b></span>: this approach identifies slots with a
token that is easily comparable (e.g., a string), enabling
slots to be arbitrary function objects. While this approach is
essentially equivalent to the approach taken by Boost.Signals,
it is possibly more error-prone for several reasons:</p><div class="itemizedlist"><ul type="circle"><li><p>Connections and disconnections must be paired, so
the problem becomes similar to the problems incurred when
pairing <tt class="computeroutput">new</tt> and <tt class="computeroutput">delete</tt> for
dynamic memory allocation. While errors of this sort would
not be catastrophic for a signals and slots
implementation, their detection is generally
nontrivial.</p></li><li><p>Tokens must be unique, otherwise two slots will have
the same name and will be indistinguishable. In
environments where many connections will be made
dynamically, name generation becomes an additional task
for the user. Uniqueness of tokens also results in an
additional failure mode when attempting to connect a slot
using a token that has already been used.</p></li><li><p>More parameterization would be required, because the
token type must be user-defined. Additional
parameterization steepens the learning curver and
overcomplicates a simple interface.</p></li></ul></div><p> This type of interface is supported in Boost.Signals
via the slot grouping mechanism. It augments the
<tt class="computeroutput"><a href="id2890015.html" title="Class connection">connection</a></tt> object-based
connection management scheme.</p></li></ul></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2811980"></a>Combiner Interface</h3></div></div><div></div></div><p> The Combiner interface was chosen to mimic a call to an
algorithm in the C++ standard library. It is felt that by viewing
slot call results as merely a sequence of values accessed by input
iterators, the combiner interface would be most natural to a
proficient C++ programmer. Competing interface design generally
required the combiners to be constructed to conform to an
interface that would be customized for (and limited to) the
Signals library. While these interfaces are generally enable more
straighforward implementation of the signals &amp; slots
libraries, the combiners are unfortunately not reusable (either in
other signals &amp; slots libraries or within other generic
algorithms), and the learning curve is steepened slightly to learn
the specific combiner interface.</p><p> The Signals formulation of combiners is based on the
combiner using the &quot;pull&quot; mode of communication, instead of the
more complex &quot;push&quot; mechanism. With a &quot;pull&quot; mechanism, the
combiner's state can be kept on the stack and in the program
counter, because whenever new data is required (i.e., calling the
next slot to retrieve its return value), there is a simple
interface to retrieve that data immediately and without returning
from the combiner's code. Contrast this with the &quot;push&quot; mechanism,
where the combiner must keep all state in class members because
the combiner's routines will be invoked for each signal
called. Compare, for example, a combiner that returns the maximum
element from calling the slots. If the maximum element ever
exceeds 100, no more slots are to be called.</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th align="left"><p>Pull</p></th><th align="left"><p>Push</p></th></tr></thead><tbody><tr><td align="left"><pre class="programlisting">
struct pull_max {
typedef int result_type;
template&lt;typename InputIterator&gt;
result_type operator()(InputIterator first,
InputIterator last)
{
if (first == last)
throw std::runtime_error(&quot;Empty!&quot;);
int max_value = *first++;
while(first != last &amp;&amp; *first &lt;= 100) {
if (*first &gt; max_value)
max_value = *first;
++first;
}
return max_value;
}
};
</pre></td><td align="left"><pre class="programlisting">
struct push_max {
typedef int result_type;
push_max() : max_value(), got_first(false) {}
// returns false when we want to stop
bool operator()(int result) {
if (result &gt; 100)
return false;
if (!got_first) {
got_first = true;
max_value = result;
return true;
}
if (result &gt; max_value)
max_value = result;
return true;
}
int get_value() const
{
if (!got_first)
throw std::runtime_error(&quot;Empty!&quot;);
return max_value;
}
private:
int max_value;
bool got_first;
};
</pre></td></tr></tbody></table></div><p>There are several points to note in these examples. The
&quot;pull&quot; version is a reusable function object that is based on an
input iterator sequence with an integer <tt class="computeroutput">value_type</tt>,
and is very straightforward in design. The &quot;push&quot; model, on the
other hand, relies on an interface specific to the caller and is
not generally reusable. It also requires extra state values to
determine, for instance, if any elements have been
received. Though code quality and ease-of-use is generally
subjective, the &quot;pull&quot; model is clearly shorter and more reusable
and will often be construed as easier to write and understand,
even outside the context of a signals &amp; slots library.</p><p> The cost of the &quot;pull&quot; combiner interface is paid in the
implementation of the Signals library itself. To correctly handle
slot disconnections during calls (e.g., when the dereference
operator is invoked), one must construct the iterator to skip over
disconnected slots. Additionally, the iterator must carry with it
the set of arguments to pass to each slot (although a reference to
a structure containing those arguments suffices), and must cache
the result of calling the slot so that multiple dereferences don't
result in multiple calls. This apparently requires a large degree
of overhead, though if one considers the entire process of
invoking slots one sees that the overhead is nearly equivalent to
that in the &quot;push&quot; model, but we have inverted the control
structures to make iteration and dereference complex (instead of
making combiner state-finding complex).</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2897087"></a>Connection Interfaces: += operator</h3></div></div><div></div></div><p> Boost.Signals supports a connection syntax with the form
<tt class="computeroutput">sig.<a href="class.boost.signalN.html#id2841744">connect</a>(slot)</tt>, but a
more terse syntax <tt class="computeroutput">sig += slot</tt> has been suggested (and
has been used by other signals &amp; slots implementations). There
are several reasons as to why this syntax has been
rejected:</p><div class="itemizedlist"><ul type="disc"><li><p><span class="bold"><b>It's unnecessary</b></span>: the
connection syntax supplied by Boost.Signals is no less
powerful that that supplied by the <tt class="computeroutput">+=</tt>
operator. The savings in typing (<tt class="computeroutput">connect()</tt>
vs. <tt class="computeroutput">+=</tt>) is essentially negligible. Furthermore,
one could argue that calling <tt class="computeroutput">connect()</tt> is more
readable than an overload of <tt class="computeroutput">+=</tt>.</p></li><li><p><span class="bold"><b>Ambiguous return type</b></span>:
there is an ambiguity concerning the return value of the
<tt class="computeroutput">+=</tt> operation: should it be a reference to the
signal itself, to enable <tt class="computeroutput">sig += slot1 += slot2</tt>,
or should it return a
<tt class="computeroutput"><a href="id2890015.html" title="Class connection">connection</a></tt> for the
newly-created signal/slot connection?</p></li><li><p><span class="bold"><b>Gateway to operators -=,
+</b></span>: when one has added a connection operator
<tt class="computeroutput">+=</tt>, it seems natural to have a disconnection
operator <tt class="computeroutput">-=</tt>. However, this presents problems when
the library allows arbitrary function objects to implicitly
become slots, because slots are no longer comparable. </p><p> The second obvious addition when one has
<tt class="computeroutput">operator+=</tt> would be to add a <tt class="computeroutput">+</tt>
operator that supports addition of multiple slots, followed by
assignment to a signal. However, this would require
implementing <tt class="computeroutput">+</tt> such that it can accept any two
function objects, which is technically infeasible.</p></li></ul></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2897291"></a><tt class="computeroutput">trackable</tt> rationale</h3></div></div><div></div></div><p> The <tt class="computeroutput"><a href="id2852290.html" title="Class trackable">trackable</a></tt>
class is the primary user interface to automatic connection
lifetime management, and its design affects users directly. Two
issues stick out most: the odd copying behavior of
<tt class="computeroutput">trackable</tt>, and the limitation requiring users to
derive from <tt class="computeroutput">trackable</tt> to create types that can
participate in automatic connection management.</p><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2897340"></a><tt class="computeroutput">trackable</tt> copying behavior</h4></div></div><div></div></div><p> The copying behavior of
<tt class="computeroutput"><a href="id2852290.html" title="Class trackable">trackable</a></tt> is essentially
that <tt class="computeroutput"><a href="id2852290.html" title="Class trackable">trackable</a></tt> subobjects
are never copied; instead, the copy operation is merely a
no-op. To understand this, we look at the nature of a
signal-slot connection and note that the connection is based on
the entities that are being connected; when one of the entities
is destroyed, the connection is destroyed. Therefore, when a
<tt class="computeroutput"><a href="id2852290.html" title="Class trackable">trackable</a></tt> subobject is
copied, we cannot copy the connections because the connections
don't refer to the target entity - they refer to the source
entity. This reason is dual to the reason signals are
noncopyable: the slots connected to them are connected to that
particular signal, not the data contained in the signal.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2897409"></a>Why derivation from <tt class="computeroutput">trackable</tt>?</h4></div></div><div></div></div><p> For <tt class="computeroutput"><a href="id2852290.html" title="Class trackable">trackable</a></tt> to work
properly, there are two constraints:</p><div class="itemizedlist"><ul type="disc"><li><p><tt class="computeroutput"><a href="id2852290.html" title="Class trackable">trackable</a></tt> must
have storage space to keep track of all connections made to
this object.</p></li><li><p><tt class="computeroutput"><a href="id2852290.html" title="Class trackable">trackable</a></tt> must be
notified when the object is being destructed so that it can
disconnect its connections.</p></li></ul></div><p>Clearly, deriving from
<tt class="computeroutput"><a href="id2852290.html" title="Class trackable">trackable</a></tt> meets these two
guidelines. We have not yet found a superior solution.</p></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2897506"></a>Comparison with other Signal/Slot implementations</h3></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2897514"></a>libsigc++</h4></div></div><div></div></div><p> <a href="http://libsigc.sourceforge.net" target="_top">libsigc++</a> is a C++
signals &amp; slots library that originally started as part of
an initiative to wrap the C interfaces to <a href="http://www.gtk.org" target="_top">GTK</a> libraries in C++, and has
grown to be a separate library maintained by Karl Nelson. There
are many similarities between libsigc++ and Boost.Signals, and
indeed Boost.Signals was strongly influenced by Karl Nelson and
libsigc++. A cursory inspection of each library will find a
similar syntax for the construction of signals and in the use of
connections and automatic connection lifetime management. There
are some major differences in design that separate these
libraries:</p><div class="itemizedlist"><ul type="disc"><li><p><span class="bold"><b>Slot definitions</b></span>:
slots in libsigc++ are created using a set of primitives
defined by the library. These primitives allow binding of
objects (as part of the library), explicit adaptation from
the argument and return types of the signal to the argument
and return types of the slot (libsigc++ is, by default, more
strict about types than Boost.Signals). A discussion of this
approach with a comparison against the approach taken by
Boost.Signals is given in Choice of Slot Definitions.</p></li><li><p><span class="bold"><b>Combiner/Marshaller
interface</b></span>: the equivalent to Boost.Signals
combiners in libsigc++ are the marshallers. Marshallers are
similar to the &quot;push&quot; interface described in Combiner
Interface, and a proper treatment of the topic is given
there.</p></li></ul></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2897600"></a>.NET delegates</h4></div></div><div></div></div><p> <a href="http://www.microsoft.com" target="_top">Microsoft</a>
has introduced the .NET Framework and an associated set of
languages and language extensions, one of which is the
delgate. Delegates are similar to signals and slots, but they
are more limited than most C++ signals and slots implemetations
in that they:</p><div class="itemizedlist"><ul type="disc"><li><p>Require exact type matches between a delegate and what
it is calling.</p></li><li><p>Do not allow return types.</p></li><li><p>Must call a method with <tt class="computeroutput">this</tt> already
bound.</p></li></ul></div></div></div></div><table width="100%"><tr><td align="left"><small></small></td><td align="right"><small>Copyright © 2001-2003 Douglas Gregor</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch04s05.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="signals.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="ch04s07.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Design Overview </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Testsuite</td></tr></table></div></body></html>
+10
View File
@@ -0,0 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Testsuite</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="signals.html" title="Boost.Signals"><link rel="previous" href="ch04s06.html" title="Design Rationale"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"><link rel="subsection" href="ch04s07.html#id2897667" title="Acceptance tests"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2897663"></a>Testsuite</h2></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2897667"></a>Acceptance tests</h3></div></div><div></div></div><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Test</th><th>Type</th><th>Description</th><th>If failing...</th></tr></thead><tbody><tr><td><p><a href="../../libs/signals/test/dead_slot_test.cpp" target="_top">dead_slot_test.cpp</a></p></td><td><p>run</p></td><td><p>Ensure that calling connect with a slot
that has already been disconnected via deletion does not actually
connect to the slot.</p></td><td> </td></tr><tr><td><p><a href="../../libs/signals/test/deletion_test.cpp" target="_top">deletion_test.cpp</a></p></td><td><p>run</p></td><td><p>Test deletion of slots.</p></td><td> </td></tr><tr><td><p><a href="../../libs/signals/test/ordering_test.cpp" target="_top">ordering_test.cpp</a></p></td><td><p>run</p></td><td><p>Test slot group ordering.</p></td><td> </td></tr><tr><td><p><a href="../../libs/signals/test/signal_n_test.cpp" target="_top">signal_n_test.cpp</a></p></td><td><p>run</p></td><td><p>Basic test of signal/slot connections and invocation using the
<a href="class.boost.signalN.html" title="Class template signalN">boost::signalN</a> class templates.</p></td><td> </td></tr><tr><td><p><a href="../../libs/signals/test/signal_test.cpp" target="_top">signal_test.cpp</a></p></td><td><p>run</p></td><td><p>Basic test of signal/slot connections and invocation using the
<a href="class.boost.signal.html" title="Class template signal">boost::signal</a> class template.</p></td><td><p>The <a href="class.boost.signal.html" title="Class template signal">boost::signal</a> class template may not
be usable on your compiler. However, the
<a href="class.boost.signalN.html" title="Class template signalN">boost::signalN</a> class templates may still be
usable.</p></td></tr><tr><td><p><a href="../../libs/signals/test/trackable_test.cpp" target="_top">trackable_test.cpp</a></p></td><td><p>run</p></td><td><p>Test automatic lifetime management using
boost::trackable objects.</p></td><td> </td></tr></tbody></table></div></div></div><table width="100%"><tr><td align="left"><small></small></td><td align="right"><small>Copyright © 2001-2003 Douglas Gregor</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch04s06.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="signals.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> </td></tr><tr><td width="40%" align="left" valign="top">Design Rationale </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html>
+72
View File
@@ -0,0 +1,72 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Class any</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="any.reference.html#header.boost.any.hpp" title="Header &lt;boost/any.hpp&gt;"><link rel="previous" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="next" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"><link rel="section" href="class.boost.any.html#id2865702" title="Description"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="refentry" lang="en"><a name="class.boost.any"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">Class any</span></h2><p>boost::any &#8212; A class whose instances can hold instances of any
type that satisfies ValueType
requirements.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
<span class="bold"><b>class</b></span> any {
<span class="bold"><b>public</b></span>:
  <span class="emphasis"><em>// <a href="class.boost.any.html#id2623685construct-copy-destruct">construct/copy/destruct</a></em></span>
  <a href="class.boost.any.html#id2828868">any()</a>;
  <a href="class.boost.any.html#id2828883">any(<span class="bold"><b>const</b></span> any &amp;)</a>;
  <a href="class.boost.any.html#id2828939"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> ValueType&gt; any(<span class="bold"><b>const</b></span> ValueType &amp;)</a>;
  <a href="class.boost.any.html#id2829010">any &amp; <span class="bold"><b>operator</b></span>=(<span class="bold"><b>const</b></span> any &amp;)</a>;
  <a href="class.boost.any.html#id2829076"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> ValueType&gt; any &amp; <span class="bold"><b>operator</b></span>=(<span class="bold"><b>const</b></span> ValueType &amp;)</a>;
  <a href="class.boost.any.html#id2828993">~any()</a>;
  <span class="emphasis"><em>// <a href="class.boost.any.html#id2829139">modifiers</a></em></span>
  <a href="class.boost.any.html#id2829145">any &amp; swap(any &amp;)</a>;
  <span class="emphasis"><em>// <a href="class.boost.any.html#id2827756">queries</a></em></span>
  <a href="class.boost.any.html#id2827762"><span class="bold"><b>bool</b></span> empty() <span class="bold"><b>const</b></span></a>;
  <a href="class.boost.any.html#id2827796"><span class="bold"><b>const</b></span> std::type_info &amp; type() <span class="bold"><b>const</b></span></a>;
};</pre></div><div class="refsect1" lang="en"><h2>Description</h2><div class="refsect2" lang="en"><h3><a name="id2623685construct-copy-destruct"></a><tt class="computeroutput">any</tt> construct/copy/destruct</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><a name="id2828868"></a>any();</pre><p><b><span class="term">Postconditions</span></b>:
<tt class="computeroutput">this-&gt;<a href="class.boost.any.html#id2827762">empty</a>()</tt></p></li><li><pre class="literallayout"><a name="id2828883"></a>any(<span class="bold"><b>const</b></span> any &amp; other);</pre><p><b><span class="term">Effects</span></b>:
Copy constructor that copies content of
<tt class="computeroutput">other</tt> into new instance, so that any content
is equivalent in both type and value to the content of
<tt class="computeroutput">other</tt>, or empty if <tt class="computeroutput">other</tt> is
empty. <br><b><span class="term">Throws</span></b>:
May fail with a
<tt class="computeroutput">std::bad_alloc</tt>
exception or any exceptions arising from the copy
constructor of the contained type.</p></li><li><pre class="literallayout"><a name="id2828939"></a><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> ValueType&gt; any(<span class="bold"><b>const</b></span> ValueType &amp; value);</pre><p><b><span class="term">Effects</span></b>:
Makes a copy of <tt class="computeroutput">value</tt>, so
that the initial content of the new instance is equivalent
in both type and value to
<tt class="computeroutput">value</tt>.<br><b><span class="term">Throws</span></b>:
<tt class="computeroutput">std::bad_alloc</tt>
or any exceptions arising from the copy constructor of the
contained type.</p></li><li><pre class="literallayout"><a name="id2829010"></a>any &amp; <span class="bold"><b>operator</b></span>=(<span class="bold"><b>const</b></span> any &amp; rhs);</pre><p><b><span class="term">Effects</span></b>:
Copies content of <tt class="computeroutput">rhs</tt> into
current instance, discarding previous content, so that the
new content is equivalent in both type and value to the
content of <tt class="computeroutput">rhs</tt>, or empty if
<tt class="computeroutput">rhs.<a href="class.boost.any.html#id2827762">empty</a>()</tt>.<br><b><span class="term">Throws</span></b>:
<tt class="computeroutput">std::bad_alloc</tt>
or any exceptions arising from the copy constructor of the
contained type. Assignment satisfies the strong guarantee
of exception safety.</p></li><li><pre class="literallayout"><a name="id2829076"></a><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> ValueType&gt; any &amp; <span class="bold"><b>operator</b></span>=(<span class="bold"><b>const</b></span> ValueType &amp; rhs);</pre><p><b><span class="term">Effects</span></b>:
Makes a copy of <tt class="computeroutput">rhs</tt>,
discarding previous content, so that the new content of is
equivalent in both type and value to
<tt class="computeroutput">rhs</tt>.<br><b><span class="term">Throws</span></b>:
<tt class="computeroutput">std::bad_alloc</tt>
or any exceptions arising from the copy constructor of the
contained type. Assignment satisfies the strong guarantee
of exception safety.</p></li><li><pre class="literallayout"><a name="id2828993"></a>~any();</pre><p><b><span class="term">Effects</span></b>:
Releases any and all resources used in
management of instance.<br><b><span class="term">Throws</span></b>:
Nothing.</p></li></ol></div></div><div class="refsect2" lang="en"><h3><a name="id2829139"></a><tt class="computeroutput">any</tt> modifiers</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><a name="id2829145"></a>any &amp; swap(any &amp; rhs);</pre><p><b><span class="term">Effects</span></b>:
Exchange of the contents of
<tt class="computeroutput">*this</tt> and
<tt class="computeroutput">rhs</tt>.<br><b><span class="term">Returns</span></b>:
<tt class="computeroutput">*this</tt><br><b><span class="term">Throws</span></b>:
Nothing.</p></li></ol></div></div><div class="refsect2" lang="en"><h3><a name="id2827756"></a><tt class="computeroutput">any</tt> queries</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><a name="id2827762"></a><span class="bold"><b>bool</b></span> empty() <span class="bold"><b>const</b></span>;</pre><p><b><span class="term">Returns</span></b>:
<tt class="computeroutput">true</tt> if instance is
empty, otherwise <tt class="computeroutput">false</tt>.<br><b><span class="term">Throws</span></b>:
Will not throw.</p></li><li><pre class="literallayout"><a name="id2827796"></a><span class="bold"><b>const</b></span> std::type_info &amp; type() <span class="bold"><b>const</b></span>;</pre><p><b><span class="term">Returns</span></b>:
the <tt class="computeroutput">typeid</tt> of the
contained value if instance is non-empty, otherwise
<tt class="computeroutput">typeid(void)</tt>.<br><b><span class="term">Notes</span></b>:
Useful for querying against types known
either at compile time or only at
runtime.</p></li></ol></div></div></div></div><table width="100%"><tr><td align="left"><small></small></td><td align="right"><small>Copyright © 2001 Kevlin Henney</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class.boost.bad_any_cast.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="any.reference.html#header.boost.any.hpp"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="id2827840.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Class bad_any_cast </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Function any_cast</td></tr></table></div></body></html>
+8
View File
@@ -0,0 +1,8 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Class bad_any_cast</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="any.reference.html#header.boost.any.hpp" title="Header &lt;boost/any.hpp&gt;"><link rel="previous" href="any.reference.html" title="Reference"><link rel="next" href="class.boost.any.html" title="Class any"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="refentry" lang="en"><a name="class.boost.bad_any_cast"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">Class bad_any_cast</span></h2><p>boost::bad_any_cast &#8212; The exception thrown in the event of a failed
any_cast of an
any value.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
<span class="bold"><b>class</b></span> bad_any_cast : <span class="bold"><b>public</b></span> std::bad_cast {
<span class="bold"><b>public</b></span>:
  <a name="id2623670"></a><span class="bold"><b>const</b></span> <span class="bold"><b>char</b></span> * what() <span class="bold"><b>const</b></span>;
};</pre></div></div><table width="100%"><tr><td align="left"><small></small></td><td align="right"><small>Copyright © 2001 Kevlin Henney</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="any.reference.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="any.reference.html#header.boost.any.hpp"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="class.boost.any.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Reference </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Class any</td></tr></table></div></body></html>
+109
View File
@@ -0,0 +1,109 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Class template function</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="function.reference.html#header.boost.function.hpp" title="Header &lt;boost/function.hpp&gt;"><link rel="previous" href="class.boost.functionN.html" title="Class template functionN"><link rel="next" href="function.faq.html" title="Frequently Asked Questions"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"><link rel="section" href="class.boost.function.html#id2884268" title="Description"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="refentry" lang="en"><a name="class.boost.function"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">Class template function</span></h2><p>boost::function &#8212; A generalized function pointer that can be used for
callbacks or wrapping function objects.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> Signature, <span class="emphasis"><em> // Function type R (T1, T2, ..., TN)</em></span>
         <span class="bold"><b>typename</b></span> Allocator = std::allocator&lt;void&gt; &gt;
<span class="bold"><b>class</b></span> function : <span class="bold"><b>public</b></span> <a href="class.boost.functionN.html" title="Class template functionN">functionN</a>&lt;R, T1, T2, ..., TN, Allocator&gt; {
<span class="bold"><b>public</b></span>:
  <span class="emphasis"><em>// types</em></span>
  <span class="bold"><b>typedef</b></span> R         result_type;         
  <span class="bold"><b>typedef</b></span> Allocator allocator_type;      
  <span class="bold"><b>typedef</b></span> T1        argument_type;        <span class="emphasis"><em>// If N == 1</em></span>
  <span class="bold"><b>typedef</b></span> T1        first_argument_type;  <span class="emphasis"><em>// If N == 2</em></span>
  <span class="bold"><b>typedef</b></span> T2        second_argument_type; <span class="emphasis"><em>// If N == 2</em></span>
  <span class="bold"><b>typedef</b></span> T1        arg1_type;           
  <span class="bold"><b>typedef</b></span> T2        arg2_type;           
     .
     .
     .
  <span class="bold"><b>typedef</b></span> TN        argN_type;           
  <span class="emphasis"><em>// static constants</em></span>
  <span class="bold"><b>static</b></span> <span class="bold"><b>const</b></span> <span class="bold"><b>int</b></span> arity = N;
  <span class="emphasis"><em>// <a href="class.boost.function.html#id2747518construct-copy-destruct">construct/copy/destruct</a></em></span>
  <a href="class.boost.function.html#id2821169">function()</a>;
  <a href="class.boost.function.html#id2821190">function(<span class="bold"><b>const</b></span> functionN&amp;)</a>;
  <a href="class.boost.function.html#id2821239">function(<span class="bold"><b>const</b></span> function&amp;)</a>;
  <a href="class.boost.function.html#id2821288"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> F&gt; function(F)</a>;
  <a href="class.boost.function.html#id2834405">function&amp; <span class="bold"><b>operator</b></span>=(<span class="bold"><b>const</b></span> functionN&amp;)</a>;
  <a href="class.boost.function.html#id2820958">function&amp; <span class="bold"><b>operator</b></span>=(<span class="bold"><b>const</b></span> function&amp;)</a>;
  <a href="class.boost.function.html#id2834383">~function()</a>;
  <span class="emphasis"><em>// <a href="class.boost.function.html#id2821009">modifiers</a></em></span>
  <a href="class.boost.function.html#id2821015"><span class="bold"><b>void</b></span> swap(<span class="bold"><b>const</b></span> function&amp;)</a>;
  <a href="class.boost.function.html#id2821057"><span class="bold"><b>void</b></span> clear()</a>;
  <span class="emphasis"><em>// <a href="class.boost.function.html#id2821084">capacity</a></em></span>
  <a href="class.boost.function.html#id2833437"><span class="bold"><b>bool</b></span> empty() <span class="bold"><b>const</b></span></a>;
  <a href="class.boost.function.html#id2833472"><span class="bold"><b>operator</b></span> safe_bool() <span class="bold"><b>const</b></span></a>;
  <a href="class.boost.function.html#id2833516"><span class="bold"><b>bool</b></span> <span class="bold"><b>operator</b></span>!() <span class="bold"><b>const</b></span></a>;
  <span class="emphasis"><em>// <a href="class.boost.function.html#id2833546">invocation</a></em></span>
  <a href="class.boost.function.html#id2833552">result_type <span class="bold"><b>operator</b></span>()(arg1_type, arg2_type, ..., argN_type) <span class="bold"><b>const</b></span></a>;
};
<span class="emphasis"><em>// <a href="class.boost.function.html#id2700310">specialized algorithms</a></em></span>
<span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> Signature, <span class="bold"><b>typename</b></span> Allocator&gt;
  <span class="bold"><b>void</b></span> <a href="class.boost.function.html#id2700316">swap</a>(<a href="class.boost.function.html" title="Class template function">function</a>&lt;Signature, Allocator&gt;&amp;, <a href="class.boost.function.html" title="Class template function">function</a>&lt;Signature, Allocator&gt;&amp;);
<span class="emphasis"><em>// <a href="class.boost.function.html#id2747987">undefined operators</a></em></span>
<span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> Signature1, <span class="bold"><b>typename</b></span> Allocator1, <span class="bold"><b>typename</b></span> Signature2,
         <span class="bold"><b>typename</b></span> Allocator2&gt;
  <span class="bold"><b>void</b></span> <a href="class.boost.function.html#id2747993"><span class="bold"><b>operator</b></span>==</a>(<span class="bold"><b>const</b></span> <a href="class.boost.function.html" title="Class template function">function</a>&lt;Signature1, Allocator1&gt;&amp;,
                  <span class="bold"><b>const</b></span> <a href="class.boost.function.html" title="Class template function">function</a>&lt;Signature2, Allocator2&gt;&amp;);
<span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> Signature1, <span class="bold"><b>typename</b></span> Allocator1, <span class="bold"><b>typename</b></span> Signature2,
         <span class="bold"><b>typename</b></span> Allocator2&gt;
  <span class="bold"><b>void</b></span> <a href="class.boost.function.html#id2748081"><span class="bold"><b>operator</b></span>!=</a>(<span class="bold"><b>const</b></span> <a href="class.boost.function.html" title="Class template function">function</a>&lt;Signature1, Allocator1&gt;&amp;,
                  <span class="bold"><b>const</b></span> <a href="class.boost.function.html" title="Class template function">function</a>&lt;Signature2, Allocator2&gt;&amp;);</pre></div><div class="refsect1" lang="en"><h2>Description</h2><p>
Class template <a href="class.boost.function.html" title="Class template function">function</a> is a thin wrapper
around the numbered class templates <a href="class.boost.functionN.html" title="Class template functionN">function0</a>, <a href="class.boost.functionN.html" title="Class template functionN">function1</a>, etc. It accepts a
function type with N arguments and will will derive from
<a href="class.boost.functionN.html" title="Class template functionN">functionN</a> instantiated with the arguments it receives.
The semantics of all operations in class template
<a href="class.boost.function.html" title="Class template function">function</a> are equivalent to that of the underlying
<a href="class.boost.functionN.html" title="Class template functionN">functionN</a> object, although additional member
functions are required to allow proper copy construction and
copy assignment of function objects.
</p><div class="refsect2" lang="en"><h3><a name="id2747518construct-copy-destruct"></a><tt class="computeroutput">function</tt> construct/copy/destruct</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><a name="id2821169"></a>function();</pre><p><b><span class="term">Postconditions</span></b>:
<tt class="computeroutput">this-&gt;<a href="class.boost.function.html#id2833437">empty</a>()</tt><br><b><span class="term">Throws</span></b>:
Will not throw.</p></li><li><pre class="literallayout"><a name="id2821190"></a>function(<span class="bold"><b>const</b></span> functionN&amp; f);</pre><p><b><span class="term">Postconditions</span></b>:
Contains a copy of the <tt class="computeroutput">f</tt>'s target, if it has one, or is empty if <tt class="computeroutput">f.<a href="class.boost.function.html#id2833437">empty</a>()</tt>.<br><b><span class="term">Throws</span></b>:
Will not throw unless copying the target of <tt class="computeroutput">f</tt> throws.</p></li><li><pre class="literallayout"><a name="id2821239"></a>function(<span class="bold"><b>const</b></span> function&amp; f);</pre><p><b><span class="term">Postconditions</span></b>:
Contains a copy of the <tt class="computeroutput">f</tt>'s target, if it has one, or is empty if <tt class="computeroutput">f.<a href="class.boost.function.html#id2833437">empty</a>()</tt>.<br><b><span class="term">Throws</span></b>:
Will not throw unless copying the target of <tt class="computeroutput">f</tt> throws.</p></li><li><pre class="literallayout"><a name="id2821288"></a><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> F&gt; function(F f);</pre><p><b><span class="term">Requires</span></b>:
F is a function object Callable from <tt class="computeroutput">this</tt>.<br><b><span class="term">Postconditions</span></b>:
<tt class="computeroutput">*this</tt> targets a copy of <tt class="computeroutput">f</tt> if <tt class="computeroutput">f</tt> is nonempty, or <tt class="computeroutput">this-&gt;<a href="class.boost.function.html#id2833437">empty</a>()</tt> if <tt class="computeroutput">f</tt> is empty.<br><b><span class="term">Throws</span></b>:
Will not throw when <tt class="computeroutput">f</tt> is a stateless function object.</p></li><li><pre class="literallayout"><a name="id2834405"></a>function&amp; <span class="bold"><b>operator</b></span>=(<span class="bold"><b>const</b></span> functionN&amp; f);</pre><p><b><span class="term">Postconditions</span></b>:
<tt class="computeroutput">*this</tt> targets a copy of <tt class="computeroutput">f</tt>'s target, if it has one, or is empty if <tt class="computeroutput">f.<a href="class.boost.function.html#id2833437">empty</a>()</tt><br><b><span class="term">Throws</span></b>:
Will not throw when the target of <tt class="computeroutput">f</tt> is a stateless function object or a reference to the function object.</p></li><li><pre class="literallayout"><a name="id2820958"></a>function&amp; <span class="bold"><b>operator</b></span>=(<span class="bold"><b>const</b></span> function&amp; f);</pre><p><b><span class="term">Postconditions</span></b>:
<tt class="computeroutput">*this</tt> targets a copy of <tt class="computeroutput">f</tt>'s target, if it has one, or is empty if <tt class="computeroutput">f.<a href="class.boost.function.html#id2833437">empty</a>()</tt><br><b><span class="term">Throws</span></b>:
Will not throw when the target of <tt class="computeroutput">f</tt> is a stateless function object or a reference to the function object.</p></li><li><pre class="literallayout"><a name="id2834383"></a>~function();</pre><p><b><span class="term">Effects</span></b>:
If <tt class="computeroutput">!this-&gt;<a href="class.boost.function.html#id2833437">empty</a>()</tt>, destroys the target of <tt class="computeroutput">this</tt>.</p></li></ol></div></div><div class="refsect2" lang="en"><h3><a name="id2821009"></a><tt class="computeroutput">function</tt> modifiers</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><a name="id2821015"></a><span class="bold"><b>void</b></span> swap(<span class="bold"><b>const</b></span> function&amp; f);</pre><p><b><span class="term">Effects</span></b>:
Interchanges the targets of <tt class="computeroutput">*this</tt> and <tt class="computeroutput">f</tt>.<br><b><span class="term">Throws</span></b>:
Will not throw.</p></li><li><pre class="literallayout"><a name="id2821057"></a><span class="bold"><b>void</b></span> clear();</pre><p><b><span class="term">Postconditions</span></b>:
<tt class="computeroutput">this-&gt;<a href="class.boost.function.html#id2833437">empty</a>()</tt><br><b><span class="term">Throws</span></b>:
Will not throw.</p></li></ol></div></div><div class="refsect2" lang="en"><h3><a name="id2821084"></a><tt class="computeroutput">function</tt> capacity</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><a name="id2833437"></a><span class="bold"><b>bool</b></span> empty() <span class="bold"><b>const</b></span>;</pre><p><b><span class="term">Returns</span></b>:
<tt class="computeroutput">true</tt> if <tt class="computeroutput">this</tt> has a target, and <tt class="computeroutput">false</tt> otherwise.<br><b><span class="term">Throws</span></b>:
Will not throw.</p></li><li><pre class="literallayout"><a name="id2833472"></a><span class="bold"><b>operator</b></span> safe_bool() <span class="bold"><b>const</b></span>;</pre><p><b><span class="term">Returns</span></b>:
A <tt class="computeroutput">safe_bool</tt> that evaluates <tt class="computeroutput">false</tt> in a boolean context when <tt class="computeroutput">this-&gt;<a href="class.boost.function.html#id2833437">empty</a>()</tt>, and <tt class="computeroutput">true</tt> otherwise.<br><b><span class="term">Throws</span></b>:
Will not throw.</p></li><li><pre class="literallayout"><a name="id2833516"></a><span class="bold"><b>bool</b></span> <span class="bold"><b>operator</b></span>!() <span class="bold"><b>const</b></span>;</pre><p><b><span class="term">Returns</span></b>:
<tt class="computeroutput">this-&gt;<a href="class.boost.function.html#id2833437">empty</a>()</tt><br><b><span class="term">Throws</span></b>:
Will not throw.</p></li></ol></div></div><div class="refsect2" lang="en"><h3><a name="id2833546"></a><tt class="computeroutput">function</tt> invocation</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><a name="id2833552"></a>result_type <span class="bold"><b>operator</b></span>()(arg1_type a1, arg2_type a2, ... , argN_type aN) <span class="bold"><b>const</b></span>;</pre><p><b><span class="term">Effects</span></b>:
<tt class="computeroutput">f(a1, a2, ..., aN)</tt>, where <tt class="computeroutput">f</tt> is the target of <tt class="computeroutput">*this</tt>.<br><b><span class="term">Returns</span></b>:
if <tt class="computeroutput">R</tt> is <tt class="computeroutput">void</tt>, nothing is returned; otherwise, the return value of the call to <tt class="computeroutput">f</tt> is returned.<br><b><span class="term">Throws</span></b>:
<tt class="computeroutput"><a href="id2837192.html" title="Class bad_function_call">bad_function_call</a></tt> if <tt class="computeroutput">!this-&gt;<a href="class.boost.function.html#id2833437">empty</a>()</tt>. Otherwise, may through any exception thrown by the target function <tt class="computeroutput">f</tt>.</p></li></ol></div></div><div class="refsect2" lang="en"><h3><a name="id2700310"></a><tt class="computeroutput">function</tt> specialized algorithms</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> Signature, <span class="bold"><b>typename</b></span> Allocator&gt;
  <span class="bold"><b>void</b></span> <a name="id2700316"></a>swap(<a href="class.boost.function.html" title="Class template function">function</a>&lt;Signature, Allocator&gt;&amp; f1,
            <a href="class.boost.function.html" title="Class template function">function</a>&lt;Signature, Allocator&gt;&amp; f2);</pre><p><b><span class="term">Effects</span></b>:
<tt class="computeroutput">f1.<a href="class.boost.function.html#id2821015">swap</a>(f2)</tt><br><b><span class="term">Throws</span></b>:
Will not throw.</p></li></ol></div></div><div class="refsect2" lang="en"><h3><a name="id2747987"></a><tt class="computeroutput">function</tt> undefined operators</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> Signature1, <span class="bold"><b>typename</b></span> Allocator1, <span class="bold"><b>typename</b></span> Signature2,
         <span class="bold"><b>typename</b></span> Allocator2&gt;
  <span class="bold"><b>void</b></span> <a name="id2747993"></a><span class="bold"><b>operator</b></span>==(<span class="bold"><b>const</b></span> <a href="class.boost.function.html" title="Class template function">function</a>&lt;Signature1, Allocator1&gt;&amp; f1,
                  <span class="bold"><b>const</b></span> <a href="class.boost.function.html" title="Class template function">function</a>&lt;Signature2, Allocator2&gt;&amp; f2);</pre><p><b><span class="term">Notes</span></b>:
This function must be left undefined.<br><b><span class="term">Rationale</span></b>:
The <tt class="computeroutput">safe_bool</tt> conversion opens a loophole whereby two function instances can be compared via <tt class="computeroutput">==</tt>. This undefined <tt class="computeroutput">void operator ==</tt> closes the loophole and ensures a compile-time or link-time error.</p></li><li><pre class="literallayout"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> Signature1, <span class="bold"><b>typename</b></span> Allocator1, <span class="bold"><b>typename</b></span> Signature2,
         <span class="bold"><b>typename</b></span> Allocator2&gt;
  <span class="bold"><b>void</b></span> <a name="id2748081"></a><span class="bold"><b>operator</b></span>!=(<span class="bold"><b>const</b></span> <a href="class.boost.function.html" title="Class template function">function</a>&lt;Signature1, Allocator1&gt;&amp; f1,
                  <span class="bold"><b>const</b></span> <a href="class.boost.function.html" title="Class template function">function</a>&lt;Signature2, Allocator2&gt;&amp; f2);</pre><p><b><span class="term">Notes</span></b>:
This function must be left undefined.<br><b><span class="term">Rationale</span></b>:
The <tt class="computeroutput">safe_bool</tt> conversion opens a loophole whereby two function instances can be compared via <tt class="computeroutput">!=</tt>. This undefined <tt class="computeroutput">void operator !=</tt> closes the loophole and ensures a compile-time or link-time error.</p></li></ol></div></div></div></div><table width="100%"><tr><td align="left"><small>Last revised: February 19, 2003 at 22:46:09 GMT</small></td><td align="right"><small>Copyright © 2001-2003 Douglas Gregor</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class.boost.functionN.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="function.reference.html#header.boost.function.hpp"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="function.faq.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Class template functionN </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Frequently Asked Questions</td></tr></table></div></body></html>
+99
View File
@@ -0,0 +1,99 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Class template functionN</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="function.reference.html#header.boost.function.hpp" title="Header &lt;boost/function.hpp&gt;"><link rel="previous" href="class.boost.function_base.html" title="Class function_base"><link rel="next" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"><link rel="section" href="class.boost.functionN.html#id2882120" title="Description"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="refentry" lang="en"><a name="class.boost.functionN"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">Class template functionN</span></h2><p>boost::functionN &#8212; A set of generalized function pointers that can be used for callbacks or wrapping function objects.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> R, <span class="bold"><b>typename</b></span> T1, <span class="bold"><b>typename</b></span> T2, ..., <span class="bold"><b>typename</b></span> TN,
         <span class="bold"><b>typename</b></span> Allocator = std::allocator&lt;void&gt; &gt;
<span class="bold"><b>class</b></span> functionN : <span class="bold"><b>public</b></span> <a href="class.boost.function_base.html" title="Class function_base">function_base</a> {
<span class="bold"><b>public</b></span>:
  <span class="emphasis"><em>// types</em></span>
  <span class="bold"><b>typedef</b></span> R         result_type;         
  <span class="bold"><b>typedef</b></span> Allocator allocator_type;      
  <span class="bold"><b>typedef</b></span> T1        argument_type;        <span class="emphasis"><em>// If N == 1</em></span>
  <span class="bold"><b>typedef</b></span> T1        first_argument_type;  <span class="emphasis"><em>// If N == 2</em></span>
  <span class="bold"><b>typedef</b></span> T2        second_argument_type; <span class="emphasis"><em>// If N == 2</em></span>
  <span class="bold"><b>typedef</b></span> T1        arg1_type;           
  <span class="bold"><b>typedef</b></span> T2        arg2_type;           
     .
     .
     .
  <span class="bold"><b>typedef</b></span> TN        argN_type;           
  <span class="emphasis"><em>// static constants</em></span>
  <span class="bold"><b>static</b></span> <span class="bold"><b>const</b></span> <span class="bold"><b>int</b></span> arity = N;
  <span class="emphasis"><em>// <a href="class.boost.functionN.html#id2720100construct-copy-destruct">construct/copy/destruct</a></em></span>
  <a href="class.boost.functionN.html#id2746690">functionN()</a>;
  <a href="class.boost.functionN.html#id2699960">functionN(<span class="bold"><b>const</b></span> functionN&amp;)</a>;
  <a href="class.boost.functionN.html#id2832222"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> F&gt; functionN(F)</a>;
  <a href="class.boost.functionN.html#id2832562">functionN&amp; <span class="bold"><b>operator</b></span>=(<span class="bold"><b>const</b></span> functionN&amp;)</a>;
  <a href="class.boost.functionN.html#id2832544">~functionN()</a>;
  <span class="emphasis"><em>// <a href="class.boost.functionN.html#id2826241">modifiers</a></em></span>
  <a href="class.boost.functionN.html#id2826247"><span class="bold"><b>void</b></span> swap(<span class="bold"><b>const</b></span> functionN&amp;)</a>;
  <a href="class.boost.functionN.html#id2728923"><span class="bold"><b>void</b></span> clear()</a>;
  <span class="emphasis"><em>// <a href="class.boost.functionN.html#id2728950">capacity</a></em></span>
  <a href="class.boost.functionN.html#id2728955"><span class="bold"><b>bool</b></span> empty() <span class="bold"><b>const</b></span></a>;
  <a href="class.boost.functionN.html#id2765962"><span class="bold"><b>operator</b></span> safe_bool() <span class="bold"><b>const</b></span></a>;
  <a href="class.boost.functionN.html#id2766007"><span class="bold"><b>bool</b></span> <span class="bold"><b>operator</b></span>!() <span class="bold"><b>const</b></span></a>;
  <span class="emphasis"><em>// <a href="class.boost.functionN.html#id2805174">invocation</a></em></span>
  <a href="class.boost.functionN.html#id2805179">result_type <span class="bold"><b>operator</b></span>()(arg1_type, arg2_type, ..., argN_type) <span class="bold"><b>const</b></span></a>;
};
<span class="emphasis"><em>// <a href="class.boost.functionN.html#id2837093">specialized algorithms</a></em></span>
<span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> T1, <span class="bold"><b>typename</b></span> T2, ..., <span class="bold"><b>typename</b></span> TN, <span class="bold"><b>typename</b></span> Allocator&gt;
  <span class="bold"><b>void</b></span> <a href="class.boost.functionN.html#id2837098">swap</a>(<a href="class.boost.functionN.html" title="Class template functionN">functionN</a>&lt;T1, T2, ..., TN, Allocator&gt;&amp;,
            <a href="class.boost.functionN.html" title="Class template functionN">functionN</a>&lt;T1, T2, ..., TN, Allocator&gt;&amp;);
<span class="emphasis"><em>// <a href="class.boost.functionN.html#id2818156">undefined operators</a></em></span>
<span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> T1, <span class="bold"><b>typename</b></span> T2, ..., <span class="bold"><b>typename</b></span> TN, <span class="bold"><b>typename</b></span> Allocator1,
         <span class="bold"><b>typename</b></span> U1, <span class="bold"><b>typename</b></span> U2, ..., <span class="bold"><b>typename</b></span> UN, <span class="bold"><b>typename</b></span> Allocator2&gt;
  <span class="bold"><b>void</b></span> <a href="class.boost.functionN.html#id2818162"><span class="bold"><b>operator</b></span>==</a>(<span class="bold"><b>const</b></span> <a href="class.boost.functionN.html" title="Class template functionN">functionN</a>&lt;T1, T2, ..., TN, Allocator1&gt;&amp;,
                  <span class="bold"><b>const</b></span> <a href="class.boost.functionN.html" title="Class template functionN">functionN</a>&lt;U1, U2, ..., UN, Allocator2&gt;&amp;);
<span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> T1, <span class="bold"><b>typename</b></span> T2, ..., <span class="bold"><b>typename</b></span> TN, <span class="bold"><b>typename</b></span> Allocator1,
         <span class="bold"><b>typename</b></span> U1, <span class="bold"><b>typename</b></span> U2, ..., <span class="bold"><b>typename</b></span> UN, <span class="bold"><b>typename</b></span> Allocator2&gt;
  <span class="bold"><b>void</b></span> <a href="class.boost.functionN.html#id2822734"><span class="bold"><b>operator</b></span>!=</a>(<span class="bold"><b>const</b></span> <a href="class.boost.functionN.html" title="Class template functionN">functionN</a>&lt;T1, T2, ..., TN, Allocator1&gt;&amp;,
                  <span class="bold"><b>const</b></span> <a href="class.boost.functionN.html" title="Class template functionN">functionN</a>&lt;U1, U2, ..., UN, Allocator2&gt;&amp;);</pre></div><div class="refsect1" lang="en"><h2>Description</h2><p>
Class template <a href="class.boost.functionN.html" title="Class template functionN">functionN</a> is actually a
family of related classes <a href="class.boost.functionN.html" title="Class template functionN">function0</a>,
<a href="class.boost.functionN.html" title="Class template functionN">function1</a>, etc., up to some
implementation-defined maximum. In this context,
<tt class="computeroutput">N</tt> refers to the number of
parameters.
</p><div class="refsect2" lang="en"><h3><a name="id2720100construct-copy-destruct"></a><tt class="computeroutput">functionN</tt> construct/copy/destruct</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><a name="id2746690"></a>functionN();</pre><p><b><span class="term">Postconditions</span></b>:
<tt class="computeroutput">this-&gt;<a href="class.boost.functionN.html#id2728955">empty</a>()</tt><br><b><span class="term">Throws</span></b>:
Will not throw.</p></li><li><pre class="literallayout"><a name="id2699960"></a>functionN(<span class="bold"><b>const</b></span> functionN&amp; f);</pre><p><b><span class="term">Postconditions</span></b>:
Contains a copy of the <tt class="computeroutput">f</tt>'s target, if it has one, or is empty if <tt class="computeroutput">f.<a href="class.boost.functionN.html#id2728955">empty</a>()</tt>.<br><b><span class="term">Throws</span></b>:
Will not throw unless copying the target of <tt class="computeroutput">f</tt> throws.</p></li><li><pre class="literallayout"><a name="id2832222"></a><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> F&gt; functionN(F f);</pre><p><b><span class="term">Requires</span></b>:
F is a function object Callable from <tt class="computeroutput">this</tt>.<br><b><span class="term">Postconditions</span></b>:
<tt class="computeroutput">*this</tt> targets a copy of <tt class="computeroutput">f</tt> if <tt class="computeroutput">f</tt> is nonempty, or <tt class="computeroutput">this-&gt;<a href="class.boost.functionN.html#id2728955">empty</a>()</tt> if <tt class="computeroutput">f</tt> is empty.<br><b><span class="term">Throws</span></b>:
Will not throw when <tt class="computeroutput">f</tt> is a stateless function object.</p></li><li><pre class="literallayout"><a name="id2832562"></a>functionN&amp; <span class="bold"><b>operator</b></span>=(<span class="bold"><b>const</b></span> functionN&amp; f);</pre><p><b><span class="term">Postconditions</span></b>:
<tt class="computeroutput">*this</tt> targets a copy of <tt class="computeroutput">f</tt>'s target, if it has one, or is empty if <tt class="computeroutput">f.<a href="class.boost.functionN.html#id2728955">empty</a>()</tt>.<br><b><span class="term">Throws</span></b>:
Will not throw when the target of <tt class="computeroutput">f</tt> is a stateless function object or a reference to the function object.</p></li><li><pre class="literallayout"><a name="id2832544"></a>~functionN();</pre><p><b><span class="term">Effects</span></b>:
If <tt class="computeroutput">!this-&gt;<a href="class.boost.functionN.html#id2728955">empty</a>()</tt>, destroys the target of this.</p></li></ol></div></div><div class="refsect2" lang="en"><h3><a name="id2826241"></a><tt class="computeroutput">functionN</tt> modifiers</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><a name="id2826247"></a><span class="bold"><b>void</b></span> swap(<span class="bold"><b>const</b></span> functionN&amp; f);</pre><p><b><span class="term">Effects</span></b>:
Interchanges the targets of <tt class="computeroutput">*this</tt> and <tt class="computeroutput">f</tt>.<br><b><span class="term">Throws</span></b>:
Will not throw.</p></li><li><pre class="literallayout"><a name="id2728923"></a><span class="bold"><b>void</b></span> clear();</pre><p><b><span class="term">Postconditions</span></b>:
this-&gt;<a href="class.boost.functionN.html#id2728955">empty</a>()<br><b><span class="term">Throws</span></b>:
Will not throw.</p></li></ol></div></div><div class="refsect2" lang="en"><h3><a name="id2728950"></a><tt class="computeroutput">functionN</tt> capacity</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><a name="id2728955"></a><span class="bold"><b>bool</b></span> empty() <span class="bold"><b>const</b></span>;</pre><p><b><span class="term">Returns</span></b>:
<tt class="computeroutput">true</tt> if <tt class="computeroutput">this</tt> has a target, and <tt class="computeroutput">false</tt> otherwise.<br><b><span class="term">Throws</span></b>:
Will not throw.</p></li><li><pre class="literallayout"><a name="id2765962"></a><span class="bold"><b>operator</b></span> safe_bool() <span class="bold"><b>const</b></span>;</pre><p><b><span class="term">Returns</span></b>:
A <tt class="computeroutput">safe_bool</tt> that evaluates <tt class="computeroutput">false</tt> in a boolean context when <tt class="computeroutput">this-&gt;<a href="class.boost.functionN.html#id2728955">empty</a>()</tt>, and <tt class="computeroutput">true</tt> otherwise.<br><b><span class="term">Throws</span></b>:
Will not throw.</p></li><li><pre class="literallayout"><a name="id2766007"></a><span class="bold"><b>bool</b></span> <span class="bold"><b>operator</b></span>!() <span class="bold"><b>const</b></span>;</pre><p><b><span class="term">Returns</span></b>:
<tt class="computeroutput">this-&gt;<a href="class.boost.functionN.html#id2728955">empty</a>()</tt><br><b><span class="term">Throws</span></b>:
Will not throw.</p></li></ol></div></div><div class="refsect2" lang="en"><h3><a name="id2805174"></a><tt class="computeroutput">functionN</tt> invocation</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><a name="id2805179"></a>result_type <span class="bold"><b>operator</b></span>()(arg1_type a1, arg2_type a2, ... , argN_type aN) <span class="bold"><b>const</b></span>;</pre><p><b><span class="term">Effects</span></b>:
<tt class="computeroutput">f(a1, a2, ..., aN)</tt>, where <tt class="computeroutput">f</tt> is the target of <tt class="computeroutput">*this</tt>.<br><b><span class="term">Returns</span></b>:
if <tt class="computeroutput">R</tt> is <tt class="computeroutput">void</tt>, nothing is returned; otherwise, the return value of the call to <tt class="computeroutput">f</tt> is returned.<br><b><span class="term">Throws</span></b>:
<tt class="computeroutput"><a href="id2837192.html" title="Class bad_function_call">bad_function_call</a></tt> if <tt class="computeroutput">!this-&gt;<a href="class.boost.functionN.html#id2728955">empty</a>()</tt>. Otherwise, may through any exception thrown by the target function <tt class="computeroutput">f</tt>.</p></li></ol></div></div><div class="refsect2" lang="en"><h3><a name="id2837093"></a><tt class="computeroutput">functionN</tt> specialized algorithms</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> T1, <span class="bold"><b>typename</b></span> T2, ..., <span class="bold"><b>typename</b></span> TN, <span class="bold"><b>typename</b></span> Allocator&gt;
  <span class="bold"><b>void</b></span> <a name="id2837098"></a>swap(<a href="class.boost.functionN.html" title="Class template functionN">functionN</a>&lt;T1, T2, ..., TN, Allocator&gt;&amp; f1,
            <a href="class.boost.functionN.html" title="Class template functionN">functionN</a>&lt;T1, T2, ..., TN, Allocator&gt;&amp; f2);</pre><p><b><span class="term">Effects</span></b>:
<tt class="computeroutput">f1.<a href="class.boost.functionN.html#id2826247">swap</a>(f2)</tt><br><b><span class="term">Throws</span></b>:
Will not throw.</p></li></ol></div></div><div class="refsect2" lang="en"><h3><a name="id2818156"></a><tt class="computeroutput">functionN</tt> undefined operators</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> T1, <span class="bold"><b>typename</b></span> T2, ..., <span class="bold"><b>typename</b></span> TN, <span class="bold"><b>typename</b></span> Allocator1,
         <span class="bold"><b>typename</b></span> U1, <span class="bold"><b>typename</b></span> U2, ..., <span class="bold"><b>typename</b></span> UN, <span class="bold"><b>typename</b></span> Allocator2&gt;
  <span class="bold"><b>void</b></span> <a name="id2818162"></a><span class="bold"><b>operator</b></span>==(<span class="bold"><b>const</b></span> <a href="class.boost.functionN.html" title="Class template functionN">functionN</a>&lt;T1, T2, ..., TN, Allocator1&gt;&amp; f1,
                  <span class="bold"><b>const</b></span> <a href="class.boost.functionN.html" title="Class template functionN">functionN</a>&lt;U1, U2, ..., UN, Allocator2&gt;&amp; f2);</pre><p><b><span class="term">Notes</span></b>:
This function must be left undefined.<br><b><span class="term">Rationale</span></b>:
The <tt class="computeroutput">safe_bool</tt> conversion opens a loophole whereby two function instances can be compared via <tt class="computeroutput">==</tt>. This undefined <tt class="computeroutput">void operator ==</tt> closes the loophole and ensures a compile-time or link-time error.</p></li><li><pre class="literallayout"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> T1, <span class="bold"><b>typename</b></span> T2, ..., <span class="bold"><b>typename</b></span> TN, <span class="bold"><b>typename</b></span> Allocator1,
         <span class="bold"><b>typename</b></span> U1, <span class="bold"><b>typename</b></span> U2, ..., <span class="bold"><b>typename</b></span> UN, <span class="bold"><b>typename</b></span> Allocator2&gt;
  <span class="bold"><b>void</b></span> <a name="id2822734"></a><span class="bold"><b>operator</b></span>!=(<span class="bold"><b>const</b></span> <a href="class.boost.functionN.html" title="Class template functionN">functionN</a>&lt;T1, T2, ..., TN, Allocator1&gt;&amp; f1,
                  <span class="bold"><b>const</b></span> <a href="class.boost.functionN.html" title="Class template functionN">functionN</a>&lt;U1, U2, ..., UN, Allocator2&gt;&amp; f2);</pre><p><b><span class="term">Notes</span></b>:
This function must be left undefined.<br><b><span class="term">Rationale</span></b>:
The <tt class="computeroutput">safe_bool</tt> conversion opens a loophole whereby two function instances can be compared via <tt class="computeroutput">!=</tt>. This undefined <tt class="computeroutput">void operator !=</tt> closes the loophole and ensures a compile-time or link-time error.</p></li></ol></div></div></div></div><table width="100%"><tr><td align="left"><small>Last revised: February 19, 2003 at 22:46:09 GMT</small></td><td align="right"><small>Copyright © 2001-2003 Douglas Gregor</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class.boost.function_base.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="function.reference.html#header.boost.function.hpp"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="class.boost.function.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Class function_base </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Class template function</td></tr></table></div></body></html>
+12
View File
@@ -0,0 +1,12 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Class function_base</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="function.reference.html#header.boost.function.hpp" title="Header &lt;boost/function.hpp&gt;"><link rel="previous" href="id2837192.html" title="Class bad_function_call"><link rel="next" href="class.boost.functionN.html" title="Class template functionN"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"><link rel="section" href="class.boost.function_base.html#id2881255" title="Description"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="refentry" lang="en"><a name="class.boost.function_base"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">Class function_base</span></h2><p>boost::function_base &#8212; The common base class for all Boost.Function
objects. Objects of type function_base may not be created
directly.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
<span class="bold"><b>class</b></span> function_base {
<span class="bold"><b>public</b></span>:
  <span class="emphasis"><em>// <a href="class.boost.function_base.html#id2747963">capacity</a></em></span>
  <a href="class.boost.function_base.html#id2720063"><span class="bold"><b>bool</b></span> empty() <span class="bold"><b>const</b></span></a>;
};</pre></div><div class="refsect1" lang="en"><h2>Description</h2><div class="refsect2" lang="en"><h3><a name="id2747963"></a><tt class="computeroutput">function_base</tt> capacity</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><a name="id2720063"></a><span class="bold"><b>bool</b></span> empty() <span class="bold"><b>const</b></span>;</pre><p><b><span class="term">Returns</span></b>:
<tt class="computeroutput">true</tt> if <tt class="computeroutput">this</tt> has a target, and <tt class="computeroutput">false</tt> otherwise.<br><b><span class="term">Throws</span></b>:
Will not throw.</p></li></ol></div></div></div></div><table width="100%"><tr><td align="left"><small>Last revised: February 19, 2003 at 22:46:09 GMT</small></td><td align="right"><small>Copyright © 2001-2003 Douglas Gregor</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="id2837192.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="function.reference.html#header.boost.function.hpp"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="class.boost.functionN.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Class bad_function_call </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Class template functionN</td></tr></table></div></body></html>
+16
View File
@@ -0,0 +1,16 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Class template last_value</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="signals.reference.html#id2875832" title="Header &lt;boost/last_value.hpp&gt;"><link rel="previous" href="id2905241.html" title="Function template visit_each"><link rel="next" href="id2830650.html" title="Class last_value&lt;void&gt;"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"><link rel="section" href="class.boost.last_value.html#id2895295" title="Description"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="refentry" lang="en"><a name="class.boost.last_value"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">Class template last_value</span></h2><p>boost::last_value &#8212; Evaluate an InputIterator sequence and return the
last value in the sequence.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> T&gt;
<span class="bold"><b>class</b></span> last_value {
<span class="bold"><b>public</b></span>:
  <span class="emphasis"><em>// types</em></span>
  <span class="bold"><b>typedef</b></span> T result_type;
  <span class="emphasis"><em>// <a href="class.boost.last_value.html#id2900055">invocation</a></em></span>
  <span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> InputIterator&gt;
    result_type <a href="class.boost.last_value.html#id2897944"><span class="bold"><b>operator</b></span>()</a>(InputIterator, InputIterator) <span class="bold"><b>const</b></span>;
};</pre></div><div class="refsect1" lang="en"><h2>Description</h2><div class="refsect2" lang="en"><h3><a name="id2900055"></a><tt class="computeroutput">last_value</tt> invocation</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> InputIterator&gt;
  result_type <a name="id2897944"></a><span class="bold"><b>operator</b></span>()(InputIterator first, InputIterator last) <span class="bold"><b>const</b></span>;</pre><p><b><span class="term">Requires</span></b>:
<tt class="computeroutput">first != last</tt><br><b><span class="term">Effects</span></b>:
Dereferences every iterator in the sequence <tt class="computeroutput">[first, last)</tt>.<br><b><span class="term">Returns</span></b>:
The result of dereferencing the iterator <tt class="computeroutput">last-1</tt>.</p></li></ol></div></div><div class="refsect2" lang="en"><h3>Specializations</h3><div class="itemizedlist"><ul type="disc"><li><p><a href="id2830650.html" title="Class last_value&lt;void&gt;">Class last_value&lt;void&gt;</a></p></li></ul></div></div></div></div><table width="100%"><tr><td align="left"><small></small></td><td align="right"><small>Copyright © 2001-2003 Douglas Gregor</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="id2905241.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="signals.reference.html#id2875832"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="id2830650.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Function template visit_each </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Class last_value&lt;void&gt;</td></tr></table></div></body></html>
+21
View File
@@ -0,0 +1,21 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Class template signal</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="signals.reference.html#header.boost.signal.hpp" title="Header &lt;boost/signal.hpp&gt;"><link rel="previous" href="class.boost.signalN.html" title="Class template signalN"><link rel="next" href="class.boost.slot.html" title="Class template slot"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"><link rel="section" href="class.boost.signal.html#id2892409" title="Description"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="refentry" lang="en"><a name="class.boost.signal"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">Class template signal</span></h2><p>boost::signal &#8212; Safe multicast callback.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> Signature, <span class="emphasis"><em> // Function type R (T1, T2, ..., TN)</em></span>
         <span class="bold"><b>typename</b></span> Allocator = std::allocator&lt;void&gt;,
         <span class="bold"><b>typename</b></span> Combiner = <a href="class.boost.last_value.html" title="Class template last_value">last_value</a>&lt;R&gt;,
         <span class="bold"><b>typename</b></span> Group = int,
         <span class="bold"><b>typename</b></span> GroupCompare = std::less&lt;Group&gt;,
         <span class="bold"><b>typename</b></span> SlotFunction = <a href="class.boost.functionN.html" title="Class template functionN">functionN</a>&lt;Signature&gt; &gt;
<span class="bold"><b>class</b></span> signal : <span class="bold"><b>public</b></span> <a href="class.boost.signalN.html" title="Class template signalN">signalN</a>&lt;R, T1, T2, ..., TN, Combiner, Group, GroupCompare, SlotFunction&gt; {
<span class="bold"><b>public</b></span>:
  <span class="emphasis"><em>// <a href="class.boost.signal.html#id2876506construct-copy-destruct">construct/copy/destruct</a></em></span>
  <a href="class.boost.signal.html#id2876702">signal</a>(<span class="bold"><b>const</b></span> combiner_type&amp; = combiner_type(),
         <span class="bold"><b>const</b></span> group_compare_type&amp; = group_compare_type());
};</pre></div><div class="refsect1" lang="en"><h2>Description</h2><p>Class template <a href="class.boost.signal.html" title="Class template signal">signal</a> is a thin
wrapper around the numbered class templates <a href="class.boost.signalN.html" title="Class template signalN">signal0</a>, <a href="class.boost.signalN.html" title="Class template signalN">signal1</a>, etc. It accepts a function
type with N arguments instead of N separate arguments, and
derives from the appropriate <a href="class.boost.signalN.html" title="Class template signalN">signalN</a>
instantiation.</p><p>All functionality of this class template is in its base
class <a href="class.boost.signalN.html" title="Class template signalN">signalN</a>.</p><div class="refsect2" lang="en"><h3><a name="id2876506construct-copy-destruct"></a><tt class="computeroutput">signal</tt> construct/copy/destruct</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><a name="id2876702"></a>signal(<span class="bold"><b>const</b></span> combiner_type&amp; combiner = combiner_type(),
       <span class="bold"><b>const</b></span> group_compare_type&amp; compare = group_compare_type());</pre><p><b><span class="term">Effects</span></b>:
Initializes the base class with the given combiner
and comparison objects.</p></li></ol></div></div></div></div><table width="100%"><tr><td align="left"><small></small></td><td align="right"><small>Copyright © 2001-2003 Douglas Gregor</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class.boost.signalN.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="signals.reference.html#header.boost.signal.hpp"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="class.boost.slot.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Class template signalN </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Class template slot</td></tr></table></div></body></html>
+134
View File
@@ -0,0 +1,134 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Class template signalN</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="signals.reference.html#header.boost.signal.hpp" title="Header &lt;boost/signal.hpp&gt;"><link rel="previous" href="signals.reference.html" title="Reference"><link rel="next" href="class.boost.signal.html" title="Class template signal"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"><link rel="section" href="class.boost.signalN.html#id2891517" title="Description"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="refentry" lang="en"><a name="class.boost.signalN"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">Class template signalN</span></h2><p>boost::signalN &#8212; Set of safe multicast callback types.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> R, <span class="bold"><b>typename</b></span> T1, <span class="bold"><b>typename</b></span> T2, ..., <span class="bold"><b>typename</b></span> TN,
         <span class="bold"><b>typename</b></span> Combiner = <a href="class.boost.last_value.html" title="Class template last_value">last_value</a>&lt;R&gt;, <span class="bold"><b>typename</b></span> Group = int,
         <span class="bold"><b>typename</b></span> GroupCompare = std::less&lt;Group&gt;,
         <span class="bold"><b>typename</b></span> SlotFunction = <a href="class.boost.functionN.html" title="Class template functionN">functionN</a>&lt;R, T1, T2, ..., TN&gt; &gt;
<span class="bold"><b>class</b></span> signalN : <span class="bold"><b>public</b></span> <a href="id2852290.html" title="Class trackable">signals::trackable</a>, <span class="bold"><b>private</b></span> noncopyable {
<span class="bold"><b>public</b></span>:
  <span class="emphasis"><em>// types</em></span>
  <span class="bold"><b>typedef</b></span> typename Combiner::result_type result_type;         
  <span class="bold"><b>typedef</b></span> Combiner                       combiner_type;       
  <span class="bold"><b>typedef</b></span> Group                          group_type;          
  <span class="bold"><b>typedef</b></span> GroupCompare                   group_compare_type;  
  <span class="bold"><b>typedef</b></span> SlotFunction                   slot_function_type;  
  <span class="bold"><b>typedef</b></span> <a href="class.boost.slot.html" title="Class template slot">slot</a>&lt;SlotFunction&gt;             slot_type;           
  <span class="bold"><b>typedef</b></span> unspecified                    slot_result_type;    
  <span class="bold"><b>typedef</b></span> unspecified                    slot_call_iterator;  
  <span class="bold"><b>typedef</b></span> T1                             argument_type;        <span class="emphasis"><em>// If N == 1</em></span>
  <span class="bold"><b>typedef</b></span> T1                             first_argument_type;  <span class="emphasis"><em>// If N == 2</em></span>
  <span class="bold"><b>typedef</b></span> T2                             second_argument_type; <span class="emphasis"><em>// If N == 2</em></span>
  <span class="bold"><b>typedef</b></span> T1                             arg1_type;           
  <span class="bold"><b>typedef</b></span> T2                             arg2_type;           
     .
     .
     .
  <span class="bold"><b>typedef</b></span> TN                             argN_type;           
  <span class="emphasis"><em>// static constants</em></span>
  <span class="bold"><b>static</b></span> <span class="bold"><b>const</b></span> <span class="bold"><b>int</b></span> arity = N;
  <span class="emphasis"><em>// <a href="class.boost.signalN.html#id2855793construct-copy-destruct">construct/copy/destruct</a></em></span>
  <a href="class.boost.signalN.html#id2875800">signalN</a>(<span class="bold"><b>const</b></span> combiner_type&amp; = combiner_type(),
          <span class="bold"><b>const</b></span> group_compare_type&amp; = group_compare_type());
  <a href="class.boost.signalN.html#id2851500">~signalN()</a>;
  <span class="emphasis"><em>// <a href="class.boost.signalN.html#id2841740">connection management</a></em></span>
  <a href="class.boost.signalN.html#id2870792">signals::connection connect(<span class="bold"><b>const</b></span> slot_type&amp;)</a>;
  <a href="class.boost.signalN.html#id2885476">signals::connection connect(<span class="bold"><b>const</b></span> group_type&amp;, <span class="bold"><b>const</b></span> slot_type&amp;)</a>;
  <a href="class.boost.signalN.html#id2846925"><span class="bold"><b>void</b></span> disconnect(<span class="bold"><b>const</b></span> group_type&amp;)</a>;
  <a href="class.boost.signalN.html#id2859894"><span class="bold"><b>void</b></span> disconnect_all_slots()</a>;
  <a href="class.boost.signalN.html#id2881781"><span class="bold"><b>bool</b></span> empty() <span class="bold"><b>const</b></span></a>;
  <span class="emphasis"><em>// <a href="class.boost.signalN.html#id2853108">invocation</a></em></span>
  <a href="class.boost.signalN.html#id2867592">result_type <span class="bold"><b>operator</b></span>()(arg1_type, arg2_type, ..., argN_type)</a>;
  <a href="class.boost.signalN.html#id2841874">result_type <span class="bold"><b>operator</b></span>()(arg1_type, arg2_type, ..., argN_type) <span class="bold"><b>const</b></span></a>;
};</pre></div><div class="refsect1" lang="en"><h2>Description</h2><p>
The class template <a href="class.boost.signalN.html" title="Class template signalN">signalN</a> covers
several related classes signal0, signal1, signal2, etc.,
where the number suffix describes the number of function
parameters the signal and its connected slots will
take. Instead of enumerating all classes, a single pattern
<a href="class.boost.signalN.html" title="Class template signalN">signalN</a> will be described, where N
represents the number of function parameters.
</p><div class="refsect2" lang="en"><h3><a name="id2855793construct-copy-destruct"></a><tt class="computeroutput">signalN</tt> construct/copy/destruct</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><a name="id2875800"></a>signalN(<span class="bold"><b>const</b></span> combiner_type&amp; combiner = combiner_type(),
        <span class="bold"><b>const</b></span> group_compare_type&amp; compare = group_compare_type());</pre><p><b><span class="term">Effects</span></b>:
Initializes the signal to contain no slots, copies the given combiner into internal storage, and stores the given group comparison function object to compare groups.<br><b><span class="term">Postconditions</span></b>:
<tt class="computeroutput">this-&gt;<a href="class.boost.signalN.html#id2881781">empty</a>()</tt></p></li><li><pre class="literallayout"><a name="id2851500"></a>~signalN();</pre><p><b><span class="term">Effects</span></b>:
Disconnects all slots connected to <tt class="computeroutput">*this</tt>.</p></li></ol></div></div><div class="refsect2" lang="en"><h3><a name="id2841740"></a><tt class="computeroutput">signalN</tt> connection management</h3><div class="orderedlist"><ol type="1"><li><p><a name="id2841744"></a></p><pre class="literallayout"><a name="id2870792"></a>signals::connection connect(<span class="bold"><b>const</b></span> slot_type&amp; slot);
<a name="id2885476"></a>signals::connection connect(<span class="bold"><b>const</b></span> group_type&amp; group, <span class="bold"><b>const</b></span> slot_type&amp; slot);</pre><p><b><span class="term">Effects</span></b>:
Connects the signal this to the incoming slot. If
the slot is inactive, i.e., any of the trackable objects
bound by the slot call have been destroyed, then the call to
connect is a no-op. If the second version of
<tt class="computeroutput">connect</tt> is invoked, the
slot is associated with the given group.<br><b><span class="term">Returns</span></b>:
A
<tt class="computeroutput"><a href="id2890015.html" title="Class connection">signals::connection</a></tt>
object that references the newly-created connection between
the signal and the slot; if the slot is inactive, returns a
disconnected connection.<br><b><span class="term">Throws</span></b>:
This routine meets the strong exception guarantee,
where any exception thrown will cause the slot to not be
connected to the signal.<br><b><span class="term">Complexity</span></b>:
O(lg n) where n is the number of
slots known to the signal.<br><b><span class="term">Notes</span></b>:
It is unspecified whether connecting a slot while the
signal is calling will result in the slot being called
immediately.</p></li><li><pre class="literallayout"><a name="id2846925"></a><span class="bold"><b>void</b></span> disconnect(<span class="bold"><b>const</b></span> group_type&amp; group);</pre><p><b><span class="term">Effects</span></b>:
Any slots in the given group are disconnected.<br><b><span class="term">Throws</span></b>:
Will not throw unless a user destructor throws. If a
user destructor throws, not all slots in this group may be
disconnected.<br><b><span class="term">Complexity</span></b>:
O(lg n) + k where n is the number of slots known
to the signal and k is the number of slots in the
group.</p></li><li><pre class="literallayout"><a name="id2859894"></a><span class="bold"><b>void</b></span> disconnect_all_slots();</pre><p><b><span class="term">Effects</span></b>:
Disconnects all slots connected to the signal.<br><b><span class="term">Postconditions</span></b>:
<tt class="computeroutput">this-&gt;<a href="class.boost.signalN.html#id2881781">empty</a>()</tt>.<br><b><span class="term">Throws</span></b>:
If disconnecting a slot causes an exception to be
thrown, not all slots may be disconnected.<br><b><span class="term">Complexity</span></b>:
Linear in the number of slots known to the
signal.<br><b><span class="term">Notes</span></b>:
May be called at any time within the lifetime of the
signal, including during calls to the signal's slots.</p></li><li><pre class="literallayout"><a name="id2881781"></a><span class="bold"><b>bool</b></span> empty() <span class="bold"><b>const</b></span>;</pre><p><b><span class="term">Returns</span></b>:
<tt class="computeroutput">true</tt> if no slots
are connected to the signal, and
<tt class="computeroutput">false</tt> otherwise.<br><b><span class="term">Throws</span></b>:
Will not throw.<br><b><span class="term">Complexity</span></b>:
Linear in the number of slots known to the
signal.<br><b><span class="term">Rationale</span></b>:
Slots can disconnect at any point in time,
including while those same slots are being invoked. It is
therefore possible that the implementation must search
through a list of disconnected slots to determine if any
slots are still connected.</p></li></ol></div></div><div class="refsect2" lang="en"><h3><a name="id2853108"></a><tt class="computeroutput">signalN</tt> invocation</h3><div class="orderedlist"><ol type="1"><li><p><a name="id2867587"></a></p><pre class="literallayout"><a name="id2867592"></a>result_type <span class="bold"><b>operator</b></span>()(arg1_type a1, arg2_type a2, ... , argN_type aN);
<a name="id2841874"></a>result_type <span class="bold"><b>operator</b></span>()(arg1_type a1, arg2_type a2, ... , argN_type aN) <span class="bold"><b>const</b></span>;</pre><p><b><span class="term">Effects</span></b>:
Invokes the combiner with a
<tt class="computeroutput">slot_call_iterator</tt> range
[first, last) corresponding to the sequence of calls to the
slots connected to signal
<tt class="computeroutput">*this</tt>. Dereferencing an
iterator in this range causes a slot call with the given set
of parameters <tt class="computeroutput">(a1, a2, ...,
aN)</tt>, the result of which is returned from
the iterator dereference operation.<br><b><span class="term">Returns</span></b>:
The result returned by the combiner.<br><b><span class="term">Throws</span></b>:
If an exception is thrown by a slot call, or if the
combiner does not dereference any slot past some given slot,
all slots after that slot in the internal list of connected
slots will not be invoked.<br><b><span class="term">Notes</span></b>:
<p>Only the slots associated with iterators that are
actually dereferenced will be invoked. Multiple dereferences
of the same iterator will not result in multiple slot
invocations, because the return value of the slot will be
cached.</p><p>The <tt class="computeroutput">const</tt> version of
the function call operator will invoke the combiner as
<tt class="computeroutput">const</tt>, whereas the
non-<tt class="computeroutput">const</tt> version will
invoke the combiner as
non-<tt class="computeroutput">const</tt>.</p><p>Ordering between members of a given group or between
ungrouped slots is unspecified.</p><p>Calling the function call operator may invoke undefined
behavior if no slots are connected to the signal, depending
on the combiner used. The default combiner is well-defined
for zero slots when the return type is void but is undefined
when the return type is any other type (because there is no
way to synthesize a return value).</p></p></li></ol></div></div></div></div><table width="100%"><tr><td align="left"><small></small></td><td align="right"><small>Copyright © 2001-2003 Douglas Gregor</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="signals.reference.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="signals.reference.html#header.boost.signal.hpp"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="class.boost.signal.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Reference </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Class template signal</td></tr></table></div></body></html>
+17
View File
@@ -0,0 +1,17 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Class template slot</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="signals.reference.html#id2895664" title="Header &lt;boost/signals/slot.hpp&gt;"><link rel="previous" href="class.boost.signal.html" title="Class template signal"><link rel="next" href="id2852290.html" title="Class trackable"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"><link rel="section" href="class.boost.slot.html#id2892680" title="Description"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="refentry" lang="en"><a name="class.boost.slot"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">Class template slot</span></h2><p>boost::slot &#8212; Pass slots as function arguments.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> SlotFunction&gt;
<span class="bold"><b>class</b></span> slot {
<span class="bold"><b>public</b></span>:
  <span class="emphasis"><em>// <a href="class.boost.slot.html#id2871631construct-copy-destruct">construct/copy/destruct</a></em></span>
  <a href="class.boost.slot.html#id2860043"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> Slot&gt; slot(Slot)</a>;
};</pre></div><div class="refsect1" lang="en"><h2>Description</h2><div class="refsect2" lang="en"><h3><a name="id2871631construct-copy-destruct"></a><tt class="computeroutput">slot</tt> construct/copy/destruct</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><a name="id2860043"></a><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> Slot&gt; slot(Slot target);</pre><p><b><span class="term">Effects</span></b>:
<p>Invokes
<tt class="computeroutput"><a href="id2905241.html" title="Function template visit_each">visit_each</a></tt>
(unqualified) to discover pointers and references to
<tt class="computeroutput"><a href="id2852290.html" title="Class trackable">signals::trackable</a></tt>
objects in <tt class="computeroutput">target</tt>.</p><p>Initializes <tt class="computeroutput">this</tt> to
contain the incoming slot
<tt class="computeroutput">target</tt>, which may be any
function object with which a
<tt class="computeroutput">SlotFunction</tt> can be
constructed.</p></p></li></ol></div></div></div></div><table width="100%"><tr><td align="left"><small></small></td><td align="right"><small>Copyright © 2001-2003 Douglas Gregor</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class.boost.signal.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="signals.reference.html#id2895664"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="id2852290.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Class template signal </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Class trackable</td></tr></table></div></body></html>
+24
View File
@@ -0,0 +1,24 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Frequently Asked Questions</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="function.html" title="Boost.Function"><link rel="previous" href="class.boost.function.html" title="Class template function"><link rel="next" href="function.misc.html" title="Miscellaneous Notes"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="function.faq"></a>Frequently Asked Questions</h2></div></div><div></div></div><div class="qandaset"><dl><dt>1. <a href="function.faq.html#id2885834">I see void pointers; is this [mess] type safe?</a></dt><dt>2. <a href="function.faq.html#id2885869">Why are there workarounds for void returns? C++ allows them!</a></dt><dt>3. <a href="function.faq.html#id2885932">Why (function) cloning?</a></dt></dl><table border="0" summary="Q and A Set"><col align="left" width="1%"><tbody><tr class="question"><td align="left" valign="top"><a name="id2885834"></a><a name="id2885837"></a><b>1. </b></td><td align="left" valign="top"><p>I see void pointers; is this [mess] type safe?</p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p>Yes, <tt class="computeroutput">boost::function</tt> is type
safe even though it uses void pointers and pointers to functions
returning void and taking no arguments. Essentially, all type
information is encoded in the functions that manage and invoke
function pointers and function objects. Only these functions are
instantiated with the exact type that is pointed to by the void
pointer or pointer to void function. The reason that both are required
is that one may cast between void pointers and object pointers safely
or between different types of function pointers (provided you don't
invoke a function pointer with the wrong type). </p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2885869"></a><a name="id2885871"></a><b>2. </b></td><td align="left" valign="top"><p>Why are there workarounds for void returns? C++ allows them!</p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p>Void returns are permitted by the C++ standard, as in this code snippet:
</p><pre class="programlisting">void f();
void g() { return f(); }</pre><p>
</p><p> This is a valid usage of <tt class="computeroutput">boost::function</tt> because void returns are not used. With void returns, we would attempting to compile ill-formed code similar to:
</p><pre class="programlisting">int f();
void g() { return f(); }</pre><p>
</p><p> In essence, not using void returns allows
<tt class="computeroutput">boost::function</tt> to swallow a return value. This is
consistent with allowing the user to assign and invoke functions and
function objects with parameters that don't exactly match.</p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2885932"></a><a name="id2885934"></a><b>3. </b></td><td align="left" valign="top"><p>Why (function) cloning?</p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p>In November and December of 2000, the issue of cloning
vs. reference counting was debated at length and it was decided
that cloning gave more predictable semantics. I won't rehash the
discussion here, but if it cloning is incorrect for a particular
application a reference-counting allocator could be used.</p></td></tr></tbody></table></div></div><table width="100%"><tr><td align="left"><small>Last revised: February 19, 2003 at 22:46:09 GMT</small></td><td align="right"><small>Copyright © 2001-2003 Douglas Gregor</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class.boost.function.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="function.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="function.misc.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Class template function </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Miscellaneous Notes</td></tr></table></div></body></html>
+52
View File
@@ -0,0 +1,52 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>History &amp; Compatibility Notes</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="function.html" title="Boost.Function"><link rel="previous" href="function.html" title="Boost.Function"><link rel="next" href="function.tutorial.html" title="Tutorial"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="function.history"></a>History &amp; Compatibility Notes</h2></div></div><div></div></div><div class="itemizedlist"><ul type="disc" compact><li><p><span class="bold"><b>Version 1.30.0</b></span>: </p><div class="itemizedlist"><ul type="circle" compact><li><p>All features deprecated in version 1.29.0 have
been removed from Boost.Function.</p></li><li><p><tt class="computeroutput"><a href="class.boost.function.html" title="Class template function">boost::function</a></tt>
and <tt class="computeroutput"><a href="class.boost.functionN.html" title="Class template functionN">boost::functionN</a></tt> objects
can be assigned to 0 (semantically equivalent to calling
<tt class="computeroutput"><a href="class.boost.function.html#id2821057">clear</a>()</tt>) and
compared against 0 (semantically equivalent to calling
<tt class="computeroutput"><a href="class.boost.function.html#id2833437">empty</a>()</tt>).</p></li><li><p>The Boost.Function code is now generated
entirely by the <a href="../../libs/preprocessor/index.html" target="_top">Preprocessor</a> library,
so it is now possible to generate
<tt class="computeroutput"><a href="class.boost.function.html" title="Class template function">boost::function</a></tt> and
<tt class="computeroutput"><a href="class.boost.functionN.html" title="Class template functionN">boost::functionN</a></tt> class
templates for any number of arguments.</p></li><li><p>The
<a href="id2837192.html" title="Class bad_function_call">boost::bad_function_call</a> exception class
was introduced.</p></li></ul></div></li><li><p><span class="bold"><b>Version 1.29.0</b></span>:
Boost.Function has been partially redesigned to minimize the
interface and make it cleaner. Several seldom- or never-used
features of the older Boost.Function have been deprecated and will
be removed in the near future. Here is a list of features that have
been deprecated, the likely impact of the deprecations, and how to
adjust your code:
</p><div class="itemizedlist"><ul type="circle" compact><li><p>The <tt class="computeroutput">boost::function</tt> class template syntax has
changed. The old syntax, e.g., <tt class="computeroutput">boost::function&lt;int, float,
double, std::string&gt;</tt>, has been changed to a more natural
syntax <tt class="computeroutput">boost::function&lt;int (float, double,
std::string)&gt;</tt>, where all return and argument types are
encoded in a single function type parameter. Any other template
parameters (e.g., the <tt class="computeroutput">Allocator</tt>) follow this single
parameter.</p><p> The resolution to this change depends on the
abilities of your compiler: if your compiler supports template
partial specialization and can parse function types (most do), modify
your code to use the newer
syntax (preferable) or directly use one of the
<tt class="computeroutput">functionN</tt> classes whose syntax has not
changed. If your compiler does not support template partial
specialization or function types, you must take the latter option and
use the numbered Boost.Function classes. This option merely requires
changing types such as <tt class="computeroutput">boost::function&lt;void, int, int&gt;</tt>
to <tt class="computeroutput">boost::function2&lt;void, int, int&gt;</tt> (adding the number of
function arguments to the end of the class name).</p><p> Support for the old syntax with the
<tt class="computeroutput">boost::function</tt> class template will persist for a short
while, but will eventually be removed so that we can provide better
error messages and link compatibility. </p></li><li><p>The invocation
policy template parameter (<tt class="computeroutput">Policy</tt>) has been deprecated
and will be removed. There is no direct equivalent to this rarely
used feature.</p></li><li><p>The mixin template parameter
(<tt class="computeroutput">Mixin</tt>) has been deprecated and will be removed. There
is not direct equivalent to this rarely used feature.</p></li><li><p>The
<tt class="computeroutput">set</tt> methods have been deprecated and will be
removed. Use the assignment operator instead.</p></li></ul></div><p>
</p></li></ul></div></div><table width="100%"><tr><td align="left"><small>Last revised: February 19, 2003 at 22:46:09 GMT</small></td><td align="right"><small>Copyright © 2001-2003 Douglas Gregor</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="function.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="function.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="function.tutorial.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Boost.Function </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Tutorial</td></tr></table></div></body></html>
+21
View File
@@ -0,0 +1,21 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Boost.Function</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="index.html" title="The Boost C++ Libraries"><link rel="previous" href="ch01s04.html" title="Acknowledgements"><link rel="next" href="function.history.html" title="History &amp; Compatibility Notes"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"><link rel="section" href="function.html#function.intro" title="Introduction"><link rel="section" href="function.history.html" title="History &amp; Compatibility Notes"><link rel="section" href="function.tutorial.html" title="Tutorial"><link rel="section" href="function.reference.html" title="Reference"><link rel="section" href="function.faq.html" title="Frequently Asked Questions"><link rel="section" href="function.misc.html" title="Miscellaneous Notes"><link rel="section" href="function.testsuite.html" title="Testsuite"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="function"></a>Boost.Function</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Douglas</span> <span class="surname">Gregor</span></h3></div></div><div><p class="copyright">Copyright © 2001-2003 Douglas Gregor</p></div><div><div class="legalnotice"><p>Permission to copy, use, sell and distribute this software
is granted provided this copyright notice appears in all copies.
Permission to modify the code and to distribute modified code is
granted provided this copyright notice appears in all copies, and
a notice that the code was modified is included with the copyright
notice. </p><p> This software is provided &quot;as is&quot; without express or
implied warranty, and with no claim as to its suitability for any
purpose. </p></div></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="function.html#function.intro">Introduction</a></dt><dt><a href="function.history.html">History &amp; Compatibility Notes</a></dt><dt><a href="function.tutorial.html">Tutorial</a></dt><dd><dl><dt><a href="function.tutorial.html#id2879195">Basic Usage</a></dt><dt><a href="function.tutorial.html#id2879609">Free functions</a></dt><dt><a href="function.tutorial.html#id2879654">Member functions</a></dt><dt><a href="function.tutorial.html#id2879906">References to Functions</a></dt></dl></dd><dt><a href="function.reference.html">Reference</a></dt><dd><dl><dt><a href="function.reference.html#function.definitions">Definitions</a></dt><dt><a href="function.reference.html#header.boost.function.hpp">Header &lt;boost/function.hpp&gt;</a></dt></dl></dd><dt><a href="function.faq.html">Frequently Asked Questions</a></dt><dt><a href="function.misc.html">Miscellaneous Notes</a></dt><dd><dl><dt><a href="function.misc.html#id2885974">Boost.Function vs. Function Pointers</a></dt><dt><a href="function.misc.html#id2886053">Performance</a></dt><dd><dl><dt><a href="function.misc.html#id2886060">Function object wrapper size</a></dt><dt><a href="function.misc.html#id2886078">Copying efficiency</a></dt><dt><a href="function.misc.html#id2886105">Invocation efficiency</a></dt></dl></dd><dt><a href="function.misc.html#id2886122">Combatting virtual function &quot;bloat&quot;</a></dt><dt><a href="function.misc.html#id2886152">Acknowledgements</a></dt></dl></dd><dt><a href="function.testsuite.html">Testsuite</a></dt><dd><dl><dt><a href="function.testsuite.html#function.testsuite.acceptance">Acceptance tests</a></dt><dt><a href="function.testsuite.html#function.testsuite.negative">Negative tests</a></dt></dl></dd></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="function.intro"></a>Introduction</h2></div></div><div></div></div><p>The Boost.Function library contains a family of class templates
that are function object wrappers. The notion is similar to a
generalized callback. It shares features with function pointers in
that both define a call interface (e.g., a function taking two integer
arguments and returning a floating-point value) through which some
implementation can be called, and the implementation that is invoked
may change throughout the course of the program.</p><p> Generally, any place in which a function pointer would be used
to defer a call or make a callback, Boost.Function can be used instead
to allow the user greater flexibility in the implementation of the
target. Targets can be any 'compatible' function object (or function
pointer), meaning that the arguments to the interface designated by
Boost.Function can be converted to the arguments of the target
function object.</p></div></div><table width="100%"><tr><td align="left"><small>Last revised: February 19, 2003 at 22:46:09 GMT</small></td><td align="right"><small></small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch01s04.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="index.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="function.history.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Acknowledgements </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> History &amp; Compatibility Notes</td></tr></table></div></body></html>
+13
View File
@@ -0,0 +1,13 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Miscellaneous Notes</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="function.html" title="Boost.Function"><link rel="previous" href="function.faq.html" title="Frequently Asked Questions"><link rel="next" href="function.testsuite.html" title="Testsuite"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"><link rel="subsection" href="function.misc.html#id2885974" title="Boost.Function vs. Function Pointers"><link rel="subsection" href="function.misc.html#id2886053" title="Performance"><link rel="subsection" href="function.misc.html#id2886122" title="Combatting virtual function &quot;bloat&quot;"><link rel="subsection" href="function.misc.html#id2886152" title="Acknowledgements"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="function.misc"></a>Miscellaneous Notes</h2></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2885974"></a>Boost.Function vs. Function Pointers</h3></div></div><div></div></div><p>Boost.Function has several advantages over function pointers, namely:
</p><div class="itemizedlist"><ul type="disc" compact><li><p>Boost.Function allows arbitrary compatible function objects to be targets (instead of requiring an exact function signature).</p></li><li><p>Boost.Function may be used with argument-binding and other function object construction libraries.</p></li><li><p>Boost.Function has predictible behavior when an empty function object is called. </p></li></ul></div><p> And, of course, function pointers have several advantages over Boost.Function:
</p><div class="itemizedlist"><ul type="disc" compact><li><p> Function pointers are smaller (the size of one pointer instead of three) </p></li><li><p> Function pointers are faster (Boost.Function may require two calls through function pointers) </p></li><li><p> Function pointers are backward-compatible with C libraries.</p></li><li><p> More readable error messages. </p></li></ul></div><p>
</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2886053"></a>Performance</h3></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2886060"></a>Function object wrapper size</h4></div></div><div></div></div><p> Function object wrappers will be the size of two function pointers plus one function pointer or data pointer (whichever is larger). On common 32-bit platforms, this amounts to 12 bytes per wrapper. Additionally, the function object target will be allocated on the heap.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2886078"></a>Copying efficiency</h4></div></div><div></div></div><p> Copying function object wrappers may require allocating memory for a copy of the function object target. The default allocator may be replaced with a faster custom allocator or one may choose to allow the function object wrappers to only store function object targets by reference (using <tt class="computeroutput">ref</tt>) if the cost of this cloning becomes prohibitive.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2886105"></a>Invocation efficiency</h4></div></div><div></div></div><p> With a properly inlining compiler, an invocation of a function object requires one call through a function pointer. If the call is to a free function pointer, an additional call must be made to that function pointer (unless the compiler has very powerful interprocedural analysis).</p></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2886122"></a>Combatting virtual function &quot;bloat&quot;</h3></div></div><div></div></div><p> The use of virtual functions tends to cause 'code bloat' on many compilers. When a class contains a virtual function, it is necessary to emit an additional function that classifies the type of the object. It has been our experience that these auxiliary functions increase the size of the executable significantly when many <tt class="computeroutput">boost::function</tt> objects are used. </p><p> In Boost.Function, an alternative but equivalent approach was taken using free functions instead of virtual functions. The Boost.Function object essentially holds two pointers to make a valid target call: a void pointer to the function object it contains and a void pointer to an &quot;invoker&quot; that can call the function object, given the function pointer. This invoker function performs the argument and return value conversions Boost.Function provides. A third pointer points to a free function called the &quot;manager&quot;, which handles the cloning and destruction of function objects. The scheme is typesafe because the only functions that actually handle the function object, the invoker and the manager, are instantiated given the type of the function object, so they can safely cast the incoming void pointer (the function object pointer) to the appropriate type.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2886152"></a>Acknowledgements</h3></div></div><div></div></div><p> Many people were involved in the construction of this
library. William Kempf, Jesse Jones and Karl Nelson were all
extremely helpful in isolating an interface and scope for the
library. John Maddock managed the formal review, and many
reviewers gave excellent comments on interface, implementation,
and documentation. Peter Dimov led us to the function
declarator-based syntax.</p></div></div><table width="100%"><tr><td align="left"><small>Last revised: February 19, 2003 at 22:46:09 GMT</small></td><td align="right"><small>Copyright © 2001-2003 Douglas Gregor</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="function.faq.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="function.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="function.testsuite.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Frequently Asked Questions </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Testsuite</td></tr></table></div></body></html>
+75
View File
@@ -0,0 +1,75 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Reference</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="function.html" title="Boost.Function"><link rel="previous" href="function.tutorial.html" title="Tutorial"><link rel="next" href="id2837192.html" title="Class bad_function_call"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"><link rel="subsection" href="function.reference.html#function.definitions" title="Definitions"><link rel="subsection" href="function.reference.html#header.boost.function.hpp" title="Header &lt;boost/function.hpp&gt;"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="function.reference"></a>Reference</h2></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="function.definitions"></a>Definitions</h3></div></div><div></div></div><p>
</p><div class="itemizedlist"><ul type="disc"><li><p>A function object <tt class="computeroutput">f</tt> is
<span class="emphasis"><em>compatible</em></span> if for the given set of argument
types <tt class="computeroutput">Arg1</tt>,
<tt class="computeroutput">Arg2</tt>, ...,
<tt class="computeroutput">ArgN</tt> and a
return type <tt class="computeroutput">ResultType</tt>, the
appropriate following function is well-formed:
</p><pre class="programlisting">
<span class="emphasis"><em>// if ResultType is not <span class="bold"><b>void</b></span></em></span>
ResultType foo(Arg1 arg1, Arg2 arg2, ..., Arg<span class="emphasis"><em>N</em></span> arg<span class="emphasis"><em>N</em></span>)
{
<span class="bold"><b>return</b></span> f(arg1, arg2, ..., arg<span class="emphasis"><em>N</em></span>);
}
<span class="emphasis"><em>// if ResultType is <span class="bold"><b>void</b></span></em></span>
ResultType foo(Arg1 arg1, Arg2 arg2, ..., Arg<span class="emphasis"><em>N</em></span> arg<span class="emphasis"><em>N</em></span>)
{
f(arg1, arg2, ..., arg<span class="emphasis"><em>N</em></span>);
}
</pre><p> A special provision is made for pointers to member
functions. Though they are not function objects, Boost.Function
will adapt them internally to function objects. This requires
that a pointer to member function of the form <tt class="computeroutput">R
(X::*mf)(Arg1, Arg2, ..., ArgN)
cv-quals</tt> be adapted to a
function object with the following function call operator
overloads:
</p><pre class="programlisting">
<span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename P</b></span>&gt;
R <span class="bold"><b>operator</b></span>()(<span class="emphasis"><em>cv-quals</em></span> P&amp; x, Arg1 arg1, Arg2 arg2, ..., Arg<span class="emphasis"><em>N</em></span> arg<span class="emphasis"><em>N</em></span>) <span class="bold"><b>const</b></span>
{
<span class="bold"><b>return</b></span> (*x).*mf(arg1, arg2, ..., arg<span class="emphasis"><em>N</em></span>);
}
</pre><p>
</p></li><li><p>A function object <tt class="computeroutput">f</tt> of
type <tt class="computeroutput">F</tt> is
<span class="emphasis"><em>stateless</em></span> if it is a function pointer or if
<tt class="computeroutput">boost::is_stateless&lt;T&gt;</tt>
is true. The construction of or copy to a Boost.Function object
from a stateless function object will not cause exceptions to be
thrown and will not allocate any storage.
</p></li></ul></div><p>
</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="header.boost.function.hpp"></a>Header &lt;<a href="../../boost/function.hpp" target="_top">boost/function.hpp</a>&gt;</h3></div></div><div></div></div><pre class="synopsis"><span class="bold"><b>namespace</b></span> boost {
  <a href="id2837192.html" title="Class bad_function_call"><span class="bold"><b>class</b></span> bad_function_call;</a>
  <a href="class.boost.function_base.html" title="Class function_base"><span class="bold"><b>class</b></span> function_base;</a>
  <span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> R, <span class="bold"><b>typename</b></span> T1, <span class="bold"><b>typename</b></span> T2, ..., <span class="bold"><b>typename</b></span> TN,
           <span class="bold"><b>typename</b></span> Allocator = std::allocator&lt;void&gt; &gt;
  <span class="bold"><b>class</b></span> <a href="class.boost.functionN.html" title="Class template functionN">functionN</a>;
  <span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> T1, <span class="bold"><b>typename</b></span> T2, ..., <span class="bold"><b>typename</b></span> TN, <span class="bold"><b>typename</b></span> Allocator&gt;
    <span class="bold"><b>void</b></span> <a href="class.boost.functionN.html#id2837098">swap</a>(<a href="class.boost.functionN.html" title="Class template functionN">functionN</a>&lt;T1, T2, ..., TN, Allocator&gt;&amp;,
              <a href="class.boost.functionN.html" title="Class template functionN">functionN</a>&lt;T1, T2, ..., TN, Allocator&gt;&amp;);
  <span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> T1, <span class="bold"><b>typename</b></span> T2, ..., <span class="bold"><b>typename</b></span> TN, <span class="bold"><b>typename</b></span> Allocator1,
           <span class="bold"><b>typename</b></span> U1, <span class="bold"><b>typename</b></span> U2, ..., <span class="bold"><b>typename</b></span> UN, <span class="bold"><b>typename</b></span> Allocator2&gt;
    <span class="bold"><b>void</b></span> <a href="class.boost.functionN.html#id2818162"><span class="bold"><b>operator</b></span>==</a>(<span class="bold"><b>const</b></span> <a href="class.boost.functionN.html" title="Class template functionN">functionN</a>&lt;T1, T2, ..., TN, Allocator1&gt;&amp;,
                    <span class="bold"><b>const</b></span> <a href="class.boost.functionN.html" title="Class template functionN">functionN</a>&lt;U1, U2, ..., UN, Allocator2&gt;&amp;);
  <span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> T1, <span class="bold"><b>typename</b></span> T2, ..., <span class="bold"><b>typename</b></span> TN, <span class="bold"><b>typename</b></span> Allocator1,
           <span class="bold"><b>typename</b></span> U1, <span class="bold"><b>typename</b></span> U2, ..., <span class="bold"><b>typename</b></span> UN, <span class="bold"><b>typename</b></span> Allocator2&gt;
    <span class="bold"><b>void</b></span> <a href="class.boost.functionN.html#id2822734"><span class="bold"><b>operator</b></span>!=</a>(<span class="bold"><b>const</b></span> <a href="class.boost.functionN.html" title="Class template functionN">functionN</a>&lt;T1, T2, ..., TN, Allocator1&gt;&amp;,
                    <span class="bold"><b>const</b></span> <a href="class.boost.functionN.html" title="Class template functionN">functionN</a>&lt;U1, U2, ..., UN, Allocator2&gt;&amp;);
  <span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> Signature, <span class="bold"><b>typename</b></span> Allocator = std::allocator&lt;void&gt; &gt;
  <span class="bold"><b>class</b></span> <a href="class.boost.function.html" title="Class template function">function</a>;
  <span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> Signature, <span class="bold"><b>typename</b></span> Allocator&gt;
    <span class="bold"><b>void</b></span> <a href="class.boost.function.html#id2700316">swap</a>(<a href="class.boost.function.html" title="Class template function">function</a>&lt;Signature, Allocator&gt;&amp;,
              <a href="class.boost.function.html" title="Class template function">function</a>&lt;Signature, Allocator&gt;&amp;);
  <span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> Signature1, <span class="bold"><b>typename</b></span> Allocator1, <span class="bold"><b>typename</b></span> Signature2,
           <span class="bold"><b>typename</b></span> Allocator2&gt;
    <span class="bold"><b>void</b></span> <a href="class.boost.function.html#id2747993"><span class="bold"><b>operator</b></span>==</a>(<span class="bold"><b>const</b></span> <a href="class.boost.function.html" title="Class template function">function</a>&lt;Signature1, Allocator1&gt;&amp;,
                    <span class="bold"><b>const</b></span> <a href="class.boost.function.html" title="Class template function">function</a>&lt;Signature2, Allocator2&gt;&amp;);
  <span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> Signature1, <span class="bold"><b>typename</b></span> Allocator1, <span class="bold"><b>typename</b></span> Signature2,
           <span class="bold"><b>typename</b></span> Allocator2&gt;
    <span class="bold"><b>void</b></span> <a href="class.boost.function.html#id2748081"><span class="bold"><b>operator</b></span>!=</a>(<span class="bold"><b>const</b></span> <a href="class.boost.function.html" title="Class template function">function</a>&lt;Signature1, Allocator1&gt;&amp;,
                    <span class="bold"><b>const</b></span> <a href="class.boost.function.html" title="Class template function">function</a>&lt;Signature2, Allocator2&gt;&amp;);
}</pre></div></div><table width="100%"><tr><td align="left"><small>Last revised: February 19, 2003 at 22:46:09 GMT</small></td><td align="right"><small>Copyright © 2001-2003 Douglas Gregor</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="function.tutorial.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="function.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="id2837192.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Tutorial </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Class bad_function_call</td></tr></table></div></body></html>
File diff suppressed because one or more lines are too long
+135
View File
@@ -0,0 +1,135 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Tutorial</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="function.html" title="Boost.Function"><link rel="previous" href="function.history.html" title="History &amp; Compatibility Notes"><link rel="next" href="function.reference.html" title="Reference"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"><link rel="subsection" href="function.tutorial.html#id2879195" title="Basic Usage"><link rel="subsection" href="function.tutorial.html#id2879609" title="Free functions"><link rel="subsection" href="function.tutorial.html#id2879654" title="Member functions"><link rel="subsection" href="function.tutorial.html#id2879906" title="References to Functions"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="function.tutorial"></a>Tutorial</h2></div></div><div></div></div><p> Boost.Function has two syntactical forms: the preferred form
and the portable form. The preferred form fits more closely with the
C++ language and reduces the number of separate template parameters
that need to be considered, often improving readability; however, the
preferred form is not supported on all platforms due to compiler
bugs. The compatible form will work on all compilers supported by
Boost.Function. Consult the table below to determine which syntactic
form to use for your compiler.
</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th align="left">Preferred syntax</th><th align="left">Portable syntax</th></tr></thead><tbody><tr><td align="left"><div class="itemizedlist"><ul type="disc" compact><li>GNU C++ 2.95.x, 3.0.x, 3.1.x</li><li>Comeau C++ 4.2.45.2</li><li>SGI MIPSpro 7.3.0</li><li>Intel C++ 5.0, 6.0</li><li>Compaq's cxx 6.2</li></ul></div></td><td align="left"><div class="itemizedlist"><ul type="disc" compact><li><span class="emphasis"><em>Any compiler supporting the preferred syntax</em></span></li><li>Microsoft Visual C++ 6.0, 7.0</li><li>Borland C++ 5.5.1</li><li>Sun WorkShop 6 update 2 C++ 5.3</li><li>Metrowerks CodeWarrior 8.1</li></ul></div></td></tr></tbody></table></div><p>
</p><p> If your compiler does not appear in this list, please try the preferred syntax and report your results to the Boost list so that we can keep this table up-to-date.</p><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2879195"></a>Basic Usage</h3></div></div><div></div></div><p> A function wrapper is defined simply
by instantiating the <tt class="computeroutput">function</tt> class
template with the desired return type and argument types, formulated
as a C++ function type. Any number of arguments may be supplied, up to
some implementation-defined limit (10 is the default maximum). The
following declares a function object wrapper
<tt class="computeroutput">f</tt> that takes two
<tt class="computeroutput">int</tt> parameters and returns a
<tt class="computeroutput">float</tt>:
</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th align="left">Preferred syntax</th><th align="left">Portable syntax</th></tr></thead><tbody><tr><td align="left"><pre class="programlisting"><a href="class.boost.function.html" title="Class template function">boost::function</a>&lt;float (int x, int y)&gt; f;</pre></td><td align="left"><pre class="programlisting"><a href="class.boost.functionN.html" title="Class template functionN">boost::function2</a>&lt;float, int, int&gt; f;</pre></td></tr></tbody></table></div><p>
</p><p> By default, function object wrappers are empty, so we can create a
function object to assign to <tt class="computeroutput">f</tt>:
</p><pre class="programlisting">struct int_div {
float operator()(int x, int y) const { return ((float)x)/y; };
};</pre><p>
</p><pre class="programlisting">f = int_div();</pre><p>
</p><p> Now we can use <tt class="computeroutput">f</tt> to execute
the underlying function object
<tt class="computeroutput">int_div</tt>:
</p><pre class="programlisting">std::cout &lt;&lt; f(5, 3) &lt;&lt; std::endl;</pre><p>
</p><p> We are free to assign any compatible function object to
<tt class="computeroutput">f</tt>. If
<tt class="computeroutput">int_div</tt> had been declared to take two
<tt class="computeroutput">long</tt> operands, the implicit
conversions would have been applied to the arguments without any user
interference. The only limit on the types of arguments is that they be
CopyConstructible, so we can even use references and arrays:
</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><thead><tr><th align="left">Preferred syntax</th></tr></thead><tbody><tr><td align="left"><pre class="programlisting"><a href="class.boost.function.html" title="Class template function">boost::function</a>&lt;void (int values[], int n, int&amp; sum, float&amp; avg)&gt; sum_avg;</pre></td></tr></tbody></table></div><p>
</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><thead><tr><th align="left">Portable syntax</th></tr></thead><tbody><tr><td align="left"><pre class="programlisting"><a href="class.boost.functionN.html" title="Class template functionN">boost::function4</a>&lt;void, int[], int, int&amp;, float&gt; sum_avg;</pre></td></tr></tbody></table></div><p>
</p><pre class="programlisting">void do_sum_avg(int values[], int n, int&amp; sum, float&amp; avg)
{
sum = 0;
for (int i = 0; i &lt; n; i++)
sum += values[i];
avg = (float)sum / n;
}</pre><p>
</p><pre class="programlisting">sum_avg = &amp;do_sum_avg;</pre><p>
</p><p> Invoking a function object wrapper that does not actually
contain a function object is a precondition violation, much like
trying to call through a null function pointer, and will throw a <a href="id2837192.html" title="Class bad_function_call">bad_function_call</a> exception). We can check for an
empty function object wrapper by using it in a boolean context (it evaluates <tt class="computeroutput">true</tt> if the wrapper is not empty) or compare it against <tt class="computeroutput">0</tt>. For instance:
</p><pre class="programlisting">if (f)
std::cout &lt;&lt; f(5, 3) &lt;&lt; std::endl;
else
std::cout &lt;&lt; &quot;f has no target, so it is unsafe to call&quot; &lt;&lt; std::endl;</pre><p>
</p><p> Alternatively,
<tt class="computeroutput"><a href="class.boost.function.html#id2833437">empty</a>()</tt>
method will return whether or not the wrapper is empty. </p><p> Finally, we can clear out a function target by assigning it to <tt class="computeroutput">0</tt> or by calling the <tt class="computeroutput"><a href="class.boost.function.html#id2821057">clear</a>()</tt> member function, e.g.,
</p><pre class="programlisting">f = 0;</pre><p>
</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2879609"></a>Free functions</h3></div></div><div></div></div><p> Free function pointers can be considered singleton function objects with const function call operators, and can therefore be directly used with the function object wrappers:
</p><pre class="programlisting">float mul_ints(int x, int y) { return ((float)x) * y; }</pre><p>
</p><pre class="programlisting">f = &amp;mul_ints;</pre><p>
</p><p> Note that the <tt class="computeroutput">&amp;</tt> isn't really necessary unless you happen to be using Microsoft Visual C++ version 6. </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2879654"></a>Member functions</h3></div></div><div></div></div><p> In many systems, callbacks often call to member functions of a
particular object. This is often referred to as &quot;argument binding&quot;,
and is beyond the scope of Boost.Function. The use of member functions
directly, however, is supported, so the following code is valid:
</p><pre class="programlisting">struct X {
int foo(int);
};</pre><p>
</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th align="left">Preferred syntax</th><th align="left">Portable syntax</th></tr></thead><tbody><tr><td align="left"><pre class="programlisting"><a href="class.boost.function.html" title="Class template function">boost::function</a>&lt;int (X*, int)&gt; f;
f = &amp;X::foo;
X x;
f(&amp;x, 5);</pre></td><td align="left"><pre class="programlisting"><a href="class.boost.functionN.html" title="Class template functionN">boost::function2</a>&lt;int, X*, int&gt; f;
f = &amp;X::foo;
X x;
f(&amp;x, 5);</pre></td></tr></tbody></table></div><p>
</p><p> Several libraries exist that support argument binding. Three such libraries are summarized below:
</p><div class="itemizedlist"><ul type="disc"><li><p><a href="../../libs/bind/index.html" target="_top">Bind</a>. This library allows binding of
arguments for any function object. It is lightweight and very
portable.</p></li><li><p>The C++ Standard library. Using
<tt class="computeroutput">std::bind1st</tt> and
<tt class="computeroutput">std::mem_fun</tt> together one can bind
the object of a pointer-to-member function for use with
Boost.Function:
</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th align="left">Preferred syntax</th><th align="left">Portable syntax</th></tr></thead><tbody><tr><td align="left"><pre class="programlisting"> <a href="class.boost.function.html" title="Class template function">boost::function</a>&lt;int (int)&gt; f;
X x;
f = std::bind1st(
std::mem_fun(&amp;X::foo), &amp;x);
f(5); // Call x.foo(5)</pre></td><td align="left"><pre class="programlisting"> <a href="class.boost.functionN.html" title="Class template functionN">boost::function1</a>&lt;int, int&gt; f;
X x;
f = std::bind1st(
std::mem_fun(&amp;X::foo), &amp;x);
f(5); // Call x.foo(5)</pre></td></tr></tbody></table></div><p>
</p></li><li><p>The <a href="../../libs/lambda/index.html" target="_top">Lambda</a> library. This library provides a powerful composition mechanism to construct function objects that uses very natural C++ syntax. Lambda requires a compiler that is reasonably conformant to the C++ standard. </p></li></ul></div><p>
</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2879906"></a>References to Functions</h3></div></div><div></div></div><p> In some cases it is
expensive (or semantically incorrect) to have Boost.Function clone a
function object. In such cases, it is possible to request that
Boost.Function keep only a reference to the actual function
object. This is done using the <tt class="computeroutput">ref</tt>
and <tt class="computeroutput">cref</tt> functions to wrap a
reference to a function object:
</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th align="left">Preferred syntax</th><th align="left">Portable syntax</th></tr></thead><tbody><tr><td align="left"><pre class="programlisting"> stateful_type a_function_object;
<a href="class.boost.function.html" title="Class template function">boost::function</a>&lt;int (int)&gt; f;
f = <a href="id2833212.html#id2695067">boost::ref</a>(a_function_object);
<a href="class.boost.function.html" title="Class template function">boost::function</a>&lt;int (int)&gt; f2(f);</pre></td><td align="left"><pre class="programlisting"> stateful_type a_function_object;
<a href="class.boost.functionN.html" title="Class template functionN">boost::function1</a>&lt;int, int&gt; f;
f = <a href="id2833212.html#id2695067">boost::ref</a>(a_function_object);
<a href="class.boost.functionN.html" title="Class template functionN">boost::function1</a>&lt;int, int&gt; f2(f);</pre></td></tr></tbody></table></div><p>
</p><p> Here, <tt class="computeroutput">f</tt> will not make a copy
of <tt class="computeroutput">a_function_object</tt>, nor will
<tt class="computeroutput">f2</tt> when it is targeted to
<tt class="computeroutput">f</tt>'s reference to
<tt class="computeroutput">a_function_object</tt>. Additionally, when
using references to function objects, Boost.Function will not throw
exceptions during assignment or construction.
</p></div></div><table width="100%"><tr><td align="left"><small>Last revised: February 18, 2003 at 03:32:15 GMT</small></td><td align="right"><small>Copyright © 2001-2003 Douglas Gregor</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="function.history.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="function.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="function.reference.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">History &amp; Compatibility Notes </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Reference</td></tr></table></div></body></html>
+7
View File
@@ -0,0 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Class template is_reference_wrapper</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="ref.reference.html#header.boost.ref.hpp" title="Header &lt;boost/ref.hpp&gt;"><link rel="previous" href="id2833212.html" title="Class template reference_wrapper"><link rel="next" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"><link rel="section" href="id2695148.html#id2887879" title="Description"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="refentry" lang="en"><a name="id2695148"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">Class template is_reference_wrapper</span></h2><p>boost::is_reference_wrapper &#8212; Determine if a type T is an instantiation of reference_wrapper.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> T&gt;
<span class="bold"><b>class</b></span> is_reference_wrapper {
<span class="bold"><b>public</b></span>:
  <span class="emphasis"><em>// static constants</em></span>
  <span class="bold"><b>static</b></span> <span class="bold"><b>const</b></span> <span class="bold"><b>bool</b></span> value = unspecified;
};</pre></div><div class="refsect1" lang="en"><h2>Description</h2><p>The <tt class="computeroutput">value</tt> static constant will be <tt class="computeroutput">true</tt> iff the type <tt class="computeroutput">T</tt> is a specialization of <tt class="computeroutput"><a href="id2833212.html" title="Class template reference_wrapper">reference_wrapper</a></tt>.</p></div></div><table width="100%"><tr><td align="left"><small>Last revised: February 18, 2003 at 14:32:03 GMT</small></td><td align="right"><small>Copyright © 1999, 2000 Jaakko Järvi<br>Copyright © 2001, 2002 Peter Dimov<br>Copyright © 2002 David Abrahams</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="id2833212.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="ref.reference.html#header.boost.ref.hpp"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="id2695230.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Class template reference_wrapper </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Class template unwrap_reference</td></tr></table></div></body></html>
+7
View File
@@ -0,0 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Class template unwrap_reference</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="ref.reference.html#header.boost.ref.hpp" title="Header &lt;boost/ref.hpp&gt;"><link rel="previous" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="next" href="ref.ack.html" title="Acknowledgements"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"><link rel="section" href="id2695230.html#id2887984" title="Description"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="refentry" lang="en"><a name="id2695230"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">Class template unwrap_reference</span></h2><p>boost::unwrap_reference &#8212; Find the type in a reference_wrapper.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> T&gt;
<span class="bold"><b>class</b></span> unwrap_reference {
<span class="bold"><b>public</b></span>:
  <span class="emphasis"><em>// types</em></span>
  <span class="bold"><b>typedef</b></span> unspecified T;
};</pre></div><div class="refsect1" lang="en"><h2>Description</h2><p>The typedef <tt class="computeroutput">type</tt> is <tt class="computeroutput">T::type</tt> if <tt class="computeroutput">T</tt> is a <tt class="computeroutput"><a href="id2833212.html" title="Class template reference_wrapper">reference_wrapper</a></tt>, <tt class="computeroutput">T</tt> otherwise.</p></div></div><table width="100%"><tr><td align="left"><small>Last revised: February 18, 2003 at 14:32:03 GMT</small></td><td align="right"><small>Copyright © 1999, 2000 Jaakko Järvi<br>Copyright © 2001, 2002 Peter Dimov<br>Copyright © 2002 David Abrahams</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="id2695148.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="ref.reference.html#header.boost.ref.hpp"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="ref.ack.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Class template is_reference_wrapper </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Acknowledgements</td></tr></table></div></body></html>
+21
View File
@@ -0,0 +1,21 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Function any_cast</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="any.reference.html#header.boost.any.hpp" title="Header &lt;boost/any.hpp&gt;"><link rel="previous" href="class.boost.any.html" title="Class any"><link rel="next" href="ch01s04.html" title="Acknowledgements"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"><link rel="section" href="id2827840.html#id2812766" title="Description"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="refentry" lang="en"><a name="id2827840"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">Function any_cast</span></h2><p>boost::any_cast &#8212; Custom keyword cast for extracting a value
of a given type from an
any.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
<span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> ValueType&gt; ValueType any_cast(<span class="bold"><b>const</b></span> any &amp; operand);
<span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> ValueType&gt; <span class="bold"><b>const</b></span> ValueType * any_cast(<span class="bold"><b>const</b></span> any * operand);
<span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> ValueType&gt; ValueType * any_cast(any * operand);</pre></div><div class="refsect1" lang="en"><h2>Description</h2><p><b><span class="term">Returns</span></b>:
If passed a pointer, it returns a
similarly qualified pointer to the value content if
successful, otherwise null is returned. If passed a value or
reference, it returns a copy of the value content if
successful.<br><b><span class="term">Throws</span></b>:
Overloads taking an
<tt class="computeroutput"><a href="class.boost.any.html" title="Class any">any</a></tt> pointer do not
throw; the overload taking an
<tt class="computeroutput"><a href="class.boost.any.html" title="Class any">any</a></tt> value or reference
throws <tt class="computeroutput"><a href="class.boost.bad_any_cast.html" title="Class bad_any_cast">bad_any_cast</a></tt> if
unsuccessful.<br><b><span class="term">Rationale</span></b>:
The value/reference version returns a
copy because the C++ keyword casts return
copies.</p></div></div><table width="100%"><tr><td align="left"><small></small></td><td align="right"><small>Copyright © 2001 Kevlin Henney</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class.boost.any.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="any.reference.html#header.boost.any.hpp"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="ch01s04.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Class any </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Acknowledgements</td></tr></table></div></body></html>
+13
View File
@@ -0,0 +1,13 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Class last_value&lt;void&gt;</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="signals.reference.html#id2875832" title="Header &lt;boost/last_value.hpp&gt;"><link rel="previous" href="class.boost.last_value.html" title="Class template last_value"><link rel="next" href="ch04s04.html" title="Frequently Asked Questions"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"><link rel="section" href="id2830650.html#id2895526" title="Description"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="refentry" lang="en"><a name="id2830650"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">Class last_value&lt;void&gt;</span></h2><p>boost::last_value&lt;void&gt; &#8212; Evaluate an InputIterator sequence.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
<span class="bold"><b>class</b></span> last_value&lt;void&gt; {
<span class="bold"><b>public</b></span>:
  <span class="emphasis"><em>// types</em></span>
  <span class="bold"><b>typedef</b></span> unspecified result_type;
  <span class="emphasis"><em>// <a href="id2830650.html#id2899868">invocation</a></em></span>
  <span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> InputIterator&gt;
    result_type <a href="id2830650.html#id2842507"><span class="bold"><b>operator</b></span>()</a>(InputIterator, InputIterator) <span class="bold"><b>const</b></span>;
};</pre></div><div class="refsect1" lang="en"><h2>Description</h2><div class="refsect2" lang="en"><h3><a name="id2899868"></a><tt class="computeroutput">last_value</tt> invocation</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> InputIterator&gt;
  result_type <a name="id2842507"></a><span class="bold"><b>operator</b></span>()(InputIterator first, InputIterator last) <span class="bold"><b>const</b></span>;</pre><p><b><span class="term">Effects</span></b>:
Dereferences every iterator in the sequence <tt class="computeroutput">[first, last)</tt>.</p></li></ol></div></div></div></div><table width="100%"><tr><td align="left"><small></small></td><td align="right"><small>Copyright © 2001-2003 Douglas Gregor</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class.boost.last_value.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="signals.reference.html#id2875832"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="ch04s04.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Class template last_value </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Frequently Asked Questions</td></tr></table></div></body></html>
+44
View File
@@ -0,0 +1,44 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Class template reference_wrapper</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="ref.reference.html#header.boost.ref.hpp" title="Header &lt;boost/ref.hpp&gt;"><link rel="previous" href="ref.reference.html" title="Reference"><link rel="next" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"><link rel="section" href="id2833212.html#id2887409" title="Description"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="refentry" lang="en"><a name="id2833212"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">Class template reference_wrapper</span></h2><p>boost::reference_wrapper &#8212;
Contains a reference to an object of type
T.
</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> T&gt;
<span class="bold"><b>class</b></span> reference_wrapper {
<span class="bold"><b>public</b></span>:
  <span class="emphasis"><em>// types</em></span>
  <span class="bold"><b>typedef</b></span> T type;
  <span class="emphasis"><em>// <a href="id2833212.html#id2833212construct-copy-destruct">construct/copy/destruct</a></em></span>
  <a href="id2833212.html#id2833271">reference_wrapper(T&amp;)</a>;
  <span class="emphasis"><em>// <a href="id2833212.html#id2833314">access</a></em></span>
  <a href="id2833212.html#id2833319"><span class="bold"><b>operator</b></span> T&amp;() <span class="bold"><b>const</b></span></a>;
  <a href="id2833212.html#id2833343">T&amp; get() <span class="bold"><b>const</b></span></a>;
  <a href="id2833212.html#id2833366">T* get_pointer() <span class="bold"><b>const</b></span></a>;
};
<span class="emphasis"><em>// <a href="id2833212.html#id2695061">constructors</a></em></span>
<a href="id2833212.html#id2695067">reference_wrapper&lt;T&gt; ref(T&amp;)</a>;
<a href="id2833212.html#id2695106">reference_wrapper&lt;T <span class="bold"><b>const</b></span>&gt; cref(T <span class="bold"><b>const</b></span>&amp;)</a>;</pre></div><div class="refsect1" lang="en"><h2>Description</h2><p>
<tt class="computeroutput"><a href="id2833212.html" title="Class template reference_wrapper">reference_wrapper</a></tt>
is primarily used to &quot;feed&quot; references to function templates
(algorithms) that take their parameter by value. It provides
an implicit conversion to
<tt class="computeroutput">T&amp;</tt>, which usually allows
the function templates to work on references unmodified.
</p><div class="refsect2" lang="en"><h3><a name="id2833212construct-copy-destruct"></a><tt class="computeroutput">reference_wrapper</tt> construct/copy/destruct</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><a name="id2833271"></a>reference_wrapper(T&amp; t);</pre><p><b><span class="term">Effects</span></b>:
Constructs a
<tt class="computeroutput"><a href="id2833212.html" title="Class template reference_wrapper">reference_wrapper</a></tt>
object that stores a reference to
<tt class="computeroutput">t</tt>.<br><b><span class="term">Throws</span></b>:
Does not throw.</p></li></ol></div></div><div class="refsect2" lang="en"><h3><a name="id2833314"></a><tt class="computeroutput">reference_wrapper</tt> access</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><a name="id2833319"></a><span class="bold"><b>operator</b></span> T&amp;() <span class="bold"><b>const</b></span>;</pre><p><b><span class="term">Returns</span></b>:
The stored reference.<br><b><span class="term">Throws</span></b>:
Does not throw.</p></li><li><pre class="literallayout"><a name="id2833343"></a>T&amp; get() <span class="bold"><b>const</b></span>;</pre><p><b><span class="term">Returns</span></b>:
The stored reference.<br><b><span class="term">Throws</span></b>:
Does not throw.</p></li><li><pre class="literallayout"><a name="id2833366"></a>T* get_pointer() <span class="bold"><b>const</b></span>;</pre><p><b><span class="term">Returns</span></b>:
A pointer to the object referenced by the stored reference.<br><b><span class="term">Throws</span></b>:
Does not throw.</p></li></ol></div></div><div class="refsect2" lang="en"><h3><a name="id2695061"></a><tt class="computeroutput">reference_wrapper</tt> constructors</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><a name="id2695067"></a>reference_wrapper&lt;T&gt; ref(T&amp; t);</pre><p><b><span class="term">Returns</span></b>:
<tt class="computeroutput"><a href="id2833212.html" title="Class template reference_wrapper">reference_wrapper</a>&lt;T&gt;(t)</tt><br><b><span class="term">Throws</span></b>:
Does not throw.</p></li><li><pre class="literallayout"><a name="id2695106"></a>reference_wrapper&lt;T <span class="bold"><b>const</b></span>&gt; cref(T <span class="bold"><b>const</b></span>&amp; t);</pre><p><b><span class="term">Returns</span></b>:
<tt class="computeroutput"><a href="id2833212.html" title="Class template reference_wrapper">reference_wrapper</a>&lt;T const&gt;(t)</tt><br><b><span class="term">Throws</span></b>:
Does not throw.</p></li></ol></div></div></div></div><table width="100%"><tr><td align="left"><small>Last revised: February 18, 2003 at 14:32:03 GMT</small></td><td align="right"><small>Copyright © 1999, 2000 Jaakko Järvi<br>Copyright © 2001, 2002 Peter Dimov<br>Copyright © 2002 David Abrahams</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ref.reference.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="ref.reference.html#header.boost.ref.hpp"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="id2695148.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Reference </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Class template is_reference_wrapper</td></tr></table></div></body></html>
+8
View File
@@ -0,0 +1,8 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Class bad_function_call</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="function.reference.html#header.boost.function.hpp" title="Header &lt;boost/function.hpp&gt;"><link rel="previous" href="function.reference.html" title="Reference"><link rel="next" href="class.boost.function_base.html" title="Class function_base"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"><link rel="section" href="id2837192.html#id2881116" title="Description"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="refentry" lang="en"><a name="id2837192"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">Class bad_function_call</span></h2><p>boost::bad_function_call &#8212; An exception type thrown when an instance of a function object is empty when invoked.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
<span class="bold"><b>class</b></span> bad_function_call : <span class="bold"><b>public</b></span> std::runtime_error {
<span class="bold"><b>public</b></span>:
  <span class="emphasis"><em>// <a href="id2837192.html#id2837192construct-copy-destruct">construct/copy/destruct</a></em></span>
  <a href="id2837192.html#id2747934">bad_function_call()</a>;
};</pre></div><div class="refsect1" lang="en"><h2>Description</h2><div class="refsect2" lang="en"><h3><a name="id2837192construct-copy-destruct"></a><tt class="computeroutput">bad_function_call</tt> construct/copy/destruct</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><a name="id2747934"></a>bad_function_call();</pre><p><b><span class="term">Effects</span></b>:
Constructs a <tt class="computeroutput"><a href="id2837192.html" title="Class bad_function_call">bad_function_call</a></tt> exception object.</p></li></ol></div></div></div></div><table width="100%"><tr><td align="left"><small>Last revised: February 19, 2003 at 22:46:09 GMT</small></td><td align="right"><small>Copyright © 2001-2003 Douglas Gregor</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="function.reference.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="function.reference.html#header.boost.function.hpp"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="class.boost.function_base.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Reference </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Class function_base</td></tr></table></div></body></html>
+37
View File
@@ -0,0 +1,37 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Class trackable</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="signals.reference.html#id2900517" title="Header &lt;boost/signals/trackable.hpp&gt;"><link rel="previous" href="class.boost.slot.html" title="Class template slot"><link rel="next" href="id2890015.html" title="Class connection"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"><link rel="section" href="id2852290.html#id2892968" title="Description"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="refentry" lang="en"><a name="id2852290"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">Class trackable</span></h2><p>boost::signals::trackable &#8212; Enables safe use of multicast callbacks.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
<span class="bold"><b>class</b></span> trackable {
<span class="bold"><b>public</b></span>:
  <span class="emphasis"><em>// <a href="id2852290.html#id2852290construct-copy-destruct">construct/copy/destruct</a></em></span>
  <a href="id2852290.html#id2889800">trackable()</a>;
  <a href="id2852290.html#id2891558">trackable(<span class="bold"><b>const</b></span> trackable&amp;)</a>;
  <a href="id2852290.html#id2873094">trackable&amp; <span class="bold"><b>operator</b></span>=(<span class="bold"><b>const</b></span> trackable&amp;)</a>;
  <a href="id2852290.html#id2903091">~trackable()</a>;
};</pre></div><div class="refsect1" lang="en"><h2>Description</h2><p>The <tt class="computeroutput">trackable</tt> class
provides automatic disconnection of signals and slots when
objects bound in slots (via pointer or reference) are
destroyed. The <tt class="computeroutput">trackable</tt>
class may only be used as a public base class for some other
class; when used as such, that class may be bound to function
objects used as part of slots. The manner in which a
<tt class="computeroutput">trackable</tt> object tracks the
set of signal-slot connections it is a part of is
unspecified.</p><p>The actual use of
<tt class="computeroutput">trackable</tt> is contingent on
the presence of appropriate
<a href="id2905241.html" title="Function template visit_each">visit_each</a> overloads for any type
that may contain pointers or references to trackable
objects.</p><div class="refsect2" lang="en"><h3><a name="id2852290construct-copy-destruct"></a><tt class="computeroutput">trackable</tt> construct/copy/destruct</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><a name="id2889800"></a>trackable();</pre><p><b><span class="term">Effects</span></b>:
Sets the list of connected slots to empty.<br><b><span class="term">Throws</span></b>:
Will not throw.</p></li><li><pre class="literallayout"><a name="id2891558"></a>trackable(<span class="bold"><b>const</b></span> trackable&amp; other);</pre><p><b><span class="term">Effects</span></b>:
Sets the list of connected slots to empty.<br><b><span class="term">Throws</span></b>:
Will not throw.<br><b><span class="term">Rationale</span></b>:
Signal-slot connections can only be created via calls to an explicit connect method, and therefore cannot be created here when trackable objects are copied.</p></li><li><pre class="literallayout"><a name="id2873094"></a>trackable&amp; <span class="bold"><b>operator</b></span>=(<span class="bold"><b>const</b></span> trackable&amp; other);</pre><p><b><span class="term">Effects</span></b>:
Sets the list of connected slots to empty.<br><b><span class="term">Returns</span></b>:
<tt class="computeroutput">*this</tt><br><b><span class="term">Throws</span></b>:
Will not throw.<br><b><span class="term">Rationale</span></b>:
Signal-slot connections can only be created via calls to an explicit connect method, and therefore cannot be created here when trackable objects are copied.</p></li><li><pre class="literallayout"><a name="id2903091"></a>~trackable();</pre><p><b><span class="term">Effects</span></b>:
Disconnects all signal/slot connections that
contain a pointer or reference to this trackable object that
can be found by
<a href="id2905241.html" title="Function template visit_each">visit_each</a>.</p></li></ol></div></div></div></div><table width="100%"><tr><td align="left"><small></small></td><td align="right"><small>Copyright © 2001-2003 Douglas Gregor</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class.boost.slot.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="signals.reference.html#id2900517"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="id2890015.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Class template slot </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Class connection</td></tr></table></div></body></html>
+29
View File
@@ -0,0 +1,29 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Class scoped_connection</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="signals.reference.html#id2858799" title="Header &lt;boost/signals/connection.hpp&gt;"><link rel="previous" href="id2890015.html" title="Class connection"><link rel="next" href="id2905241.html" title="Function template visit_each"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"><link rel="section" href="id2877648.html#id2894490" title="Description"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="refentry" lang="en"><a name="id2877648"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">Class scoped_connection</span></h2><p>boost::signals::scoped_connection &#8212; Limits a signal-slot connection lifetime to a particular scope.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
<span class="bold"><b>class</b></span> scoped_connection : <span class="bold"><b>private</b></span> noncopyable {
<span class="bold"><b>public</b></span>:
  <span class="emphasis"><em>// <a href="id2877648.html#id2877648construct-copy-destruct">construct/copy/destruct</a></em></span>
  <a href="id2877648.html#id2899197">scoped_connection(<span class="bold"><b>const</b></span> connection&amp;)</a>;
  <a href="id2877648.html#id2856525">~scoped_connection()</a>;
  <span class="emphasis"><em>// <a href="id2877648.html#id2902063">connection management</a></em></span>
  <a href="id2877648.html#id2902069"><span class="bold"><b>void</b></span> disconnect() <span class="bold"><b>const</b></span></a>;
  <a href="id2877648.html#id2865054"><span class="bold"><b>bool</b></span> connected() <span class="bold"><b>const</b></span></a>;
};</pre></div><div class="refsect1" lang="en"><h2>Description</h2><div class="refsect2" lang="en"><h3><a name="id2877648construct-copy-destruct"></a><tt class="computeroutput">scoped_connection</tt> construct/copy/destruct</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><a name="id2899197"></a>scoped_connection(<span class="bold"><b>const</b></span> connection&amp; other);</pre><p><b><span class="term">Effects</span></b>:
<tt class="computeroutput">this</tt> references
the connection referenced by
<tt class="computeroutput">other</tt>.<br><b><span class="term">Throws</span></b>:
Will not throw.</p></li><li><pre class="literallayout"><a name="id2856525"></a>~scoped_connection();</pre><p><b><span class="term">Effects</span></b>:
If
<tt class="computeroutput">this-&gt;<a href="id2877648.html#id2865054">connected</a>()</tt>,
disconnects the signal-slot connection.</p></li></ol></div></div><div class="refsect2" lang="en"><h3><a name="id2902063"></a><tt class="computeroutput">scoped_connection</tt> connection management</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><a name="id2902069"></a><span class="bold"><b>void</b></span> disconnect() <span class="bold"><b>const</b></span>;</pre><p><b><span class="term">Effects</span></b>:
If
<tt class="computeroutput">this-&gt;<a href="id2877648.html#id2865054">connected</a>()</tt>,
disconnects the signal and slot referenced by this;
otherwise, this operation is a no-op.<br><b><span class="term">Postconditions</span></b>:
<tt class="computeroutput">!this-&gt;<a href="id2877648.html#id2865054">connected</a>()</tt>.</p></li><li><pre class="literallayout"><a name="id2865054"></a><span class="bold"><b>bool</b></span> connected() <span class="bold"><b>const</b></span>;</pre><p><b><span class="term">Returns</span></b>:
<tt class="computeroutput">true</tt> if this
references a non-NULL connection that is still active
(connected), and <tt class="computeroutput">false</tt>
otherwise.<br><b><span class="term">Throws</span></b>:
Will not throw.</p></li></ol></div></div></div></div><table width="100%"><tr><td align="left"><small></small></td><td align="right"><small>Copyright © 2001-2003 Douglas Gregor</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="id2890015.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="signals.reference.html#id2858799"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="id2905241.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Class connection </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Function template visit_each</td></tr></table></div></body></html>
+74
View File
@@ -0,0 +1,74 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Class connection</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="signals.reference.html#id2858799" title="Header &lt;boost/signals/connection.hpp&gt;"><link rel="previous" href="id2852290.html" title="Class trackable"><link rel="next" href="id2877648.html" title="Class scoped_connection"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"><link rel="section" href="id2890015.html#id2893618" title="Description"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="refentry" lang="en"><a name="id2890015"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">Class connection</span></h2><p>boost::signals::connection &#8212; Query/disconnect a signal-slot connection.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
<span class="bold"><b>class</b></span> connection {
<span class="bold"><b>public</b></span>:
  <span class="emphasis"><em>// <a href="id2890015.html#id2890015construct-copy-destruct">construct/copy/destruct</a></em></span>
  <a href="id2890015.html#id2886986">connection()</a>;
  <a href="id2890015.html#id2886853">connection(<span class="bold"><b>const</b></span> connection&amp;)</a>;
  <a href="id2890015.html#id2870983">connection&amp; <span class="bold"><b>operator</b></span>=(<span class="bold"><b>const</b></span> connection&amp;)</a>;
  <span class="emphasis"><em>// <a href="id2890015.html#id2908734">connection management</a></em></span>
  <a href="id2890015.html#id2908738"><span class="bold"><b>void</b></span> disconnect() <span class="bold"><b>const</b></span></a>;
  <a href="id2890015.html#id2893725"><span class="bold"><b>bool</b></span> connected() <span class="bold"><b>const</b></span></a>;
  <span class="emphasis"><em>// <a href="id2890015.html#id2848854">modifiers</a></em></span>
  <a href="id2890015.html#id2848859"><span class="bold"><b>void</b></span> swap(<span class="bold"><b>const</b></span> connection&amp;)</a>;
  <span class="emphasis"><em>// <a href="id2890015.html#id2895677">comparisons</a></em></span>
  <a href="id2890015.html#id2855780"><span class="bold"><b>bool</b></span> <span class="bold"><b>operator</b></span>==(<span class="bold"><b>const</b></span> connection&amp;) <span class="bold"><b>const</b></span></a>;
  <a href="id2890015.html#id2869664"><span class="bold"><b>bool</b></span> <span class="bold"><b>operator</b></span>&lt;(<span class="bold"><b>const</b></span> connection&amp;) <span class="bold"><b>const</b></span></a>;
};
<span class="emphasis"><em>// <a href="id2890015.html#id2849362">specialized algorithms</a></em></span>
<a href="id2890015.html#id2883120"><span class="bold"><b>void</b></span> swap(connection&amp;, connection&amp;)</a>;</pre></div><div class="refsect1" lang="en"><h2>Description</h2><p>
The <a href="id2890015.html" title="Class connection">connection</a> class represents a
connection between a Signal and a Slot. It is a lightweight
object that has the ability to query whether the signal and
slot are currently connected, and to disconnect the signal
and slot. It is always safe to query or disconnect a
connection.
</p><div class="refsect2" lang="en"><h3><a name="id2890015construct-copy-destruct"></a><tt class="computeroutput">connection</tt> construct/copy/destruct</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><a name="id2886986"></a>connection();</pre><p><b><span class="term">Effects</span></b>:
Sets the currently represented connection to the
NULL connection.<br><b><span class="term">Postconditions</span></b>:
<tt class="computeroutput">!this-&gt;<a href="id2890015.html#id2893725">connected</a>()</tt>.<br><b><span class="term">Throws</span></b>:
Will not throw.</p></li><li><pre class="literallayout"><a name="id2886853"></a>connection(<span class="bold"><b>const</b></span> connection&amp; other);</pre><p><b><span class="term">Effects</span></b>:
<tt class="computeroutput">this</tt> references
the connection referenced by
<tt class="computeroutput">other</tt>.<br><b><span class="term">Throws</span></b>:
Will not throw.</p></li><li><pre class="literallayout"><a name="id2870983"></a>connection&amp; <span class="bold"><b>operator</b></span>=(<span class="bold"><b>const</b></span> connection&amp; other);</pre><p><b><span class="term">Effects</span></b>:
<tt class="computeroutput">this</tt> references
the connection referenced by
<tt class="computeroutput">other</tt>.<br><b><span class="term">Throws</span></b>:
Will not throw.</p></li></ol></div></div><div class="refsect2" lang="en"><h3><a name="id2908734"></a><tt class="computeroutput">connection</tt> connection management</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><a name="id2908738"></a><span class="bold"><b>void</b></span> disconnect() <span class="bold"><b>const</b></span>;</pre><p><b><span class="term">Effects</span></b>:
If
<tt class="computeroutput">this-&gt;<a href="id2890015.html#id2893725">connected</a>()</tt>,
disconnects the signal and slot referenced by this;
otherwise, this operation is a no-op.<br><b><span class="term">Postconditions</span></b>:
<tt class="computeroutput">!this-&gt;<a href="id2890015.html#id2893725">connected</a>()</tt>.</p></li><li><pre class="literallayout"><a name="id2893725"></a><span class="bold"><b>bool</b></span> connected() <span class="bold"><b>const</b></span>;</pre><p><b><span class="term">Returns</span></b>:
<tt class="computeroutput">true</tt> if this
references a non-NULL connection that is still active
(connected), and <tt class="computeroutput">false</tt>
otherwise.<br><b><span class="term">Throws</span></b>:
Will not throw.</p></li></ol></div></div><div class="refsect2" lang="en"><h3><a name="id2848854"></a><tt class="computeroutput">connection</tt> modifiers</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><a name="id2848859"></a><span class="bold"><b>void</b></span> swap(<span class="bold"><b>const</b></span> connection&amp; other);</pre><p><b><span class="term">Effects</span></b>:
Swaps the connections referenced in
<tt class="computeroutput">this</tt> and
<tt class="computeroutput">other</tt>.<br><b><span class="term">Throws</span></b>:
Will not throw.</p></li></ol></div></div><div class="refsect2" lang="en"><h3><a name="id2895677"></a><tt class="computeroutput">connection</tt> comparisons</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><a name="id2855780"></a><span class="bold"><b>bool</b></span> <span class="bold"><b>operator</b></span>==(<span class="bold"><b>const</b></span> connection&amp; other) <span class="bold"><b>const</b></span>;</pre><p><b><span class="term">Returns</span></b>:
<tt class="computeroutput">true</tt> if
<tt class="computeroutput">this</tt> and
<tt class="computeroutput">other</tt> reference the same
connection or both reference the NULL connection, and
<tt class="computeroutput">false</tt>
otherwise.<br><b><span class="term">Throws</span></b>:
Will not throw.</p></li><li><pre class="literallayout"><a name="id2869664"></a><span class="bold"><b>bool</b></span> <span class="bold"><b>operator</b></span>&lt;(<span class="bold"><b>const</b></span> connection&amp; other) <span class="bold"><b>const</b></span>;</pre><p><b><span class="term">Returns</span></b>:
<tt class="computeroutput">true</tt> if the
connection referenced by
<tt class="computeroutput">this</tt> precedes the
connection referenced by
<tt class="computeroutput">other</tt> based on some
unspecified ordering, and
<tt class="computeroutput">false</tt>
otherwise.<br><b><span class="term">Throws</span></b>:
Will not throw.</p></li></ol></div></div><div class="refsect2" lang="en"><h3><a name="id2849362"></a><tt class="computeroutput">connection</tt> specialized algorithms</h3><div class="orderedlist"><ol type="1"><li><pre class="literallayout"><a name="id2883120"></a><span class="bold"><b>void</b></span> swap(connection&amp; x, connection&amp; y);</pre><p><b><span class="term">Effects</span></b>:
<tt class="computeroutput">x.swap(y)</tt><br><b><span class="term">Throws</span></b>:
Will not throw.</p></li></ol></div></div></div></div><table width="100%"><tr><td align="left"><small></small></td><td align="right"><small>Copyright © 2001-2003 Douglas Gregor</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="id2852290.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="signals.reference.html#id2858799"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="id2877648.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Class trackable </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Class scoped_connection</td></tr></table></div></body></html>
+26
View File
@@ -0,0 +1,26 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Function template visit_each</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="signals.reference.html#id2905340" title="Header &lt;boost/visit_each.hpp&gt;"><link rel="previous" href="id2877648.html" title="Class scoped_connection"><link rel="next" href="class.boost.last_value.html" title="Class template last_value"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"><link rel="section" href="id2905241.html#id2894940" title="Description"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="refentry" lang="en"><a name="id2905241"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">Function template visit_each</span></h2><p>boost::visit_each &#8212; Allow limited exploration of class members.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
<span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> Visitor, <span class="bold"><b>typename</b></span> T&gt;
  <span class="bold"><b>void</b></span> visit_each(<span class="bold"><b>const</b></span> Visitor&amp; visitor, <span class="bold"><b>const</b></span> T&amp; t, <span class="bold"><b>int</b></span> );</pre></div><div class="refsect1" lang="en"><h2>Description</h2><p>The <a href="id2905241.html" title="Function template visit_each">visit_each</a> mechanism
allows a visitor to be applied to every subobject in a given
object. It is used by the Signals library to discover
<a href="id2852290.html" title="Class trackable">signals::trackable</a> objects within a
function object, but other uses may surface if used universally
(e.g., conservative garbage collection). To fit within the
<a href="id2905241.html" title="Function template visit_each">visit_each</a> framework, a
<a href="id2905241.html" title="Function template visit_each">visit_each</a> overload must be supplied for
each object type. </p><p><b><span class="term">Effects</span></b>:
<tt class="computeroutput">visitor(t)</tt>, and for
every subobject <tt class="computeroutput">x</tt> of
<tt class="computeroutput">t</tt>:
<div class="itemizedlist"><ul type="disc"><li><p>If <tt class="computeroutput">x</tt> is a reference, <tt class="computeroutput">visit_each(visitor, <a href="id2833212.html#id2695067">ref</a>(x), 0)</tt></p></li><li><p>Otherwise, <tt class="computeroutput">visit_each(visitor, x, 0)</tt></p></li></ul></div>
<br><b><span class="term">Notes</span></b>:
<p>The third parameter is
<tt class="computeroutput">long</tt> for the fallback version
of <a href="id2905241.html" title="Function template visit_each">visit_each</a> and the argument
supplied to this third paramter must always be 0. The third
parameter is an artifact of the widespread lack of proper
function template ordering, and will be removed in the future.</p><p>Library authors will be expected to add additional
overloads that specialize the T argument for their classes, so
that subobjects can be visited.</p><p>Calls to visit_each are required to be unqualified, to
enable argument-dependent lookup.</p></p></div></div><table width="100%"><tr><td align="left"><small></small></td><td align="right"><small>Copyright © 2001-2003 Douglas Gregor</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="id2877648.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="signals.reference.html#id2905340"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="class.boost.last_value.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Class scoped_connection </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Class template last_value</td></tr></table></div></body></html>
Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 722 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 490 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 449 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

File diff suppressed because one or more lines are too long
+8
View File
@@ -0,0 +1,8 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Acknowledgements</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="ref.html" title="Boost.Ref"><link rel="previous" href="id2695230.html" title="Class template unwrap_reference"><link rel="next" href="signals.html" title="Boost.Signals"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="ref.ack"></a>Acknowledgements</h2></div></div><div></div></div><p><a href="id2833212.html#id2695067">ref</a> and <a href="id2833212.html#id2695106">cref</a>
were originally part of the <a href="../../libs/tuple/index.html" target="_top">Tuple</a> library
by Jaakko Järvi. They were &quot;promoted to boost:: status&quot; by
Peter Dimov because they are generally useful. Douglas Gregor and
Dave Abrahams contributed
<a href="id2695148.html" title="Class template is_reference_wrapper">is_reference_wrapper</a> and
<a href="id2695230.html" title="Class template unwrap_reference">unwrap_reference</a>.</p></div><table width="100%"><tr><td align="left"><small>Last revised: February 18, 2003 at 14:32:03 GMT</small></td><td align="right"><small>Copyright © 1999, 2000 Jaakko Järvi<br>Copyright © 2001, 2002 Peter Dimov<br>Copyright © 2002 David Abrahams</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="id2695230.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="signals.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Class template unwrap_reference </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Boost.Signals</td></tr></table></div></body></html>
+37
View File
@@ -0,0 +1,37 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Boost.Ref</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="index.html" title="The Boost C++ Libraries"><link rel="previous" href="function.testsuite.html" title="Testsuite"><link rel="next" href="ref.reference.html" title="Reference"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"><link rel="section" href="ref.html#ref.intro" title="Introduction"><link rel="section" href="ref.reference.html" title="Reference"><link rel="section" href="ref.ack.html" title="Acknowledgements"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="ref"></a>Boost.Ref</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Jaakko</span> <span class="surname">Järvi</span></h3></div></div><div><div class="author"><h3 class="author"><span class="firstname">Peter</span> <span class="surname">Dimov</span></h3></div></div><div><div class="author"><h3 class="author"><span class="firstname">Douglas</span> <span class="surname">Gregor</span></h3></div></div><div><div class="author"><h3 class="author"><span class="firstname">Dave</span> <span class="surname">Abrahams</span></h3></div></div><div><p class="copyright">Copyright © 1999, 2000 Jaakko Järvi</p></div><div><p class="copyright">Copyright © 2001, 2002 Peter Dimov</p></div><div><p class="copyright">Copyright © 2002 David Abrahams</p></div><div><div class="legalnotice"><p>Permission to copy, use, modify, sell and distribute this
software is granted provided this copyright notice appears in
all copies. This software is provided &quot;as is&quot; without express
or implied warranty, and with no claim as to its suitability for
any purpose.
</p></div></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="ref.html#ref.intro">Introduction</a></dt><dt><a href="ref.reference.html">Reference</a></dt><dd><dl><dt><a href="ref.reference.html#header.boost.ref.hpp">Header &lt;boost/ref.hpp&gt;</a></dt></dl></dd><dt><a href="ref.ack.html">Acknowledgements</a></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="ref.intro"></a>Introduction</h2></div></div><div></div></div><p>The Ref library is a small library that is useful for passing
references to function templates (algorithms) that would usually
take copies of their arguments. It defines the class template
<tt class="computeroutput"><a href="id2833212.html" title="Class template reference_wrapper">boost::reference_wrapper&lt;T&gt;</a></tt>,
the two functions
<tt class="computeroutput"><a href="id2833212.html#id2695067">boost::ref</a></tt> and
<tt class="computeroutput"><a href="id2833212.html#id2695106">boost::cref</a></tt> that return
instances of <tt class="computeroutput">boost::reference_wrapper&lt;T&gt;</tt>, and the
two traits classes
<tt class="computeroutput"><a href="id2695148.html" title="Class template is_reference_wrapper">boost::is_reference_wrapper&lt;T&gt;</a></tt>
and
<tt class="computeroutput"><a href="id2695230.html" title="Class template unwrap_reference">boost::unwrap_reference&lt;T&gt;</a></tt>.</p><p>The purpose of
<tt class="computeroutput">boost::reference_wrapper&lt;T&gt;</tt> is to
contain a reference to an object of type T. It is primarily used to
&quot;feed&quot; references to function templates (algorithms) that take their
parameter by value.</p><p>To support this usage,
<tt class="computeroutput">boost::reference_wrapper&lt;T&gt;</tt> provides an implicit
conversion to <tt class="computeroutput">T&amp;</tt>. This usually allows the function
templates to work on references unmodified.</p><p><tt class="computeroutput">boost::reference_wrapper&lt;T&gt;</tt> is
both CopyConstructible and Assignable (ordinary references are not
Assignable).</p><p>The expression <tt class="computeroutput">boost::ref(x)</tt>
returns a
<tt class="computeroutput">boost::reference_wrapper&lt;X&gt;(x)</tt> where X
is the type of x. Similarly,
<tt class="computeroutput">boost::cref(x)</tt> returns a
<tt class="computeroutput">boost::reference_wrapper&lt;X const&gt;(x)</tt>.</p><p>The expression
<tt class="computeroutput">boost::is_reference_wrapper&lt;T&gt;::value</tt>
is true if T is a <tt class="computeroutput">reference_wrapper</tt>, and
false otherwise.</p><p>The type-expression
<tt class="computeroutput">boost::unwrap_reference&lt;T&gt;::type</tt> is T::type if T
is a <tt class="computeroutput">reference_wrapper</tt>, T otherwise.</p></div></div><table width="100%"><tr><td align="left"><small>Last revised: February 18, 2003 at 14:32:03 GMT</small></td><td align="right"><small></small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="function.testsuite.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="index.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="ref.reference.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Testsuite </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Reference</td></tr></table></div></body></html>
+8
View File
@@ -0,0 +1,8 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Reference</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="ref.html" title="Boost.Ref"><link rel="previous" href="ref.html" title="Boost.Ref"><link rel="next" href="id2833212.html" title="Class template reference_wrapper"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"><link rel="subsection" href="ref.reference.html#header.boost.ref.hpp" title="Header &lt;boost/ref.hpp&gt;"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="ref.reference"></a>Reference</h2></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="header.boost.ref.hpp"></a>Header &lt;<a href="../../boost/ref.hpp" target="_top">boost/ref.hpp</a>&gt;</h3></div></div><div></div></div><pre class="synopsis"><span class="bold"><b>namespace</b></span> boost {
  <a href="id2833212.html" title="Class template reference_wrapper"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> T&gt; <span class="bold"><b>class</b></span> reference_wrapper;</a>
  <a href="id2833212.html#id2695067">reference_wrapper&lt;T&gt; ref(T&amp;)</a>;
  <a href="id2833212.html#id2695106">reference_wrapper&lt;T <span class="bold"><b>const</b></span>&gt; cref(T <span class="bold"><b>const</b></span>&amp;)</a>;
  <a href="id2695148.html" title="Class template is_reference_wrapper"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> T&gt; <span class="bold"><b>class</b></span> is_reference_wrapper;</a>
  <a href="id2695230.html" title="Class template unwrap_reference"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> T&gt; <span class="bold"><b>class</b></span> unwrap_reference;</a>
}</pre></div></div><table width="100%"><tr><td align="left"><small>Last revised: February 18, 2003 at 14:32:03 GMT</small></td><td align="right"><small>Copyright © 1999, 2000 Jaakko Järvi<br>Copyright © 2001, 2002 Peter Dimov<br>Copyright © 2002 David Abrahams</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ref.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="id2833212.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Boost.Ref </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Class template reference_wrapper</td></tr></table></div></body></html>
+5
View File
@@ -0,0 +1,5 @@
PRE.synopsis {
background-color: #e0ffff;
border: thin solid blue;
padding: 1em
}
+24
View File
@@ -0,0 +1,24 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Boost.Signals</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="index.html" title="The Boost C++ Libraries"><link rel="previous" href="ref.ack.html" title="Acknowledgements"><link rel="next" href="ch04s02.html" title="Tutorial"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"><link rel="section" href="signals.html#id2888155" title="Introduction"><link rel="section" href="ch04s02.html" title="Tutorial"><link rel="section" href="signals.reference.html" title="Reference"><link rel="section" href="ch04s04.html" title="Frequently Asked Questions"><link rel="section" href="ch04s05.html" title="Design Overview"><link rel="section" href="ch04s06.html" title="Design Rationale"><link rel="section" href="ch04s07.html" title="Testsuite"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="signals"></a>Boost.Signals</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Douglas</span> <span class="surname">Gregor</span></h3></div></div><div><p class="copyright">Copyright © 2001-2003 Douglas Gregor</p></div><div><div class="legalnotice"><p>Permission to copy, use, sell and distribute this software
is granted provided this copyright notice appears in all copies.
Permission to modify the code and to distribute modified code is
granted provided this copyright notice appears in all copies, and
a notice that the code was modified is included with the copyright
notice. </p><p> This software is provided &quot;as is&quot; without express or
implied warranty, and with no claim as to its suitability for any
purpose. </p></div></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="signals.html#id2888155">Introduction</a></dt><dt><a href="ch04s02.html">Tutorial</a></dt><dd><dl><dt><a href="ch04s02.html#id2888202">How to Read this Tutorial</a></dt><dt><a href="ch04s02.html#id2888275">Compatibility Note</a></dt><dt><a href="ch04s02.html#id2888425">Hello, World! (Beginner)</a></dt><dt><a href="ch04s02.html#id2888584">Calling multiple slots</a></dt><dd><dl><dt><a href="ch04s02.html#id2888590">Connecting multiple slots (Beginner)</a></dt><dt><a href="ch04s02.html#id2888807">Ordering slot call groups (Intermediate)</a></dt></dl></dd><dt><a href="ch04s02.html#id2889063">Passing values to and from slots</a></dt><dd><dl><dt><a href="ch04s02.html#id2889069">Slot Arguments (Beginner)</a></dt><dt><a href="ch04s02.html#id2889329">Signal Return Values (Advanced)</a></dt></dl></dd><dt><a href="ch04s02.html#id2890060">Connection Management</a></dt><dd><dl><dt><a href="ch04s02.html#id2890066">Disconnecting Slots (Beginner)</a></dt><dt><a href="ch04s02.html#id2890208">Scoped connections (Intermediate)</a></dt><dt><a href="ch04s02.html#id2890264">Automatic connection management (Intermediate)</a></dt><dt><a href="ch04s02.html#id2890510">When can disconnections occur? (Intermediate)</a></dt><dt><a href="ch04s02.html#id2890595">Passing slots (Intermediate)</a></dt></dl></dd></dl></dd><dt><a href="signals.reference.html">Reference</a></dt><dd><dl><dt><a href="signals.reference.html#header.boost.signal.hpp">Header &lt;boost/signal.hpp&gt;</a></dt><dt><a href="signals.reference.html#id2895664">Header &lt;boost/signals/slot.hpp&gt;</a></dt><dt><a href="signals.reference.html#id2900517">Header &lt;boost/signals/trackable.hpp&gt;</a></dt><dt><a href="signals.reference.html#id2858799">Header &lt;boost/signals/connection.hpp&gt;</a></dt><dt><a href="signals.reference.html#id2905340">Header &lt;boost/visit_each.hpp&gt;</a></dt><dt><a href="signals.reference.html#id2875832">Header &lt;boost/last_value.hpp&gt;</a></dt></dl></dd><dt><a href="ch04s04.html">Frequently Asked Questions</a></dt><dt><a href="ch04s05.html">Design Overview</a></dt><dd><dl><dt><a href="ch04s05.html#id2895772">Type Erasure</a></dt><dt><a href="ch04s05.html#id2895860">connection class</a></dt><dt><a href="ch04s05.html#id2895993">Slot Call Iterator</a></dt><dt><a href="ch04s05.html#id2896236">visit_each function template</a></dt></dl></dd><dt><a href="ch04s06.html">Design Rationale</a></dt><dd><dl><dt><a href="ch04s06.html#id2896415">Choice of Slot Definitions</a></dt><dt><a href="ch04s06.html#id2896550">User-level Connection Management</a></dt><dt><a href="ch04s06.html#id2811980">Combiner Interface</a></dt><dt><a href="ch04s06.html#id2897087">Connection Interfaces: += operator</a></dt><dt><a href="ch04s06.html#id2897291">trackable rationale</a></dt><dd><dl><dt><a href="ch04s06.html#id2897340">trackable copying behavior</a></dt><dt><a href="ch04s06.html#id2897409">Why derivation from trackable?</a></dt></dl></dd><dt><a href="ch04s06.html#id2897506">Comparison with other Signal/Slot implementations</a></dt><dd><dl><dt><a href="ch04s06.html#id2897514">libsigc++</a></dt><dt><a href="ch04s06.html#id2897600">.NET delegates</a></dt></dl></dd></dl></dd><dt><a href="ch04s07.html">Testsuite</a></dt><dd><dl><dt><a href="ch04s07.html#id2897667">Acceptance tests</a></dt></dl></dd></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2888155"></a>Introduction</h2></div></div><div></div></div><p>The Boost.Signals library is an implementation of a managed
signals and slots system. Signals represent callbacks with multiple
targets, and are also called publishers or events in similar
systems. Signals are connected to some set of slots, which are
callback receivers (also called event targets or subscribers), which
are called when the signal is &quot;emitted.&quot;</p><p>Signals and slots are managed, in that signals and slots (or,
more properly, objects that occur as part of the slots) track all
connections and are capable of automatically disconnecting signal/slot
connections when either is destroyed. This enables the user to make
signal/slot connections without expending a great effort to manage the
lifetimes of those connections with regard to the lifetimes of all
objects involved.</p><p>When signals are connected to multiple slots, there is a
question regarding the relationship between the return values of the
slots and the return value of the signals. Boost.Signals allows the
user to specify the manner in which multiple return values are
combined.</p></div></div><table width="100%"><tr><td align="left"><small></small></td><td align="right"><small></small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ref.ack.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="index.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="ch04s02.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Acknowledgements </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Tutorial</td></tr></table></div></body></html>
+32
View File
@@ -0,0 +1,32 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Reference</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.60.1"><link rel="home" href="index.html" title="The Boost C++ Libraries"><link rel="up" href="signals.html" title="Boost.Signals"><link rel="previous" href="ch04s02.html" title="Tutorial"><link rel="next" href="class.boost.signalN.html" title="Class template signalN"><link rel="chapter" href="any.html" title="Boost.Any"><link rel="refentry" href="class.boost.bad_any_cast.html" title="Class bad_any_cast"><link rel="refentry" href="class.boost.any.html" title="Class any"><link rel="refentry" href="id2827840.html" title="Function any_cast"><link rel="chapter" href="function.html" title="Boost.Function"><link rel="refentry" href="id2837192.html" title="Class bad_function_call"><link rel="refentry" href="class.boost.function_base.html" title="Class function_base"><link rel="refentry" href="class.boost.functionN.html" title="Class template functionN"><link rel="refentry" href="class.boost.function.html" title="Class template function"><link rel="chapter" href="ref.html" title="Boost.Ref"><link rel="refentry" href="id2833212.html" title="Class template reference_wrapper"><link rel="refentry" href="id2695148.html" title="Class template is_reference_wrapper"><link rel="refentry" href="id2695230.html" title="Class template unwrap_reference"><link rel="chapter" href="signals.html" title="Boost.Signals"><link rel="refentry" href="class.boost.signalN.html" title="Class template signalN"><link rel="refentry" href="class.boost.signal.html" title="Class template signal"><link rel="refentry" href="class.boost.slot.html" title="Class template slot"><link rel="refentry" href="id2852290.html" title="Class trackable"><link rel="refentry" href="id2890015.html" title="Class connection"><link rel="refentry" href="id2877648.html" title="Class scoped_connection"><link rel="refentry" href="id2905241.html" title="Function template visit_each"><link rel="refentry" href="class.boost.last_value.html" title="Class template last_value"><link rel="refentry" href="id2830650.html" title="Class last_value&lt;void&gt;"><link rel="subsection" href="signals.reference.html#header.boost.signal.hpp" title="Header &lt;boost/signal.hpp&gt;"><link rel="subsection" href="signals.reference.html#id2895664" title="Header &lt;boost/signals/slot.hpp&gt;"><link rel="subsection" href="signals.reference.html#id2900517" title="Header &lt;boost/signals/trackable.hpp&gt;"><link rel="subsection" href="signals.reference.html#id2858799" title="Header &lt;boost/signals/connection.hpp&gt;"><link rel="subsection" href="signals.reference.html#id2905340" title="Header &lt;boost/visit_each.hpp&gt;"><link rel="subsection" href="signals.reference.html#id2875832" title="Header &lt;boost/last_value.hpp&gt;"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="1" cellpadding="2" bgcolor="#007F7F"><tr><td bgcolor="#FFFFFF"><img src="../../c%2B%2Bboost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86"></td><td><a href="../../index.htm"><font color="#FFFFFF" size="4" face="Arial">Home</font></a></td><td><a href="../../libs/libraries.htm"><font color="#FFFFFF" size="4" face="Arial">Libraries</font></a></td><td><a href="../../people/people.htm"><font color="#FFFFFF" size="4" face="Arial">People</font></a></td><td><a href="../../more/faq.htm"><font color="#FFFFFF" size="4" face="Arial">FAQ</font></a></td><td><a href="../../more/index.htm"><font color="#FFFFFF" size="4" face="Arial">More</font></a></td></tr></table><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="signals.reference"></a>Reference</h2></div></div><div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="header.boost.signal.hpp"></a>Header &lt;<a href="../../boost/signal.hpp" target="_top">boost/signal.hpp</a>&gt;</h3></div></div><div></div></div><pre class="synopsis"><span class="bold"><b>namespace</b></span> boost {
  <span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> R, <span class="bold"><b>typename</b></span> T1, <span class="bold"><b>typename</b></span> T2, ..., <span class="bold"><b>typename</b></span> TN,
           <span class="bold"><b>typename</b></span> Combiner = <a href="class.boost.last_value.html" title="Class template last_value">last_value</a>&lt;R&gt;, <span class="bold"><b>typename</b></span> Group = int,
           <span class="bold"><b>typename</b></span> GroupCompare = std::less&lt;Group&gt;,
           <span class="bold"><b>typename</b></span> SlotFunction = <a href="class.boost.functionN.html" title="Class template functionN">functionN</a>&lt;R, T1, T2, ..., TN&gt; &gt;
  <span class="bold"><b>class</b></span> <a href="class.boost.signalN.html" title="Class template signalN">signalN</a>;
  <span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> Signature, <span class="bold"><b>typename</b></span> Allocator = std::allocator&lt;void&gt;,
           <span class="bold"><b>typename</b></span> Combiner = <a href="class.boost.last_value.html" title="Class template last_value">last_value</a>&lt;R&gt;, <span class="bold"><b>typename</b></span> Group = int,
           <span class="bold"><b>typename</b></span> GroupCompare = std::less&lt;Group&gt;,
           <span class="bold"><b>typename</b></span> SlotFunction = <a href="class.boost.functionN.html" title="Class template functionN">functionN</a>&lt;Signature&gt; &gt;
  <span class="bold"><b>class</b></span> <a href="class.boost.signal.html" title="Class template signal">signal</a>;
}</pre></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2895664"></a>Header &lt;<a href="../../boost/signals/slot.hpp" target="_top">boost/signals/slot.hpp</a>&gt;</h3></div></div><div></div></div><pre class="synopsis"><span class="bold"><b>namespace</b></span> boost {
  <a href="class.boost.slot.html" title="Class template slot"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> SlotFunction&gt; <span class="bold"><b>class</b></span> slot;</a>
}</pre></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2900517"></a>Header &lt;<a href="../../boost/signals/trackable.hpp" target="_top">boost/signals/trackable.hpp</a>&gt;</h3></div></div><div></div></div><pre class="synopsis"><span class="bold"><b>namespace</b></span> boost {
  <span class="bold"><b>namespace</b></span> signals {
    <a href="id2852290.html" title="Class trackable"><span class="bold"><b>class</b></span> trackable;</a>
  }
}</pre></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2858799"></a>Header &lt;<a href="../../boost/signals/connection.hpp" target="_top">boost/signals/connection.hpp</a>&gt;</h3></div></div><div></div></div><pre class="synopsis"><span class="bold"><b>namespace</b></span> boost {
  <span class="bold"><b>namespace</b></span> signals {
    <a href="id2890015.html" title="Class connection"><span class="bold"><b>class</b></span> connection;</a>
    <a href="id2890015.html#id2883120"><span class="bold"><b>void</b></span> swap(connection&amp;, connection&amp;)</a>;
    <a href="id2877648.html" title="Class scoped_connection"><span class="bold"><b>class</b></span> scoped_connection;</a>
  }
}</pre></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2905340"></a>Header &lt;<a href="../../boost/visit_each.hpp" target="_top">boost/visit_each.hpp</a>&gt;</h3></div></div><div></div></div><pre class="synopsis"><span class="bold"><b>namespace</b></span> boost {
  <span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> Visitor, <span class="bold"><b>typename</b></span> T&gt;
    <span class="bold"><b>void</b></span> <a href="id2905241.html" title="Function template visit_each">visit_each</a>(<span class="bold"><b>const</b></span> Visitor&amp;, <span class="bold"><b>const</b></span> T&amp;, <span class="bold"><b>int</b></span>);
}</pre></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2875832"></a>Header &lt;<a href="../../boost/last_value.hpp" target="_top">boost/last_value.hpp</a>&gt;</h3></div></div><div></div></div><pre class="synopsis"><span class="bold"><b>namespace</b></span> boost {
  <a href="class.boost.last_value.html" title="Class template last_value"><span class="bold"><b>template</b></span>&lt;<span class="bold"><b>typename</b></span> T&gt; <span class="bold"><b>class</b></span> last_value;</a>
  <a href="id2830650.html" title="Class last_value&lt;void&gt;"><span class="bold"><b>template</b></span>&lt;&gt; <span class="bold"><b>class</b></span> last_value&lt;<span class="bold"><b>void</b></span>&gt;;</a>
}</pre></div></div><table width="100%"><tr><td align="left"><small></small></td><td align="right"><small>Copyright © 2001-2003 Douglas Gregor</small></td></tr></table><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch04s02.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="signals.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="class.boost.signalN.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Tutorial </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> Class template signalN</td></tr></table></div></body></html>
-783
View File
@@ -1,783 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE boostbook PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
"http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
<boostbook xmlns:xi="http://www.w3.org/2001/XInclude"
last-revision="$Date$">
<title>The Boost C++ Libraries</title>
<chapter id="libraries">
<title>The Boost C++ Libraries</title>
<para>
Documentation for some libraries is available in alternative formats:
<itemizedlist>
<listitem>
<simpara><ulink url="../boost-doc-html.tar.gz">HTML (tarred, gzipped)</ulink></simpara>
</listitem>
<listitem>
<simpara><ulink url="../boost.pdf">PDF</ulink></simpara>
</listitem>
<listitem>
<simpara>
<ulink url="../boost-doc-man.tar.gz">Unix man pages</ulink>
</simpara>
</listitem>
<listitem>
<simpara><ulink url="../boost.docbook">DocBook</ulink></simpara>
</listitem>
<listitem>
<simpara>
<ulink url="../boost.fo">XSL Formatting Objects</ulink>
</simpara>
</listitem>
</itemizedlist>
</para>
<section>
<title>Libraries Listed Alphabetically</title>
<librarylist/>
</section>
<section>
<title>Libraries Listed by Category</title>
<librarycategorylist>
<librarycategorydef name="category:string-text">
String and text processing
</librarycategorydef>
<librarycategorydef name="category:containers">
Containers
</librarycategorydef>
<librarycategorydef name="category:iterators">
Iterators
</librarycategorydef>
<librarycategorydef name="category:algorithms">
Algorithms
</librarycategorydef>
<librarycategorydef name="category:higher-order">
Function objects and higher-order programming
</librarycategorydef>
<librarycategorydef name="category:generic">
Generic programming
</librarycategorydef>
<librarycategorydef name="category:template">
Template metaprogramming
</librarycategorydef>
<librarycategorydef name="category:preprocessor">
Preprocessor metaprogramming
</librarycategorydef>
<librarycategorydef name="category:concurrent">
Concurrent programming
</librarycategorydef>
<librarycategorydef name="category:math">
Math and numerics
</librarycategorydef>
<librarycategorydef name="category:testing">
Correctness and testing
</librarycategorydef>
<librarycategorydef name="category:data-structures">
Data structures
</librarycategorydef>
<librarycategorydef name="category:io">
Input/Output
</librarycategorydef>
<librarycategorydef name="category:lang">
Inter-language support
</librarycategorydef>
<librarycategorydef name="category:memory">
Memory
</librarycategorydef>
<librarycategorydef name="category:parsing">
Parsing
</librarycategorydef>
<librarycategorydef name="category:misc">
Miscellaneous
</librarycategorydef>
<librarycategorydef name="category:broken">
Broken compiler workarounds
</librarycategorydef>
</librarycategorylist>
</section>
</chapter>
<xi:include href="../../libs/any/doc/any.xml"/>
<xi:include href="../../libs/array/doc/array.xml"/>
<library name="Bind" dirname="bind" html-only="1">
<libraryinfo>
<author>
<firstname>Peter</firstname>
<surname>Dimov</surname>
</author>
<librarypurpose>Generalized binders for function/object/pointers and member functions</librarypurpose>
<librarycategory name="category:higher-order"/>
</libraryinfo>
</library>
<library name="Mem_fn" dirname="bind" html-only="1"
url="../../libs/bind/mem_fn.html">
<libraryinfo>
<author>
<firstname>Peter</firstname>
<surname>Dimov</surname>
</author>
<librarypurpose>Generalized binders for member functions</librarypurpose>
<librarycategory name="category:higher-order"/>
</libraryinfo>
</library>
<library name="Call Traits" dirname="call_traits" html-only="1"
url="../../libs/utility/call_traits.htm">
<libraryinfo>
<author>
<firstname>John</firstname>
<surname>Maddock</surname>
</author>
<author>
<firstname>Howard</firstname>
<surname>Hinnant</surname>
</author>
<librarypurpose>Defines types for passing parameters</librarypurpose>
<librarycategory name="category:generic"/>
</libraryinfo>
</library>
<library name="Compatibility" dirname="compatibility" html-only="1">
<libraryinfo>
<author>
<firstname>Ralf</firstname>
<surname>Grosse-Kunstleve</surname>
</author>
<author>
<firstname>Jens</firstname>
<surname>Maurer</surname>
</author>
<librarypurpose>Help for non-conforming standard libraries</librarypurpose>
<librarycategory name="category:broken"/>
</libraryinfo>
</library>
<library name="Compose" dirname="compose" html-only="1"
url="../../libs/compose/index.htm">
<libraryinfo>
<author>
<firstname>Nicolai</firstname>
<surname>Josuttis</surname>
</author>
<librarypurpose>Functional composition adapters for the STL</librarypurpose>
<librarycategory name="category:higher-order"/>
</libraryinfo>
</library>
<library name="Compressed Pair" dirname="compressed_pair" html-only="1"
url="../../libs/utility/compressed_pair.htm">
<libraryinfo>
<author>
<firstname>John</firstname>
<surname>Maddock</surname>
</author>
<author>
<firstname>Howard</firstname>
<surname>Hinnant</surname>
</author>
<librarypurpose>Empty member optimization</librarypurpose>
<librarycategory name="category:data-structures"/>
<librarycategory name="category:misc"/>
</libraryinfo>
</library>
<library name="Concept Check" dirname="concept_check" html-only="1">
<libraryinfo>
<author>
<firstname>Jeremy</firstname>
<surname>Siek</surname>
</author>
<librarypurpose>Tools for generic programming</librarypurpose>
<librarycategory name="category:generic"/>
<librarycategory name="category:testing"/>
</libraryinfo>
</library>
<library name="Config" dirname="config" html-only="1">
<libraryinfo>
<author>
<firstname>John</firstname>
<surname>Maddock</surname>
</author>
<author>
<firstname>Beman</firstname>
<surname>Dawes</surname>
</author>
<author>
<firstname>Vesa</firstname>
<surname>Karvonen</surname>
</author>
<librarypurpose>Helps boost library developers adapt to compiler idiosyncrasies; not intended for library users</librarypurpose>
<librarycategory name="category:broken"/>
</libraryinfo>
</library>
<library name="Conversion" dirname="conversion" html-only="1"
url="../../libs/conversion/index.htm">
<libraryinfo>
<author>
<firstname>Dave</firstname>
<surname>Abrahams</surname>
</author>
<author>
<firstname>Kevlin</firstname>
<surname>Henney</surname>
</author>
<librarypurpose>Numeric, polymorphic, and lexical casts</librarypurpose>
<librarycategory name="category:misc"/>
</libraryinfo>
</library>
<library name="CRC" dirname="crc" html-only="1">
<libraryinfo>
<author>
<firstname>Daryle</firstname>
<surname>Walker</surname>
</author>
<librarypurpose>Cyclic Redundancy Code</librarypurpose>
<librarycategory name="category:misc"/>
</libraryinfo>
</library>
<library name="Date-Time" dirname="date_time" html-only="1">
<libraryinfo>
<author>
<firstname>Jeff</firstname>
<surname>Garland</surname>
</author>
<librarypurpose>Date-Time library</librarypurpose>
<librarycategory name="category:misc"/>
</libraryinfo>
</library>
<library name="Dynamic Bitset" dirname="dynamic_bitset" html-only="1">
<libraryinfo>
<author>
<firstname>Jeremy</firstname>
<surname>Siek</surname>
</author>
<author>
<firstname>Chuck</firstname>
<surname>Allison</surname>
</author>
<librarypurpose>A runtime sized version of <code>std::bitset</code></librarypurpose>
<librarycategory name="category:containers"/>
</libraryinfo>
</library>
<library name="Format" dirname="format" html-only="1"
url="../../libs/format/index.htm">
<libraryinfo>
<author>
<firstname>Samuel</firstname>
<surname>Krempp</surname>
</author>
<librarypurpose>Type-safe 'printf-like' format operations</librarypurpose>
<librarycategory name="category:string-text"/>
<librarycategory name="category:io"/>
</libraryinfo>
</library>
<library name="Filesystem" dirname="filesystem" html-only="1">
<libraryinfo>
<author>
<firstname>Beman</firstname>
<surname>Dawes</surname>
</author>
<librarypurpose>Portable paths, iteration over directories, and other useful filesystem operations</librarypurpose>
<librarycategory name="category:misc"/>
</libraryinfo>
</library>
<xi:include href="../../libs/function/doc/function.xml"/>
<library name="Functional" dirname="functional" html-only="1">
<libraryinfo>
<author>
<firstname>Mark</firstname>
<surname>Rodgers</surname>
</author>
<librarypurpose>Enhanced function object adaptors</librarypurpose>
<librarycategory name="category:higher-order"/>
</libraryinfo>
</library>
<library name="Graph" dirname="graph" html-only="1">
<libraryinfo>
<author>
<firstname>Jeremy</firstname>
<surname>Siek</surname>
</author>
<author>
<firstname>University of Notre Dame</firstname>
<surname>Team</surname>
</author>
<librarypurpose>Generic graph components and algorithms</librarypurpose>
<librarycategory name="category:containers"/>
<librarycategory name="category:iterators"/>
<librarycategory name="category:algorithms"/>
</libraryinfo>
</library>
<library name="Integer" dirname="integer" html-only="1"
url="../../libs/integer/index.htm">
<libraryinfo>
<author>
<firstname>various</firstname>
<surname>authors</surname>
</author>
<librarypurpose>Headers to ease dealing with integral types</librarypurpose>
<librarycategory name="category:math"/>
</libraryinfo>
</library>
<library name="Interval" dirname="numeric/interval" html-only="1"
url="../../libs/numeric/interval/doc/index.html">
<libraryinfo>
<author>
<firstname>Guillaume</firstname>
<surname>Melquiond</surname>
</author>
<author>
<firstname>Herv&eacute;</firstname>
<surname>Br&ouml;nnimann</surname>
</author>
<author>
<firstname>Sylvain</firstname>
<surname>Pion</surname>
</author>
<librarypurpose>Extends the usual arithmetic functions to mathematical intervals</librarypurpose>
<librarycategory name="category:math"/>
</libraryinfo>
</library>
<library name="I/O State Savers" dirname="io" html-only="1">
<libraryinfo>
<author>
<firstname>Daryle</firstname>
<surname>Walker</surname>
</author>
<librarypurpose>Save I/O state to prevent jumbled data</librarypurpose>
<librarycategory name="category:io"/>
</libraryinfo>
</library>
<library name="Iterator Adaptors" dirname="utility" html-only="1"
url="../../libs/utility/iterator_adaptors.htm">
<libraryinfo>
<author>
<firstname>Dave</firstname>
<surname>Abrahams</surname>
</author>
<author>
<firstname>Jeremy</firstname>
<surname>Siek</surname>
</author>
<author>
<firstname>John</firstname>
<surname>Potter</surname>
</author>
<librarypurpose>Adapt a base type into a standard conforming iterator</librarypurpose>
<librarycategory name="category:iterators"/>
</libraryinfo>
</library>
<library name="Lambda" dirname="lambda" html-only="1">
<libraryinfo>
<author>
<firstname>Jaakko</firstname>
<surname>J&auml;rvi</surname>
</author>
<author>
<firstname>Gary</firstname>
<surname>Powell</surname>
</author>
<librarypurpose>Define small unnamed function objects at the actual call site, and more</librarypurpose>
<librarycategory name="category:higher-order"/>
</libraryinfo>
</library>
<library name="Math" dirname="math" html-only="1">
<libraryinfo>
<author>
<firstname>various</firstname>
<surname>authors</surname>
</author>
<librarypurpose>Several contributions in the domain of mathematics</librarypurpose>
<librarycategory name="category:math"/>
</libraryinfo>
</library>
<library name="Math/Common Factor" dirname="math/common_factor" html-only="1"
url="../../libs/math/doc/common_factor.html">
<libraryinfo>
<author>
<firstname>Daryle</firstname>
<surname>Walker</surname>
</author>
<librarypurpose>Greatest common divisor and least common multiple</librarypurpose>
<librarycategory name="category:math"/>
</libraryinfo>
</library>
<library name="Math/Octonion" dirname="math/octonion" html-only="1">
<libraryinfo>
<author>
<firstname>Hubert</firstname>
<surname>Holin</surname>
</author>
<librarypurpose>Octonions</librarypurpose>
<librarycategory name="category:math"/>
</libraryinfo>
</library>
<library name="Math/Quaternion" dirname="math/quaternion" html-only="1">
<libraryinfo>
<author>
<firstname>Hubert</firstname>
<surname>Holin</surname>
</author>
<librarypurpose>Quaternions</librarypurpose>
<librarycategory name="category:math"/>
</libraryinfo>
</library>
<library name="Math/Special Functions" dirname="math/special_functions" html-only="1">
<libraryinfo>
<author>
<firstname>Hubert</firstname>
<surname>Holin</surname>
</author>
<librarypurpose>Mathematical special functions such as atanh, sinc, and sinhc</librarypurpose>
<librarycategory name="category:math"/>
</libraryinfo>
</library>
<library name="MPL" dirname="mpl" html-only="1">
<libraryinfo>
<author>
<firstname>Aleksey</firstname>
<surname>Gurtovoy</surname>
</author>
<librarypurpose>Template metaprogramming framework of compile-time algorithms, sequences and metafunction classes</librarypurpose>
<librarycategory name="category:template"/>
</libraryinfo>
</library>
<library name="Multi Array" dirname="multi_array" html-only="1">
<libraryinfo>
<author>
<firstname>Ron</firstname>
<surname>Garcia</surname>
</author>
<librarypurpose>Multidimensional containers and adaptors for arrays of contiguous data</librarypurpose>
<librarycategory name="category:math"/>
<librarycategory name="category:containers"/>
</libraryinfo>
</library>
<library name="Operators" dirname="utility" html-only="1">
<libraryinfo>
<author>
<firstname>Dave</firstname>
<surname>Abrahams</surname>
</author>
<author>
<firstname>Jeremy</firstname>
<surname>Siek</surname>
</author>
<librarypurpose>Templates ease arithmetic classes and iterators</librarypurpose>
<librarycategory name="category:generic"/>
<librarycategory name="category:iterators"/>
<librarycategory name="category:math"/>
</libraryinfo>
</library>
<library name="Optional" dirname="optional" html-only="1">
<libraryinfo>
<author>
<firstname>Fernando</firstname>
<surname>Cacciola</surname>
</author>
<librarypurpose>Discriminated-union wrapper for optional values</librarypurpose>
<librarycategory name="category:misc"/>
<librarycategory name="category:data-structures"/>
</libraryinfo>
</library>
<library name="Pool" dirname="pool" html-only="1">
<libraryinfo>
<author>
<firstname>Steve</firstname>
<surname>Cleary</surname>
</author>
<librarypurpose>Memory pool management</librarypurpose>
<librarycategory name="category:memory"/>
</libraryinfo>
</library>
<library name="Preprocessor" dirname="preprocessor" html-only="1">
<libraryinfo>
<author>
<firstname>Vesa</firstname>
<surname>Karvonen</surname>
</author>
<author>
<firstname>Paul</firstname>
<surname>Mensonides</surname>
</author>
<librarypurpose>Preprocessor metaprogramming tools including repetition and recursion</librarypurpose>
<librarycategory name="category:preprocessor"/>
</libraryinfo>
</library>
<library name="Property Map" dirname="property_map" html-only="1">
<libraryinfo>
<author>
<firstname>Jeremy</firstname>
<surname>Siek</surname>
</author>
<librarypurpose>Concepts defining interfaces which map key objects to value objects</librarypurpose>
<librarycategory name="category:containers"/>
<librarycategory name="category:generic"/>
</libraryinfo>
</library>
<library name="Python" dirname="python" html-only="1">
<libraryinfo>
<author>
<firstname>Dave</firstname>
<surname>Abrahams</surname>
</author>
<librarypurpose>Reflects C++ classes and functions into <ulink url="http://www.python.org">Python</ulink></librarypurpose>
<librarycategory name="category:lang"/>
</libraryinfo>
</library>
<library name="Random" dirname="random" html-only="1">
<libraryinfo>
<author>
<firstname>Jens</firstname>
<surname>Maurer</surname>
</author>
<librarypurpose>A complete system for random number generation</librarypurpose>
<librarycategory name="category:math"/>
</libraryinfo>
</library>
<library name="Rational" dirname="rational" html-only="1">
<libraryinfo>
<author>
<firstname>Paul</firstname>
<surname>Moore</surname>
</author>
<librarypurpose>A rational number class</librarypurpose>
<librarycategory name="category:math"/>
</libraryinfo>
</library>
<xi:include href="../../libs/bind/doc/ref.xml"/>
<library name="Regex" dirname="regex" html-only="1"
url="../../libs/regex/index.htm">
<libraryinfo>
<author>
<firstname>John</firstname>
<surname>Maddock</surname>
</author>
<librarypurpose>Regular expression library</librarypurpose>
<librarycategory name="category:string-text"/>
</libraryinfo>
</library>
<xi:include href="../../libs/signals/doc/signals.xml"/>
<library name="Smart Pointer" dirname="smart_ptr" html-only="1"
url="../../libs/smart_ptr/index.htm">
<libraryinfo>
<author>
<firstname>Greg</firstname>
<surname>Colvin</surname>
</author>
<author>
<firstname>Beman</firstname>
<surname>Dawes</surname>
</author>
<author>
<firstname>Peter</firstname>
<surname>Dimov</surname>
</author>
<author>
<firstname>Darin</firstname>
<surname>Adler</surname>
</author>
<librarypurpose>Five smart pointer class templates</librarypurpose>
<librarycategory name="category:memory"/>
</libraryinfo>
</library>
<library name="Spirit" dirname="spirit" html-only="1">
<libraryinfo>
<author>
<firstname>Joel</firstname>
<surname>de Guzman</surname>
</author>
<author>
<firstname>team</firstname>
</author>
<librarypurpose>LL parser framework represents parsers directly as EBNF grammars in inlined C++</librarypurpose>
<librarycategory name="category:text"/>
<librarycategory name="category:parsing"/>
</libraryinfo>
</library>
<library name="Static Assert" dirname="static_assert" html-only="1">
<libraryinfo>
<author>
<firstname>John</firstname>
<surname>Maddock</surname>
</author>
<librarypurpose>Static assertions (compile time assertions)</librarypurpose>
<librarycategory name="category:template"/>
<librarycategory name="category:generic"/>
<librarycategory name="category:testing"/>
</libraryinfo>
</library>
<library name="Test" dirname="test" html-only="1">
<libraryinfo>
<author>
<firstname>Gennadiy</firstname>
<surname>Rozental</surname>
</author>
<librarypurpose>Support for simple program testing, full unit testing, and for program execution monitoring</librarypurpose>
<librarycategory name="category:testing"/>
</libraryinfo>
</library>
<library name="Threads" dirname="thread" html-only="1">
<libraryinfo>
<author>
<firstname>William</firstname>
<surname>Kempf</surname>
</author>
<librarypurpose>Portable C++ multi-threading</librarypurpose>
<librarycategory name="category:concurrent"/>
</libraryinfo>
</library>
<library name="Timer" dirname="timer" html-only="1"
url="../../libs/timer/index.htm">
<libraryinfo>
<author>
<firstname>Beman</firstname>
<surname>Dawes</surname>
</author>
<librarypurpose>Event timer, progress timer, and progress display classes</librarypurpose>
<librarycategory name="category:misc"/>
</libraryinfo>
</library>
<library name="Tokenizer" dirname="tokenizer" html-only="1"
url="../../libs/tokenizer/index.htm">
<libraryinfo>
<author>
<firstname>John</firstname>
<surname>Bandela</surname>
</author>
<librarypurpose>Break of a string or other character sequence into a series of tokens</librarypurpose>
<librarycategory name="category:string-text"/>
<librarycategory name="category:iterators"/>
</libraryinfo>
</library>
<library name="Tuple" dirname="tuple" html-only="1">
<libraryinfo>
<author>
<firstname>Jaakko</firstname>
<surname>J&auml;rvi</surname>
</author>
<librarypurpose>Ease definition of functions returning multiple values, and more</librarypurpose>
<librarycategory name="category:data-structures"/>
</libraryinfo>
</library>
<library name="Type Traits" dirname="type_traits" html-only="1"
url="../../libs/type_traits/index.htm">
<libraryinfo>
<author>
<firstname>John</firstname>
<surname>Maddock</surname>
</author>
<author>
<firstname>Steve</firstname>
<surname>Cleary</surname>
</author>
<author>
<firstname>others</firstname>
</author>
<librarypurpose>Templates for fundamental properties of types</librarypurpose>
<librarycategory name="category:generic"/>
<librarycategory name="category:template"/>
</libraryinfo>
</library>
<library name="uBLAS" dirname="numeric/ublas" html-only="1">
<libraryinfo>
<author>
<firstname>Joerg</firstname>
<surname>Walter</surname>
</author>
<author>
<firstname>Mathias</firstname>
<surname>Koch</surname>
</author>
<librarypurpose>Basic linear algebra for dense, packed and sparse matrices</librarypurpose>
<librarycategory name="category:math"/>
</libraryinfo>
</library>
<library name="Utility" dirname="utility" html-only="1">
<libraryinfo>
<author>
<firstname>Dave</firstname>
<surname>Abrahams</surname>
</author>
<author>
<firstname>others</firstname>
</author>
<librarypurpose>Class noncopyable plus <functionname>checked_delete</functionname>, <functionname>checked_array_delete</functionname>, <functionname>next</functionname>, <functionname>prior</functionname> function templates, plus base-from-member idiom</librarypurpose>
<librarycategory name="category:misc"/>
<librarycategory name="category:memory"/>
<librarycategory name="category:algorithms"/>
</libraryinfo>
</library>
<xi:include href="../../libs/variant/doc/variant.xml"/>
</boostbook>
+164 -27
View File
@@ -29,6 +29,7 @@
and newsgroups</b><br>
.&nbsp;<a href="more/mailing_lists.htm#main">Boost (Developers)</a><br>
.&nbsp;<a href="more/mailing_lists.htm#users">Boost Users</a><br>
.&nbsp;<a href="more/mailing_lists.htm#projects">Project-Specific</a><br>
.&nbsp;<a href="more/mailing_lists.htm#announce">Announcements</a><br>
.&nbsp;<a href="more/discussion_policy.htm">Discussion Policy</a></p>
<p><b>Support<br>
@@ -54,11 +55,7 @@
.&nbsp;<a href="more/moderators.html">Moderators</a><br>
.&nbsp;<a href="more/index.htm">More Boost...</a><br>
.&nbsp;<a href="more/links.htm#cpp">More C++...</a></p>
<p><b>Official Branch Sites</b><br>
.&nbsp;<a href="http://spirit.sourceforge.net/">
Spirit</a><br>
</p>
<p><b>Unofficial Branch Sites<br>
<p><b>Unofficial<br>
</b>.&nbsp;<a href="http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl">
Wiki</a><br>
.&nbsp;<a href="http://boost.c-view.org">Chinese mirror</a><br>
@@ -107,13 +104,151 @@
</center>
<!-- Search Google -->
<h2><a name="Latest News">Latest News</a></h2>
<p>????? 2003 - Version 1.31.0</p>
<p>August 19, 2003 - Version 1.30.2 (bugfix release)</p>
<ul>
<li><a href="http://www.boost-consulting.com">Boost Consulting</a> is now hosting
Boost CVS mirrors - see our <a href="more\download.html#CVS">download page</a>.
</li>
<li>Backported changes to the <a href="libs/config/config.htm">config system</a>, to
better handle new compiler releases.
</li>
<li>Bugs in regression reporting in subproject tests were fixed.
</li>
<li>Tests are now run in the context of the user's PATH environment settings
</li>
<li><a href="tools/build/msvc-stlport-tools.html">msvc-stlport</a> and
<a href="tools/build/intel-win32-tools.html">intel-win32-stlport</a> toolsets now
build static libraries with multithreading enabled, to be compatible with the
STLPort builds.
</li>
<li><a href="tools/build/intel-win32-tools.html">intel-win32</a>
toolset now handles <code>wchar_t</code> correctly when intel is installed over msvc6.
<li>Backported fixes from the main trunk which prevent errors building the
<a href="libs/test/doc/index.htm">Boost.Test</a> library in its default configuration.
</li>
<li>Backported portability improvements for
<a href="libs/utility/checked_delete.html">checked_delete</a>.
</li>
<li>
Locale support for metrowerks (requiring a statically-linked runtime) is more uniformly handled.
</li>
<li>Backported <a href="libs/conversion/lexical_cast.htm">conversion/lexical_cast</a>'s
<code>wchar_t</code> fixes from the main trunk.
</li>
<li><a href="tools/build/intel-linux-tools.html">intel-linux-tools</a>:
added <code>rt</code> to FINDLIBS in order to make the <code>clock_gettime()</code>
function available (backport of a patch in CVS HEAD).
</li>
<li><a href="tools\regression\index.htm">regression/compiler_status.cpp</a>: backported
fixes in error log links generation.
</li>
</ul>
<p>August 12, 2003 - <b>ALERT</b></p>
<p>Significant problems were found in
the 1.30.1 release, so it has been
withdrawn from the website. These
problems mostly take the form of
missing files due to an error by the
release manager in using CVS to tag
the release. We expect to release
Version 1.30.2 in a few days. Stay
tuned.
<p>Until then, you may want to get
the <code>RC_1_30_0</code> branch
(which, with only very slight
modification, will become version
1.30.2) from our <a
href="more/download.html#CVS">CVS</a>
repository or the <a
href="more/download.html#CVS">CVS
mirror</a> at <a
href="http://www.boost-consulting.com">Boost
Consulting</a>.
<p>August 4, 2003 - Version 1.30.1 (bugfix release)</p>
Fixes were made to the following libraries:
<ul>
<li><a href="libs/variant/index.html">Variant
Library</a> added - Safe, generic, stack-based discriminated union container,
from Eric Friedman and Itay Maman.</li>
<li>Add news here!</li>
</ul>
<li>The <a
href="libs/lambda/doc/index.html">Boost.Lambda</a>
library is now usable with
gcc-2.95.2
<li><a
href="libs/spirit/index.html">Boost.Spirit</a>:
<ul>
<li> Fixed. Using MSVC++6 (SP5), calling the assign action with a string value on parsers
using the file_iterator will not work.
<li>Fixed: using assign semantic action in a grammar with a multi_pass iterator adaptor
applied to an std::istream_iterator resulted in a failure to compile under msvc 7.0.
<li> Fixed: There is a bug in the "range_run&lt;CharT&gt;::set (range&lt;CharT&gt; const&amp; r)" function in
the "boost\spirit\utility\impl\chset\range_run.ipp".
<li>Fixed: handling of trailing whitespace bug (ast_parse/pt_parse related)
<li>Fixed: comment_p and end of data bug
<li>Fixed: Most trailing space bug:
<li>Fixed:
<code>chset&lt;&gt;::operator~(range&lt;&gt;)</code> bug,
<code>operator&(chset&lt;&gt;, range&lt;&gt;)</code> bug,
<code>operator&(range&lt;&gt;, chset&lt;&gt;)</code> bug,
<li> Fixed: <code>impl::detach_clear</code> bug
<li> Fixed: mismatch closure return type bug
<li> Fixed: <code>access_node_d[]</code> and <code>access_match_d[]</code> iterator bugs
<li>Fixed a bug regarding threadsafety of Phoenix/Spirit closures.
</ul>
<li>The Boost Template <a
href="libs/mpl/doc/index.html">Metaprogramming Library (MPL)</a>'s typeof implementation is now compatible with Metrowerks CodeWarrior Pro8.
<li><a
href="libs/function/index.html">Boost.Function</a>: workaround for the new Borland patch (version 0x564) and MSVC++ .NET
2003.
<li><a href="libs/config/index.html">Boost.Config</a>, <a href="libs/format/doc/format.html">Boost.Format</a>, and <a href="libs/regex/index.html">Boost.Regex</a> have been adjusted to avoid warnings with GCC-3.3, and Boost.Format also now works with string types other than <code>std::string</code>.
<li><a href="libs/smart_ptr/index.htm">Smart Pointers</a>
<ul>
<li><code>checked_delete</code> now works on more platforms
<li>Compatibility with the SunPro compiler
<li>Added missing <code>#include</code>s.
</ul>
<li><a href="libs/python/index.html">Boost.Python</a>
<ul>
<li> warning
suppression for finicky compilers
<li> fixed a crashing bug in
the <code>raw_function</code> facility when no keyword arguments were
passed.
<li> Improved conversion of NULL <code>shared_ptr</code>s to Python.
</ul>
</ul>
<p>March 19, 2003 - Version 1.30.0</p>
<ul>
<li>
@@ -139,21 +274,21 @@
actions, ASTs and much more, from Joel de Guzman and team.
<li>
<a href="libs/smart_ptr/index.htm">Smart Pointers Library</a> - cast functions are now
spelled <a href="libs/smart_ptr/shared_ptr.htm#static_pointer_cast">static_pointer_cast</a>
/ <a href="libs/smart_ptr/shared_ptr.htm#dynamic_pointer_cast">dynamic_pointer_cast</a>
; <a href="libs/smart_ptr/enable_shared_from_this.html">enable_shared_from_this</a>
spelled <A href="libs/smart_ptr/shared_ptr.htm#static_pointer_cast">static_pointer_cast</A>
/ <A href="libs/smart_ptr/shared_ptr.htm#dynamic_pointer_cast">dynamic_pointer_cast</A>
; <A href="libs/smart_ptr/enable_shared_from_this.html">enable_shared_from_this</A>
added; shared_ptr::shared_ptr(), shared_ptr::reset(), weak_ptr::weak_ptr(),
weak_ptr::reset() no longer throw; <a href="libs/smart_ptr/shared_ptr.htm#get_deleter">
get_deleter</a> added; weak_ptr::get() removed; make_shared is now spelled <a href="libs/smart_ptr/weak_ptr.htm#lock">
weak_ptr::lock()</a> ; <a href="libs/smart_ptr/intrusive_ptr.html">intrusive_ptr
documentation</a> added; some experimental undocumented shared_ptr features
have been removed; a <a href="libs/smart_ptr/sp_techniques.html">page describing
some smart pointer programming techniques</a>
weak_ptr::reset() no longer throw; <A href="libs/smart_ptr/shared_ptr.htm#get_deleter">
get_deleter</A> added; weak_ptr::get() removed; make_shared is now spelled <A href="libs/smart_ptr/weak_ptr.htm#lock">
weak_ptr::lock()</A> ; <A href="libs/smart_ptr/intrusive_ptr.html">intrusive_ptr
documentation</A> added; some experimental undocumented shared_ptr features
have been removed; a <A href="libs/smart_ptr/sp_techniques.html">page describing
some smart pointer programming techniques</A>
has been added.
<li>
<a href="libs/utility/assert.html">boost/assert.hpp</a>, <a href="libs/utility/current_function.html">
boost/current_function.hpp</a>, <a href="libs/utility/throw_exception.html">boost/throw_exception.hpp</a>,
<a href="libs/utility/checked_delete.html">boost/checked_delete.hpp</a>
<LI>
<A href="libs/utility/assert.html">boost/assert.hpp</A>, <A href="libs/utility/current_function.html">
boost/current_function.hpp</A>, <A href="libs/utility/throw_exception.html">boost/throw_exception.hpp</A>,
<A href="libs/utility/checked_delete.html">boost/checked_delete.hpp</A>
have been documented.
<li> <a href="libs/date_time/doc/index.html">Date-Time Library</a> - several fixes and small additions including an interface change to partial_date. See <a href="libs/date_time/doc/Changes.html">Date-Time Change History</a> for more details.
</li>
@@ -169,7 +304,7 @@
very nice
<a href="http://boost.sourceforge.net/regression-logs/">
summary page</a> from Rene Rivera.</li>
<li> <a href="libs/test/index.html">Test Library</a>
<LI> <a href="libs/test/index.html">Test Library</a>
- introduced following new facilities:
<ul>
<li>Automatic registration of unit tests</li>
@@ -181,6 +316,7 @@
For complete list of changes see Test Library <a href="libs/test/doc/release_notes.htm#v1_30_0">release notes</a>
<li><a href="libs/libraries.htm">Documentation</a> for some Boost libraries has been converted to a new format allowing PDF and Unix man pages to be generated along with HTML.</li>
<li>
Many fixes and enhancements to other libraries.</li>
</ul>
@@ -319,6 +455,7 @@
</table>
<hr>
<p>Revised
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->19 July, 2003<!--webbot bot="Timestamp" endspan i-checksum="13988" --></p>
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d
%B, %Y" startspan -->12 August, 2003<!--webbot bot="Timestamp" endspan i-checksum="28847" --></p>
</body>
</html>
</html>
+1 -1
Submodule libs/io updated: 38c84588c0...074a89efcf
+12 -12
View File
@@ -66,6 +66,12 @@ how to download and install the libraries.<br>
See <a href="../tools/build/index.html">Building Boost Libraries</a> page to find
out how to build object libraries, when needed.</p>
<p>Documentation for some Boost libraries is available in alternative formats:</p>
<ul>
<li>PDF [<a href="http://boost.sourceforge.net/release/boost_1_30_doc_pdf.zip">zip</a>] [<a href="http://boost.sourceforge.net/release/boost_1_30_doc_pdf.tar.gz">tar.gz</a>] [<a href="http://boost.sourceforge.net/release/boost_1_30_doc_pdf.tar.bz2">tar.bz2</a>]</li>
<li>Unix man pages [<a href="http://boost.sourceforge.net/release/boost_1_30_doc_man.tar.gz">tar.gz</a>] [<a href="http://boost.sourceforge.net/release/boost_1_30_doc_man.tar.bz2">tar.bz2</a>]</li>
</ul>
<hr>
<h2>Libraries Listed <a name="Alphabetically">Alphabetically</a></h2>
@@ -169,7 +175,7 @@ out how to build object libraries, when needed.</p>
passing references to generic functions, from Jaako J&auml;rvi,
Peter Dimov, Doug Gregor, and Dave Abrahams.</li>
<li><a href="regex/index.html">regex</a> - Regular expression
<li><a href="regex/index.htm">regex</a> - Regular expression
library, from John Maddock.</li>
<li><a href="signals/index.html">signals</a> - managed signals &amp;
slots callback implementation, from Doug Gregor.</li>
@@ -182,7 +188,7 @@ out how to build object libraries, when needed.</p>
<li><a href="spirit/index.html">spirit</a> - LL parser framework&nbsp;
represents parsers directly as EBNF grammars in inlined C++, from Joel de
Guzman and team.</li>
<li><a href="test/doc/index.html">test</a> - Support for simple program testing,
<li><a href="test/doc/index.htm">test</a> - Support for simple program testing,
full unit testing, and for program
execution monitoring, from Gennadiy Rozental.</li>
<li><a href="thread/doc/index.html">thread</a> - Portable C++
@@ -202,9 +208,7 @@ out how to build object libraries, when needed.</p>
<li><a href="utility/utility.htm">utility</a> - Class <b>noncopyable</b>
plus <b>checked_delete()</b>, <b>checked_array_delete()</b>, <b>next(),</b>&nbsp;
<b>prior()</b>
function templates, plus <b>base-from-member idiom</b>, from Dave Abrahams and others.</li>
<li><a href="variant/index.html">variant</a> - Safe, generic, stack-based discriminated union
container, from Eric Friedman and Itay Maman.</li>
function templates, plus <b>base-from-member idiom</b>, from Dave Abrahams and others. </li>
</ul>
<hr>
@@ -218,7 +222,7 @@ out how to build object libraries, when needed.</p>
class template, from Kevlin Henney.</li>
<li><a href="format/index.htm">format</a> - Type-safe 'printf-like' format
operations, from Samuel Krempp.</li>
<li><a href="regex/index.html">regex</a> - Regular expression
<li><a href="regex/index.htm">regex</a> - Regular expression
library, from John Maddock</li>
<li><a href="spirit/index.html">spirit</a> - LL parser framework&nbsp;
represents parsers directly as EBNF grammars in inlined C++, from Joel de
@@ -242,8 +246,6 @@ out how to build object libraries, when needed.</p>
<li><a href="property_map/property_map.html">property map</a>
- Concepts defining interfaces which map key objects to
value objects, from Jeremy Siek.</li>
<li><a href="variant/index.html">variant</a> - Safe, generic, stack-based
discriminated union container, from Eric Friedman and Itay Maman.</li>
</ul>
<h3><a name="Iterators">Iterators</a></h3>
@@ -389,7 +391,7 @@ out how to build object libraries, when needed.</p>
<li><a href="static_assert/static_assert.htm">static_assert</a>
- Static assertions (compile time assertions), from John
Maddock.</li>
<li><a href="test/doc/index.html">test</a> - Support for simple program testing,
<li><a href="test/doc/index.htm">test</a> - Support for simple program testing,
full unit testing, and for program
execution monitoring, from Gennadiy Rozental.</li>
</ul>
@@ -404,8 +406,6 @@ out how to build object libraries, when needed.</p>
Hinnant, et al.</li>
<li><a href="tuple/doc/tuple_users_guide.html">tuple</a> - Ease definition of functions returning multiple values, and more,
from Jaakko Järvi.</li>
<li><a href="variant/index.html">variant</a> - Safe, generic, stack-based
discriminated union container, from Eric Friedman and Itay Maman.</li>
</ul>
<h3><a name="IO">Input/Output</a></h3>
@@ -502,6 +502,6 @@ out how to build object libraries, when needed.</p>
<p>Revised
<!--webbot bot="Timestamp" s-type="EDITED"
s-format="%d %b %Y" startspan -->09 Jul 2003<!--webbot bot="Timestamp" endspan i-checksum="15006" --></p>
s-format="%d %b %Y" startspan -->04 Feb 2003<!--webbot bot="Timestamp" endspan i-checksum="14388" --></p>
</body>
</html>
Submodule
+1
Submodule libs/log added at 6a032b633e

Some files were not shown because too many files have changed in this diff Show More