Compare commits

..
Author SHA1 Message Date
Andrey Semashev 65a0a819d5 Boost.Log merged to trunk.
[SVN r83860]
2013-04-13 12:30:25 +00:00
nobody d5cafb2bad This commit was manufactured by cvs2svn to create tag
'Version_1_30_0'.

[SVN r18026]
2003-03-20 02:53:48 +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
533 changed files with 14996 additions and 29622 deletions
-15
View File
@@ -1,15 +0,0 @@
/b2
/b2.exe
/bin.v2
/bjam
/bjam.exe
/bootstrap.log
/boost
/dist
/project-config.jam*
/stage
/stage_x64/
/user-config.jam
/.settings/
/.project
/.pydevproject
+148 -525
View File
@@ -1,118 +1,154 @@
[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 "wave"]
path = libs/wave
url = ../wave.git
[submodule "inspect"]
path = tools/inspect
url = ../inspect.git
fetchRecurseSubmodules = on-demand
[submodule "integer"]
path = libs/integer
url = ../integer.git
[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
[submodule "math"]
path = libs/math
url = ../math.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
[submodule "regex"]
path = libs/regex
url = ../regex.git
fetchRecurseSubmodules = on-demand
[submodule "iterator"]
path = libs/iterator
url = ../iterator.git
fetchRecurseSubmodules = on-demand
[submodule "regex"]
path = libs/regex
url = ../regex.git
[submodule "array"]
path = libs/array
url = ../array.git
fetchRecurseSubmodules = on-demand
[submodule "graph"]
path = libs/graph
url = ../graph.git
[submodule "random"]
path = libs/random
url = ../random.git
fetchRecurseSubmodules = on-demand
[submodule "static_assert"]
path = libs/static_assert
url = ../static_assert.git
[submodule "bind"]
path = libs/bind
url = ../bind.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
[submodule "thread"]
path = libs/thread
url = ../thread.git
fetchRecurseSubmodules = on-demand
[submodule "pool"]
path = libs/pool
url = ../pool.git
fetchRecurseSubmodules = on-demand
[submodule "thread"]
path = libs/thread
url = ../thread.git
[submodule "integer"]
path = libs/integer
url = ../integer.git
fetchRecurseSubmodules = on-demand
[submodule "format"]
path = libs/format
url = ../format.git
fetchRecurseSubmodules = on-demand
[submodule "test"]
path = libs/test
url = ../test.git
fetchRecurseSubmodules = on-demand
[submodule "multi_array"]
path = libs/multi_array
url = ../multi_array.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 "dynamic_bitset"]
path = libs/dynamic_bitset
url = ../dynamic_bitset.git
fetchRecurseSubmodules = on-demand
[submodule "disjoint_sets"]
path = libs/disjoint_sets
url = ../disjoint_sets.git
fetchRecurseSubmodules = on-demand
[submodule "timer"]
path = libs/timer
url = ../timer.git
fetchRecurseSubmodules = on-demand
[submodule "preprocessor"]
path = libs/preprocessor
url = ../preprocessor.git
fetchRecurseSubmodules = on-demand
[submodule "mpl"]
path = libs/mpl
url = ../mpl.git
fetchRecurseSubmodules = on-demand
[submodule "spirit"]
path = libs/spirit
url = ../spirit.git
fetchRecurseSubmodules = on-demand
[submodule "optional"]
path = libs/optional
url = ../optional.git
fetchRecurseSubmodules = on-demand
[submodule "config"]
path = libs/config
url = ../config.git
fetchRecurseSubmodules = on-demand
[submodule "function"]
path = libs/function
url = ../function.git
fetchRecurseSubmodules = on-demand
[submodule "interval"]
path = libs/numeric/interval
url = ../interval.git
fetchRecurseSubmodules = on-demand
[submodule "ublas"]
path = libs/numeric/ublas
url = ../ublas.git
fetchRecurseSubmodules = on-demand
[submodule "type_traits"]
path = libs/type_traits
url = ../type_traits.git
fetchRecurseSubmodules = on-demand
[submodule "property_map"]
path = libs/property_map
url = ../property_map.git
fetchRecurseSubmodules = on-demand
[submodule "conversion"]
path = libs/conversion
url = ../conversion.git
fetchRecurseSubmodules = on-demand
[submodule "lambda"]
path = libs/lambda
url = ../lambda.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 "filesystem"]
path = libs/filesystem
url = ../filesystem.git
fetchRecurseSubmodules = on-demand
[submodule "tuple"]
path = libs/tuple
@@ -122,456 +158,43 @@
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
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
fetchRecurseSubmodules = on-demand
[submodule "multi_array"]
path = libs/multi_array
url = ../multi_array.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
fetchRecurseSubmodules = on-demand
[submodule "range"]
path = libs/range
url = ../range.git
fetchRecurseSubmodules = on-demand
[submodule "serialization"]
path = libs/serialization
url = ../serialization.git
fetchRecurseSubmodules = on-demand
[submodule "numeric_conversion"]
path = libs/numeric/conversion
url = ../numeric_conversion.git
fetchRecurseSubmodules = on-demand
[submodule "assign"]
path = libs/assign
url = ../assign.git
fetchRecurseSubmodules = on-demand
[submodule "logic"]
path = libs/logic
url = ../logic.git
[submodule "static_assert"]
path = libs/static_assert
url = ../static_assert.git
fetchRecurseSubmodules = on-demand
[submodule "exception"]
path = libs/exception
url = ../exception.git
fetchRecurseSubmodules = on-demand
[submodule "statechart"]
path = libs/statechart
url = ../statechart.git
[submodule "compatibility"]
path = libs/compatibility
url = ../compatibility.git
fetchRecurseSubmodules = on-demand
[submodule "variant"]
path = libs/variant
url = ../variant.git
[submodule "build"]
path = tools/build
url = ../build.git
fetchRecurseSubmodules = on-demand
[submodule "interval"]
path = libs/numeric/interval
url = ../interval.git
[submodule "python"]
path = libs/python
url = ../python.git
fetchRecurseSubmodules = on-demand
[submodule "optional"]
path = libs/optional
url = ../optional.git
[submodule "utility"]
path = libs/utility
url = ../utility.git
fetchRecurseSubmodules = on-demand
[submodule "graph_parallel"]
path = libs/graph_parallel
url = ../graph_parallel.git
[submodule "crc"]
path = libs/crc
url = ../crc.git
fetchRecurseSubmodules = on-demand
[submodule "bcp"]
path = tools/bcp
url = ../bcp.git
fetchRecurseSubmodules = on-demand
[submodule "spirit"]
path = libs/spirit
url = ../spirit.git
fetchRecurseSubmodules = on-demand
[submodule "inspect"]
path = tools/inspect
url = ../inspect.git
fetchRecurseSubmodules = on-demand
[submodule "boostbook"]
path = tools/boostbook
url = ../boostbook.git
fetchRecurseSubmodules = on-demand
[submodule "filesystem"]
path = libs/filesystem
url = ../filesystem.git
fetchRecurseSubmodules = on-demand
[submodule "multi_index"]
path = libs/multi_index
url = ../multi_index.git
fetchRecurseSubmodules = on-demand
[submodule "program_options"]
path = libs/program_options
url = ../program_options.git
fetchRecurseSubmodules = on-demand
[submodule "algorithm"]
path = libs/algorithm
url = ../algorithm.git
fetchRecurseSubmodules = on-demand
[submodule "local_function"]
path = libs/local_function
url = ../local_function.git
fetchRecurseSubmodules = on-demand
[submodule "property_tree"]
path = libs/property_tree
url = ../property_tree.git
fetchRecurseSubmodules = on-demand
[submodule "circular_buffer"]
path = libs/circular_buffer
url = ../circular_buffer.git
fetchRecurseSubmodules = on-demand
[submodule "bimap"]
path = libs/bimap
url = ../bimap.git
fetchRecurseSubmodules = on-demand
[submodule "xpressive"]
path = libs/xpressive
url = ../xpressive.git
fetchRecurseSubmodules = on-demand
[submodule "foreach"]
path = libs/foreach
url = ../foreach.git
fetchRecurseSubmodules = on-demand
[submodule "typeof"]
path = libs/typeof
url = ../typeof.git
fetchRecurseSubmodules = on-demand
[submodule "ptr_container"]
path = libs/ptr_container
url = ../ptr_container.git
fetchRecurseSubmodules = on-demand
[submodule "quickbook"]
path = tools/quickbook
url = ../quickbook.git
fetchRecurseSubmodules = on-demand
[submodule "iostreams"]
path = libs/iostreams
url = ../iostreams.git
fetchRecurseSubmodules = on-demand
[submodule "parameter"]
path = libs/parameter
url = ../parameter.git
fetchRecurseSubmodules = on-demand
[submodule "function_types"]
path = libs/function_types
url = ../function_types.git
fetchRecurseSubmodules = on-demand
[submodule "litre"]
path = tools/litre
url = ../litre.git
fetchRecurseSubmodules = on-demand
[submodule "fusion"]
path = libs/fusion
url = ../fusion.git
fetchRecurseSubmodules = on-demand
[submodule "asio"]
path = libs/asio
url = ../asio.git
fetchRecurseSubmodules = on-demand
[submodule "interprocess"]
path = libs/interprocess
url = ../interprocess.git
fetchRecurseSubmodules = on-demand
[submodule "mpi"]
path = libs/mpi
url = ../mpi.git
fetchRecurseSubmodules = on-demand
[submodule "gil"]
path = libs/gil
url = ../gil.git
fetchRecurseSubmodules = on-demand
[submodule "system"]
path = libs/system
url = ../system.git
fetchRecurseSubmodules = on-demand
[submodule "intrusive"]
path = libs/intrusive
url = ../intrusive.git
fetchRecurseSubmodules = on-demand
[submodule "coroutine"]
path = libs/coroutine
url = ../coroutine.git
fetchRecurseSubmodules = on-demand
[submodule "flyweight"]
path = libs/flyweight
url = ../flyweight.git
fetchRecurseSubmodules = on-demand
[submodule "geometry"]
path = libs/geometry
url = ../geometry.git
fetchRecurseSubmodules = on-demand
[submodule "atomic"]
path = libs/atomic
url = ../atomic.git
fetchRecurseSubmodules = on-demand
[submodule "auto_index"]
path = tools/auto_index
url = ../auto_index.git
fetchRecurseSubmodules = on-demand
[submodule "heap"]
path = libs/heap
url = ../heap.git
fetchRecurseSubmodules = on-demand
[submodule "icl"]
path = libs/icl
url = ../icl.git
fetchRecurseSubmodules = on-demand
[submodule "multiprecision"]
path = libs/multiprecision
url = ../multiprecision.git
fetchRecurseSubmodules = on-demand
[submodule "odeint"]
path = libs/numeric/odeint
url = ../odeint.git
fetchRecurseSubmodules = on-demand
[submodule "locale"]
path = libs/locale
url = ../locale.git
fetchRecurseSubmodules = on-demand
[submodule "lockfree"]
path = libs/lockfree
url = ../lockfree.git
fetchRecurseSubmodules = on-demand
[submodule "move"]
path = libs/move
url = ../move.git
fetchRecurseSubmodules = on-demand
[submodule "msm"]
path = libs/msm
url = ../msm.git
fetchRecurseSubmodules = on-demand
[submodule "tti"]
path = libs/tti
url = ../tti.git
fetchRecurseSubmodules = on-demand
[submodule "type_erasure"]
path = libs/type_erasure
url = ../type_erasure.git
fetchRecurseSubmodules = on-demand
[submodule "phoenix"]
path = libs/phoenix
url = ../phoenix.git
fetchRecurseSubmodules = on-demand
[submodule "polygon"]
path = libs/polygon
url = ../polygon.git
fetchRecurseSubmodules = on-demand
[submodule "predef"]
path = libs/predef
url = ../predef.git
fetchRecurseSubmodules = on-demand
[submodule "proto"]
path = libs/proto
url = ../proto.git
fetchRecurseSubmodules = on-demand
[submodule "ratio"]
path = libs/ratio
url = ../ratio.git
fetchRecurseSubmodules = on-demand
[submodule "scope_exit"]
path = libs/scope_exit
url = ../scope_exit.git
fetchRecurseSubmodules = on-demand
[submodule "signals2"]
path = libs/signals2
url = ../signals2.git
fetchRecurseSubmodules = on-demand
[submodule "sync"]
path = libs/sync
url = ../sync.git
fetchRecurseSubmodules = on-demand
[submodule "units"]
path = libs/units
url = ../units.git
fetchRecurseSubmodules = on-demand
[submodule "unordered"]
path = libs/unordered
url = ../unordered.git
fetchRecurseSubmodules = on-demand
[submodule "uuid"]
path = libs/uuid
url = ../uuid.git
fetchRecurseSubmodules = on-demand
[submodule "chrono"]
path = libs/chrono
url = ../chrono.git
fetchRecurseSubmodules = on-demand
[submodule "container"]
path = libs/container
url = ../container.git
fetchRecurseSubmodules = on-demand
[submodule "context"]
path = libs/context
url = ../context.git
fetchRecurseSubmodules = on-demand
[submodule "accumulators"]
path = libs/accumulators
url = ../accumulators.git
[submodule "any"]
path = libs/any
url = ../any.git
fetchRecurseSubmodules = on-demand
[submodule "log"]
path = libs/log
url = ../log.git
fetchRecurseSubmodules = on-demand
[submodule "assert"]
path = libs/assert
url = ../assert.git
fetchRecurseSubmodules = on-demand
[submodule "align"]
path = libs/align
url = ../align.git
fetchRecurseSubmodules = on-demand
[submodule "type_index"]
path = libs/type_index
url = ../type_index.git
fetchRecurseSubmodules = on-demand
[submodule "core"]
path = libs/core
url = ../core.git
fetchRecurseSubmodules = on-demand
[submodule "throw_exception"]
path = libs/throw_exception
url = ../throw_exception.git
fetchRecurseSubmodules = on-demand
[submodule "winapi"]
path = libs/winapi
url = ../winapi.git
fetchRecurseSubmodules = on-demand
[submodule "boostdep"]
path = tools/boostdep
url = ../boostdep.git
fetchRecurseSubmodules = on-demand
[submodule "lexical_cast"]
path = libs/lexical_cast
url = ../lexical_cast.git
fetchRecurseSubmodules = on-demand
[submodule "convert"]
path = libs/convert
url = ../convert.git
fetchRecurseSubmodules = on-demand
[submodule "endian"]
path = libs/endian
url = ../endian.git
fetchRecurseSubmodules = on-demand
[submodule "sort"]
path = libs/sort
url = ../sort.git
fetchRecurseSubmodules = on-demand
[submodule "coroutine2"]
path = libs/coroutine2
url = ../coroutine2.git
fetchRecurseSubmodules = on-demand
[submodule "vmd"]
path = libs/vmd
url = ../vmd.git
fetchRecurseSubmodules = on-demand
[submodule "compute"]
path = libs/compute
url = ../compute.git
fetchRecurseSubmodules = on-demand
[submodule "dll"]
path = libs/dll
url = ../dll.git
fetchRecurseSubmodules = on-demand
[submodule "metaparse"]
path = libs/metaparse
url = ../metaparse.git
fetchRecurseSubmodules = on-demand
[submodule "hana"]
path = libs/hana
url = ../hana.git
fetchRecurseSubmodules = on-demand
[submodule "qvm"]
path = libs/qvm
url = ../qvm.git
fetchRecurseSubmodules = on-demand
[submodule "fiber"]
path = libs/fiber
url = ../fiber.git
fetchRecurseSubmodules = on-demand
[submodule "process"]
path = libs/process
url = ../process.git
branch = develop
fetchRecurseSubmodules = on-demand
[submodule "stacktrace"]
path = libs/stacktrace
url = ../stacktrace.git
fetchRecurseSubmodules = on-demand
[submodule "poly_collection"]
path = libs/poly_collection
url = ../poly_collection.git
fetchRecurseSubmodules = on-demand
[submodule "beast"]
path = libs/beast
url = ../beast.git
fetchRecurseSubmodules = on-demand
[submodule "mp11"]
path = libs/mp11
url = ../mp11.git
fetchRecurseSubmodules = on-demand
[submodule "callable_traits"]
path = libs/callable_traits
url = ../callable_traits.git
fetchRecurseSubmodules = on-demand
[submodule "contract"]
path = libs/contract
url = ../contract.git
fetchRecurseSubmodules = on-demand
[submodule "check_build"]
path = tools/check_build
url = ../check_build.git
fetchRecurseSubmodules = on-demand
[submodule "container_hash"]
path = libs/container_hash
url = ../container_hash.git
fetchRecurseSubmodules = on-demand
[submodule "hof"]
path = libs/hof
url = ../hof.git
fetchRecurseSubmodules = on-demand
[submodule "yap"]
path = libs/yap
url = ../yap.git
fetchRecurseSubmodules = on-demand
[submodule "safe_numerics"]
path = libs/safe_numerics
url = ../safe_numerics.git
fetchRecurseSubmodules = on-demand
[submodule "parameter_python"]
path = libs/parameter_python
url = ../parameter_python.git
fetchRecurseSubmodules = on-demand
-87
View File
@@ -1,87 +0,0 @@
# Use, modification, and distribution are
# subject to the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# Copyright Rene Rivera 2015-2016.
# Copyright Peter Dimov 2017.
branches:
only:
- master
- develop
dist: trusty
language: cpp
compiler: gcc
addons:
apt:
packages:
- p7zip-full
- docutils-common
- docutils-doc
- docbook
- docbook-xml
- docbook-xsl
- xsltproc
- doxygen
- dvipsk-ja
- texlive
- sshpass
- ghostscript
ssh_known_hosts: frs.sourceforge.net
env:
matrix:
- TRAVIS_EMPTY_JOB_WORKAROUND=true
matrix:
exclude:
- env: TRAVIS_EMPTY_JOB_WORKAROUND=true
include:
- env: SCRIPT=ci_boost_release MODE=check
# Simple integrated status tests check.
- env: SCRIPT=ci_boost_status
# Run 'quick' tests.
- env: SCRIPT=ci_boost_status TARGET=quick TOOLSET=gcc CXXSTD=03,11
compiler: g++
- env: SCRIPT=ci_boost_status TARGET=quick TOOLSET=clang CXXSTD=03,11
compiler: clang++
# Build Boost
- env: SCRIPT=ci_boost_build TOOLSET=gcc CXXSTD=11
compiler: g++
# Run tests for the library updated by this commit.
- env: SCRIPT=ci_boost_test_library TOOLSET=gcc CXXSTD=11
compiler: g++
- env: SCRIPT=ci_boost_test_library TOOLSET=clang CXXSTD=11
compiler: clang++
# # Library requirements tests.
# - env: SCRIPT=ci_boost_library_check
#
# allow_failures:
# - env: SCRIPT=ci_boost_library_check
before_install:
# Fetch the scripts to do the actual building/testing.
- |
wget "https://raw.githubusercontent.com/boostorg/release-tools/develop/ci_boost_common.py" -P ..
wget "https://raw.githubusercontent.com/boostorg/release-tools/develop/${SCRIPT}.py" -P ..
rvm install 2.3.3
install: python "${TRAVIS_BUILD_DIR}/../${SCRIPT}.py" install
before_script: python "${TRAVIS_BUILD_DIR}/../${SCRIPT}.py" before_script
script: python "${TRAVIS_BUILD_DIR}/../${SCRIPT}.py" script
after_success: python "${TRAVIS_BUILD_DIR}/../${SCRIPT}.py" after_success
after_failure: python "${TRAVIS_BUILD_DIR}/../${SCRIPT}.py" after_failure
after_script: python "${TRAVIS_BUILD_DIR}/../${SCRIPT}.py" after_script
-8
View File
@@ -1,8 +0,0 @@
See ./index.html for information about this release. The "Getting Started"
section is a useful starting place.
---------------------------
Copyright Beman Dawes, 2008
Distributed under the Boost Software License, Version 1.0.
See ./LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt
+10
View File
@@ -0,0 +1,10 @@
project-root ;
# please order by name to ease maintenance
subinclude libs/date_time/build ;
subinclude libs/filesystem/build ;
subinclude libs/python/build ;
subinclude libs/regex/build ;
subinclude libs/signals/build ;
subinclude libs/test/build ;
subinclude libs/thread/build ;
+26
View File
@@ -0,0 +1,26 @@
#
# This is Boost Jamfile for Boost.Build V2.
# Currently, known to work on Linux with gcc
#
# To build Boost with it, run
#
# bjam --v2 link=static
#
# from the top-level directory
project boost
: requirements <include>.
;
build-project libs/test/build ;
build-project libs/date_time/build ;
build-project libs/regex/build ;
build-project libs/signals/build ;
build-project libs/graph/build ;
# Comment this out if you don't have Python2.2 installed
build-project libs/python/build ;
build-project libs/thread/build ;
build-project libs/filesystem/build ;
-342
View File
@@ -1,342 +0,0 @@
# Copyright Vladimir Prus 2002-2006.
# Copyright Dave Abrahams 2005-2006.
# Copyright Rene Rivera 2005-2007.
# Copyright Douglas Gregor 2005.
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# Usage:
#
# b2 [options] [properties] [install|stage]
#
# Builds and installs Boost.
#
# Targets and Related Options:
#
# install Install headers and compiled library files to the
# ======= configured locations (below).
#
# --prefix=<PREFIX> Install architecture independent files here.
# Default; C:\Boost on Win32
# Default; /usr/local on Unix. Linux, etc.
#
# --exec-prefix=<EPREFIX> Install architecture dependent files here.
# Default; <PREFIX>
#
# --libdir=<DIR> Install library files here.
# Default; <EPREFIX>/lib
#
# --includedir=<HDRDIR> Install header files here.
# Default; <PREFIX>/include
#
# stage Build and install only compiled library files to the
# ===== stage directory.
#
# --stagedir=<STAGEDIR> Install library files here
# Default; ./stage
#
# Other Options:
#
# --build-type=<type> Build the specified pre-defined set of variations of
# the libraries. Note, that which variants get built
# depends on what each library supports.
#
# -- minimal -- (default) Builds a minimal set of
# variants. On Windows, these are static
# multithreaded libraries in debug and release
# modes, using shared runtime. On Linux, these are
# static and shared multithreaded libraries in
# release mode.
#
# -- complete -- Build all possible variations.
#
# --build-dir=DIR Build in this location instead of building within
# the distribution tree. Recommended!
#
# --show-libraries Display the list of Boost libraries that require
# build and installation steps, and then exit.
#
# --layout=<layout> Determine whether to choose library names and header
# locations such that multiple versions of Boost or
# multiple compilers can be used on the same system.
#
# -- versioned -- Names of boost binaries include
# the Boost version number, name and version of
# the compiler and encoded build properties. Boost
# headers are installed in a subdirectory of
# <HDRDIR> whose name contains the Boost version
# number.
#
# -- tagged -- Names of boost binaries include the
# encoded build properties such as variant and
# threading, but do not including compiler name
# and version, or Boost version. This option is
# useful if you build several variants of Boost,
# using the same compiler.
#
# -- system -- Binaries names do not include the
# Boost version number or the name and version
# number of the compiler. Boost headers are
# installed directly into <HDRDIR>. This option is
# intended for system integrators building
# distribution packages.
#
# The default value is 'versioned' on Windows, and
# 'system' on Unix.
#
# --buildid=ID Add the specified ID to the name of built libraries.
# The default is to not add anything.
#
# --python-buildid=ID Add the specified ID to the name of built libraries
# that depend on Python. The default is to not add
# anything. This ID is added in addition to --buildid.
#
# --help This message.
#
# --with-<library> Build and install the specified <library>. If this
# option is used, only libraries specified using this
# option will be built.
#
# --without-<library> Do not build, stage, or install the specified
# <library>. By default, all libraries are built.
#
# Properties:
#
# toolset=toolset Indicate the toolset to build with.
#
# variant=debug|release Select the build variant
#
# link=static|shared Whether to build static or shared libraries
#
# threading=single|multi Whether to build single or multithreaded binaries
#
# runtime-link=static|shared
# Whether to link to static or shared C and C++
# runtime.
#
# TODO:
# - handle boost version
# - handle python options such as pydebug
import boostcpp ;
import package ;
import sequence ;
import xsltproc ;
import set ;
import path ;
import link ;
import notfile ;
import virtual-target ;
import "class" : new ;
import property-set ;
import threadapi-feature ;
import option ;
path-constant BOOST_ROOT : . ;
constant BOOST_VERSION : 1.69.0 ;
constant BOOST_JAMROOT_MODULE : $(__name__) ;
boostcpp.set-version $(BOOST_VERSION) ;
use-project /boost/architecture : libs/config/checks/architecture ;
local all-headers =
[ MATCH .*libs/(.*)/include/boost : [ glob libs/*/include/boost libs/*/*/include/boost ] ] ;
for dir in $(all-headers)
{
link-directory $(dir)-headers : libs/$(dir)/include/boost : <location>. ;
explicit $(dir)-headers ;
}
if $(all-headers)
{
constant BOOST_MODULARLAYOUT : $(all-headers) ;
}
project boost
: requirements <include>.
[ boostcpp.architecture ]
[ boostcpp.address-model ]
# Disable auto-linking for all targets here, primarily because it caused
# troubles with V2.
<define>BOOST_ALL_NO_LIB=1
# Used to encode variant in target name. See the 'tag' rule below.
<tag>@$(__name__).tag
<conditional>@handle-static-runtime
# Comeau does not support shared lib
<toolset>como:<link>static
<toolset>como-linux:<define>_GNU_SOURCE=1
# When building docs within Boost, we want the standard Boost style
<xsl:param>boost.defaults=Boost
<conditional>@threadapi-feature.detect
: usage-requirements <include>.
: default-build
<visibility>hidden
: build-dir bin.v2
;
# This rule is called by Boost.Build to determine the name of target. We use it
# to encode the build variant, compiler name and boost version in the target
# name.
#
rule tag ( name : type ? : property-set )
{
return [ boostcpp.tag $(name) : $(type) : $(property-set) ] ;
}
rule python-tag ( name : type ? : property-set )
{
return [ boostcpp.python-tag $(name) : $(type) : $(property-set) ] ;
}
rule handle-static-runtime ( properties * )
{
# Using static runtime with shared libraries is impossible on Linux, and
# dangerous on Windows. Therefore, we disallow it. This might be drastic,
# but it was disabled for a while without anybody complaining.
# For CW, static runtime is needed so that std::locale works.
if <link>shared in $(properties) && <runtime-link>static in $(properties) &&
! ( <toolset>cw in $(properties) )
{
if ! $(.shared-static-warning-emitted)
{
ECHO "warning: skipping configuration link=shared, runtime-link=static" ;
ECHO "warning: this combination is either impossible or too dangerous" ;
ECHO "warning: to be of any use" ;
.shared-static-warning-emitted = 1 ;
}
return <build>no ;
}
}
all-libraries = [ MATCH .*libs/(.*)/build/.* : [ glob libs/*/build/Jamfile.v2 ]
[ glob libs/*/build/Jamfile ] ] ;
all-libraries = [ sequence.unique $(all-libraries) ] ;
# The function_types library has a Jamfile, but it's used for maintenance
# purposes, there's no library to build and install.
all-libraries = [ set.difference $(all-libraries) : function_types ] ;
# Setup convenient aliases for all libraries.
local rule explicit-alias ( id : targets + )
{
alias $(id) : $(targets) ;
explicit $(id) ;
}
# First, the complicated libraries: where the target name in Jamfile is
# different from its directory name.
explicit-alias prg_exec_monitor : libs/test/build//boost_prg_exec_monitor ;
explicit-alias test_exec_monitor : libs/test/build//boost_test_exec_monitor ;
explicit-alias unit_test_framework : libs/test/build//boost_unit_test_framework ;
explicit-alias bgl-vis : libs/graps/build//bgl-vis ;
explicit-alias serialization : libs/serialization/build//boost_serialization ;
explicit-alias wserialization : libs/serialization/build//boost_wserialization ;
for local l in $(all-libraries)
{
if ! $(l) in test graph serialization
{
explicit-alias $(l) : libs/$(l)/build//boost_$(l) ;
}
}
# Log has an additional target
explicit-alias log_setup : libs/log/build//boost_log_setup ;
rule do-nothing { }
rule generate-alias ( project name : property-set : sources * )
{
local action-name = [ $(property-set).get <action> ] ;
local m = [ MATCH ^@(.*) : $(action-name) ] ;
property-set = [ property-set.empty ] ;
local action = [ new action $(sources) : $(m[1]) : $(property-set) ] ;
local t = [ new notfile-target $(name) : $(project) : $(action) ] ;
return [ virtual-target.register $(t) ] ;
}
generate headers : $(all-headers)-headers : <generating-rule>@generate-alias <action>@do-nothing : : <include>. ;
#alias headers : $(all-headers)-headers : : : <include>. ;
explicit headers ;
# Make project ids of all libraries known.
for local l in $(all-libraries)
{
use-project /boost/$(l) : libs/$(l)/build ;
}
if [ path.exists $(BOOST_ROOT)/tools/inspect/build ]
{
use-project /boost/tools/inspect : tools/inspect/build ;
}
if [ path.exists $(BOOST_ROOT)/libs/wave/tool/build ]
{
use-project /boost/libs/wave/tool : libs/wave/tool/build ;
}
# This rule should be called from libraries' Jamfiles and will create two
# targets, "install" and "stage", that will install or stage that library. The
# --prefix option is respected, but --with and --without options, naturally, are
# ignored.
#
# - libraries -- list of library targets to install.
#
rule boost-install ( libraries * )
{
package.install install
: <dependency>/boost//install-proper-headers $(install-requirements)
: # No binaries
: $(libraries)
: # No headers, it is handled by the dependency.
;
local stage-locate = [ option.get stagedir : $(BOOST_ROOT)/stage ] ;
install stage : $(libraries) : <location>$(stage-locate)/lib ;
module [ CALLER_MODULE ]
{
explicit stage ;
explicit install ;
}
}
# Creates a library target, adding autolink support and also creates
# stage and install targets via boost-install, above.
rule boost-lib ( name : sources * : requirements * : default-build * : usage-requirements * )
{
name = boost_$(name) ;
autolink = <link>shared:<define>$(name:U)_DYN_LINK=1 ;
lib $(name)
: $(sources)
: $(requirements) $(autolink)
: $(default-build)
: $(usage-requirements) $(autolink)
;
boost-install $(name) ;
}
headers =
# The .SUNWCCh files are present in tr1 include directory and have to be
# installed (see http://lists.boost.org/Archives/boost/2007/05/121430.php).
[ path.glob-tree $(BOOST_ROOT)/boost : *.hpp *.ipp *.h *.inc *.SUNWCCh : CVS .svn ]
[ path.glob-tree $(BOOST_ROOT)/boost/compatibility/cpp_c_headers : c* : CVS .svn ]
[ path.glob $(BOOST_ROOT)/boost/tr1/tr1 : * : bcc32 sun CVS .svn ]
;
# Declare special top-level targets that build and install the desired variants
# of the libraries.
boostcpp.declare-targets $(all-libraries) : $(headers) : $(all-headers) ;
+14
View File
@@ -0,0 +1,14 @@
# Boost.Build top level Jamrules
# See tools/build/index.html for documentation.
# Set some important global variables if they haven't already been set by the
# user on the command-line or in the environment
# Establish this as the root of the boost installation. Most targets will want
# $(BOOST_ROOT) in their #include path. $(gTOP) is the name of the variable
# containing the path from the invocation directory to the project root.
path-global BOOST_ROOT : $($(gTOP)) ;
# The current version of Boost.
BOOST_VERSION ?= 1.30.0 ;
-23
View File
@@ -1,23 +0,0 @@
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
+11
View File
@@ -0,0 +1,11 @@
For the most current version of Boost libraries and documentation, see:
http://www.boost.org
Boost documentation is in HTML format.
The highest level directory (which contains this README file) should have a file index.htm
with links to all documentation. When viewing index.htm with a web browser, follow the
"Libraries" link on the navigation bar for information on building boost libraries for
your particular compiler and operating system.
-34
View File
@@ -1,34 +0,0 @@
version: 1.0.{build}-{branch}
branches:
only:
- develop
- master
environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
SCRIPT: ci_boost_test_library
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
SCRIPT: ci_boost_test_library
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
SCRIPT: ci_boost_test_library
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
SCRIPT: ci_boost_status
TARGET: quick
init:
- cd %APPVEYOR_BUILD_FOLDER%/..
- appveyor DownloadFile "https://raw.githubusercontent.com/boostorg/release-tools/develop/ci_boost_common.py"
- appveyor DownloadFile "https://raw.githubusercontent.com/boostorg/release-tools/develop/%SCRIPT%.py"
- cd %APPVEYOR_BUILD_FOLDER%
install: python ../%SCRIPT%.py install
before_build: python ../%SCRIPT%.py before_build
build_script: python ../%SCRIPT%.py build_script
after_build: python ../%SCRIPT%.py after_build
before_test: python ../%SCRIPT%.py before_test
test_script: python ../%SCRIPT%.py test_script
after_test: python ../%SCRIPT%.py after_test
on_success: python ../%SCRIPT%.py on_success
on_failure: python ../%SCRIPT%.py on_failure
on_finish: python ../%SCRIPT%.py on_finish
+17 -16
View File
@@ -1,17 +1,18 @@
# Copyright (C) 2002-2003 David Abrahams.
# Copyright (C) 2002-2003 Vladimir Prus.
# Copyright (C) 2003,2007 Rene Rivera.
# Use, modification and distribution are subject to the
# Boost Software License, Version 1.0. (See accompanying file
# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
# This is the initial file loaded by Boost Jam when run from any Boost library
# folder. It allows us to choose which Boost Build installation to use for
# building Boost libraries. Unless explicitly selected using a command-line
# option, the version included with the Boost library distribution is used (as
# opposed to any other Boost Build version installed on the user's sytem).
BOOST_ROOT = $(.boost-build-file:D) ;
BOOST_BUILD = [ MATCH --boost-build=(.*) : $(ARGV) ] ;
BOOST_BUILD ?= tools/build/src ;
boost-build $(BOOST_BUILD) ;
if --v2 in $(ARGV)
{
if $(JAM_VERSION:J="") < 030103
{
ECHO "error: Boost.Jam 3.1.3 or later required" ;
EXIT ;
}
else
{
JAMFILE = [Jj]amfile.v2 ;
boost-build tools/build/new ;
}
}
else
{
boost-build tools/build ;
}
+3 -15
View File
@@ -1,9 +1,3 @@
/*=============================================================================
Copyright 2002 William E. Kempf
Distributed under the Boost Software License, Version 1.0. (See accompany-
ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
H1
{
FONT-SIZE: 200%;
@@ -25,21 +19,15 @@ BODY
{
FONT-SIZE: 100%;
BACKGROUND-COLOR: #ffffff;
COLOR: #000000;
}
PRE
{
MARGIN-LEFT: 2em;
FONT-FAMILY: Courier,
monospace;
FONT-FAMILY: Courier;
}
CODE
{
FONT-FAMILY: Courier,
monospace;
}
CODE.as_pre
{
FONT-FAMILY: Courier;
white-space: pre;
}
.index
@@ -63,4 +51,4 @@ CODE.as_pre
.function-semantics
{
CLEAR: left;
}
}
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

-721
View File
@@ -1,721 +0,0 @@
# Boost.Build support specific for the Boost C++ Libraries.
# Copyright Vladimir Prus 2002-2010.
# Copyright Dave Abrahams 2005-2006.
# Copyright Rene Rivera 2005-2007.
# Copyright Douglas Gregor 2005.
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import "class" : new ;
import common ;
import configure ;
import build-system ;
import generate ;
import modules ;
import option ;
import os ;
import package ;
import path ;
import project ;
import regex ;
import sequence ;
import set ;
import targets ;
import feature ;
import property ;
import version : version-less ;
##############################################################################
#
# 0. General setup. Parse options, check them.
#
##############################################################################
BOOST_ROOT = [ modules.binding $(__name__) ] ;
BOOST_ROOT = $(BOOST_ROOT:D) ;
rule set-version ( version )
{
BOOST_VERSION = $(version) ;
local version-tag =
[ MATCH "^([^.]+)[.]([^.]+)[.]([^.]+)" : $(BOOST_VERSION) ] ;
if $(version-tag[3]) = 0
{
version-tag = $(version-tag[1-2]) ;
}
BOOST_VERSION_TAG = $(version-tag:J=_) ;
}
# Option to choose how many variants to build. The default is "minimal".
build-type = [ option.get build-type ] ;
build-type ?= minimal ;
if ! ( $(build-type) in complete minimal )
{
EXIT The value of the --build-type option should be either 'complete' or
'minimal' ;
}
# What kind of layout are we doing?
layout = [ option.get layout : "" ] ;
layout = [ MATCH (versioned|tagged|system)(-(.+))? : $(layout) ] ;
if $(layout[3])
{
layout-version = $(layout[3]) ;
layout = $(layout[1]) ;
if [ version-less [ regex.split $(layout-version) "[.]" ] : 1 66 ]
{
layout-version = 1.40 ;
}
else if [ version-less [ regex.split $(layout-version) "[.]" ] : 1 69 ]
{
layout-version = 1.66 ;
}
}
layout-version ?= 1.69 ;
# On Windows, we used versioned layout by default in order to be compatible with
# autolink. On other systems, we use system layout which is what every other
# program uses. Note that the Windows check is static, and will not be affected
# by specific build properties used.
if ! $(layout)
{
if [ os.name ] = NT
{
layout = versioned ;
}
else
{
layout = system ;
}
}
layout-$(layout) = true ;
if $(layout) = system && $(build-type) = complete
{
ECHO error\: Cannot use --layout=system with --build-type complete. ;
ECHO error\: Please use either --layout=versioned or --layout=tagged ;
ECHO error\: if you wish to build multiple variants. ;
if [ os.name ] != NT
{
ECHO error\: Note that --layout=system is used by default on Unix
starting with Boost 1.40. ;
}
EXIT ;
}
# Possible stage only location.
stage-locate = [ option.get stagedir ] ;
stage-locate ?= stage ;
BOOST_STAGE_LOCATE = $(stage-locate) ;
# Custom build ID.
build-id = [ option.get buildid ] ;
if $(build-id)
{
BUILD_ID = [ regex.replace $(build-id) "[*\\/:.\"\' ]" _ ] ;
}
# Python build id (for Python libraries only).
python-id = [ option.get "python-buildid" ] ;
if $(python-id)
{
PYTHON_ID = [ regex.replace $(python-id) "[*\\/:.\"\']" _ ] ;
}
if $(layout) = versioned
{
switch $(layout-version)
{
case 1.40 :
.format-name-args =
<base> <toolset> <threading> <runtime> ;
case 1.66 :
.format-name-args =
<base> <toolset> <threading> <runtime> <arch-and-model> ;
case 1.69 :
.format-name-args =
<base> <toolset> <threading> <runtime> <arch-and-model> ;
}
}
else if $(layout) = tagged
{
switch $(layout-version)
{
case 1.40 :
.format-name-args =
<base> <threading> <runtime> ;
case 1.66 :
.format-name-args =
<base> <threading> <runtime> ;
case 1.69 :
.format-name-args =
<base> <threading> <runtime> <arch-and-model> ;
}
}
else if $(layout) = system
{
.format-name-args = <base> ;
}
else
{
.format-name-error = true ;
}
################################################################################
#
# 1. 'tag' function adding decorations suitable to the properties if versioned
# or tagged layout is requested. Called from Jamroot.
#
################################################################################
rule tag ( name : type ? : property-set )
{
if $(type) in STATIC_LIB SHARED_LIB IMPORT_LIB
{
local args = $(.format-name-args) ;
if $(layout) = versioned
{
args += -$(BOOST_VERSION_TAG) ;
}
local result = [ common.format-name
$(args) -$(BUILD_ID)
: $(name) : $(type) : $(property-set) ] ;
if $(.format-name-error)
{
EXIT error\: invalid layout '$(layout:E=)' ;
}
# Optionally add version suffix. On NT, library with version suffix will
# not be recognized by linkers. On CYGWIN, we get strage duplicate
# symbol errors when library is generated with version suffix. On OSX,
# version suffix is not needed -- the linker expects the
# libFoo.1.2.3.dylib format. AIX linkers do not accept version suffixes
# either. Pgi compilers can not accept a library with version suffix.
if $(type) = SHARED_LIB &&
! [ $(property-set).get <target-os> ] in windows cygwin darwin aix &&
! [ $(property-set).get <toolset> ] in pgi
{
result = $(result).$(BOOST_VERSION) ;
}
return $(result) ;
}
}
# Specialized tag function to use for libraries linking to Python.
# Appends value of --python-buildid if provided.
rule python-tag ( name : type ? : property-set )
{
local result = $(name) ;
if $(type) in STATIC_LIB SHARED_LIB IMPORT_LIB && $(PYTHON_ID)
{
result = $(result)-$(PYTHON_ID) ;
}
# forward to the boost tagging rule
return [ tag $(result) : $(type) : $(property-set) ] ;
}
################################################################################
#
# 2. Declare targets that build and install all libraries. Specifically:
#
# - 'stage-proper' that puts all libraries in stage/lib
# - 'install-proper' that install libraries and headers to system location
#
################################################################################
rule filtered-target ( name : message + : sources + : requirements * )
{
message $(name)-message : warning\: $(message) ;
alias $(name) : $(sources) : $(requirements) ;
alias $(name) : $(name)-message ;
local p = [ project.current ] ;
$(p).mark-target-as-explicit $(name) ;
$(p).mark-target-as-explicit $(name)-message ;
}
rule declare_install_and_stage_proper_targets ( libraries * : headers * : modular-headers * )
{
local p = [ project.current ] ;
for local l in $(libraries)
{
if $(l) = locale
{
filtered-target $(l)-for-install :
Skipping Boost.Locale library with threading=single. :
libs/$(l)/build : <threading>multi ;
}
else if $(l) = wave
{
filtered-target $(l)-for-install :
Skipping Boost.Wave library with threading=single. :
libs/$(l)/build : <threading>multi ;
}
else if $(l) = thread
{
filtered-target $(l)-for-install :
Skipping Boost.Thread library with threading=single. :
libs/$(l)/build : <threading>multi ;
}
else
{
alias $(l)-for-install : libs/$(l)/build ;
$(p).mark-target-as-explicit $(l)-for-install ;
}
}
local library-targets = $(libraries)-for-install ;
local install-requirements ;
if $(layout-versioned)
{
install-requirements +=
<install-header-subdir>boost-$(BOOST_VERSION_TAG)/boost ;
}
else
{
install-requirements += <install-header-subdir>boost ;
}
if [ os.name ] = NT
{
install-requirements += <install-default-prefix>C:/Boost ;
}
else
{
install-requirements += <install-default-prefix>/usr/local ;
}
p = [ project.current ] ;
# These headers will be installed from the modular
# layout, and should be ignored in the global boost/
local skip-headers ;
# Install modular headers.
for local lib in $(modular-headers)
{
local header-root = $(BOOST_ROOT)/libs/$(lib)/include/boost ;
local lib-headers =
[ path.glob-tree $(header-root) : *.hpp *.ipp *.h *.inc *.SUNWCCh : CVS .svn ]
[ path.glob-tree $(header-root)/compatibility/cpp_c_headers : c* : CVS .svn ]
[ path.glob $(header-root)/tr1/tr1 : * : bcc32 sun CVS .svn ]
;
skip-headers += [ sequence.transform path.relative-to [ path.make $(header-root) ] : $(lib-headers) ] ;
package.install install-$(lib)-headers
: <install-source-root>$(header-root)
$(install-requirements)
<install-no-version-symlinks>on
: # binaries
: # libraries
: $(lib-headers)
;
$(p).mark-target-as-explicit install-$(lib)-headers ;
}
# Filter out headers that were created by b2 headers
local header-root = [ path.make $(BOOST_ROOT)/boost ] ;
headers = [ set.difference $(headers) : $(header-root)/$(skip-headers) ] ;
# Complete install.
package.install install-proper
: <install-source-root>$(BOOST_ROOT)/boost
$(install-requirements)
<install-no-version-symlinks>on
:
: $(libraries)-for-install
: $(headers)
;
$(p).mark-target-as-explicit install-proper ;
# Install just library.
install stage-proper
: $(libraries)-for-install
: <location>$(stage-locate)/lib
<install-dependencies>on <install-type>LIB
<install-no-version-symlinks>on
;
$(p).mark-target-as-explicit stage-proper ;
}
################################################################################
#
# 3. Declare top-level targets 'stage' and 'install'. These examine the
# --build-type option and, in case it is 'complete', build the 'install-proper'
# and 'stage-proper' targets with a number of property sets.
#
################################################################################
class top-level-target : alias-target-class
{
import modules ;
rule __init__ ( name : project : sources * : requirements *
: default-build * : usage-requirements * )
{
alias-target-class.__init__ $(name) : $(project) : $(sources) :
$(requirements) : $(default-build) : $(usage-requirements) ;
self.build-type = [ modules.peek boostcpp : build-type ] ;
# On Linux, we build the release variant by default, since few users
# will ever want to debug C++ Boost libraries, and there is no ABI
# incompatibility between debug and release variants. We build shared
# and static libraries since that is what most packages seem to provide
# (.so in libfoo and .a in libfoo-dev).
self.minimal-properties = [ property-set.create <variant>release
<threading>multi <link>shared <link>static <runtime-link>shared ] ;
# On Windows, new IDE projects use:
#
# runtime-link=dynamic, threading=multi, variant=(debug|release)
#
# and in addition, C++ Boost's autolink defaults to static linking.
self.minimal-properties-win = [ property-set.create <variant>debug
<variant>release <threading>multi <link>static <runtime-link>shared
<address-model>32 <address-model>64 ] ;
self.complete-properties = [ property-set.create
<variant>debug <variant>release
<threading>multi
<link>shared <link>static
<runtime-link>shared <runtime-link>static ] ;
self.complete-properties-win = [ property-set.create
<variant>debug <variant>release
<threading>multi
<link>shared <link>static
<runtime-link>shared <runtime-link>static
<address-model>32 <address-model>64 ] ;
}
rule generate ( property-set )
{
modules.poke : top-level-targets : [ modules.peek : top-level-targets ]
$(self.name) ;
local os = [ $(property-set).get <target-os> ] ;
# Because we completely override the parent's 'generate' we need to
# check for default feature values ourselves.
if ! $(os)
{
os = [ feature.defaults <target-os> ] ;
os = $(os:G=) ;
}
local build-type-set ;
if $(self.build-type) = minimal
{
if $(os) = windows
{
build-type-set = $(self.minimal-properties-win) ;
}
else
{
build-type-set = $(self.minimal-properties) ;
}
}
else if $(self.build-type) = complete
{
if $(os) = windows
{
build-type-set = $(self.complete-properties-win) ;
}
else
{
build-type-set = $(self.complete-properties) ;
}
}
else
{
import errors ;
errors.error "Unknown build type" ;
}
if $(build-type-set)
{
local expanded = [ targets.apply-default-build $(property-set)
: $(build-type-set) ] ;
# Filter inappopriate combinations.
local filtered ;
for local p in $(expanded)
{
# See comment in handle-static-runtime regarding this logic.
if [ $(p).get <link> ] = shared
&& [ $(p).get <runtime-link> ] = static
&& [ $(p).get <toolset> ] != cw
{
# Skip this.
}
else
{
filtered += $(p) ;
}
}
return [ build-multiple $(filtered) ] ;
}
}
rule build-multiple ( property-sets * )
{
local usage-requirements = [ property-set.empty ] ;
local result ;
for local p in $(property-sets)
{
local r = [ alias-target-class.generate $(p) ] ;
if $(r)
{
usage-requirements = [ $(usage-requirements).add $(r[1]) ] ;
result += $(r[2-]) ;
}
}
return $(usage-requirements) [ sequence.unique $(result) ] ;
}
}
rule declare_top_level_targets ( libraries * : headers * : modular-headers * )
{
declare_install_and_stage_proper_targets $(libraries) : $(headers) : $(modular-headers) ;
targets.create-metatarget top-level-target : [ project.current ]
: install
: install-$(modular-headers)-headers install-proper
;
targets.create-metatarget top-level-target : [ project.current ]
: stage
: stage-proper headers
;
p = [ project.current ] ;
$(p).mark-target-as-explicit install stage ;
# This target is built by default, and will forward to 'stage' after
# producing some explanations.
targets.create-metatarget top-level-target : [ project.current ]
: forward
: explain stage
;
}
stage-abs = [ path.native [ path.root $(stage-locate)/lib [ path.pwd ] ] ] ;
################################################################################
#
# 4. Add hook to report configuration before the build, and confirmation with
# setup instructions after the build.
#
################################################################################
message explain : "\nBuilding the Boost C++ Libraries.\n\n" ;
local p = [ project.current ] ;
$(p).mark-target-as-explicit explain ;
rule pre-build ( )
{
local tl = [ modules.peek : top-level-targets ] ;
if stage in $(tl) || install in $(tl)
{
# FIXME: Remove 'if' when Boost regression tests start using trunk bjam.
if PAD in [ RULENAMES ]
{
configure.print-component-configuration ;
}
}
}
IMPORT $(__name__) : pre-build : : $(__name__).pre-build ;
build-system.set-pre-build-hook $(__name__).pre-build ;
# FIXME: Revise stage_abs.
rule post-build ( ok ? )
{
if forward in [ modules.peek : top-level-targets ]
{
if $(ok)
{
local include-path = [ path.native $(BOOST_ROOT) ] ;
ECHO "
The Boost C++ Libraries were successfully built!
The following directory should be added to compiler include paths:
$(include-path)
The following directory should be added to linker library paths:
$(stage-abs)
" ;
}
}
}
IMPORT $(__name__) : post-build : : $(__name__).post-build ;
build-system.set-post-build-hook $(__name__).post-build ;
################################################################################
#
# 5. Top-level setup.
#
################################################################################
# Decides which libraries are to be installed by looking at --with-<library>
# --without-<library> arguments. Returns the list of directories under "libs"
# which must be built and installed.
#
rule libraries-to-install ( existing-libs * )
{
local argv = [ modules.peek : ARGV ] ;
local with-parameter = [ MATCH ^--with-(.*) : $(argv) ] ;
local without-parameter = [ MATCH ^--without-(.*) : $(argv) ] ;
if ! $(with-parameter) && ! $(without-parameter)
{
# Nothing is specified on command line. See if maybe project-config.jam
# has some choices.
local libs = [ modules.peek project-config : libraries ] ;
with-parameter = [ MATCH ^--with-(.*) : $(libs) ] ;
without-parameter = [ MATCH ^--without-(.*) : $(libs) ] ;
}
# Do some checks.
if $(with-parameter) && $(without-parameter)
{
EXIT error\: both --with-<library> and --without-<library> specified ;
}
local wrong = [ set.difference $(with-parameter) : $(existing-libs) ] ;
if $(wrong)
{
EXIT error\: wrong library name '$(wrong[1])' in the --with-<library>
option. ;
}
local wrong = [ set.difference $(without-parameter) : $(existing-libs) ] ;
if $(wrong)
{
EXIT error\: wrong library name '$(wrong[1])' in the --without-<library>
option. ;
}
if $(with-parameter)
{
return [ set.intersection $(existing-libs) : $(with-parameter) ] ;
}
else
{
return [ set.difference $(existing-libs) : $(without-parameter) ] ;
}
}
rule declare-targets ( all-libraries * : headers * : modular-headers * )
{
configure.register-components $(all-libraries) ;
# Select the libraries to install.
libraries = [ libraries-to-install $(all-libraries) ] ;
configure.components-building $(libraries) ;
if [ option.get "show-libraries" : : true ]
{
ECHO The following libraries require building\: ;
for local l in $(libraries)
{
ECHO " - $(l)" ;
}
EXIT ;
}
declare_top_level_targets $(libraries) : $(headers) : $(modular-headers) ;
}
# Returns the properties identifying the toolset. We'll use them
# below to configure checks. These are essentially same as in
# configure.builds, except we don't use address-model and
# architecture - as we're trying to detect them here.
#
rule toolset-properties ( properties * )
{
local toolset = [ property.select <toolset> : $(properties) ] ;
local toolset-version-property = "<toolset-$(toolset:G=):version>" ;
return [ property.select <target-os> <toolset> $(toolset-version-property) : $(properties) ] ;
}
feature.feature deduced-address-model : 32 64 : propagated optional composite hidden ;
feature.compose <deduced-address-model>32 : <address-model>32 ;
feature.compose <deduced-address-model>64 : <address-model>64 ;
rule deduce-address-model ( properties * )
{
local result ;
local filtered = [ toolset-properties $(properties) ] ;
local names = 32 64 ;
local idx = [ configure.find-builds "default address-model" : $(filtered)
: /boost/architecture//32 "32-bit"
: /boost/architecture//64 "64-bit" ] ;
result = $(names[$(idx)]) ;
if $(result)
{
# Normally, returning composite feature here is equivalent to forcing
# consituent properties as well. But we only want to indicate toolset
# deduced default, so also pick whatever address-model is explicitly
# specified, if any.
result = <deduced-address-model>$(result) [ property.select <address-model> : $(properties) ] ;
}
return $(result) ;
}
rule address-model ( )
{
return <conditional>@boostcpp.deduce-address-model ;
}
local deducable-architectures = arm mips1 power sparc x86 combined ;
feature.feature deduced-architecture : $(deducable-architectures) : propagated optional composite hidden ;
for a in $(deducable-architectures)
{
feature.compose <deduced-architecture>$(a) : <architecture>$(a) ;
}
rule deduce-architecture ( properties * )
{
local result ;
local filtered = [ toolset-properties $(properties) ] ;
local names = arm mips1 power sparc x86 combined ;
local idx = [ configure.find-builds "default architecture" : $(filtered)
: /boost/architecture//arm
: /boost/architecture//mips1
: /boost/architecture//power
: /boost/architecture//sparc
: /boost/architecture//x86
: /boost/architecture//combined ] ;
result = $(names[$(idx)]) ;
if $(result)
{
# See comment in deduce-address-model.
result = <deduced-architecture>$(result) [ property.select <architecture> : $(properties) ] ;
}
return $(result) ;
}
rule architecture ( )
{
return <conditional>@boostcpp.deduce-architecture ;
}
-459
View File
@@ -1,459 +0,0 @@
# Boost.Build support specific for the Boost C++ Libraries.
# Copyright Vladimir Prus 2002-2010.
# Copyright Dave Abrahams 2005-2006.
# Copyright Rene Rivera 2005-2007.
# Copyright Douglas Gregor 2005.
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import b2.util.option as option
import b2.build.feature as feature
import b2.build.virtual_target as virtual_target
import b2.build.targets as targets
import b2.build.property_set as property_set
import b2.build_system as build_system
import b2.build.configure as configure
import b2.tools.stage as stage
import b2.tools.package as package
import b2.util.regex as regex
import b2.util.set as set
from b2.build.alias import AliasTarget, alias
from b2.tools.message import message
from b2.manager import get_manager
from b2.util import bjam_signature, value_to_jam
from b2.util.sequence import unique
import sys
import os
# FIXME: temporary fix until I port the xsltproc module
feature.feature("xsl:param", [], ["free"])
##############################################################################
#
# 0. General setup. Parse options, check them.
#
##############################################################################
BOOST_ROOT = get_manager().projects().loaded_tool_module_path_[__name__]
print "HERE I AM"
@bjam_signature((["version"],))
def set_version(version):
global BOOST_VERSION, BOOST_VERSION_TAG
BOOST_VERSION = version
pieces = version.split(".")
if pieces[2] == "0":
pieces = pieces[0:2]
BOOST_VERSION_TAG = "_".join(pieces)
# Option to choose how many variants to build. The default is "minimal".
build_type = option.get("build-type", "minimal")
if not build_type in ["minimal", "complete"]:
get_manager().errors()("The value of the --build-type option should be either 'complete' or 'minimal'")
# What kind of layout are we doing?
layout = option.get("layout")
# On Windows, we used versioned layout by default in order to
# be compatible with autolink. On other systems, we use system
# layout which is what every other program uses. Note that windows
# check is static, and won't
if not layout:
if os.name == "nt":
layout = "versioned"
else:
layout = "system"
if layout == "system" and build_type == "complete":
get_manager().errors()(
"Cannot use --layout=system with --build-type complete.\n"
"Please used either --layout=versioned or --layout=tagged\n"
"if you wish to build multiple variants.")
# Possible stage only location.
stage_locate = option.get("stagedir", "stage")
BOOST_STAGE_LOCATE = stage_locate
# Custom build ID.
build_id = option.get("buildid")
if build_id:
BUILD_ID = re.sub("[*\\/:.\"\' ]", "_", build_id)
# Python build id (only for Python libraries)
python_id = option.get("python-buildid")
if python_id:
PYTHON_ID = re.sub("[*\\/:.\"\' ]", "_", python_id)
##############################################################################
#
# 1. The 'tag' function that adds decoration suitable to the properties if
# versioned or tagged layout is requested. This function is called from
# Jamroot
#
##############################################################################
def tag(name, type, ps):
if type in ["STATIC_LIB", "SHARED_LIB", "IMPORT_LIB"]:
pass
## FIXME
## if $(layout) = versioned
## {
## result = [ common.format-name
## <base> <toolset> <threading> <runtime> -$(BOOST_VERSION_TAG)
## -$(BUILD_ID)
## : $(name) : $(type) : $(property-set) ] ;
## }
## else if $(layout) = tagged
## {
## result = [ common.format-name
## <base> <threading> <runtime>
## -$(BUILD_ID)
## : $(name) : $(type) : $(property-set) ] ;
## }
## else if $(layout) = system
## {
## result = [ common.format-name
## <base>
## -$(BUILD_ID)
## : $(name) : $(type) : $(property-set) ] ;
## }
## else
## {
## ECHO "error: invalid layout '$(layout:E=)'" ;
## EXIT ;
## }
## # Optionally add version suffix. On NT, library with version suffix
## # will not be recognized by linkers. On CYGWIN, we get strage
## # duplicate symbol errors when library is generated with version
## # suffix. On OSX, version suffix is not needed -- the linker expects
## # the libFoo.1.2.3.dylib format. AIX linkers do not accept version
## # suffixes either. Pgi compilers can not accept library with version
## # suffix.
## if $(type) = SHARED_LIB &&
## ( ! ( [ $(property-set).get <target-os> ] in windows cygwin darwin aix ) &&
## ! ( [ $(property-set).get <toolset> ] in pgi ) )
## {
## result = $(result).$(BOOST_VERSION) ;
## }
## return $(result) ;
## }
##############################################################################
#
# 2. Declare targets that build and install all libraries. Specifically:
#
# - 'stage-proper' that puts all libraries in stage/lib
# - 'install-proper' that install libraries and headers to system location
# - 'stage-unversioned' that creates links to libraries without boost veriosn
# in name
# - 'install-unversioned' which creates unversioned linked to installed
# libraries.
#
##############################################################################
# Worker function suitable to the 'generate' metatarget. Creates a link
# to 'source', striping any version number from the name.
def make_unversioned_links(project, name, ps, sources):
result = []
filtered = []
nt = os.name == "nt"
# Collect the libraries that have the version number in 'filtered'.
for s in sources:
if nt:
m = s.name().endswith(".lib")
else:
m = re.match("(.*[.]so[.0-9]+)" "(.*[.]dylib)" "(.*[.]a)", s.name())
if m:
filtered.append(s)
# Create links without version.
for s in filtered:
a = virtual_target.NonScanningAction(s, "symlink.ln", s.action().properties())
name = s.name()
if nt:
m = re.match("(.*)-[0-9_]+(.*[.]lib)", name)
else:
m = re.match("(.*)-[0-9_]+(.*[.]so)[.0-9]*", name)
if not m:
m = re.match("(.*)-[0-9_]+(.*[.]dylib)", name)
if not m:
m = re.match("(.*)-[0-9_]+(.*[.]a)", name)
if not m:
m = re.match("(.*)-[0-9_]+(.*[.]dll[.]a)", name)
new_name = m.group(1) + m.group(2)
result.append(virtual_target.FileTarget(new_name, s.type(), project, a,
exact=True))
return result
def declare_install_and_stage_proper_targets(libraries, headers):
install_requirements = ["<install-source-root>" + BOOST_ROOT + "/boost"]
if layout == "versioned":
install_requirements.append("<install-header-subdir>boost-" + BOOST_VERSION_TAG + "/boost")
else:
install_requirements.append("<install-header-subdir>boost")
if os.name == "nt":
default_prefix = "C:/Boost"
else:
default_prefix = "/usr/local"
install_requirements.append("<install-default-prefix>" + default_prefix)
p = get_manager().projects().current()
package.install("install-proper",
install_requirements + ["<install-no-version-symlinks>on"],
[],
["libs/%s/build" % l for l in libraries],
headers)
p.mark_targets_as_explicit(["install-proper"])
stage.install("stage-proper",
["libs/%s/build" % l for l in libraries],
["<location>" + stage_locate + "/lib",
"<install-dependencies>on", "<install-type>LIB",
"<install-no-version-symlinks>on"])
p.mark_targets_as_explicit(["stage-proper"])
gr = value_to_jam(make_unversioned_links)
gr = "<generating-rule>" + gr
if layout == "versioned":
generate("stage-unversioned", ["stage-proper"], [gr])
generate("install-unversioned", ["install-proper"], [gr])
else:
# Create do-nothing aliases.
alias("stage-unversioned")
alias("install-unversioned")
p.mark_targets_as_explicit(["stage-unversioned", "install-unversioned"])
##############################################################################
#
# 3. Declare top-level targets 'stage' and 'install'. These examine
# the --build-type option and, in case it's 'complete', build the
# 'install-proper' and 'stage-proper' targets with a number of
# property sets.
#
##############################################################################
# The names of all top-level targets that were built.
top_level_targets = []
class TopLevelTarget(AliasTarget):
def __init__(self, name, project, sources, requirements, default_build,
usage_requirements):
AliasTarget.__init__(self, name, project, sources, requirements, default_build,
usage_requirements)
# On Linux, we build release variant by default, since few users will
# ever want to debug C++ Boost libraries, and there's no ABI
# incompatibility between debug and release variants. We build
# shared and static libraries since that's what most packages
# seem to provide (.so in libfoo and .a in libfoo-dev).
self.minimal_properties = property_set.create([
"<variant>release", "<threading>multi", "<link>shared", "<link>static",
"<runtime-link>shared"])
# On Windows, new IDE projects use:
#
# runtime-link=dynamic, threading=multi, variant=(debug|release)
#
# and in addition, C++ Boost's autolink defaults to static linking.
self.minimal_properties_win = property_set.create([
"<variant>debug", "<variant>release", "<threading>multi", "<link>static",
"<runtime-link>shared"])
self.complete_properties = property_set.create([
"<variant>debug", "<variant>release",
"<threading>single", "<threading>multi"
"<link>shared", "<link>static",
"<runtime-link>shared", "<runtime-link>static"])
def generate(self, ps):
global top_level_targets
top_level_targets.append(self.name())
if build_type == "minimal":
os = ps.get('target-os')
# Because we completely override parent's 'generate'
# we need to check for default value of feature ourself.
if not os:
os = feature.get('target-os').default()
if os == "windows":
expanded = targets.apply_default_build(ps, self.minimal_properties_win)
else:
expanded = targets.apply_default_build(ps, self.minimal_properties)
return self.build_multiple(expanded)
elif build_type == "complete":
expanded = targets.apply_default_build(ps, self.complete_properties)
# Filter inappopriate combinations
filtered = []
for p in expanded:
# See comment in handle-static-runtime regarding this logic.
if ps.get("link") == ["shared"] and p.get("runtime-link") == ["static"] \
and p.get("toolset") != ["cw"]:
# Skip this
pass
else:
filtered.append(p)
return build_multiple(filtered)
else:
get_manager().errors("Unknown build type")
def build_multiple(self, property_sets):
usage_requirements = property_set.empty()
result = []
for p in property_sets:
r = AliasTarget.generate(self, p)
if r:
usage_requirements = usage_requirements.add(r.usage_requirements())
result.extend(r.targets())
return targets.GenerateResult(usage_requirements, unique(result))
def declare_top_level_targets(libraries, headers):
declare_install_and_stage_proper_targets(libraries, headers)
targets.create_metatarget(TopLevelTarget,
"install",
["install-proper", "install-unversioned"])
targets.create_metatarget(TopLevelTarget,
"stage",
["stage-proper", "stage-unversioned"])
message("explain", "\nBuilding the Boost C++ Libraries.\n\n")
get_manager().projects().current().mark_targets_as_explicit(
["install", "stage", "explain"])
# This target is built by default, and will forward to 'stage'
# after producing some explanations.
targets.create_metatarget(TopLevelTarget,
"forward",
["explain", "stage"])
stage_abs = os.path.abspath(os.path.join(stage_locate, "lib"))
##############################################################################
#
# 4. Add hook to report configuration before the build, and confirmation
# with setup instructions after the build
#
##############################################################################
def pre_build():
if "stage" in top_level_targets or "install" in top_level_targets:
configure.print_component_configuration()
build_system.add_pre_build_hook(pre_build)
def post_build(ok):
if "forward" in top_level_targets and ok:
print """\n\nThe Boost C++ Libraries were successfully built!
The following directory should be added to compiler include paths:
%s
The following directory should be added to linker library paths:
%s
""" % (BOOST_ROOT, stage_abs)
build_system.set_post_build_hook(post_build)
##############################################################################
#
# 5. Top-level setup
#
##############################################################################
def libraries_to_install(existing_libraries):
# Decides which libraries are to be installed by looking at --with-<library>
# --without-<library> arguments. Returns the list of directories under "libs"
# which must be built and installed.
with_parameter = regex.transform(sys.argv, "--with-(.*)")
without_parameter = regex.transform(sys.argv, "--without-(.*)")
if not with_parameter and not without_parameter:
# Nothing is specified on command line. See if maybe
# project-config.jam has some choices.
project_config_libs = bjam.call("peek", "project-config", "libraries")
with_parameter = regex.transform(project_config_libs, "--with-(.*)")
without_parameter = regex.transform(project_config_libs, "--without-(.*)")
# Do some checks.
if with_parameter and without_parameter:
get_manager().errors()("both --with-<library> and --without-<library> specified")
wrong = set.difference(with_parameter, existing_libraries)
if wrong:
get_manager().errors()("wrong library name '" + wrong[0] + "' in the --with-<library> option.")
wrong = set.difference(without_parameter, existing_libraries)
if wrong:
get_manager().errors()("wrong library name '" + wrong[0] + "' in the --without-<library> option.")
if with_parameter:
return set.intersection(existing_libraries, with_parameter)
else:
return set.difference(existing_libraries, without_parameter)
def declare_targets(all_libraries, headers):
configure.register_components(all_libraries)
# Select the libraries to install.
libraries = libraries_to_install(all_libraries)
configure.components_building(libraries)
if option.get("show-libraries", None, True):
print "The following libraries require building:"
for l in libraries:
print " - " + l
sys.exit(0)
declare_top_level_targets(libraries, headers)
-100
View File
@@ -1,100 +0,0 @@
@ECHO OFF
SETLOCAL
REM Copyright (C) 2009 Vladimir Prus
REM
REM Distributed under the Boost Software License, Version 1.0.
REM (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
ECHO Building Boost.Build engine
if exist ".\tools\build\src\engine\bin.ntx86\b2.exe" del tools\build\src\engine\bin.ntx86\b2.exe
if exist ".\tools\build\src\engine\bin.ntx86\bjam.exe" del tools\build\src\engine\bin.ntx86\bjam.exe
if exist ".\tools\build\src\engine\bin.ntx86_64\b2.exe" del tools\build\src\engine\bin.ntx86_64\b2.exe
if exist ".\tools\build\src\engine\bin.ntx86_64\bjam.exe" del tools\build\src\engine\bin.ntx86_64\bjam.exe
pushd tools\build\src\engine
call .\build.bat %* > ..\..\..\..\bootstrap.log
@ECHO OFF
popd
if exist ".\tools\build\src\engine\bin.ntx86\bjam.exe" (
copy .\tools\build\src\engine\bin.ntx86\b2.exe . > nul
copy .\tools\build\src\engine\bin.ntx86\bjam.exe . > nul
goto :bjam_built)
if exist ".\tools\build\src\engine\bin.ntx86_64\bjam.exe" (
copy .\tools\build\src\engine\bin.ntx86_64\b2.exe . > nul
copy .\tools\build\src\engine\bin.ntx86_64\bjam.exe . > nul
goto :bjam_built)
goto :bjam_failure
:bjam_built
REM Ideally, we should obtain the toolset that build.bat has
REM guessed. However, it uses setlocal at the start and does not
REM export BOOST_JAM_TOOLSET, and I don't know how to do that
REM properly. Default to msvc if not specified.
SET TOOLSET=msvc
IF "%1"=="gcc" SET TOOLSET=gcc
IF "%1"=="vc71" SET TOOLSET=msvc : 7.1
IF "%1"=="vc8" SET TOOLSET=msvc : 8.0
IF "%1"=="vc9" SET TOOLSET=msvc : 9.0
IF "%1"=="vc10" SET TOOLSET=msvc : 10.0
IF "%1"=="vc11" SET TOOLSET=msvc : 11.0
IF "%1"=="vc12" SET TOOLSET=msvc : 12.0
IF "%1"=="vc14" SET TOOLSET=msvc : 14.0
IF "%1"=="vc141" SET TOOLSET=msvc : 14.1
ECHO.
ECHO Generating Boost.Build configuration in project-config.jam for %TOOLSET%..."
ECHO # Boost.Build Configuration > project-config.jam
ECHO # Automatically generated by bootstrap.bat >> project-config.jam
ECHO. >> project-config.jam
ECHO import option ; >> project-config.jam
ECHO. >> project-config.jam
ECHO using %TOOLSET% ; >> project-config.jam
ECHO. >> project-config.jam
ECHO option.set keep-going : false ; >> project-config.jam
ECHO. >> project-config.jam
ECHO.
ECHO Bootstrapping is done. To build, run:
ECHO.
ECHO .\b2
ECHO.
ECHO. To generate header files, run:
ECHO.
ECHO. .\b2 headers
ECHO.
ECHO To adjust configuration, edit 'project-config.jam'.
ECHO Further information:
ECHO.
ECHO - Command line help:
ECHO .\b2 --help
ECHO.
ECHO - Getting started guide:
ECHO http://boost.org/more/getting_started/windows.html
ECHO.
ECHO - Boost.Build documentation:
ECHO http://www.boost.org/build/doc/html/index.html
ECHO.
goto :end
:bjam_failure
ECHO.
ECHO Failed to build Boost.Build engine.
ECHO Please consult bootstrap.log for further diagnostics.
ECHO.
REM Set an error code to allow `bootstrap && b2`
cmd /c exit /b 1 > nul
:end
-417
View File
@@ -1,417 +0,0 @@
#!/bin/sh
# Copyright (C) 2005, 2006 Douglas Gregor.
# Copyright (C) 2006 The Trustees of Indiana University
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# boostinspect:notab - Tabs are required for the Makefile.
BJAM=""
TOOLSET=""
BJAM_CONFIG=""
BUILD=""
PREFIX=/usr/local
EPREFIX=
LIBDIR=
INCLUDEDIR=
LIBS=""
PYTHON=python
PYTHON_VERSION=
PYTHON_ROOT=
ICU_ROOT=
# Handle case where builtin shell version of echo command doesn't
# support -n. Use the installed echo executable if there is one
# rather than builtin version to ensure -n is supported.
ECHO=`which echo`
if test "x$ECHO" = x; then
ECHO=echo
fi
# Internal flags
flag_no_python=
flag_icu=
flag_show_libraries=
for option
do
case $option in
-help | --help | -h)
want_help=yes ;;
-prefix=* | --prefix=*)
PREFIX=`expr "x$option" : "x-*prefix=\(.*\)"`
;;
-exec-prefix=* | --exec-prefix=*)
EPREFIX=`expr "x$option" : "x-*exec-prefix=\(.*\)"`
;;
-libdir=* | --libdir=*)
LIBDIR=`expr "x$option" : "x-*libdir=\(.*\)"`
;;
-includedir=* | --includedir=*)
INCLUDEDIR=`expr "x$option" : "x-*includedir=\(.*\)"`
;;
-show-libraries | --show-libraries )
flag_show_libraries=yes
;;
-with-bjam=* | --with-bjam=* )
BJAM=`expr "x$option" : "x-*with-bjam=\(.*\)"`
;;
-with-icu | --with-icu )
flag_icu=yes
;;
-with-icu=* | --with-icu=* )
flag_icu=yes
ICU_ROOT=`expr "x$option" : "x-*with-icu=\(.*\)"`
;;
-without-icu | --without-icu )
flag_icu=no
;;
-with-libraries=* | --with-libraries=* )
library_list=`expr "x$option" : "x-*with-libraries=\(.*\)"`
if test "$library_list" != "all"; then
old_IFS=$IFS
IFS=,
for library in $library_list
do
LIBS="$LIBS --with-$library"
if test $library = python; then
requested_python=yes
fi
done
IFS=$old_IFS
if test "x$requested_python" != xyes; then
flag_no_python=yes
fi
fi
;;
-without-libraries=* | --without-libraries=* )
library_list=`expr "x$option" : "x-*without-libraries=\(.*\)"`
old_IFS=$IFS
IFS=,
for library in $library_list
do
LIBS="$LIBS --without-$library"
if test $library = python; then
flag_no_python=yes
fi
done
IFS=$old_IFS
;;
-with-python=* | --with-python=* )
PYTHON=`expr "x$option" : "x-*with-python=\(.*\)"`
;;
-with-python-root=* | --with-python-root=* )
PYTHON_ROOT=`expr "x$option" : "x-*with-python-root=\(.*\)"`
;;
-with-python-version=* | --with-python-version=* )
PYTHON_VERSION=`expr "x$option" : "x-*with-python-version=\(.*\)"`
;;
-with-toolset=* | --with-toolset=* )
TOOLSET=`expr "x$option" : "x-*with-toolset=\(.*\)"`
;;
-*)
{ echo "error: unrecognized option: $option
Try \`$0 --help' for more information." >&2
{ (exit 1); exit 1; }; }
;;
esac
done
if test "x$want_help" = xyes; then
cat <<EOF
\`./bootstrap.sh' prepares Boost for building on a few kinds of systems.
Usage: $0 [OPTION]...
Defaults for the options are specified in brackets.
Configuration:
-h, --help display this help and exit
--with-bjam=BJAM use existing Boost.Jam executable (bjam)
[automatically built]
--with-toolset=TOOLSET use specific Boost.Build toolset
[automatically detected]
--show-libraries show the set of libraries that require build
and installation steps (i.e., those libraries
that can be used with --with-libraries or
--without-libraries), then exit
--with-libraries=list build only a particular set of libraries,
describing using either a comma-separated list of
library names or "all"
[all]
--without-libraries=list build all libraries except the ones listed []
--with-icu enable Unicode/ICU support in Regex
[automatically detected]
--without-icu disable Unicode/ICU support in Regex
--with-icu=DIR specify the root of the ICU library installation
and enable Unicode/ICU support in Regex
[automatically detected]
--with-python=PYTHON specify the Python executable [python]
--with-python-root=DIR specify the root of the Python installation
[automatically detected]
--with-python-version=X.Y specify the Python version as X.Y
[automatically detected]
Installation directories:
--prefix=PREFIX install Boost into the given PREFIX
[/usr/local]
--exec-prefix=EPREFIX install Boost binaries into the given EPREFIX
[PREFIX]
More precise control over installation directories:
--libdir=DIR install libraries here [EPREFIX/lib]
--includedir=DIR install headers here [PREFIX/include]
EOF
fi
test -n "$want_help" && exit 0
my_dir=$(dirname "$0")
# Determine the toolset, if not already decided
if test "x$TOOLSET" = x; then
guessed_toolset=`$my_dir/tools/build/src/engine/build.sh --guess-toolset`
case $guessed_toolset in
acc | darwin | gcc | como | mipspro | pathscale | pgi | qcc | vacpp )
TOOLSET=$guessed_toolset
;;
intel-* )
TOOLSET=intel
;;
mingw )
TOOLSET=gcc
;;
sun* )
TOOLSET=sun
;;
* )
# Not supported by Boost.Build
;;
esac
fi
rm -f config.log
# Build bjam
if test "x$BJAM" = x; then
$ECHO -n "Building Boost.Build engine with toolset $TOOLSET... "
pwd=`pwd`
(cd "$my_dir/tools/build/src/engine" && ./build.sh "$TOOLSET") > bootstrap.log 2>&1
if [ $? -ne 0 ]; then
echo
echo "Failed to build Boost.Build build engine"
echo "Consult 'bootstrap.log' for more details"
exit 1
fi
cd "$pwd"
arch=`cd $my_dir/tools/build/src/engine && ./bootstrap/jam0 -d0 -f build.jam --toolset=$TOOLSET --toolset-root= --show-locate-target && cd ..`
BJAM="$my_dir/tools/build/src/engine/$arch/b2"
echo "tools/build/src/engine/$arch/b2"
cp "$BJAM" .
cp "$my_dir/tools/build/src/engine/$arch/bjam" .
fi
# TBD: Turn BJAM into an absolute path
# If there is a list of libraries
if test "x$flag_show_libraries" = xyes; then
cat <<EOF
The following Boost libraries have portions that require a separate build
and installation step. Any library not listed here can be used by including
the headers only.
The Boost libraries requiring separate building and installation are:
EOF
$BJAM -d0 --show-libraries | grep '^[[:space:]]*-'
exit 0
fi
# Setup paths
if test "x$EPREFIX" = x; then
EPREFIX="$PREFIX"
fi
if test "x$LIBDIR" = x; then
LIBDIR="$EPREFIX/lib"
fi
if test "x$INCLUDEDIR" = x; then
INCLUDEDIR="$PREFIX/include"
fi
# Find Python
if test "x$flag_no_python" = x; then
result=`$PYTHON -c "exit" > /dev/null 2>&1`
if [ "$?" -ne "0" ]; then
flag_no_python=yes
fi
fi
if test "x$flag_no_python" = x; then
if test "x$PYTHON_VERSION" = x; then
$ECHO -n "Detecting Python version... "
PYTHON_VERSION=`$PYTHON -c "import sys; print (\"%d.%d\" % (sys.version_info[0], sys.version_info[1]))"`
echo $PYTHON_VERSION
fi
if test "x$PYTHON_ROOT" = x; then
$ECHO -n "Detecting Python root... "
PYTHON_ROOT=`$PYTHON -c "import sys; print(sys.prefix)"`
echo $PYTHON_ROOT
fi
fi
# Configure ICU
$ECHO -n "Unicode/ICU support for Boost.Regex?... "
if test "x$flag_icu" != xno; then
if test "x$ICU_ROOT" = x; then
if command -v pkg-config > /dev/null && pkg-config icu-uc ; then
ICU_ROOT=`pkg-config --variable=prefix icu-uc`
fi
fi
if test "x$ICU_ROOT" = x; then
COMMON_ICU_PATHS="/usr /usr/local /sw"
for p in $COMMON_ICU_PATHS; do
if test -r $p/include/unicode/utypes.h; then
ICU_ROOT=$p
fi
done
if test "x$ICU_ROOT" = x; then
echo "not found."
else
BJAM_CONFIG="$BJAM_CONFIG -sICU_PATH=$ICU_ROOT"
echo "$ICU_ROOT"
fi
else
BJAM_CONFIG="$BJAM_CONFIG -sICU_PATH=$ICU_ROOT"
echo "$ICU_ROOT"
fi
else
echo "disabled."
fi
# Backup the user's existing project-config.jam
JAM_CONFIG_OUT="project-config.jam"
if test -r "project-config.jam"; then
counter=1
while test -r "project-config.jam.$counter"; do
counter=`expr $counter + 1`
done
echo "Backing up existing Boost.Build configuration in project-config.jam.$counter"
mv "project-config.jam" "project-config.jam.$counter"
fi
# Generate user-config.jam
echo "Generating Boost.Build configuration in project-config.jam for $TOOLSET..."
cat > project-config.jam <<EOF
# Boost.Build Configuration
# Automatically generated by bootstrap.sh
import option ;
import feature ;
# Compiler configuration. This definition will be used unless
# you already have defined some toolsets in your user-config.jam
# file.
if ! $TOOLSET in [ feature.values <toolset> ]
{
using $TOOLSET ;
}
project : default-build <toolset>$TOOLSET ;
EOF
# - Python configuration
if test "x$flag_no_python" = x; then
cat >> project-config.jam <<EOF
# Python configuration
import python ;
if ! [ python.configured ]
{
using python : $PYTHON_VERSION : $PYTHON_ROOT ;
}
EOF
fi
if test "x$ICU_ROOT" != x; then
cat >> project-config.jam << EOF
path-constant ICU_PATH : $ICU_ROOT ;
EOF
fi
cat >> project-config.jam << EOF
# List of --with-<library> and --without-<library>
# options. If left empty, all libraries will be built.
# Options specified on the command line completely
# override this variable.
libraries = $LIBS ;
# These settings are equivalent to corresponding command-line
# options.
option.set prefix : $PREFIX ;
option.set exec-prefix : $EPREFIX ;
option.set libdir : $LIBDIR ;
option.set includedir : $INCLUDEDIR ;
# Stop on first error
option.set keep-going : false ;
EOF
cat << EOF
Bootstrapping is done. To build, run:
./b2
To generate header files, run:
./b2 headers
To adjust configuration, edit 'project-config.jam'.
Further information:
- Command line help:
./b2 --help
- Getting started guide:
http://www.boost.org/more/getting_started/unix-variants.html
- Boost.Build documentation:
http://www.boost.org/build/doc/html/index.html
EOF
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

-54
View File
@@ -1,54 +0,0 @@
# Use, modification, and distribution are
# subject to the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# Copyright Rene Rivera 2015-2016.
machine:
environment:
SCRIPT_N: ci_boost_release ci_boost_release
EOL_N: LF CRLF
pre:
- |
wget "https://raw.githubusercontent.com/boostorg/release-tools/develop/ci_boost_common.py" -P ${HOME}
wget "https://raw.githubusercontent.com/boostorg/release-tools/develop/ci_boost_library_check.py" -P ${HOME}
wget "https://raw.githubusercontent.com/boostorg/release-tools/develop/ci_boost_release.py" -P ${HOME}
wget "https://raw.githubusercontent.com/boostorg/release-tools/develop/ci_boost_status.py" -P ${HOME}
echo '#!/bin/bash' > ${HOME}/script.sh
echo 'export SCRIPT_N=(${SCRIPT_N})' >> "${HOME}/script.sh"
echo 'export SCRIPT=${SCRIPT_N[$CIRCLE_NODE_INDEX]}' >> "${HOME}/script.sh"
echo 'export EOL_N=(${EOL_N})' >> "${HOME}/script.sh"
echo 'export EOL=${EOL_N[$CIRCLE_NODE_INDEX]}' >> "${HOME}/script.sh"
echo 'python "${HOME}/${SCRIPT}.py" "$@"' >> "${HOME}/script.sh"
chmod +x "${HOME}/script.sh"
post:
- sudo apt-get update
- sudo apt-get install xsltproc
- exec "${HOME}/script.sh" machine_post
checkout:
post:
- exec "${HOME}/script.sh" checkout_post
dependencies:
pre:
- exec "${HOME}/script.sh" dependencies_pre
override:
- exec "${HOME}/script.sh" dependencies_override
post:
- exec "${HOME}/script.sh" dependencies_post
database:
pre:
- exec "${HOME}/script.sh" database_pre
override:
- exec "${HOME}/script.sh" database_override
post:
- exec "${HOME}/script.sh" database_post
test:
pre:
- exec "${HOME}/script.sh" test_pre:
parallel: true
override:
- exec "${HOME}/script.sh" test_override:
parallel: true
post:
- exec "${HOME}/script.sh" test_post:
parallel: true
-206
View File
@@ -1,206 +0,0 @@
# Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
# Copyright (c) 2016 Rene Rivera
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
project boost/doc
: requirements
<xsl:param>boost.libraries=../../libs/libraries.htm
<format>html:<xsl:param>chunker.output.doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
<format>html:<xsl:param>chunker.output.doctype-system="http://www.w3.org/TR/html4/loose.dtd"
;
import boostbook : boostbook ;
import project ;
import targets ;
import print ;
import type ;
import generators ;
import sequence ;
import path ;
import "class" : is-a ;
path-constant BOOST_DOC : . ;
local lib-docs = [ path.glob [ path.glob $(BOOST_DOC)/../libs : */doc ]
: [ modules.peek project : JAMFILE ] ] ;
local rule find-target-of-class-or-type ( root-target : klass ? : type ? )
{
local result ;
if ! $(result) && $(klass) && [ is-a $(root-target) : $(klass) ]
{
result ?= $(root-target) $(klass) ;
}
if ! $(result) && $(type) && $(type:U) = [ modules.peek $(root-target) : self.type ]
{
result ?= $(root-target) $(type:U) ;
}
local alternatives = [ modules.peek $(root-target) : self.alternatives ] ;
if ! $(result)
{
for local alternative in $(alternatives)
{
if $(result) { break ; }
result ?= [ find-target-of-class-or-type $(alternative) : $(klass) : $(type) ] ;
}
}
if ! $(result)
{
for local alternative in $(alternatives)
{
if $(result) { break ; }
local sources = [ modules.peek $(alternative) : self.sources ] ;
for local source in [ $(alternative).sources ]
{
if $(result) { break ; }
result ?= [ find-target-of-class-or-type $(source) : $(klass) : $(type) ] ;
}
}
}
return $(result) ;
}
local rule docbook-target-spec ( main-target )
{
local spec ;
local doc-sub-target
= [ find-target-of-class-or-type $(main-target) : boostbook-target-class : XML ] ;
if $(doc-sub-target)
{
#ECHO *** $(main-target) ;
#ECHO " ::" [ $(main-target).full-name ] ;
#ECHO " ::" $(doc-sub-target) :: [ $(doc-sub-target[0]).full-name ] ;
local full-name = [ $(doc-sub-target[0]).full-name ] ;
local target-path = $(full-name:D) ;
local target-name = $(full-name:B) ;
local this-path = [ path.root [ project.attribute $(__name__) location ] [ path.pwd ] ] ;
target-path = [ path.relative-to $(this-path) $(target-path) ] ;
#ECHO " ::" $(target-path) :: $(target-name) ;
spec = $(target-path)//$(target-name) ;
}
return $(spec) ;
}
local lib-doc-boostdoc-refs ;
local lib-doc-boostrelease-refs ;
local this-path = [ path.root [ project.attribute $(__name__) location ] [ path.pwd ] ] ;
for local lib-doc in $(lib-docs)
{
#ECHO === $(lib-doc) ... ;
local doc-project = $(lib-doc:D) ;
local doc-module = [ project.find $(doc-project)
: [ project.attribute $(__name__) location ] ] ;
local doc-target = [ project.target $(doc-module) ] ;
$(doc-target).build-main-targets ;
local boostrelease-target = [ $(doc-target).main-target boostrelease ] ;
if $(boostrelease-target)
{
local full-name = [ $(boostrelease-target).full-name ] ;
local target-path = [ path.relative-to $(this-path) $(full-name:D) ] ;
lib-doc-boostrelease-refs += $(target-path)//boostrelease ;
#ECHO " ::" $(target-path)//boostrelease ;
}
local boostdoc-target = [ $(doc-target).main-target boostdoc ] ;
if $(boostdoc-target)
{
local full-name = [ $(boostdoc-target).full-name ] ;
local target-path = [ path.relative-to $(this-path) $(full-name:D) ] ;
lib-doc-boostdoc-refs += $(target-path)//boostdoc ;
#ECHO " ::" $(target-path)//boostdoc ;
}
}
# Build non-integrated library docs for release.
if "--release-build" in [ modules.peek : ARGV ]
{
alias release-build : $(lib-doc-boostrelease-refs) ;
}
local rule component-order ( x y )
{
local a = [ MATCH "(/libs/[^/]+)" "(/tools/[^/]+)" : $(x:G) $(x:G=) ] ;
local b = [ MATCH "(/libs/[^/]+)" "(/tools/[^/]+)" : $(y:G) $(y:G=) ] ;
if $(a[1]) < $(b[1])
{
return true ;
}
else if $(a[1]) = $(b[1]) && $(x) < $(y)
{
return true ;
}
}
rule xinclude-generator ( target : sources * : properties * )
{
print.output $(target) ;
local includes ;
sources = [ sequence.insertion-sort $(sources) : component-order ] ;
locate = [ path.root [ on $(target) return $(LOCATE) ] [ path.pwd ] ] ;
for local xml in $(sources)
{
local dir ;
dir ?= [ on $(xml) return $(LOCATE) ] ;
dir ?= [ on $(xml) return $(SEARCH) ] ;
dir ?= "" ;
dir = [ path.root $(dir[1]) [ path.pwd ] ] ;
dir = [ path.relative-to $(locate) $(dir) ] ;
includes += "<xi:include href=\"$(dir[1])/$(xml:G=)\"/>" ;
}
print.text
"<?xml version=\"1.0\" encoding=\"utf-8\"?>"
"<xml xmlns:xi=\"http://www.w3.org/2003/XInclude\">"
$(includes)
"</xml>"
: overwrite ;
}
type.register XINCLUDE_XML : xinclude : XML ;
generators.register-composing $(__name__).xinclude-generator : XML : XINCLUDE_XML ;
rule xinclude ( name : sources * : requirements * : default-build * : usage-requirements * )
{
targets.create-typed-target XINCLUDE_XML
: [ project.current ]
: $(name)
: $(sources)
: $(requirements)
: $(default-build)
: $(usage-requirements)
;
}
xinclude libraries :
$(lib-doc-boostdoc-refs)
;
explicit libraries ;
xinclude tools :
../tools/quickbook/doc//quickbook
../tools/boostbook/doc/boostbook.xml
../tools/build/doc//boostdoc
;
explicit tools ;
boostbook doc
:
src/boost.xml
:
<xsl:param>generate.consistent.ids=1
<use>$(lib-doc-boostdoc-refs)
<dependency>libraries
<implicit-dependency>libraries
<dependency>tools
<implicit-dependency>tools
<dependency>images
<dependency>callouts
<xsl:path>$(BOOST_DOC)
;
install images : [ glob src/images/*.png ] : <location>html/images ;
explicit images ;
install callouts : [ glob src/images/callouts/*.png ] : <location>html/images/callouts ;
explicit callouts ;
-16
View File
@@ -1,16 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<title>Redirect to generated documentation</title>
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/Assignable.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/Assignable.html">http://www.boost.org/doc/libs/master/doc/html/Assignable.html</a>
</body>
</html>
-16
View File
@@ -1,16 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<title>Redirect to generated documentation</title>
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/CopyConstructible.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/CopyConstructible.html">http://www.boost.org/doc/libs/master/doc/html/CopyConstructible.html</a>
</body>
</html>
-16
View File
@@ -1,16 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<title>Redirect to generated documentation</title>
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/accumulators.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/accumulators.html">http://www.boost.org/doc/libs/master/doc/html/accumulators.html</a>
</body>
</html>
+40 -16
View File
@@ -1,16 +1,40 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<title>Redirect to generated documentation</title>
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/any.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/any.html">http://www.boost.org/doc/libs/master/doc/html/any.html</a>
</body>
</html>
<!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>
-16
View File
@@ -1,16 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<title>Redirect to generated documentation</title>
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/array.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/array.html">http://www.boost.org/doc/libs/master/doc/html/array.html</a>
</body>
</html>
-16
View File
@@ -1,16 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<title>Redirect to generated documentation</title>
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/atomic.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/atomic.html">http://www.boost.org/doc/libs/master/doc/html/atomic.html</a>
</body>
</html>
-16
View File
@@ -1,16 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<title>Redirect to generated documentation</title>
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/bbv2.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/bbv2.html">http://www.boost.org/doc/libs/master/doc/html/bbv2.html</a>
</body>
</html>
-18
View File
@@ -1,18 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<title>Redirect to new location</title>
<meta http-equiv="refresh" content="0; URL=../bbv2.html#bbv2.installation">
</head>
<body>
Automatic redirection failed, please go to
<a href="../bbv2.html#bbv2.installation">../bbv2.html#bbv2.installation</a>
</body>
</html>
-17
View File
@@ -1,17 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<title>Redirect to generated documentation</title>
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/boost_asio.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/boost_asio.html">http://www.boost.org/doc/libs/master/doc/html/boost_asio.html</a>
</body>
</html>
-16
View File
@@ -1,16 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<title>Redirect to generated documentation</title>
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/boost_lexical_cast.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/boost_lexical_cast.html">http://www.boost.org/doc/libs/master/doc/html/boost_lexical_cast.html</a>
</body>
</html>
-17
View File
@@ -1,17 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<title>Redirect to generated documentation</title>
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/boost_random.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/boost_random.html">http://www.boost.org/doc/libs/master/doc/html/boost_random.html</a>
</body>
</html>
-17
View File
@@ -1,17 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<title>Redirect to generated documentation</title>
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/boost_staticassert.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/boost_staticassert.html">http://www.boost.org/doc/libs/master/doc/html/boost_staticassert.html</a>
</body>
</html>
-16
View File
@@ -1,16 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<title>Redirect to generated documentation</title>
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/boost_typeerasure.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/boost_typeerasure.html">http://www.boost.org/doc/libs/master/doc/html/boost_typeerasure.html</a>
</body>
</html>
-16
View File
@@ -1,16 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<title>Redirect to generated documentation</title>
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/boostbook.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/boostbook.html">http://www.boost.org/doc/libs/master/doc/html/boostbook.html</a>
</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>
-16
View File
@@ -1,16 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<title>Redirect to generated documentation</title>
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/chrono.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/chrono.html">http://www.boost.org/doc/libs/master/doc/html/chrono.html</a>
</body>
</html>
-17
View File
@@ -1,17 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<title>Redirect to generated documentation</title>
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/circular_buffer.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/container.html">http://www.boost.org/doc/libs/master/doc/html/circular_buffer.html</a>
</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>
-16
View File
@@ -1,16 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<title>Redirect to generated documentation</title>
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/container.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/container.html">http://www.boost.org/doc/libs/master/doc/html/container.html</a>
</body>
</html>
-16
View File
@@ -1,16 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<title>Redirect to generated documentation</title>
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/date_time.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/date_time.html">http://www.boost.org/doc/libs/master/doc/html/date_time.html</a>
</body>
</html>
-17
View File
@@ -1,17 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<title>Redirect to generated documentation</title>
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/date_time/date_time_io.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/date_time/date_time_io.html">http://www.boost.org/doc/libs/master/doc/html/date_time/date_time_io.html</a>
</body>
</html>
-17
View File
@@ -1,17 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<title>Redirect to generated documentation</title>
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/date_time/details.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/date_time/details.html">http://www.boost.org/doc/libs/master/doc/html/date_time/details.html</a>
</body>
</html>
-17
View File
@@ -1,17 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<title>Redirect to generated documentation</title>
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/date_time/local_time.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/date_time/local_time.html">http://www.boost.org/doc/libs/master/doc/html/date_time/local_time.html</a>
</body>
</html>
-17
View File
@@ -1,17 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<title>Redirect to generated documentation</title>
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/foreach.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/foreach.html">http://www.boost.org/doc/libs/master/doc/html/foreach.html</a>
</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 -16
View File
@@ -1,16 +1,21 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<title>Redirect to generated documentation</title>
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/function.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/function.html">http://www.boost.org/doc/libs/master/doc/html/function.html</a>
</body>
</html>
<!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>
-16
View File
@@ -1,16 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<title>Redirect to generated documentation</title>
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/hash.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/hash.html">http://www.boost.org/doc/libs/master/doc/html/hash.html</a>
</body>
</html>
-16
View File
@@ -1,16 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<title>Redirect to generated documentation</title>
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/hash/custom.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/hash/custom.html">http://www.boost.org/doc/libs/master/doc/html/hash/custom.html</a>
</body>
</html>
-16
View File
@@ -1,16 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<title>Redirect to generated documentation</title>
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/heap.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/heap.html">http://www.boost.org/doc/libs/master/doc/html/heap.html</a>
</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.

Before

Width:  |  Height:  |  Size: 358 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 336 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 334 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 370 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

File diff suppressed because one or more lines are too long
-17
View File
@@ -1,17 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/interprocess.html">
<title>Redirect to generated documentation</title>
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/interprocess.html">http://www.boost.org/doc/libs/master/doc/html/interprocess.html</a>
</body>
</html>
-17
View File
@@ -1,17 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<title>Redirect to generated documentation</title>
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/intrusive.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/intrusive.html">http://www.boost.org/doc/libs/master/doc/html/intrusive.html</a>
</body>
</html>
-16
View File
@@ -1,16 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<title>Redirect to generated documentation</title>
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/lambda.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/lambda.html">http://www.boost.org/doc/libs/master/doc/html/lambda.html</a>
</body>
</html>
-16
View File
@@ -1,16 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<title>Redirect to generated documentation</title>
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/lockfree.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/lockfree.html">http://www.boost.org/doc/libs/master/doc/html/lockfree.html</a>
</body>
</html>
-16
View File
@@ -1,16 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<title>Redirect to generated documentation</title>
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/move.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/move.html">http://www.boost.org/doc/libs/master/doc/html/move.html</a>
</body>
</html>
-16
View File
@@ -1,16 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2007 Trustees of Indiana University
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<title>Redirect to generated documentation</title>
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/mpi.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/mpi.html">http://www.boost.org/doc/libs/master/doc/html/mpi.html</a>
</body>
</html>
-16
View File
@@ -1,16 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<title>Redirect to generated documentation</title>
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/program_options.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/program_options.html">http://www.boost.org/doc/libs/master/doc/html/program_options.html</a>
</body>
</html>
-16
View File
@@ -1,16 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<title>Redirect to generated documentation</title>
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/property_tree.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/property_tree.html">http://www.boost.org/doc/libs/master/doc/html/property_tree.html</a>
</body>
</html>
-16
View File
@@ -1,16 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<title>Redirect to generated documentation</title>
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/proto.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/proto.html">http://www.boost.org/doc/libs/master/doc/html/proto.html</a>
</body>
</html>
-16
View File
@@ -1,16 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<title>Redirect to generated documentation</title>
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/quickbook.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/quickbook.html">http://www.boost.org/doc/libs/master/doc/html/quickbook.html</a>
</body>
</html>
-16
View File
@@ -1,16 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<!-- Copyright (C) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt) -->
<title>Redirect to generated documentation</title>
<meta http-equiv="refresh" content="0; URL=http://www.boost.org/doc/libs/master/doc/html/ratio.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="http://www.boost.org/doc/libs/master/doc/html/ratio.html">http://www.boost.org/doc/libs/master/doc/html/ratio.html</a>
</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>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>

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