Compare commits

..

245 Commits

Author SHA1 Message Date
Peter Dimov
26e22b8b37 Update ci.yml 2025-06-09 02:44:22 +03:00
Peter Dimov
d21b8660ce Merge pull request #26 from grafikrobot/modular
Add support for modular build structure.
2025-05-02 19:23:38 +03:00
Rene Rivera
713917981c Move include to target. 2025-04-14 19:16:45 -05:00
Rene Rivera
8db96559c2 Sync from upstream. 2025-04-04 21:39:40 -05:00
Peter Dimov
426e7505cd Apply Node20 workaround 2024-12-15 20:05:50 +02:00
Peter Dimov
2ce143e061 Update ci.yml 2024-12-15 19:59:53 +02:00
Rene Rivera
cfa875a00c Update build deps. 2024-08-17 00:53:07 -05:00
Rene Rivera
bec4e19326 Move inter-lib dependencies to a project variable and into the build targets. 2024-07-23 22:34:22 -05:00
Rene Rivera
67aac44aa4 Update copyright dates. 2024-07-20 22:52:03 -05:00
Rene Rivera
c1a09affd7 Change all <source> references to <library>. 2024-07-20 21:27:22 -05:00
Rene Rivera
11a69febcb Bump B2 require to 5.2 2024-06-14 11:33:56 -05:00
Rene Rivera
2ae4a81989 Update dependencies. 2024-05-13 21:48:15 -05:00
Rene Rivera
65f5be6f9a Add requires-b2 check to top-level build file. 2024-05-05 09:00:01 -05:00
Rene Rivera
c5b6cfdea4 Switch to library requirements instead of source. As source puts extra source in install targets. 2024-03-29 21:16:00 -05:00
Rene Rivera
f2cee6fa26 Make the library modular usable. 2024-03-11 08:38:17 -05:00
Peter Dimov
4bc9de322c Update BOOST_TEST_LINK_LIBRARIES 2023-10-11 20:56:58 +03:00
Peter Dimov
ff9a75ffdf Update dependency list in cmake_subdir_test 2023-10-11 20:29:58 +03:00
Peter Dimov
412d9fab18 Regenerate CMakeLists.txt 2023-10-11 20:23:59 +03:00
Peter Dimov
d15dba11ca Use <type_traits> in decltype.hpp 2023-10-11 20:23:12 +03:00
Peter Dimov
9fbea065a4 Use <type_traits> in msvc/typeof_impl.hpp 2023-10-11 20:20:56 +03:00
Peter Dimov
2873e76139 Update registration headers 2023-10-11 20:16:38 +03:00
Peter Dimov
22be4cc612 Regenerate CMakeLists.txt 2023-10-11 20:10:45 +03:00
Peter Dimov
68552c321c Update meta/libraries.json 2023-10-11 20:10:07 +03:00
Peter Dimov
75e4c2f77e Remove tools/preprocess.pl 2023-10-11 20:08:56 +03:00
Peter Dimov
19a9a7e02f Remove obsolete header files 2023-10-11 20:08:17 +03:00
Peter Dimov
3280983db7 Remove C++03 from ci.yml 2023-10-11 19:55:55 +03:00
Peter Dimov
3b3f2e084b Require decltype in typeof.hpp, except for msvc-14.0 2023-10-11 19:49:59 +03:00
Peter Dimov
0fe3f42df7 Fix cmake_subdir_test and cmake_install_test 2023-10-11 19:29:37 +03:00
Peter Dimov
4f4104aaf0 Regenerate CMakeLists.txt 2023-10-11 19:24:15 +03:00
Peter Dimov
084619b424 Add CMake tests 2023-10-11 19:23:32 +03:00
Peter Dimov
4e4c584ec6 Update ci.yml 2023-10-11 19:08:03 +03:00
Peter Dimov
8c654f75a3 Update C++03 deprecation message 2023-06-03 02:31:59 +03:00
Peter Dimov
27a4d8b09e Trigger CI 2023-03-06 09:51:25 +02:00
Peter Dimov
4631690cf6 Merge pull request #20 from eldiener/develop
[skip ci] Add "cxxstd" json field
2023-03-06 06:24:40 +02:00
Peter Dimov
4a827b0cda Add C++03 deprecation notice 2023-03-06 05:56:22 +02:00
Peter Dimov
83756139b2 C++20 removes std::raw_storage_iterator, unary_negate, binary_negate 2023-03-06 04:51:04 +02:00
Peter Dimov
465b49c825 Add .github/workflows/ci.yml 2023-03-06 04:17:25 +02:00
Peter Dimov
46c7a05f82 Update CMakeLists.txt 2021-06-10 00:47:04 +03:00
Edward Diener
f304c9ec72 [skip ci] Add "cxxstd" json field. The "cxxstd" json field is being added to each Boost library's meta json information for libraries in order to specify the minumum C++ standard compilation level. The value of this field matches one of the values for 'cxxstd' in Boost.Build. The purpose of doing this is to provide information for the Boost website documentation for each library which will specify the minimum C++ standard compilation that an end-user must employ in order to use the particular library. This will aid end-users who want to know if they can successfully use a Boost library based on their C++ compiler's compilation level, without having to search the library's documentation to find this out. 2021-01-21 16:27:00 -05:00
Peter Dimov
da6801c691 Merge pull request #18 from eldiener/develop
Changes for Embarcadero C++ clang-based compilers, targeting Boost 1.74. Change __BORLANDC__ to BOOST_BORLANDC, which is defined in Boost conf…
2020-08-24 14:15:39 +03:00
Peter Dimov
d30c81ab01 Update .travis.yml 2020-08-24 13:41:27 +03:00
Edward Diener
0ebcad0700 Change __BORLANDC__ to BOOST_BORLANDC, which is defined in Boost config for the Embarcadero non-clang-based compilers. 2020-03-28 12:23:23 -04:00
Glen Fernandes
27890f7ec1 Merge pull request #17 from Kojoley/missing-cstddef-include
Missing `cstddef` include
2020-03-27 14:50:36 -04:00
Nikita Kniazev
a660ddd9fd Missing cstddef include 2020-03-20 19:03:48 +03:00
Glen Fernandes
067ad10264 Merge pull request #15 from Mike-Devel/min_cmake
Add minimal cmake file
2018-12-30 13:25:40 -05:00
Mike Dev
f7ceda084a [CMake] Generate cmake target that other libraries can use
... to express their dependency on this library and retrieve
any configuration information such as the include directory
and transitive dependencies.
2018-12-30 15:57:56 +01:00
Glen Fernandes
e35962f3f0 Merge pull request #14 from glenfe/develop
Drop dependency on MPL and use enable_if from TypeTraits
2018-09-22 14:47:48 -04:00
Glen Fernandes
fa5c6fc8e5 Drop dependency on MPL 2018-09-22 12:52:06 -04:00
Glen Fernandes
7538ccb6b3 Use correct include path for workaround.hpp 2018-09-22 10:20:37 -04:00
Glen Fernandes
d85bb74cb3 Use enable_if from TypeTraits 2018-09-22 10:19:30 -04:00
Peter Dimov
080f05ea46 Squash-merge branch feature/pull-11 2018-01-13 20:46:25 +02:00
Peter Dimov
0047815f4a Merge branch 'feature/ignore-deprecated' of https://github.com/DanielaE/boost.typeof into develop 2017-11-22 01:41:04 +02:00
Peter Dimov
e789dbdcbe Merge branch 'develop' 2017-11-04 20:33:26 +02:00
Peter Dimov
e9f4579047 Test typeof instead of smart_ptr :-/ 2017-11-04 16:26:08 +02:00
Peter Dimov
ec502afe5d Update .travis.yml 2017-11-04 00:36:52 +02:00
Peter Dimov
a9298ee94f Add import testing ; to test/Jamfile 2017-11-04 00:36:29 +02:00
Peter Dimov
d6f7132800 Merge pull request #10 from eldiener/develop
Remove executable attribute.
2017-11-03 23:39:24 +02:00
Edward Diener
05ad6402ef Remove executable attribute. 2017-09-17 08:27:46 -04:00
Michael Caisse
8475a449d3 Appveyor config referenced Travis variables 2017-08-10 09:19:30 -07:00
jzmaddock
a506733d99 Add appveyor.yml CI script. 2017-08-10 08:23:27 -07:00
Peter Dimov
be4cdd3a29 Merge branch 'develop'
Conflicts:
	include/boost/typeof/msvc/typeof_impl.hpp
	include/boost/typeof/typeof.hpp
2017-04-24 17:11:43 +03:00
Daniela Engert
5d737d61e5 conditionally ignore testcases for removed library features
Signed-off-by: Daniela Engert <dani@ngrt.de>
2017-04-19 19:31:39 +02:00
Peter Dimov
733e1e94c8 Remove trailing whitespace 2017-04-16 18:03:52 +03:00
Peter Dimov
2b4df4f09f Merge branch 'DanielaE-feature/msvc-option-permissive-' into develop 2017-04-16 18:02:39 +03:00
Daniela Engert
12e1fe615a enable use of msvc compiler option /permissive-
The compiler hack used to emulate __typeof__ on msvc no longer works when compiler option /permissive- is engaged. Rather than preying on a compiler bug take advantage of modern c++ instead.

Signed-off-by: Daniela Engert <dani@ngrt.de>
2017-04-16 08:51:30 +02:00
Peter Dimov
681499bba4 Merge branch 'pgroke-dt-z_OS_XL_C++_support' into develop 2017-04-16 01:27:37 +03:00
Peter Dimov
7db26fbf83 Merge branch 'z_OS_XL_C++_support' of https://github.com/pgroke-dt/typeof into pgroke-dt-z_OS_XL_C++_support 2017-04-16 01:25:32 +03:00
Peter Dimov
64ad04d3eb Merge branch 'awulkiew-fix/msc_clang' into develop 2017-04-16 01:19:39 +03:00
Peter Dimov
72e3e5ac18 Merge branch 'fix/msc_clang' of https://github.com/awulkiew/typeof into awulkiew-fix/msc_clang 2017-04-16 01:17:05 +03:00
Peter Dimov
ec9d092345 Add c++03, g++ 4.6, clang-3.4 to Travis 2017-04-16 00:22:27 +03:00
Peter Dimov
ab7073f32d Add .travis.yml 2017-04-16 00:08:05 +03:00
Paul Groke
03ae4b3465 support for IBM XL C/C++ compiler family __typeof__ 2017-02-21 22:54:41 +01:00
Rene Rivera
1d3589e9c0 Add, and update, documentation build targets. 2016-10-10 11:39:54 -05:00
Rene Rivera
d8b8af69ac Add, and update, documentation build targets. 2016-10-07 23:07:37 -05:00
Adam Wulkiewicz
4994d5be13 Fix compilation error with MSC+Clang - check defined(__clang__) explicitly. 2016-03-16 01:55:41 +01:00
Rene Rivera
ed7d30939d Fix outdated path to boostbook css. 2016-02-23 21:55:16 -06:00
Rene Rivera
c394d0a5ae Fix outdated path to boostbook css. 2015-12-21 22:32:05 -06:00
Daniel James
6aea11f3df Add metadata file. 2015-01-25 20:50:03 +02:00
Peter Dimov
5bbb552f28 Merge pull request #2 from danieljames/metadata
Create metadata file.
2015-01-25 20:27:48 +02:00
Daniel James
5bf1a089bd Add metadata file. 2014-08-18 15:12:05 +01:00
Stephen Kelly
4e34737b9c TypeOf: Fix if/elif chain after msvc 6/7 removal.
[SVN r85925]
2013-09-26 06:52:33 +00:00
Stephen Kelly
8092dd0003 TypeOf: Remove obsolete MSVC version checks
[SVN r85920]
2013-09-25 21:15:54 +00:00
Thomas Heller
9fcf6ff70e reverting accidently commited change
[SVN r75052]
2011-10-18 17:25:37 +00:00
Thomas Heller
2334bc2bf7 added full qualification to enable_if for the member pointer operator
[SVN r75050]
2011-10-18 16:09:48 +00:00
Peder Holt
e56adea1b1 Integrated from trunc: Applied patch for #5745: Use native typeof support for Oracle Solaris Studio C++ compiler
[SVN r74849]
2011-10-09 13:08:04 +00:00
Peder Holt
731e9ce0ad Applied patch for #5745: Use native typeof support for Oracle Solaris Studio C++ compiler
[SVN r73579]
2011-08-06 18:46:43 +00:00
Eric Niebler
4fab1b5d17 fix typeof bug on msvc-7.1 that is causing type_traits/common_type.hpp to fail to compile
[SVN r66662]
2010-11-21 21:42:52 +00:00
Peder Holt
85eed8ff60 from trunk: Updated documentation of typeof, added documentation for BOOST_TYPEOF_MESSAGE
[SVN r66131]
2010-10-21 09:39:55 +00:00
Peder Holt
81e54ccb1f Integrated from trunk:
#4593	Type_of does not use BOOST_TYPEOF_EMULATION for VC10 and \Za
#3520	Syntax Error in boost/typeof/typeof.hpp
#4605	Make BOOST_TYPEOF_SILENT default
Apply variadic functions patch from Sergey Zubkovsky.
Allow inclusion of typeof.hpp for compilers (borland) that does not support typeof emulation or native typeof. For these compilers, BOOST_TYPEOF_EMULATION_UNSUPPORTED will be defined, and BOOST_TYPEOF(Expr) will always result in boost::type_of::typeof_emulation_is_unsupported_on_this_compiler

[SVN r66130]
2010-10-21 09:34:15 +00:00
Peder Holt
e9749f185f From trunk: Allow inclusion of typeof.hpp for compilers (borland) that does not support typeof emulation or native typeof. For these compilers, BOOST_TYPEOF_EMULATION_UNSUPPORTED will be defined, and BOOST_TYPEOF(Expr) will always result in boost::type_of::typeof_emulation_is_unsupported_on_this_compiler
[SVN r66129]
2010-10-21 09:26:45 +00:00
Peder Holt
b46f8efd6b Ticket #3520 Syntax Error in boost/typeof/typeof.hpp
Line 18 of boost/typeof/typeof.hpp fixed from
# ifndef(BOOST_TYPEOF_EMULATION)
to
# ifndef BOOST_TYPEOF_EMULATION

[SVN r65138]
2010-08-30 20:21:47 +00:00
Peder Holt
c75b62533a #4605: Make BOOST_TYPEOF_SILENT default
BOOST_TYPEOF_SILENT has been removed and BOOST_TYPEOF_MESSAGES has been added.
Messages are now hidden by default, and you have to define BOOST_TYPEOF_MESSAGES to see them at all.

[SVN r65137]
2010-08-30 20:08:29 +00:00
Peder Holt
d04dc539a0 Removed tabs from file
[SVN r65136]
2010-08-30 20:00:04 +00:00
Peder Holt
1468636543 #4593: Type_of does not use BOOST_TYPEOF_EMULATION for VC10 and \Za - fixed
[SVN r65135]
2010-08-30 19:29:02 +00:00
Peder Holt
468e0de51e Allow inclusion of typeof.hpp for compilers (borland) that does not support typeof emulation or native typeof. For these compilers, BOOST_TYPEOF_EMULATION_UNSUPPORTED will be defined, and BOOST_TYPEOF(Expr) will always result in boost::type_of::typeof_emulation_is_unsupported_on_this_compiler
[SVN r63369]
2010-06-26 20:28:49 +00:00
Peder Holt
dcb1e95d25 Added documentation of BOOST_TYPEOF_SILENT
[SVN r63367]
2010-06-26 19:12:01 +00:00
Daniel James
bfb19140f1 Merge documentation fixes.
* Use `doc/src/*.css` instead of `doc/html/*.css`.
* Remove wiki and people directories.
* Some documentation fixes.
* Left out `minimal.css` changes and boostbook changes because of clashes.


[SVN r63347]
2010-06-26 12:30:09 +00:00
Daniel James
3892d59ff8 Update various libraries' documentation build.
Mostly to use the images and css files under doc/src instead of
doc/html, usually be deleting the settings in order to use the defaults.
Also add 'boost.root' to some builds in order to fix links which rely on
it.

[SVN r63146]
2010-06-20 18:00:48 +00:00
Alexander Nasonov
eff78826d2 Apply variadic functions patch from Sergey Zubkovsky.
[SVN r59579]
2010-02-07 19:13:43 +00:00
Troy D. Straszheim
b420583f9c rm cmake from trunk. I'm not entirely sure this is necessary to satisfy the inspect script, but I'm not taking any chances, and it is easy to put back
[SVN r56942]
2009-10-17 02:07:38 +00:00
Troy D. Straszheim
4aab62e71c rm cmake from the release branch before it goes out broken. Policy dictates that you never commit to release, you commit to trunk and merge to release.
[SVN r56941]
2009-10-17 01:10:45 +00:00
Troy D. Straszheim
9a5663ff14 Copyrights on CMakeLists.txt to keep them from clogging up the inspect
reports.  This is essentially the same commit as r55095 on the release
branch.



[SVN r55159]
2009-07-26 00:49:56 +00:00
Troy D. Straszheim
0f21fe555a Add basic copyright/license to keep cmake out of the inspection report
[SVN r55095]
2009-07-22 21:51:01 +00:00
Peder Holt
a70cd7396a BOOST_TYPEOF_NESTED_TYPEDEF now supports expressions containing "this" for VC compilers
[SVN r51687]
2009-03-10 18:07:38 +00:00
Peder Holt
c10804f3b0 Removed use of typeid in typeof implementation for VC7.1, as this caused problems in some uses of BOOST_TYPEOF
[SVN r51681]
2009-03-10 09:33:21 +00:00
Daniel James
ef283a6a74 Merge several documentation fixes. Plus a small inspect fix.
Merged revisions 50798-50799,50837-50839,50847-50848 via svnmerge from 
https://svn.boost.org/svn/boost/trunk

........
  r50798 | danieljames | 2009-01-26 23:14:53 +0000 (Mon, 26 Jan 2009) | 5 lines
  
  Make checking for duplicated names case insensitive.
  
  This avoids generating filenames with names that only differ by case as they
  cause problems on case insensitive file systems.
........
  r50799 | danieljames | 2009-01-26 23:29:52 +0000 (Mon, 26 Jan 2009) | 1 line
  
  Label the line ending inspect errors.
........
  r50837 | danieljames | 2009-01-28 09:14:21 +0000 (Wed, 28 Jan 2009) | 1 line
  
  Add scope exit to the root html file.
........
  r50838 | danieljames | 2009-01-28 09:14:45 +0000 (Wed, 28 Jan 2009) | 1 line
  
  Fix a link in the typeof forwarding html file.
........
  r50839 | danieljames | 2009-01-28 09:14:56 +0000 (Wed, 28 Jan 2009) | 1 line
  
  Fix an incorrectly escaped right arrow.
........
  r50847 | danieljames | 2009-01-28 15:17:34 +0000 (Wed, 28 Jan 2009) | 2 lines
  
  Fix some documentation issues with scope_exit.
........
  r50848 | danieljames | 2009-01-28 15:32:46 +0000 (Wed, 28 Jan 2009) | 1 line
  
  Generate the scope_exit documentation.
........


[SVN r50849]
2009-01-28 15:53:42 +00:00
Daniel James
4c9b8ba961 Fix a link in the typeof forwarding html file.
[SVN r50838]
2009-01-28 09:14:45 +00:00
Troy D. Straszheim
33ae5341c1 merge of cmake build files from trunk per beman
[SVN r50756]
2009-01-24 18:57:20 +00:00
Michael A. Jackson
b7bfcbef45 Updating dependency information for modularized libraries.
[SVN r49628]
2008-11-07 17:05:27 +00:00
Michael A. Jackson
2d046d3f9f Updating CMake files to latest trunk. Added dependency information for regression tests and a few new macros for internal use.
[SVN r49627]
2008-11-07 17:02:56 +00:00
Michael A. Jackson
f2a646b417 Continuing merge of CMake build system files into trunk with the encouragement of Doug Gregor
[SVN r49510]
2008-11-01 13:15:41 +00:00
Tobias Schwinger
7d3afd076d removes unnecessary escaping
[SVN r43411]
2008-02-25 11:45:51 +00:00
Peder Holt
cde21a588d Merged from trunk: for visual studio 8 and visual studio 9, reverted to using sizeof in 'native' typeof operator as the use of typeid caused compilation error in visual studio source code analysis.
[SVN r42200]
2007-12-20 12:04:40 +00:00
Peder Holt
6926249653 Revert to old sizeof based solution for retrieving the type from a typeof hack. This is in order to overcome problems with the code analysis module introduced in Visual Studio 2005.
[SVN r41383]
2007-11-25 21:16:46 +00:00
Beman Dawes
3ecb3bf102 Full merge from trunk at revision 41356 of entire boost-root tree.
[SVN r41370]
2007-11-25 18:38:02 +00:00
Beman Dawes
1c1ab4c883 Full merge from trunk at revision 41356 of entire boost-root tree.
[SVN r41369]
2007-11-25 18:07:19 +00:00
Peder Holt
9aa58de5e2 #1425 Support for Visual Studio 2008
[SVN r41027]
2007-11-12 11:10:20 +00:00
Peder Holt
6c09ce7883 Fixed duplicate definition of boost::type_of::push_back when BOOST_TYPEOF_LIMIT_SIZE>50 and not a multiple of 50. (From Dave Jenkins)
[SVN r40540]
2007-10-29 08:05:17 +00:00
Peder Holt
b06d94eb91 Deleted regression tests.
[SVN r40435]
2007-10-24 20:30:31 +00:00
Peder Holt
7a574a6169 [typeof] testing for typeof hacks on all compilers
[SVN r39796]
2007-10-08 17:46:23 +00:00
Peder Holt
3e4face079 Better support for BOOST_TYPEOF_NESTED_TYPEDEF for Borland
[SVN r39707]
2007-10-05 14:32:04 +00:00
Beman Dawes
8d8d35c1ae Starting point for releases
[SVN r39706]
2007-10-05 14:25:06 +00:00
Peder Holt
86d4e1c4db typeof support for template template arguments for Borland 5.9.2 (also used for Borland 5.8.2) (reverted to old scheme for other compilers)
[SVN r39704]
2007-10-05 12:39:15 +00:00
Peder Holt
cbdff442ad Update typeof emulation to support Borland 5.9.2
[SVN r39691]
2007-10-05 07:06:13 +00:00
Peder Holt
f576bcf847 Modified tests to account for Borland compiler
[SVN r39590]
2007-09-28 20:11:32 +00:00
Peder Holt
e2dc6c246a Implement typeof emulation for the Borland compiler. Tested with Borland 5.8.2
[SVN r39589]
2007-09-28 20:09:01 +00:00
Peder Holt
951d2f6467 typeof: Implemented native typeof for DMC 8.50 based on the same bugfeature used to support VC6.5 and VC7.1
[SVN r39134]
2007-09-06 07:22:10 +00:00
Peder Holt
4f4bb61781 boost.typeof now supports native typeof for VC8.0
[SVN r39131]
2007-09-05 19:52:18 +00:00
Peder Holt
24c7fe2f65 native typeof implementation for VC7.1 and VC8.0 now uses typeid() instead of sizeof() to map a type. This bypasses some bugs in Microsofts sizeof implementation, and removes a limitation on the number of typeof invocations that can be done in a single compilation unit
[SVN r38801]
2007-08-20 18:09:14 +00:00
Peder Holt
17d05e6396 #1188 Removed extra (unnecessary) semicolons in BOOST_TYPEOF_NESTED_TYPEDEF.
[SVN r38777]
2007-08-20 06:51:54 +00:00
Vladimir Prus
34ffee8e2c Remove V1 Jamfiles
[SVN r38516]
2007-08-08 19:02:26 +00:00
nobody
84ec781ea1 This commit was manufactured by cvs2svn to create tag
'Version_1_34_1'.

[SVN r38286]
2007-07-24 19:28:14 +00:00
Boris Gubenko
744db7fe1d add conditionalization for aCC and cxx
[SVN r37953]
2007-06-09 18:25:19 +00:00
Arkadiy Vertleyb
f7df17a93a Merged doc fix
[SVN r37564]
2007-05-02 20:03:05 +00:00
Arkadiy Vertleyb
e47dd5b94c *** empty log message ***
[SVN r37558]
2007-05-02 02:38:56 +00:00
Arkadiy Vertleyb
ed21868c25 tutorial text fix
[SVN r36898]
2007-02-06 01:50:40 +00:00
Arkadiy Vertleyb
07a28b16d5 tutorial text fix
[SVN r36898]
2007-02-06 01:50:40 +00:00
Peder Holt
c66289f7ac From HEAD: Added documentation: BOOST_TYPEOF_NESTED_TYPEDEF can not be used at function/block scope
[SVN r36886]
2007-02-04 09:29:20 +00:00
Peder Holt
3b4bad9217 Added documentation: BOOST_TYPEOF_NESTED_TYPEDEF can not be used at function/block scope
[SVN r36885]
2007-02-04 09:26:13 +00:00
Peder Holt
917725e67b Hack from Steven Watanabe to implement native typeof for VC8.0
[SVN r36497]
2006-12-23 09:28:50 +00:00
Rene Rivera
43b4d4522c Remove obsolete Boost.Build v1 files.
[SVN r35880]
2006-11-06 17:10:46 +00:00
Peder Holt
8868adc891 Merged from HEAD: Changed specialization of encode_integral for bool to work around issues with the sun compiler
[SVN r35135]
2006-09-16 17:36:03 +00:00
Peder Holt
21ef2c54ec Changed specialization of encode_integral for bool to work around issues with the sun compiler
[SVN r35134]
2006-09-16 17:34:18 +00:00
Arkadiy Vertleyb
452b493b7a merged suppress inspection complain about unnamed ns
[SVN r35119]
2006-09-15 02:19:55 +00:00
Arkadiy Vertleyb
eeff4e592c Merged supress inspection unnamed namespace
[SVN r35118]
2006-09-15 02:11:47 +00:00
Arkadiy Vertleyb
0dc2a5524b suppressed inspection unnamed complain
[SVN r35117]
2006-09-14 23:19:51 +00:00
Arkadiy Vertleyb
293eed92ad *** empty log message ***
[SVN r35116]
2006-09-14 23:18:14 +00:00
Peder Holt
1b65bfc95d Merged from HEAD: Fixed warnings on VC7.1 on integral encoding of bool
[SVN r35110]
2006-09-14 17:39:57 +00:00
Peder Holt
e689ac17bc Fixed warnings on VC7.1 on integral encoding of bool
[SVN r35109]
2006-09-14 17:38:44 +00:00
Peder Holt
eda5c4afba Merged from HEAD: Added name to copyright.
[SVN r35060]
2006-09-10 17:43:17 +00:00
Peder Holt
34bcfef25a Added name to copyright.
[SVN r35059]
2006-09-10 17:40:47 +00:00
Arkadiy Vertleyb
340148f738 merged removed tab
[SVN r35057]
2006-09-10 16:55:21 +00:00
Arkadiy Vertleyb
7ff4eceaa4 removing tab
[SVN r35056]
2006-09-10 16:48:39 +00:00
Arkadiy Vertleyb
64ba3be86f merged inspection report fixes
[SVN r35053]
2006-09-09 17:43:02 +00:00
nobody
d337b0837a This commit was manufactured by cvs2svn to create branch 'RC_1_34_0'.
[SVN r35052]
2006-09-09 17:25:10 +00:00
Arkadiy Vertleyb
dfb50b4e37 inspection report fixes
[SVN r35051]
2006-09-09 17:25:09 +00:00
Peder Holt
b94ec36fbf Removed tabs in typeof_impl.hpp
[SVN r35050]
2006-09-08 16:23:16 +00:00
Peder Holt
dddbb00da4 Merged from HEAD: DMC support for BOOST_TYPEOF_NESTED_TYPEDEF
[SVN r35049]
2006-09-08 16:21:49 +00:00
Peder Holt
8f24a89307 DMC support for BOOST_TYPEOF_NESTED_TYPEDEF
[SVN r35048]
2006-09-08 16:16:57 +00:00
Peder Holt
935b36d8f5 Merged from HEAD: Support typeof emulation for DMC: Integral argument support.
[SVN r35024]
2006-09-06 17:12:45 +00:00
Peder Holt
24230afadb Support typeof emulation for DMC: Integral argument support.
[SVN r35022]
2006-09-06 17:00:03 +00:00
Peder Holt
5bd010787a Fixed issues with support for compilers without SFINAE
[SVN r35017]
2006-09-01 19:25:45 +00:00
Peder Holt
86964f046d Fixed issues with support for compilers without SFINAE
[SVN r35017]
2006-09-01 19:25:45 +00:00
Peder Holt
55ac93f947 Merged from HEAD Fixed error in code for supporting compilers without SFINAE.
[SVN r35012]
2006-08-31 11:00:14 +00:00
Peder Holt
51e40de915 Fixed error in code for supporting compilers without SFINAE.
[SVN r35011]
2006-08-31 10:47:59 +00:00
Peder Holt
ba61bafc4a Removed tabs from code.
[SVN r35001]
2006-08-30 17:19:32 +00:00
Peder Holt
366ab1b621 Merged from HEAD: Disable enable_if for compiler that does not support it.
[SVN r35000]
2006-08-30 17:18:13 +00:00
Peder Holt
9d728a6b33 Disable enable_if on compilers that does not support it.
[SVN r34999]
2006-08-30 10:50:35 +00:00
Daniel James
aede9c2866 Remove tabs
[SVN r34996]
2006-08-29 21:14:51 +00:00
Daniel James
f1162b5b5a Remove tabs
[SVN r34996]
2006-08-29 21:14:51 +00:00
Peder Holt
2b92bbcb21 Merged from HEAD, Fixed issue with BOOST_TYPEOF_NESTED_TYPEDEF for CW in emulation mode
[SVN r34983]
2006-08-28 16:57:08 +00:00
Peder Holt
ea8c6a9d53 Fixed error with BOOST_TYPEOF_NESTED_TYPEDEF for CW.
[SVN r34982]
2006-08-28 13:26:19 +00:00
Gennaro Prota
dff8a5c505 boost guidelines (mainly from inspect tool: tabs, license reference text, etc.); more to do...
[SVN r34753]
2006-07-27 11:48:49 +00:00
Gennaro Prota
a0af228ad0 boost guidelines (mainly from inspect tool: tabs, license reference text, etc.)
[SVN r34752]
2006-07-27 10:27:37 +00:00
Arkadiy Vertleyb
a460694e5d *** empty log message ***
[SVN r34402]
2006-06-25 23:59:21 +00:00
Arkadiy Vertleyb
471e48eccb *** empty log message ***
[SVN r34402]
2006-06-25 23:59:21 +00:00
Arkadiy Vertleyb
db9203fb0e merged SUPPRESS_UNNAMED_NAMESPACE
[SVN r34348]
2006-06-18 15:43:26 +00:00
Arkadiy Vertleyb
ddacb0345b SUPPRESS_UNNAMED_NAMESPACE
[SVN r34347]
2006-06-18 15:37:56 +00:00
Arkadiy Vertleyb
9a14e20bc5 *** empty log message ***
[SVN r34270]
2006-06-11 12:05:52 +00:00
Arkadiy Vertleyb
0f458a1ef2 *** empty log message ***
[SVN r34269]
2006-06-11 11:55:34 +00:00
Arkadiy Vertleyb
e653184ec3 *** empty log message ***
[SVN r34268]
2006-06-11 11:45:21 +00:00
Arkadiy Vertleyb
47a4b2a2c1 *** empty log message ***
[SVN r34215]
2006-06-07 03:00:58 +00:00
Arkadiy Vertleyb
9cc64130ac *** empty log message ***
[SVN r34212]
2006-06-07 02:55:16 +00:00
Arkadiy Vertleyb
337fe1fdf6 merged function binding
[SVN r34177]
2006-06-05 02:50:05 +00:00
Arkadiy Vertleyb
11b18afcce merged function binding
[SVN r34176]
2006-06-05 02:43:08 +00:00
Arkadiy Vertleyb
a8112fe31d function binding
[SVN r34175]
2006-06-05 02:32:41 +00:00
Arkadiy Vertleyb
7cbdf2406a Merged fix for VC PCH
[SVN r33800]
2006-04-25 00:57:46 +00:00
Arkadiy Vertleyb
8ce982a048 fix for VC PCH problem
[SVN r33799]
2006-04-25 00:42:22 +00:00
Arkadiy Vertleyb
97b9bda347 merged typeof doc id
[SVN r33770]
2006-04-23 12:44:00 +00:00
Arkadiy Vertleyb
9bc7ac4b43 typeof doc id
[SVN r33769]
2006-04-23 12:09:13 +00:00
Peder Holt
041f9cfd24 Merged typo in typeof doc from HEAD
[SVN r33525]
2006-03-29 17:36:53 +00:00
Peder Holt
d061288eb7 Fixed typo in typeof docs
[SVN r33523]
2006-03-29 17:30:08 +00:00
Peder Holt
c17f725e5f Merged doc fix for BOOST_TYPEOF_NESTED_TYPEDEF (removal of tabs in doc) from HEAD
[SVN r33461]
2006-03-23 20:54:37 +00:00
Peder Holt
878e7ab5a5 Replaced tabs with spaces in documentation of BOOST_TYPEOF_NESTED_TYPEDEF
[SVN r33460]
2006-03-23 20:50:12 +00:00
nobody
35874c8e32 This commit was manufactured by cvs2svn to create branch 'RC_1_34_0'.
[SVN r33417]
2006-03-21 02:26:31 +00:00
Arkadiy Vertleyb
70942591f8 *** empty log message ***
[SVN r33398]
2006-03-19 23:15:23 +00:00
Arkadiy Vertleyb
3d26b91953 *** empty log message ***
[SVN r33397]
2006-03-19 23:07:49 +00:00
Peder Holt
2d1f22a082 Fixed regression tests for CW-9.4
[SVN r33392]
2006-03-19 19:27:35 +00:00
Tobias Schwinger
44088cb533 removes whitespace after backslash in macro definition
[SVN r33357]
2006-03-16 20:27:05 +00:00
Peder Holt
dbfa74603c Implemented BOOST_TYPEOF_NESTED_TYPEDEF.
This macro works around known bugs in VC7.1 and VC8.0 concerning the use of BOOST_TYPEOF inside templates. It also eliminates the limitation imposed by BOOST_TYPEOF_LIMIT_SIZE.


[SVN r33355]
2006-03-16 17:10:19 +00:00
Arkadiy Vertleyb
e2d492bb49 *** empty log message ***
[SVN r33131]
2006-02-27 03:18:32 +00:00
Arkadiy Vertleyb
f3d8469b59 disabled typeof emulation for cw-8_x
[SVN r33101]
2006-02-25 05:06:29 +00:00
Arkadiy Vertleyb
b234bfc0e8 enable_if not supported for vc-7_0-
[SVN r33085]
2006-02-23 11:13:16 +00:00
Vladimir Prus
eec4c67e32 Fix typo
[SVN r33069]
2006-02-21 16:13:04 +00:00
Arkadiy Vertleyb
647ef25f7c fixed incorrect include
[SVN r33060]
2006-02-21 10:59:47 +00:00
Arkadiy Vertleyb
756a0ff572 binding workarounds added
[SVN r33045]
2006-02-20 21:54:00 +00:00
Arkadiy Vertleyb
ade1b9c2d1 finished removing LVALUE_TYPEOF
[SVN r33005]
2006-02-19 12:21:28 +00:00
Arkadiy Vertleyb
f23e04c626 removed temporary code added to investigate cw-8.x failure
[SVN r32990]
2006-02-18 13:01:31 +00:00
Arkadiy Vertleyb
966c338bf0 LVALUE_TYPEOF dropped
[SVN r32989]
2006-02-18 12:56:43 +00:00
Arkadiy Vertleyb
e359321195 undo last commit
[SVN r32521]
2006-02-03 01:42:21 +00:00
Arkadiy Vertleyb
d6c44f0332 temporary -- debugging cw-8.x
[SVN r32503]
2006-02-02 02:45:46 +00:00
Vladimir Prus
4370fd31cb Update Jamfile.v2
[SVN r32497]
2006-02-01 15:52:05 +00:00
Vladimir Prus
ed50bdcd7a Add Jamfile.v2
[SVN r32480]
2006-01-31 15:38:14 +00:00
Arkadiy Vertleyb
44dd1cc56c BOOST_PP_EMPTY usage
[SVN r32468]
2006-01-30 00:29:55 +00:00
Arkadiy Vertleyb
d98ccd14f8 removed unused file
[SVN r32466]
2006-01-28 20:25:51 +00:00
Arkadiy Vertleyb
bd24c7fa71 removed trailing void
[SVN r32465]
2006-01-28 15:35:19 +00:00
Arkadiy Vertleyb
bd2418b32d cw-8_x doesn't have function types
[SVN r32415]
2006-01-26 02:52:05 +00:00
Arkadiy Vertleyb
18f15afa52 added missing include
[SVN r32392]
2006-01-24 02:15:54 +00:00
Arkadiy Vertleyb
dc7e97f71c BOOST_TYPEOF_COMPLIANT cleanup
[SVN r32329]
2006-01-15 23:14:27 +00:00
Arkadiy Vertleyb
f1df23e0c3 removed tabs
[SVN r32328]
2006-01-15 14:21:21 +00:00
Arkadiy Vertleyb
5de56065c1 preprocessed vector
[SVN r32304]
2006-01-13 02:57:07 +00:00
Arkadiy Vertleyb
dbf0cb2706 preprocessed vector
[SVN r32303]
2006-01-13 02:47:48 +00:00
Arkadiy Vertleyb
646c117ce0 removed __COUNTER__; enabled explicit IDs
[SVN r32256]
2006-01-08 03:27:49 +00:00
Alexander Nasonov
dce8922805 void main -> int main
[SVN r32221]
2006-01-04 22:21:12 +00:00
Markus Schöpflin
1cfbeb9bef Turn off Tru64/CXX-6.5 completely, this is too much for this poor old compiler.
[SVN r32114]
2005-12-20 11:53:37 +00:00
Markus Schöpflin
76e392e8c2 Disable the ODR tests for Tru64/CXX-6.5.
[SVN r32076]
2005-12-16 15:39:24 +00:00
Arkadiy Vertleyb
136960eaf6 w/a cw externel binders
[SVN r32069]
2005-12-16 11:44:47 +00:00
Arkadiy Vertleyb
8e1cd1f44d std.cpp
[SVN r31991]
2005-12-12 00:00:23 +00:00
Arkadiy Vertleyb
300eb8cf28 function_ptr_from_tpl.cpp
[SVN r31983]
2005-12-11 11:52:11 +00:00
Arkadiy Vertleyb
35b47d5b16 new test -- handling function ptr from a template context
[SVN r31973]
2005-12-10 15:45:33 +00:00
Arkadiy Vertleyb
e2f0e47fe3 temporary change to debug cw compile error
[SVN r31967]
2005-12-09 21:53:03 +00:00
Arkadiy Vertleyb
82482f3e38 minor formatting fixes
[SVN r31962]
2005-12-09 03:55:38 +00:00
Arkadiy Vertleyb
e271bc104c possible >> problem during macro expansion
[SVN r31910]
2005-12-04 20:37:23 +00:00
Arkadiy Vertleyb
6385a75441 fixed test failure on cw
[SVN r31906]
2005-12-04 19:59:42 +00:00
Arkadiy Vertleyb
670d5d4fd4 removed tabs
[SVN r31198]
2005-10-05 02:47:56 +00:00
Arkadiy Vertleyb
0f7dcbe618 made ODR test runnable
[SVN r31160]
2005-10-02 00:47:15 +00:00
Arkadiy Vertleyb
476fe4cf58 started using PP_COUNTER instead of PP_SLOT
[SVN r31159]
2005-10-01 21:50:23 +00:00
John Maddock
b553a2ecda Remove the warnings: they don't really work as intended.
[SVN r31154]
2005-09-30 12:43:31 +00:00
Arkadiy Vertleyb
9f4842e67a simplified the test
[SVN r31146]
2005-09-29 08:41:29 +00:00
Arkadiy Vertleyb
506c77897d compiler-dependent config
[SVN r31137]
2005-09-28 03:47:05 +00:00
Arkadiy Vertleyb
92e77f51d6 minor test fixes
[SVN r31136]
2005-09-28 03:44:31 +00:00
Arkadiy Vertleyb
799a1c1760 size_t->std::size_t
[SVN r31115]
2005-09-25 23:04:45 +00:00
Peder Holt
c484121dda Moved typeof documentation from sandbox.
Updated some docs based on review comments


[SVN r31101]
2005-09-24 18:29:20 +00:00
Arkadiy Vertleyb
8a2aa8eb3f changed native typeof keyword
[SVN r31050]
2005-09-20 01:56:11 +00:00
Arkadiy Vertleyb
c357f29a5b added more tests
[SVN r31048]
2005-09-20 01:32:56 +00:00
90 changed files with 2911 additions and 1780 deletions

645
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,645 @@
name: CI
on:
pull_request:
push:
branches:
- master
- develop
- feature/**
env:
UBSAN_OPTIONS: print_stacktrace=1
jobs:
posix:
strategy:
fail-fast: false
matrix:
include:
- toolset: gcc-4.8
cxxstd: "11"
container: ubuntu:18.04
os: ubuntu-latest
install: g++-4.8
- toolset: gcc-5
cxxstd: "11,14,1z"
container: ubuntu:18.04
os: ubuntu-latest
install: g++-5
- toolset: gcc-6
cxxstd: "11,14,1z"
container: ubuntu:18.04
os: ubuntu-latest
install: g++-6
- toolset: gcc-7
cxxstd: "11,14,17"
container: ubuntu:20.04
os: ubuntu-latest
install: g++-7
- toolset: gcc-8
cxxstd: "11,14,17,2a"
container: ubuntu:20.04
os: ubuntu-latest
install: g++-8
- toolset: gcc-9
cxxstd: "11,14,17,2a"
container: ubuntu:20.04
os: ubuntu-latest
- toolset: gcc-10
cxxstd: "11,14,17,2a"
container: ubuntu:20.04
os: ubuntu-latest
install: g++-10
- toolset: gcc-11
cxxstd: "11,14,17,2a"
os: ubuntu-22.04
- toolset: gcc-12
cxxstd: "11,14,17,20,2b"
os: ubuntu-22.04
install: g++-12
- toolset: gcc-13
cxxstd: "11,14,17,20,2b"
container: ubuntu:24.04
os: ubuntu-latest
install: g++-13
- toolset: gcc-14
cxxstd: "11,14,17,20,2b"
container: ubuntu:24.04
os: ubuntu-latest
install: g++-14
- toolset: clang
compiler: clang++-3.9
cxxstd: "11,14"
container: ubuntu:18.04
os: ubuntu-latest
install: clang-3.9
- toolset: clang
compiler: clang++-4.0
cxxstd: "11,14"
container: ubuntu:18.04
os: ubuntu-latest
install: clang-4.0
- toolset: clang
compiler: clang++-5.0
cxxstd: "11,14,1z"
container: ubuntu:18.04
os: ubuntu-latest
install: clang-5.0
- toolset: clang
compiler: clang++-6.0
cxxstd: "11,14,17"
container: ubuntu:20.04
os: ubuntu-latest
install: clang-6.0
- toolset: clang
compiler: clang++-7
cxxstd: "11,14,17"
container: ubuntu:20.04
os: ubuntu-latest
install: clang-7
- toolset: clang
compiler: clang++-8
cxxstd: "11,14,17"
container: ubuntu:20.04
os: ubuntu-latest
install: clang-8
- toolset: clang
compiler: clang++-9
cxxstd: "11,14,17,2a"
container: ubuntu:20.04
os: ubuntu-latest
install: clang-9
- toolset: clang
compiler: clang++-10
cxxstd: "11,14,17,2a"
container: ubuntu:20.04
os: ubuntu-latest
install: clang-10
- toolset: clang
compiler: clang++-11
cxxstd: "11,14,17,2a"
container: ubuntu:20.04
os: ubuntu-latest
install: clang-11
- toolset: clang
compiler: clang++-12
cxxstd: "11,14,17,2a"
container: ubuntu:20.04
os: ubuntu-latest
install: clang-12
- toolset: clang
compiler: clang++-13
cxxstd: "11,14,17,20,2b"
os: ubuntu-22.04
install: clang-13
- toolset: clang
compiler: clang++-14
cxxstd: "11,14,17,20,2b"
os: ubuntu-22.04
install: clang-14
- toolset: clang
compiler: clang++-15
cxxstd: "11,14,17,20,2b"
os: ubuntu-22.04
install: clang-15
- toolset: clang
compiler: clang++-16
cxxstd: "11,14,17,20,2b"
container: ubuntu:24.04
os: ubuntu-latest
install: clang-16
- toolset: clang
compiler: clang++-17
cxxstd: "11,14,17,20,2b"
container: ubuntu:24.04
os: ubuntu-latest
install: clang-17
- toolset: clang
compiler: clang++-18
cxxstd: "11,14,17,20,2b"
container: ubuntu:24.04
os: ubuntu-latest
install: clang-18
- toolset: clang
compiler: clang++-19
cxxstd: "11,14,17,20,2b"
container: ubuntu:24.10
os: ubuntu-latest
install: clang-19
- toolset: clang
cxxstd: "11,14,17,20,2b"
os: macos-13
- toolset: clang
cxxstd: "11,14,17,20,2b"
os: macos-14
- toolset: clang
cxxstd: "11,14,17,20,2b"
os: macos-15
runs-on: ${{matrix.os}}
container:
image: ${{matrix.container}}
volumes:
- /node20217:/node20217:rw,rshared
- ${{ startsWith(matrix.container, 'ubuntu:1') && '/node20217:/__e/node20:ro,rshared' || ' ' }}
defaults:
run:
shell: bash
steps:
- name: Setup container environment
if: matrix.container
run: |
apt-get update
apt-get -y install sudo python3 git g++ curl xz-utils
- name: Install nodejs20glibc2.17
if: ${{ startsWith( matrix.container, 'ubuntu:1' ) }}
run: |
curl -LO https://archives.boost.io/misc/node/node-v20.9.0-linux-x64-glibc-217.tar.xz
tar -xf node-v20.9.0-linux-x64-glibc-217.tar.xz --strip-components 1 -C /node20217
ldd /__e/node20/bin/node
- uses: actions/checkout@v4
- name: Install packages
if: matrix.install
run: |
sudo apt-get update
sudo apt-get -y install ${{matrix.install}}
- name: Setup Boost
run: |
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
LIBRARY=${GITHUB_REPOSITORY#*/}
echo LIBRARY: $LIBRARY
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
echo GITHUB_REF: $GITHUB_REF
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
REF=${REF#refs/heads/}
echo REF: $REF
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
echo BOOST_BRANCH: $BOOST_BRANCH
cd ..
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
git submodule update --init tools/boostdep
python3 tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
./bootstrap.sh
./b2 -d0 headers
- name: Create user-config.jam
if: matrix.compiler
run: |
echo "using ${{matrix.toolset}} : : ${{matrix.compiler}} ;" > ~/user-config.jam
- name: Run tests
run: |
cd ../boost-root
./b2 -j3 libs/$LIBRARY/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} variant=debug,release
windows:
strategy:
fail-fast: false
matrix:
include:
- toolset: msvc-14.0
cxxstd: "14,latest"
addrmd: 32,64
os: windows-2019
- toolset: msvc-14.2
cxxstd: "14,17,20,latest"
addrmd: 32,64
os: windows-2019
- toolset: msvc-14.3
cxxstd: "14,17,20,latest"
addrmd: 32,64
os: windows-2022
- toolset: clang-win
cxxstd: "14,17,latest"
addrmd: 32,64
os: windows-2022
- toolset: gcc
cxxstd: "11,14,17,2a"
addrmd: 64
os: windows-2022
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
- name: Setup Boost
shell: cmd
run: |
echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY%
for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi
echo LIBRARY: %LIBRARY%
echo LIBRARY=%LIBRARY%>>%GITHUB_ENV%
echo GITHUB_BASE_REF: %GITHUB_BASE_REF%
echo GITHUB_REF: %GITHUB_REF%
if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF%
set BOOST_BRANCH=develop
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
echo BOOST_BRANCH: %BOOST_BRANCH%
cd ..
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY%
cmd /c bootstrap
b2 -d0 headers
- name: Run tests
shell: cmd
run: |
cd ../boost-root
b2 -j3 libs/%LIBRARY%/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} address-model=${{matrix.addrmd}} variant=debug,release embed-manifest-via=linker
posix-cmake-subdir:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
- os: ubuntu-24.04
- os: macos-13
- os: macos-14
- os: macos-15
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
- name: Install packages
if: matrix.install
run: sudo apt-get -y install ${{matrix.install}}
- name: Setup Boost
run: |
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
LIBRARY=${GITHUB_REPOSITORY#*/}
echo LIBRARY: $LIBRARY
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
echo GITHUB_REF: $GITHUB_REF
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
REF=${REF#refs/heads/}
echo REF: $REF
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
echo BOOST_BRANCH: $BOOST_BRANCH
cd ..
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
- name: Use library with add_subdirectory
run: |
cd ../boost-root/libs/$LIBRARY/test/cmake_subdir_test
mkdir __build__ && cd __build__
cmake ..
cmake --build .
ctest --output-on-failure --no-tests=error
posix-cmake-install:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
- os: ubuntu-24.04
- os: macos-13
- os: macos-14
- os: macos-15
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
- name: Install packages
if: matrix.install
run: sudo apt-get -y install ${{matrix.install}}
- name: Setup Boost
run: |
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
LIBRARY=${GITHUB_REPOSITORY#*/}
echo LIBRARY: $LIBRARY
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
echo GITHUB_REF: $GITHUB_REF
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
REF=${REF#refs/heads/}
echo REF: $REF
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
echo BOOST_BRANCH: $BOOST_BRANCH
cd ..
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
- name: Configure
run: |
cd ../boost-root
mkdir __build__ && cd __build__
cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DCMAKE_INSTALL_PREFIX=~/.local ..
- name: Install
run: |
cd ../boost-root/__build__
cmake --build . --target install
- name: Use the installed library
run: |
cd ../boost-root/libs/$LIBRARY/test/cmake_install_test && mkdir __build__ && cd __build__
cmake -DCMAKE_INSTALL_PREFIX=~/.local ..
cmake --build .
ctest --output-on-failure --no-tests=error
posix-cmake-test:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
- os: ubuntu-24.04
- os: macos-13
- os: macos-14
- os: macos-15
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
- name: Install packages
if: matrix.install
run: sudo apt-get -y install ${{matrix.install}}
- name: Setup Boost
run: |
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
LIBRARY=${GITHUB_REPOSITORY#*/}
echo LIBRARY: $LIBRARY
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
echo GITHUB_REF: $GITHUB_REF
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
REF=${REF#refs/heads/}
echo REF: $REF
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
echo BOOST_BRANCH: $BOOST_BRANCH
cd ..
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
- name: Configure
run: |
cd ../boost-root
mkdir __build__ && cd __build__
cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DBUILD_TESTING=ON ..
- name: Build tests
run: |
cd ../boost-root/__build__
cmake --build . --target tests
- name: Run tests
run: |
cd ../boost-root/__build__
ctest --output-on-failure --no-tests=error
windows-cmake-subdir:
strategy:
fail-fast: false
matrix:
include:
- os: windows-2022
- os: windows-2025
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
- name: Setup Boost
shell: cmd
run: |
echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY%
for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi
echo LIBRARY: %LIBRARY%
echo LIBRARY=%LIBRARY%>>%GITHUB_ENV%
echo GITHUB_BASE_REF: %GITHUB_BASE_REF%
echo GITHUB_REF: %GITHUB_REF%
if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF%
set BOOST_BRANCH=develop
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
echo BOOST_BRANCH: %BOOST_BRANCH%
cd ..
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY%
- name: Use library with add_subdirectory (Debug)
shell: cmd
run: |
cd ../boost-root/libs/%LIBRARY%/test/cmake_subdir_test
mkdir __build__ && cd __build__
cmake ..
cmake --build . --config Debug
ctest --output-on-failure --no-tests=error -C Debug
- name: Use library with add_subdirectory (Release)
shell: cmd
run: |
cd ../boost-root/libs/%LIBRARY%/test/cmake_subdir_test/__build__
cmake --build . --config Release
ctest --output-on-failure --no-tests=error -C Release
windows-cmake-install:
strategy:
fail-fast: false
matrix:
include:
- os: windows-2022
- os: windows-2025
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
- name: Setup Boost
shell: cmd
run: |
echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY%
for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi
echo LIBRARY: %LIBRARY%
echo LIBRARY=%LIBRARY%>>%GITHUB_ENV%
echo GITHUB_BASE_REF: %GITHUB_BASE_REF%
echo GITHUB_REF: %GITHUB_REF%
if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF%
set BOOST_BRANCH=develop
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
echo BOOST_BRANCH: %BOOST_BRANCH%
cd ..
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY%
- name: Configure
shell: cmd
run: |
cd ../boost-root
mkdir __build__ && cd __build__
cmake -DBOOST_INCLUDE_LIBRARIES=%LIBRARY% -DCMAKE_INSTALL_PREFIX=C:/cmake-prefix ..
- name: Install (Debug)
shell: cmd
run: |
cd ../boost-root/__build__
cmake --build . --target install --config Debug
- name: Install (Release)
shell: cmd
run: |
cd ../boost-root/__build__
cmake --build . --target install --config Release
- name: Use the installed library (Debug)
shell: cmd
run: |
cd ../boost-root/libs/%LIBRARY%/test/cmake_install_test && mkdir __build__ && cd __build__
cmake -DCMAKE_INSTALL_PREFIX=C:/cmake-prefix ..
cmake --build . --config Debug
ctest --output-on-failure --no-tests=error -C Debug
- name: Use the installed library (Release)
shell: cmd
run: |
cd ../boost-root/libs/%LIBRARY%/test/cmake_install_test/__build__
cmake --build . --config Release
ctest --output-on-failure --no-tests=error -C Release
windows-cmake-test:
strategy:
fail-fast: false
matrix:
include:
- os: windows-2022
- os: windows-2025
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
- name: Setup Boost
shell: cmd
run: |
echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY%
for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi
echo LIBRARY: %LIBRARY%
echo LIBRARY=%LIBRARY%>>%GITHUB_ENV%
echo GITHUB_BASE_REF: %GITHUB_BASE_REF%
echo GITHUB_REF: %GITHUB_REF%
if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF%
set BOOST_BRANCH=develop
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
echo BOOST_BRANCH: %BOOST_BRANCH%
cd ..
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY%
- name: Configure
shell: cmd
run: |
cd ../boost-root
mkdir __build__ && cd __build__
cmake -DBOOST_INCLUDE_LIBRARIES=%LIBRARY% -DBUILD_TESTING=ON ..
- name: Build tests (Debug)
shell: cmd
run: |
cd ../boost-root/__build__
cmake --build . --target tests --config Debug
- name: Run tests (Debug)
shell: cmd
run: |
cd ../boost-root/__build__
ctest --output-on-failure --no-tests=error -C Debug
- name: Build tests (Release)
shell: cmd
run: |
cd ../boost-root/__build__
cmake --build . --target tests --config Release
- name: Run tests (Release)
shell: cmd
run: |
cd ../boost-root/__build__
ctest --output-on-failure --no-tests=error -C Release

186
.travis.yml Normal file
View File

@@ -0,0 +1,186 @@
# Copyright 2016, 2017 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
language: cpp
branches:
only:
- master
- develop
- /feature\/.*/
dist: xenial
env:
matrix:
- BOGUS_JOB=true
matrix:
exclude:
- env: BOGUS_JOB=true
include:
- os: linux
compiler: g++
env: TOOLSET=gcc COMPILER=g++ CXXSTD=03,11
- os: linux
compiler: g++-4.7
env: TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=03,11
addons:
apt:
packages:
- g++-4.7
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: g++-4.8
env: TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=03,11
addons:
apt:
packages:
- g++-4.8
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: g++-4.9
env: TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=03,11
addons:
apt:
packages:
- g++-4.9
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: g++-5
env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=03,11,14,1z
addons:
apt:
packages:
- g++-5
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: g++-6
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=03,11,14,1z
addons:
apt:
packages:
- g++-6
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: g++-7
env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=03,11,14,17
addons:
apt:
packages:
- g++-7
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: clang++
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11
- os: linux
compiler: clang++-3.5
env: TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=03,11,14,1z
addons:
apt:
packages:
- clang-3.5
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: clang++-3.6
env: TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=03,11,14,1z
addons:
apt:
packages:
- clang-3.6
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: clang++-3.7
env: TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=03,11,14,1z
addons:
apt:
packages:
- clang-3.7
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: clang++-3.8
env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=03,11,14,1z
addons:
apt:
packages:
- clang-3.8
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: clang++-3.9
env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=03,11,14,1z
addons:
apt:
packages:
- clang-3.9
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: clang++-4.0
env: TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=03,11,14,1z
addons:
apt:
packages:
- clang-4.0
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: clang++-5.0
env: TOOLSET=clang COMPILER=clang++-5.0 CXXSTD=03,11,14,1z
addons:
apt:
packages:
- clang-5.0
sources:
- ubuntu-toolchain-r-test
- os: osx
compiler: clang++
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z
install:
- BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
- cd ..
- git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
- cd boost-root
- git submodule update --init tools/build
- git submodule update --init libs/config
- git submodule update --init tools/boostdep
- cp -r $TRAVIS_BUILD_DIR/* libs/typeof
- python tools/boostdep/depinst/depinst.py typeof
- ./bootstrap.sh
- ./b2 headers
script:
- |-
echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam
- ./b2 libs/typeof/test toolset=$TOOLSET cxxstd=$CXXSTD
notifications:
email:
on_success: always

26
CMakeLists.txt Normal file
View File

@@ -0,0 +1,26 @@
# Generated by `boostdep --cmake typeof`
# Copyright 2020, 2021 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt
cmake_minimum_required(VERSION 3.8...3.20)
project(boost_typeof VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
add_library(boost_typeof INTERFACE)
add_library(Boost::typeof ALIAS boost_typeof)
target_include_directories(boost_typeof INTERFACE include)
target_link_libraries(boost_typeof
INTERFACE
Boost::config
)
target_compile_features(boost_typeof INTERFACE cxx_std_11)
if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
add_subdirectory(test)
endif()

62
appveyor.yml Normal file
View File

@@ -0,0 +1,62 @@
# Copyright 2016 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
version: 1.0.{build}-{branch}
shallow_clone: true
branches:
only:
- master
- develop
platform:
- x64
environment:
matrix:
- ARGS: --toolset=msvc-9.0 address-model=32
- ARGS: --toolset=msvc-10.0 address-model=32
- ARGS: --toolset=msvc-11.0 address-model=32
- ARGS: --toolset=msvc-12.0 address-model=32
- ARGS: --toolset=msvc-14.0 address-model=32
- ARGS: --toolset=msvc-12.0 address-model=64
- ARGS: --toolset=msvc-14.0 address-model=64
- ARGS: --toolset=msvc-14.0 address-model=64 cxxflags=-std:c++latest
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
ARGS: --toolset=msvc-14.1 address-model=64
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
ARGS: --toolset=msvc-14.1 address-model=32
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
ARGS: --toolset=msvc-14.1 address-model=64 cxxflags=-std:c++latest
- ARGS: --toolset=gcc address-model=64
PATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH%
- ARGS: --toolset=gcc address-model=64 cxxflags=-std=gnu++1z
PATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH%
- ARGS: --toolset=gcc address-model=32
PATH: C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin;%PATH%
- ARGS: --toolset=gcc address-model=32 linkflags=-Wl,-allow-multiple-definition
PATH: C:\MinGW\bin;%PATH%
install:
- cd ..
- git clone -b %APPVEYOR_REPO_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
- cd boost-root
- git submodule update --init tools/build
- git submodule update --init libs/config
- git submodule update --init tools/boostdep
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\typeof\
- python tools/boostdep/depinst/depinst.py typeof
- bootstrap
- b2 headers
build: off
test_script:
- cd libs\config\test
- ..\..\..\b2 config_info_travis_install %ARGS%
- config_info_travis
- cd ..\..\typeof\test
- ..\..\..\b2 -j3 %ARGS% define=CI_SUPPRESS_KNOWN_ISSUES

22
build.jam Normal file
View File

@@ -0,0 +1,22 @@
# Copyright René Ferdinand Rivera Morell 2023-2024
# 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)
require-b2 5.2 ;
constant boost_dependencies :
/boost/config//boost_config ;
project /boost/typeof
;
explicit
[ alias boost_typeof : : :
: <include>include <library>$(boost_dependencies) ]
[ alias all : boost_typeof test ]
;
call-if : boost-library typeof
;

29
doc/Jamfile.v2 Normal file
View File

@@ -0,0 +1,29 @@
# Copyright Peder Holt 2005. 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)
using quickbook ;
xml typeof : typeof.qbk ;
boostbook standalone
:
typeof
:
<xsl:param>boost.root=../../../..
<xsl:param>nav.layout=none
<xsl:param>navig.graphics=0
;
install html : ../../../doc/src/boostbook.css ;
install ../ : ../../../boost.png ;
###############################################################################
alias boostdoc
: typeof
:
:
: ;
explicit boostdoc ;
alias boostrelease ;
explicit boostrelease ;

884
doc/typeof.qbk Normal file
View File

@@ -0,0 +1,884 @@
[library Boost.Typeof
[authors [Vertleyb, Arkadiy], [Holt, Peder]]
[copyright 2004 2005 Arkadiy Vertleyb, Peder Holt]
[license
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
<ulink url="http://www.boost.org/LICENSE_1_0.txt">
http://www.boost.org/LICENSE_1_0.txt
</ulink>)
]
[id typeof]
[last-revision $Date$]
]
[section:moti Motivation]
[c++]
Today many template libraries supply object generators to simplify object creation
by utilizing the C++ template argument deduction facility. Consider `std::pair`.
In order to instantiate this class template and create a temporary object of this instantiation,
one has to supply template parameters, as well as parameters to the constructor:
std::pair<int, double>(5, 3.14159);
To avoid this duplication, STL supplies the `std::make_pair` object generator.
When it is used, the types of template parameters are deduced from supplied function arguments:
std::make_pair(5, 3.14159);
For the temporary objects it is enough. However, when a named object needs to be allocated,
the problem appears again:
std::pair<int, double> p(5, 3.14159);
The object generator no longer helps:
std::pair<int, double> p = std::make_pair(5, 3.14159);
It would be nice to deduce the type of the object (on the left) from the expression
it is initialized with (on the right), but the current C++ syntax does not allow for this.
The above example demonstrates the essence of the problem but does not demonstrate its scale.
Many libraries, especially expression template libraries, create objects of really complex types,
and go a long way to hide this complexity behind object generators. Consider a nit Boost.Lambda functor:
_1 > 15 && _2 < 20
If one wanted to allocate a named copy of such an innocently looking functor,
she would have to specify something like this:
lambda_functor<
lambda_functor_base<
logical_action<and_action>,
tuple<
lambda_functor<
lambda_functor_base<
relational_action<greater_action>,
tuple<
lambda_functor<placeholder<1> >,
int const
>
>
>,
lambda_functor<
lambda_functor_base<
relational_action<less_action>,
tuple<
lambda_functor<placeholder<2> >,
int const
>
>
>
>
>
>
f = _1 > 15 && _2 < 20;
Not exactly elegant. To solve this problem (as well as some other problems),
the C++ standard committee is considering
a few additions to the standard language, such as `typeof/decltype` and `auto` (see
[@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1607.pdf
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1607.pdf]).
The `typeof` operator (or `decltype`, which is a slightly different flavor of `typeof`)
allows one to determine the type of an expression at compile time. Using `typeof`,
the above example can be simplified drastically:
typeof(_1 > 15 && _2 < 20) f = _1 > 15 && _2 < 20;
Much better, but some duplication still exists. The `auto` type solves the rest of the problem:
auto f = _1 > 15 && _2 < 20;
The purpose of the Boost.Typeof library is to provide a library-based solution,
which could be used until the language-based facility is added to the Standard
and becomes widely available.
[endsect]
[section:tuto Tutorial]
To start using typeof include the typeof header:
#include <boost/typeof/typeof.hpp>
To deduce the type of an expression at compile time
use the `BOOST_TYPEOF` macro:
namespace ex1
{
typedef BOOST_TYPEOF(1 + 0.5) type;
BOOST_STATIC_ASSERT((is_same<type, double>::value));
}
In the dependent context use `BOOST_TYPEOF_TPL` instead of `BOOST_TYPEOF`:
namespace ex2
{
template<class T, class U>
BOOST_TYPEOF_TPL(T() + U()) add(const T& t, const U& u)
{
return t + u;
};
typedef BOOST_TYPEOF(add('a', 1.5)) type;
BOOST_STATIC_ASSERT((is_same<type, double>::value));
}
The above examples are possible because the Typeof Library knows about
primitive types, such as `int`, `double`, `char`, etc. The Typeof Library also
knows about most types and templates defined by the
Standard C++ Library, but the appropriate headers need to be included
to take advantage of this:
#include <boost/typeof/std/utility.hpp>
namespace ex3
{
BOOST_AUTO(p, make_pair(1, 2));
BOOST_STATIC_ASSERT((is_same<BOOST_TYPEOF(p), pair<int, int> >::value));
}
Here `<boost/typeof/std/utility.hpp>` includes `<utility>` and contains
knowledge about templates defined there. This naming convention
applies in general, for example to let the Typeof Library handle `std::vector`,
include `<boost/typeof/std/vector.hpp>`, etc.
To deduce the type of a variable from the expression, this variable
is initialized with, use the `BOOST_AUTO` macro (or `BOOST_AUTO_TPL`
in a dependent context:
#include <boost/typeof/std/string.hpp>
namespace ex4
{
BOOST_AUTO(p, new int[20]);
BOOST_STATIC_ASSERT((is_same<BOOST_TYPEOF(p), int*>::value));
}
Both `BOOST_TYPEOF` and `BOOST_AUTO` strip top-level qualifiers.
Therefore, to allocate for example a reference, it has to be specified explicitly:
namespace ex5
{
string& hello()
{
static string s = "hello";
return s;
}
BOOST_AUTO(&s, hello());
}
To better understand this syntax, note that this gets expanded into:
BOOST_TYPEOF(hello()) &s = hello();
If your define your own type, the Typeof Library cannot handle it
unless you let it know about this type. You tell the Typeof Library
about a type (or template) by the means of "registering" this type/template.
Any source or header file where types/templates are registered has to
contain the following line before any registration is done:
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
After this a type can be registered:
namespace ex6
{
struct MyType
{};
}
BOOST_TYPEOF_REGISTER_TYPE(ex6::MyType)
The registration must be done from the context of global namespace;
fully qualified type name has to be used.
Any number of types can be registered in one file, each on a separate line.
Once your type is registered, the Typeof Library can handle it in any context:
namespace ex6
{
typedef BOOST_TYPEOF(make_pair(1, MyType())) type;
BOOST_STATIC_ASSERT((is_same<type, pair<int, MyType> >::value));
}
A template is registered by specifying its fully qualified name,
and describing its parameters. In the simplest case, when all parameters
are type parameters, only their number needs to be specified:
namespace ex7
{
template<class T, class U>
struct MyTemplate
{};
}
BOOST_TYPEOF_REGISTER_TEMPLATE(ex7::MyTemplate, 2)
namespace ex7
{
typedef BOOST_TYPEOF(make_pair(1, MyTemplate<int, ex6::MyType>())) type;
BOOST_STATIC_ASSERT((is_same<type,
pair<int, MyTemplate<int, ex6::MyType> >
>::value));
}
When a template has integral template parameters, all parameters need
to be described in the preprocessor sequence:
namespace ex8
{
template<class T, int n>
struct MyTemplate
{};
}
BOOST_TYPEOF_REGISTER_TEMPLATE(ex8::MyTemplate, (class)(int))
namespace ex8
{
typedef BOOST_TYPEOF(make_pair(1, MyTemplate<ex7::MyTemplate<ex6::MyType, int>, 0>())) type;
BOOST_STATIC_ASSERT((is_same<type,
pair<int, MyTemplate<ex7::MyTemplate<ex6::MyType, int>, 0> >
>::value));
}
Please see the reference for more details.
[endsect]
[section:refe Reference]
[section:auto AUTO, AUTO_TPL]
The `BOOST_AUTO` macro emulates the proposed `auto` keyword in C++.
[h4 Usage]
BOOST_AUTO(var,expr)
BOOST_AUTO_TPL(var,expr)
[variablelist Arguments
[[var][a variable to be initialized with the expression]]
[[expr][a valid c++ expression]]
]
[h4 Remarks]
If you want to use `auto` in a template-context, use `BOOST_AUTO_TPL(expr)`,
which takes care of the `typename` keyword inside the `auto` expression.
[h4 Sample Code]
int main()
{
length::meter a(5);
force::newton b(6);
BOOST_AUTO(c, a * b);
}
[endsect]
[section:compl COMPLIANT]
The `BOOST_TYPEOF_COMPLIANT` macro can be used to force the emulation mode.
Define it if your compiler by default uses another mode, such as native `typeof`
or Microsoft-specific trick, but you want to use the emulation mode,
for example for portability reasons.
[endsect]
[section:incr INCREMENT_REGISTRATION_GROUP]
The `BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP` macro ensures that type registrations
in different header files receive unique identifiers.
[h4 Usage]
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
[h4 Remarks]
specified once in every cpp/hpp file where any registration is performed,
before any registration.
[h4 Sample Code]
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
class X;
BOOST_TYPEOF_REGISTER_TYPE(X)
[endsect]
[section:inte INTEGRAL]
The `BOOST_TYPEOF_INTEGRAL` macro is used when registering an integral
template parameter using `BOOST_TYPEOF_REGISTER_TEMPLATE`.
Useful for `enum`s and dependent integral template parameters.
[h4 Usage]
BOOST_TYPEOF_INTEGRAL(x)
[variablelist Arguments
[[x][a fully qualified integral type or enum]]
]
[h4 Remarks]
A short syntax has been implemented for the built in types
(int, bool, long, unsigned long, etc.)
Other non-type template parameters (e.g. pointer to member)
are not supported.
[h4 Sample Code]
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
namespace foo
{
enum color {red, green, blue};
template<color C0,typename T1>
class class_with_enum {};
template<typename T0,T0 I1>
class class_with_dependent_non_type {};
}
BOOST_TYPEOF_REGISTER_TEMPLATE(foo::class_with_enum,
(BOOST_TYPEOF_INTEGRAL(foo::color))
(typename)
)
BOOST_TYPEOF_REGISTER_TEMPLATE(foo::class_with_dependent_non_type,
(typename)
(BOOST_TYPEOF_INTEGRAL(P0))
)
[endsect]
[section:limit_func LIMIT_FUNCTION_ARITY]
The `BOOST_TYPEOF_LIMIT_FUNCTION_ARITY` macro defines how many parameters
are supported for functios, and applies to functions, function pointers,
function references, and member function pointers. The default value is 10.
Redefine if you want the Typeof Library to handle functions with more parameters.
[endsect]
[section:messages MESSAGES]
Define `BOOST_TYPEOF_MESSAGE` before including boost/typeof/typeof.hpp to
include messages "using typeof emulation" and "using native typeof".
By default, these messages will not be displayed.
[endsect]
[section:limit_size LIMIT_SIZE]
The `BOOST_TYPEOF_LIMIT_SIZE` macro defines the size of the compile-time sequence
used to encode a type. The default value is 50. Increase it if you want
the Typeof Library to handle very complex types, although this
possibility is limited by the maximum number of template parameters supported
by your compiler. On the other hand, if you work only with very simple types,
decreasing this number may help to boost compile-time performance.
[endsect]
[section:regtype REGISTER_TYPE]
The `BOOST_TYPEOF_REGISTER_TYPE` macro informs the Typeof Library
about the existence of a type
[h4 Usage]
BOOST_TYPEOF_REGISTER_TYPE(x)
[variablelist Arguments
[[x][a fully qualified type]]
]
[h4 Remarks]
Must be used in the global namespace
[h4 Sample Code]
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
namespace foo
{
class bar {};
enum color {red, green, blue};
}
BOOST_TYPEOF_REGISTER_TYPE(foo::bar)
BOOST_TYPEOF_REGISTER_TYPE(foo::color)
[endsect]
[section:regtemp REGISTER_TEMPLATE]
The `BOOST_TYPEOF_REGISTER_TEMPLATE` macro informs the Typeof Library
about the existence of a template and describes its parameters
[h4 Usage]
BOOST_TYPEOF_REGISTER_TEMPLATE(x, n)
BOOST_TYPEOF_REGISTER_TEMPLATE(x, seq)
[variablelist Arguments
[[x][a fully qualified template]]
[[n][the number of template arguments. Only valid if all template arguments are typenames]]
[[seq][a sequence of template arguments. Must be used when integral or template template parameters are present]]
]
[h4 Remarks]
Must be used in the global namespace.
The library allows registration of templates with type, integral,
and template template parameters:
* A type template parameter is described by the `(class)` or `(typename)` sequence element
* A template parameter of a well-known integral type can be described by
simply supplying its type, like `(unsigned int)`.
The following well-known integral types are supported:
* `[signed/unsigned] char`
* `[unsigned] short`
* `[unsigned] int`
* `[unsigned] long`
* `unsigned`
* `bool`
* `size_t`
* Enums and typedefs of integral types, need to be described explicitly
with the `BOOST_TYPEOF_INTEGRAL` macro, like `(BOOST_TYPEOF_INTEGRAL(MyEnum))`
* Template template parameters are described with the `BOOST_TYPEOF_TEMPLATE` macro,
like: `(BOOST_TYPEOF_TEMPLATE((class)(unsigned int)))`.
In case of all type parameters this can be shortened to something like `(BOOST_TYPEOF_TEMPLATE(2))`.
The nested template template parameters are not supported.
[h4 Sample Code]
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
namespace foo
{
template<typename T0, typename T1>
class simple_template {};
template<typename T0, int I1>
class class_with_integral_constant {};
}
BOOST_TYPEOF_REGISTER_TEMPLATE(foo::simple_template, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(foo::class_with_integral_constant, (typename)(int))
[endsect]
[section:temp TEMPLATE]
The `BOOST_TYPEOF_TEMPLATE` macro is used when registering template template parameters
using `BOOST_TYPEOF_REGISTER_TEMPLATE`.
[h4 Usage]
BOOST_TYPEOF_TEMPLATE(n)
BOOST_TYPEOF_TEMPLATE(seq)
[variablelist Arguments
[[n][the number of template arguments. Only valid if all template arguments are typenames]]
[[seq][a sequence of template arguments. Must be used when there are integral constants in the nested template]]
]
[h4 Remarks]
Can not be used to register nested template template parameters.
[h4 Sample Code]
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
namespace foo
{
enum color {red, green, blue};
template<color C0, template<typename> class T1>
class nested_template_class {};
template<template<typename, unsigned char> class T1>
class nested_with_integral {};
}
BOOST_TYPEOF_REGISTER_TEMPLATE(foo::nested_template_class,
(foo::color)
(BOOST_TYPEOF_TEMPLATE(1))
)
BOOST_TYPEOF_REGISTER_TEMPLATE(foo::nested_with_integral,
(BOOST_TYPEOF_TEMPLATE((typename)(unsigned char)))
)
[endsect]
[section:typo TYPEOF, TYPEOF_TPL]
The `BOOST_TYPEOF` macro calculates the type of an expression,
but removes the top-level qualifiers, `const&`
[h4 Usage]
BOOST_TYPEOF(expr)
BOOST_TYPEOF_TPL(expr)
[variablelist Arguments
[[expr][a valid c++ expression that can be bound to const T&]]
]
[h4 Remarks]
If you want to use `typeof` in a template-context, use `BOOST_TYPEOF_TPL(expr)`,
which takes care of `typename` inside the `typeof` expression.
[h4 Sample Code]
template<typename A, typename B>
struct result_of_conditional
{
typedef BOOST_TYPEOF_TPL(true?A():B()) type;
};
template<typename A, typename B>
result_of_conditional<A, B>::type min(const A& a,const B& b)
{
return a < b ? a : b;
}
[endsect]
[section:typn TYPEOF_NESTED_TYPEDEF, TYPEOF_NESTED_TYPEDEF_TPL]
The `TYPEOF_NESTED_TYPEDEF` macro works in much the same way as the 'TYPEOF' macro does, but
workarounds several compiler deficiencies.
[h4 Usage]
BOOST_TYPEOF_NESTED_TYPEDEF(name,expr)
BOOST_TYPEOF_NESTED_TYPEDEF_TPL(name,expr)
[variablelist Arguments
[[name][a valid identifier to nest the typeof operation inside]
[expr][a valid c++ expression that can be bound to const T&]]
]
[h4 Remarks]
'typeof_nested_typedef' nests the 'typeof' operation inside a struct. By doing this, the 'typeof' operation
can be split into two steps, deconfusing several compilers (notably VC7.1 and VC8.0) on the way.
This also removes the limitation imposed by `BOOST_TYPEOF_LIMIT_SIZE` and allows you to use 'typeof' on much
larger expressions.
If you want to use `typeof_nested_typedef` in a template-context, use `BOOST_TYPEOF_NESTED_TYPEDEF_TPL(name,expr)`,
which takes care of `typename` inside the `typeof` expression.
'typeof_nested_typedef' can not be used at function/block scope.
[h4 Sample Code]
template<typename A, typename B>
struct result_of_conditional
{
BOOST_TYPEOF_NESTED_TYPEDEF_TPL(nested,true?A():B())
typedef typename nested::type type;
};
template<typename A, typename B>
result_of_conditional<A, B>::type min(const A& a,const B& b)
{
return a < b ? a : b;
}
[endsect]
[endsect]
[section:other Other considerations and tips]
[section:natem Native typeof support and emulation]
Many compilers support typeof already, most noticeable GCC and Metrowerks.
Igor Chesnokov discovered a method that allows to implement `typeof`
on the VC series of compilers. It uses a bug in the Microsoft compiler
that allows a nested class of base to be defined in a class derived from base:
template<int ID> struct typeof_access
{
struct id2type; //not defined
};
template<class T, int ID> struct typeof_register : typeof_access
{
// define base's nested class here
struct typeof_access::id2type
{
typedef T type;
};
};
//Type registration function
typeof_register<T, compile-time-constant> register_type(const T&);
//Actually register type by instantiating typeof_register for the correct type
sizeof(register_type(some-type));
//Use the base class to access the type.
typedef typeof_access::id2type::type type;
Peder Holt adapted this method to VC7.0, where the nested class
is a template class that is specialized in the derived class.
In VC8.0, it seemed that all the bug-featire had been fixed, but
Steven Watanabe managed to implement a more rigorous version of the VC7.0 fix that
enables 'typeof' to be supported 'natively' here as well.
For many other compilers neither native `typeof` support
nor the trick described above is an option. For such compilers
the emulation method is the only way of implementing `typeof`.
According to a rough estimate, at the time of this writing
the introduction of the `typeof`, `auto`, etc., into the C++ standard
may not happen soon. Even after it's done, some time still has to pass
before most compilers implement this feature. But even after that,
there always are legacy compilers to support (for example now, in 2005,
many people are still using VC6, long after VC7.x, and even VC8.0 beta became available).
Considering extreme usefulness of the feature right now,
it seems to make sense to implement it at the library level.
The emulation mode seems to be important even if a better option is present
on some particular compiler. If a library author wants to develop portable
code using `typeof`, she needs to use emulation mode and register her types and
templates. Those users who have a better option can still take
advantage of it, since the registration macros are defined as no-op on
such compilers, while the users for whom emulation is the only option will use it.
The other consideration applies to the users of VC7.1. Even though the more
convenient `typeof` trick is available, the possibility of upgrade to VC8,
where emulation remains the only option, should be considered.
The emulation mode can be forced on the compilers that don't use it
by default by defining the `BOOST_TYPEOF_COMPLIANT` symbol:
g++ -D BOOST_TYPEOF_COMPLIANT -I \boost\boost_1_32_0 main.cpp
[endsect]
[section:parties The three participating parties]
The Lambda example from the Motivation section requires the following registration:
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::tuples::tuple, 2);
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::lambda::lambda_functor, 1);
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::lambda::lambda_functor_base, 2);
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::lambda::relational_action, 1);
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::lambda::logical_action, 1);
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::lambda::other_action, 1);
BOOST_TYPEOF_REGISTER_TYPE(boost::lambda::greater_action);
BOOST_TYPEOF_REGISTER_TYPE(boost::lambda::less_action);
BOOST_TYPEOF_REGISTER_TYPE(boost::lambda::and_action);
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::lambda::placeholder, (int));
It may seem that the price for the ability to discover the expression's type
is too high: rather large amount of registration is required.
However note that all of the above registration is done only once,
and after that, any combination of the registered types and templates
would be handled. Moreover, this registration is typically done
not by the end-user, but rather by a layer on top of some library
(in this example -- Boost.Lambda).
When thinking about this, it's helpful to consider three parties: the typeof facility,
the library (probably built on expression templates principle), and the end-user.
The typeof facility is responsible for registering fundamental types.
The library can register its own types and templates.
In the best-case scenario, if the expressions always consist of only
fundamental types and library-defined types and templates, a library author
can achieve the impression that the `typeof` is natively supported for her library.
On the other hand, the more often expressions contain user-defined types,
the more responsibility is put on the end-user, and therefore the less attractive
this approach becomes.
Thus, the ratio of user-defined types in the expressions should be the main
factor to consider when deciding whether or not to apply the typeof facility.
[endsect]
[section:features Supported features]
The Typeof library pre-registers fundamental types. For these types,
and for any other types/templates registered by the user library or end-user,
any combination of the following is supported:
* Pointers;
* References (except top-level);
* Consts (except top-level);
* Volatiles (except top-level);
* Arrays;
* Functions, function pointers, and references;
* Pointers to member functions;
* Pointers to data members.
For example the following type:
int& (*)(const volatile char*, double[5], void(*)(short))
is supported right away, and something like:
void (MyClass::*)(int MyClass::*, MyClass[10]) const
is supported provided `MyClass` is registered.
The Typeof Library also provides registration files for most STL classes/templates.
These files are located in the std subdirectory, and named after corresponding STL headers.
These files are not included by the typeof system and have to be explicitly included
by the user, as needed:
#include <boost/typeof/std/functional.hpp>
BOOST_AUTO(fun, std::bind2nd(std::less<int>(), 21)); //create named function object for future use.
[endsect]
[section:what What needs to be registered?]
It is possible to take advantage of the compiler when registering types for the Typeof Library.
Even though there is currently no direct support for typeof in the language,
the compiler is aware of what the type of an expression is, and gives an error
if it encounters an expression that has not been handled correctly. In the `typeof` context,
this error message will contain clues to what types needs to be registered with the
Typeof Library in order for `BOOST_TYPEOF` to work.
struct X {};
template<typename A,bool B>
struct Y {};
std::pair<X,Y<int,true> > a;
BOOST_AUTO(a,b);
We get the following error message from VC7.1
[pre
error C2504: 'boost::type_of::'anonymous-namespace'::encode_type_impl<V,Type_Not_Registered_With_Typeof_System>' : base
class undefined
with
\[
V=boost::type_of::'anonymous-namespace'::encode_type_impl<boost::mpl::vector0<boost::mpl::na>,std::pair<X,Y<int,true>>>::V0,
Type_Not_Registered_With_Typeof_System=X
\]
]
Inspecting this error message, we see that the compiler complains about `X`
BOOST_TYPEOF_REGISTER_TYPE(X); //register X with the typeof system
Recompiling, we get a new error message from VC7.1
[pre
error C2504: 'boost::type_of::'anonymous-namespace'::encode_type_impl<V,Type_Not_Registered_With_Typeof_System>' : base
class undefined
with
\[
V=boost::type_of::'anonymous-namespace'::encode_type_impl<boost::mpl::vector0<boost::mpl::na>,std::pair<X,Y<int,true>>>::V1,
Type_Not_Registered_With_Typeof_System=Y<int,true>
\]
]
Inspecting this error message, we see that the compiler complains about `Y<int,true>`.
Since `Y` is a template, and contains integral constants, we need to take more care when registering:
BOOST_TYPEOF_REGISTER_TEMPLATE(Y,(typename)(bool)); //register template class Y
It is a good idea to look up the exact definition of `Y` when it contains integral constants.
For simple template classes containing only typenames, you can rely solely on the compiler error.
The above code now compiles.
This technique can be used to get an overview of which types needs to be registered
for a given project in order to support `typeof`.
[endsect]
[section:limi Limitations]
Nested template template parameters are not supported, like:
template<template<template<class> class> class Tpl>
class A; // can't register!
Classes and templates nested inside other templates also can't be registered
because of the issue of nondeduced context. This limitation is most noticeable
with regards to standard iterators in Dinkumware STL, which are implemented
as nested classes. Instead, instantiations can be registered:
BOOST_TYPEOF_REGISTER_TYPE(std::list<int>::const_iterator)
[endsect]
[endsect]
[section:cont Contributed By:]
* Compliant compilers -- Arkadiy Vertleyb, Peder Holt
* MSVC 6.5, 7.0, 7.1 -- Igor Chesnokov, Peder Holt
[endsect]
[section:ackn Acknowledgements]
The idea of representing a type as multiple compile-time integers,
and passing these integers across function boundaries using sizeof(),
was taken from Steve Dewhurst's article "A Bitwise typeof Operator", CUJ 2002.
This article can also be viewed online, at [@http://www.semantics.org/localarchive.html
http://www.semantics.org/localarchive.html].
Special thank you to Paul Mensonides, Vesa Karvonen, and Aleksey Gurtovoy
for the Boost Preprocessor Library and MPL. Without these two libraries,
this typeof implementation would not exist.
The following people provided support, gave valuable comments,
or in any other way contributed to the library development
(in alphabetical order):
* David Abrahams
* Andrey Beliakov
* Joel de Guzman
* Daniel James
* Vesa Karvonen
* Andy Little
* Paul Mensonides
* Alexander Nasonov
* Tobias Schwinger
* Martin Wille
[endsect]

View File

@@ -1,35 +0,0 @@
// Copyright (C) 2004 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_TYPEOF_CONFIG_HPP_INCLUDED
#define BOOST_TYPEOF_CONFIG_HPP_INCLUDED
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
#if !defined(BOOST_TYPEOF_COMPLIANT) &&\
!defined(BOOST_TYPEOF_NATIVE)
# if defined __GNUC__
# define BOOST_TYPEOF_NATIVE
# elif defined __MWERKS__
# define BOOST_TYPEOF_NATIVE
# elif defined(BOOST_MSVC) && (BOOST_MSVC<1400)
//Doesn't require registration
# define BOOST_TYPEOF_NATIVE
# else
# define BOOST_TYPEOF_COMPLIANT
# endif
#endif
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
# define BOOST_TYPEOF_NO_SIMPLE_TYPE_OPTIMIZATION
#endif
#endif//BOOST_TYPEOF_CONFIG_HPP_INCLUDED

View File

@@ -0,0 +1,26 @@
/*
Copyright 2018 Glen Joseph Fernandes
(glenjofe@gmail.com)
Distributed under the Boost Software License, Version 1.0.
(http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_TYPEOF_CONSTANT_HPP
#define BOOST_TYPEOF_CONSTANT_HPP
#include <boost/config.hpp>
namespace boost {
namespace type_of {
template<class T, T N>
struct constant {
typedef constant<T, N> type;
typedef constant<T, N + 1> next;
BOOST_STATIC_CONSTANT(T, value=N);
};
} /* type_of */
} /* boost */
#endif

View File

@@ -0,0 +1,33 @@
// Copyright (C) 2006 Arkadiy Vertleyb
// Copyright (C) 2017 Daniela Engert
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_TYPEOF_DECLTYPE_HPP_INCLUDED
# define BOOST_TYPEOF_DECLTYPE_HPP_INCLUDED
#include <type_traits>
namespace boost { namespace type_of {
template<typename T>
using remove_cv_ref_t = typename std::remove_cv<typename std::remove_reference<T>::type>::type;
}}
#define BOOST_TYPEOF(expr) boost::type_of::remove_cv_ref_t<decltype(expr)>
#define BOOST_TYPEOF_TPL BOOST_TYPEOF
#define BOOST_TYPEOF_NESTED_TYPEDEF_TPL(name,expr) \
struct name {\
typedef BOOST_TYPEOF_TPL(expr) type;\
};
#define BOOST_TYPEOF_NESTED_TYPEDEF(name,expr) \
struct name {\
typedef BOOST_TYPEOF(expr) type;\
};
#define BOOST_TYPEOF_REGISTER_TYPE(x)
#define BOOST_TYPEOF_REGISTER_TEMPLATE(x, params)
#endif //BOOST_TYPEOF_DECLTYPE_HPP_INCLUDED

View File

@@ -1,34 +0,0 @@
// Copyright (C) 2004 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_TYPEOF_ENCODE_DECODE_HPP_INCLUDED
#define BOOST_TYPEOF_ENCODE_DECODE_HPP_INCLUDED
#include <boost/mpl/deref.hpp>
#include <boost/mpl/next.hpp>
namespace boost{namespace type_of{namespace{
template<class V, class Type_Not_Registered_With_Typeof_System>
struct encode_type_impl;
template<class T, class Iter>
struct decode_type_impl
{
typedef int type; // MSVC ETI workaround
};
template<class V, class T>
struct encode_type : encode_type_impl<V, T>
{};
template<class Iter>
struct decode_type : decode_type_impl<
typename Iter::type,
typename Iter::next
>
{};
}}}
#endif//BOOST_TYPEOF_ENCODE_DECODE_HPP_INCLUDED

View File

@@ -1,34 +0,0 @@
// Copyright (C) 2005 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_TYPEOF_ENCODE_DECODE_PARAMS_HPP_INCLUDED
#define BOOST_TYPEOF_ENCODE_DECODE_PARAMS_HPP_INCLUDED
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/repetition/repeat.hpp>
// Assumes iter0 contains initial iterator
#define BOOST_TYPEOF_DECODE_PARAM(z, n, text) \
typedef decode_type<iter##n> decode##n; \
typedef typename decode##n::type p##n; \
typedef typename decode##n::iter BOOST_PP_CAT(iter, BOOST_PP_INC(n));
#define BOOST_TYPEOF_DECODE_PARAMS(n)\
BOOST_PP_REPEAT(n, BOOST_TYPEOF_DECODE_PARAM, ~)
// The P0, P1, ... PN are encoded and added to V
#define BOOST_TYPEOF_ENCODE_PARAMS_BEGIN(z, n, text)\
typename encode_type<
#define BOOST_TYPEOF_ENCODE_PARAMS_END(z, n, text)\
, BOOST_PP_CAT(P, n)>::type
#define BOOST_TYPEOF_ENCODE_PARAMS(n, ID) \
BOOST_PP_REPEAT(n, BOOST_TYPEOF_ENCODE_PARAMS_BEGIN, ~) \
typename push_back<V, mpl::size_t<ID> >::type \
BOOST_PP_REPEAT(n, BOOST_TYPEOF_ENCODE_PARAMS_END, ~)
#endif//BOOST_TYPEOF_ENCODE_DECODE_PARAMS_HPP_INCLUDED

View File

@@ -0,0 +1,5 @@
// Copyright (C) 2004, 2005 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
// This header is no longer useful and is only retained for compatibility

View File

@@ -1,21 +0,0 @@
// Copyright (C) 2004 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
// Inclusion of this file increments BOOST_TYPEOF_REGISTRATION_GROUP
// This method was suggested by Paul Mensonides
#ifndef BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP_HPP_INCLUDED
# define BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP_HPP_INCLUDED
# include <boost/preprocessor/slot/slot.hpp>
# define BOOST_TYPEOF_REGISTRATION_GROUP 0
#else
# define BOOST_PP_VALUE BOOST_TYPEOF_REGISTRATION_GROUP + 1
# include BOOST_PP_ASSIGN_SLOT(1)
# undef BOOST_TYPEOF_REGISTRATION_GROUP
# define BOOST_TYPEOF_REGISTRATION_GROUP BOOST_PP_SLOT(1)
#endif//BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP_HPP_INCLUDED

View File

@@ -1,113 +0,0 @@
// Copyright (C) 2004 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_TYPEOF_INT_ENCODING_HPP_INCLUDED
#define BOOST_TYPEOF_INT_ENCODING_HPP_INCLUDED
#include <boost/mpl/if.hpp>
#include <boost/mpl/size_t.hpp>
namespace boost{namespace type_of{
template<class T> struct get_unsigned
{
typedef T type;
};
template<> struct get_unsigned<signed char>
{
typedef unsigned char type;
};
template<> struct get_unsigned<char>
{
typedef unsigned char type;
};
template<> struct get_unsigned<short>
{
typedef unsigned short type;
};
template<> struct get_unsigned<int>
{
typedef unsigned int type;
};
template<> struct get_unsigned<long>
{
typedef unsigned long type;
};
//////////////////////////
template<size_t n, bool Overflow>
struct pack
{
enum {value = (n + 1) * 2 + (Overflow ? 1 : 0)};
};
template<size_t m>
struct unpack
{
enum {value = (m / 2) - 1};
enum {overflow = (m % 2 == 1)};
};
////////////////////////////////
template<class V, size_t n, bool overflow = (n >= 0x3fffffff)>
struct encode_size_t : push_back<
V,
boost::mpl::size_t<pack<n, false>::value>
>
{};
template<class V, size_t n>
struct encode_size_t<V, n, true> : push_back<typename push_back<
V,
boost::mpl::size_t<pack<n % 0x3ffffffe, true>::value> >::type,
boost::mpl::size_t<n / 0x3ffffffe>
>
{};
template<class V, class T, T n>
struct encode_integral : encode_size_t< V, (typename get_unsigned<T>::type)n >
{};
///////////////////////////
template<size_t n, class Iter, bool overflow>
struct decode_size_t;
template<size_t n, class Iter>
struct decode_size_t<n, Iter, false>
{
enum {value = n};
typedef Iter iter;
};
template<size_t n, class Iter>
struct decode_size_t<n, Iter, true>
{
enum {m = Iter::type::value};
enum {value = (size_t)m * 0x3ffffffe + n};
typedef typename Iter::next iter;
};
template<class T, class Iter>
struct decode_integral
{
enum {m = Iter::type::value};
enum {n = unpack<m>::value};
enum {overflow = unpack<m>::overflow};
typedef typename Iter::next nextpos;
static const T value = (T)(size_t)decode_size_t<n, nextpos, overflow>::value;
typedef typename decode_size_t<n, nextpos, overflow>::iter iter;
};
}}//namespace
#endif//BOOST_TYPEOF_INT_ENCODING_HPP_INCLUDED

View File

@@ -1,80 +0,0 @@
// Copyright (C) 2005 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_TYPEOF_INTEGRAL_TEMPLATE_PARAM_HPP_INCLUDED
#define BOOST_TYPEOF_INTEGRAL_TEMPLATE_PARAM_HPP_INCLUDED
#define BOOST_TYPEOF_unsigned (unsigned)
#define BOOST_TYPEOF_signed (signed)
#define char_BOOST_TYPEOF (char)
#define short_BOOST_TYPEOF (short)
#define int_BOOST_TYPEOF (int)
#define long_BOOST_TYPEOF (long)
#define BOOST_TYPEOF_char_BOOST_TYPEOF (char)
#define BOOST_TYPEOF_short_BOOST_TYPEOF (short)
#define BOOST_TYPEOF_int_BOOST_TYPEOF (int)
#define BOOST_TYPEOF_long_BOOST_TYPEOF (long)
#define BOOST_TYPEOF_bool_BOOST_TYPEOF (bool)
#define BOOST_TYPEOF_unsigned_BOOST_TYPEOF (unsigned)
#define BOOST_TYPEOF_size_t_BOOST_TYPEOF (size_t)
#define BOOST_TYPEOF_MAKE_OBJ_char BOOST_TYPEOF_INTEGRAL_PARAM(char)
#define BOOST_TYPEOF_MAKE_OBJ_short BOOST_TYPEOF_INTEGRAL_PARAM(short)
#define BOOST_TYPEOF_MAKE_OBJ_int BOOST_TYPEOF_INTEGRAL_PARAM(int)
#define BOOST_TYPEOF_MAKE_OBJ_long BOOST_TYPEOF_INTEGRAL_PARAM(long)
#define BOOST_TYPEOF_MAKE_OBJ_bool BOOST_TYPEOF_INTEGRAL_PARAM(bool)
#define BOOST_TYPEOF_MAKE_OBJ_unsigned BOOST_TYPEOF_INTEGRAL_PARAM(unsigned)
#define BOOST_TYPEOF_MAKE_OBJ_size_t BOOST_TYPEOF_INTEGRAL_PARAM(size_t)
#define BOOST_TYPEOF_MAKE_OBJ_unsignedchar BOOST_TYPEOF_INTEGRAL_PARAM(unsigned char)
#define BOOST_TYPEOF_MAKE_OBJ_unsignedshort BOOST_TYPEOF_INTEGRAL_PARAM(unsigned short)
#define BOOST_TYPEOF_MAKE_OBJ_unsignedint BOOST_TYPEOF_INTEGRAL_PARAM(unsigned int)
#define BOOST_TYPEOF_MAKE_OBJ_unsignedlong BOOST_TYPEOF_INTEGRAL_PARAM(unsigned long)
#define BOOST_TYPEOF_MAKE_OBJ_signedchar BOOST_TYPEOF_INTEGRAL_PARAM(signed char)
#define BOOST_TYPEOF_MAKE_OBJ_signedshort BOOST_TYPEOF_INTEGRAL_PARAM(signed short)
#define BOOST_TYPEOF_MAKE_OBJ_signedint BOOST_TYPEOF_INTEGRAL_PARAM(signed int)
#define BOOST_TYPEOF_MAKE_OBJ_signedlong BOOST_TYPEOF_INTEGRAL_PARAM(signed long)
#define BOOST_TYPEOF_MAKE_OBJ_integral(x) BOOST_TYPEOF_INTEGRAL_PARAM(x)
#define BOOST_TYPEOF_INTEGRAL(X) integral(X) BOOST_TYPEOF_EAT
#define BOOST_TYPEOF_EAT_BOOST_TYPEOF
#define BOOST_TYPEOF_integral(X) (integral(X))
#define BOOST_TYPEOF_INTEGRAL_PARAM(Type)\
(INTEGRAL_PARAM)\
(Type)
#define BOOST_TYPEOF_INTEGRAL_PARAM_GETTYPE(Param)\
BOOST_PP_SEQ_ELEM(1, Param)
#define BOOST_TYPEOF_INTEGRAL_PARAM_EXPANDTYPE(Param)\
BOOST_TYPEOF_INTEGRAL_PARAM_GETTYPE(Param)
// INTEGRAL_PARAM "virtual functions" implementation
#define BOOST_TYPEOF_INTEGRAL_PARAM_ENCODE(This, n)\
typedef typename encode_integral<\
BOOST_PP_CAT(V, n),\
BOOST_TYPEOF_INTEGRAL_PARAM_GETTYPE(This),\
BOOST_PP_CAT(P, n)\
>::type BOOST_PP_CAT(V, BOOST_PP_INC(n));
#define BOOST_TYPEOF_INTEGRAL_PARAM_DECODE(This, n)\
typedef decode_integral<BOOST_TYPEOF_INTEGRAL_PARAM_GETTYPE(This), BOOST_PP_CAT(iter, n)> BOOST_PP_CAT(d, n);\
static const BOOST_TYPEOF_INTEGRAL_PARAM_GETTYPE(This) BOOST_PP_CAT(P, n) = BOOST_PP_CAT(d, n)::value;\
typedef typename BOOST_PP_CAT(d, n)::iter BOOST_PP_CAT(iter, BOOST_PP_INC(n));
#define BOOST_TYPEOF_INTEGRAL_PARAM_PLACEHOLDER(Param)\
(BOOST_TYPEOF_INTEGRAL_PARAM_GETTYPE(Param))0
#define BOOST_TYPEOF_INTEGRAL_PARAM_DECLARATION_TYPE(Param)\
BOOST_TYPEOF_INTEGRAL_PARAM_GETTYPE(Param)
#define BOOST_TYPEOF_INTEGRAL_PARAM_PLACEHOLDER_TYPES(Param, n)\
BOOST_PP_CAT(T,n)
#define BOOST_TYPEOF_INTEGRAL_PARAM_ISTEMPLATE 0
#endif//BOOST_TYPEOF_INTEGRAL_TEMPLATE_PARAM_HPP_INCLUDED

View File

@@ -1,35 +0,0 @@
// Copyright (C) 2004 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_TYPEOF_LIMIT_SIZE_HPP_INCLUDED
#define BOOST_TYPEOF_LIMIT_SIZE_HPP_INCLUDED
#include "boost/mpl/vector.hpp"
#include "boost/mpl/aux_/config/ctps.hpp"
#include "boost/preprocessor/iterate.hpp"
#include "boost/preprocessor/if.hpp"
#include "boost/config.hpp"
#ifndef BOOST_TYPEOF_LIMIT_SIZE
#define BOOST_TYPEOF_LIMIT_SIZE 50
#endif//BOOST_TYPEOF_LIMIT_SIZE
#if (BOOST_TYPEOF_LIMIT_SIZE > BOOST_MPL_LIMIT_VECTOR_SIZE)
namespace boost
{
namespace mpl
{
#define BOOST_PP_ITERATION_PARAMS_1 (3,( \
BOOST_PP_INC(BOOST_MPL_LIMIT_VECTOR_SIZE), \
BOOST_TYPEOF_LIMIT_SIZE, \
"boost/mpl/vector/aux_/numbered.hpp"))
#include BOOST_PP_ITERATE()
}
}
#endif//BOOST_TYPEOF_LIMIT_SIZE > BOOST_MPL_LIMIT_VECTOR_SIZE
#endif//BOOST_TYPEOF_LIMIT_SIZE_HPP_INCLUDED

View File

@@ -1,111 +0,0 @@
// Copyright (C) 2004 Arkadiy Vertleyb
// Copyright (C) 2004 Peder Holt
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_TYPEOF_LVALUE_TYPEOF_HPP_INCLUDED
#define BOOST_TYPEOF_LVALUE_TYPEOF_HPP_INCLUDED
#include <boost/type_traits/is_const.hpp>
namespace boost
{
namespace type_of
{
enum
{
RVALUE = 1,
LVALUE,
CONST_LVALUE
};
char(*classify_expression(...))[
RVALUE
];
template<class T>
char(*classify_expression(T&))[
is_const<T>::value ? CONST_LVALUE : LVALUE
];
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
template<class T, int n> struct decorate_type
{
typedef T type;
};
template<class T> struct decorate_type<T, LVALUE>
{
typedef T& type;
};
template<class T> struct decorate_type<T, CONST_LVALUE>
{
typedef const T& type;
};
#else
template<int n>
struct decorate_type_impl {
template<typename T>
struct inner {
typedef T type;
};
};
template<>
struct decorate_type_impl<LVALUE> {
template<typename T>
struct inner {
typedef T& type;
};
};
template<>
struct decorate_type_impl<CONST_LVALUE> {
template<typename T>
struct inner {
typedef T const& type;
};
};
template<class T, int n> struct decorate_type
{
typedef decorate_type_impl<n>::inner<T>::type type;
};
#endif
}
}
// Since this is always a type,
// just add "typename" when using in templates
#ifndef BOOST_TYPEOF_COMPLIANT
#define BOOST_LVALUE_TYPEOF(expr) \
boost::type_of::decorate_type< \
BOOST_TYPEOF(expr), \
sizeof(*boost::type_of::classify_expression(expr)) \
>::type
#else //BOOST_TYPEOF_COMPLIANT
#include <boost/typeof/typeof_impl.hpp>
namespace boost { namespace type_of {
template<class V, int n>
struct decorate_decode_begin
{
typedef typename decorate_type<
typename decode_begin<V>::type,
n
>::type type;
};
}}
#define BOOST_LVALUE_TYPEOF(expr) \
boost::type_of::decorate_decode_begin< \
BOOST_TYPEOF_ENCODED_VECTOR(expr), \
sizeof(*boost::type_of::classify_expression(expr)) \
>::type
#endif
#endif//BOOST_TYPEOF_LVALUE_TYPEOF_HPP_INCLUDED

View File

@@ -1,8 +0,0 @@
// Copyright (C) 2005 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#if defined(_MSC_VER) && !defined BOOST_TYPEOF_SILENT
# pragma message(BOOST_TYPEOF_TEXT)
#endif
#undef BOOST_TYPEOF_TEXT

View File

@@ -1,91 +0,0 @@
// Copyright (C) 2004 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_TYPEOF_MODIFIERS_HPP_INCLUDED
#define BOOST_TYPEOF_MODIFIERS_HPP_INCLUDED
#include <boost/typeof/encode_decode.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
// modifiers
#define BOOST_TYPEOF_modifier_support(ID, Fun)\
template<class V, class T> struct encode_type_impl<V, Fun(T)>\
{\
typedef\
typename encode_type<\
typename push_back<\
V\
, mpl::size_t<ID> >::type\
, T>::type\
type;\
};\
template<class Iter> struct decode_type_impl<mpl::size_t<ID>, Iter>\
{\
typedef decode_type<Iter> d1;\
typedef Fun(typename d1::type) type;\
typedef typename d1::iter iter;\
}
#define BOOST_TYPEOF_const_fun(T) const T
#define BOOST_TYPEOF_volatile_fun(T) volatile T
#define BOOST_TYPEOF_volatile_const_fun(T) volatile const T
#define BOOST_TYPEOF_pointer_fun(T) T*
#define BOOST_TYPEOF_reference_fun(T) T&
namespace boost{namespace type_of{namespace{
BOOST_TYPEOF_modifier_support(BOOST_TYPEOF_UNIQUE_ID(), BOOST_TYPEOF_const_fun);
BOOST_TYPEOF_modifier_support(BOOST_TYPEOF_UNIQUE_ID(), BOOST_TYPEOF_volatile_fun);
BOOST_TYPEOF_modifier_support(BOOST_TYPEOF_UNIQUE_ID(), BOOST_TYPEOF_volatile_const_fun);
BOOST_TYPEOF_modifier_support(BOOST_TYPEOF_UNIQUE_ID(), BOOST_TYPEOF_pointer_fun);
BOOST_TYPEOF_modifier_support(BOOST_TYPEOF_UNIQUE_ID(), BOOST_TYPEOF_reference_fun);
}}}
#undef BOOST_TYPEOF_modifier_support
#undef BOOST_TYPEOF_const_fun
#undef BOOST_TYPEOF_volatile_fun
#undef BOOST_TYPEOF_volatile_const_fun
#undef BOOST_TYPEOF_pointer_fun
#undef BOOST_TYPEOF_reference_fun
// arrays
#define BOOST_TYPEOF_array_support(ID, Qualifier)\
template<class V, class T, int N>\
struct encode_type_impl<V, Qualifier T[N]>\
{\
typedef\
typename encode_type<\
typename push_back<\
typename push_back<\
V\
, mpl::size_t<ID> >::type\
, mpl::size_t<N> >::type\
, T>::type\
type;\
};\
template<class Iter>\
struct decode_type_impl<mpl::size_t<ID>, Iter>\
{\
enum{n = Iter::type::value};\
typedef decode_type<typename Iter::next> d;\
typedef typename d::type Qualifier type[n];\
typedef typename d::iter iter;\
}
namespace boost{namespace type_of{namespace{
BOOST_TYPEOF_array_support(BOOST_TYPEOF_UNIQUE_ID(), BOOST_PP_EMPTY());
BOOST_TYPEOF_array_support(BOOST_TYPEOF_UNIQUE_ID(), const);
BOOST_TYPEOF_array_support(BOOST_TYPEOF_UNIQUE_ID(), volatile);
BOOST_TYPEOF_array_support(BOOST_TYPEOF_UNIQUE_ID(), volatile const);
}}}
#undef BOOST_TYPEOF_array_support
#endif//BOOST_TYPEOF_MODIFIERS_HPP_INCLUDED

106
include/boost/typeof/msvc/typeof_impl.hpp Executable file → Normal file
View File

@@ -1,6 +1,7 @@
// Copyright (C) 2005 Igor Chesnokov, mailto:ichesnokov@gmail.com
// Copyright (C) 2005 Peder Holt
// Copyright (C) 2005 Igor Chesnokov, mailto:ichesnokov@gmail.com (VC 6.5,VC 7.1 + counter code)
// Copyright (C) 2005-2007 Peder Holt (VC 7.0 + framework)
// Copyright (C) 2006 Steven Watanabe (VC 8.0)
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
@@ -9,7 +10,11 @@
# define BOOST_TYPEOF_MSVC_TYPEOF_IMPL_HPP_INCLUDED
# include <boost/config.hpp>
# include <boost/detail/workaround.hpp>
# include <boost/config/workaround.hpp>
# include <boost/typeof/constant.hpp>
# include <type_traits>
# include <typeinfo>
namespace boost
{
@@ -17,9 +22,9 @@ namespace boost
{
//Compile time constant code
# if BOOST_WORKAROUND(BOOST_MSVC,>=1300) && defined(_MSC_EXTENSIONS)
# if defined(_MSC_EXTENSIONS)
template<int N> struct the_counter;
template<typename T,int N = 5/*for similarity*/>
struct encode_counter
{
@@ -36,7 +41,7 @@ namespace boost
__if_not_exists(the_counter<N + 64>)
{
__if_exists(the_counter<N + 16>)
{
{
BOOST_STATIC_CONSTANT(unsigned,count=(encode_counter<T,N + 17>::count));
}
__if_not_exists(the_counter<N + 16>)
@@ -67,7 +72,7 @@ namespace boost
# else
template<int N> struct encode_counter : encode_counter<N - 1> {};
template<> struct encode_counter<0> {};
//Need to default to a larger value than 4, as due to MSVC's ETI errors. (sizeof(int)==4)
char (*encode_index(...))[5];
@@ -77,45 +82,59 @@ namespace boost
//Typeof code
# if BOOST_WORKAROUND(BOOST_MSVC,==1300)
template<int ID>
struct msvc_typeof_base
{
# if BOOST_WORKAROUND(BOOST_MSVC,>=1400)
struct msvc_extract_type_default_param {};
template<typename ID, typename T = msvc_extract_type_default_param>
struct msvc_extract_type;
template<typename ID>
struct msvc_extract_type<ID, msvc_extract_type_default_param> {
template<bool>
struct id2type_impl;
typedef id2type_impl<true> id2type;
};
template<typename T, int ID>
struct msvc_typeof : msvc_typeof_base<ID>
template<typename ID, typename T>
struct msvc_extract_type : msvc_extract_type<ID,msvc_extract_type_default_param>
{
template<>
struct id2type_impl<true>
struct id2type_impl<true> //VC8.0 specific bugfeature
{
typedef T type;
};
};
# else
template<int ID>
struct msvc_typeof_base
{
template<bool>
struct id2type_impl;
typedef id2type_impl<true> id2type;
};
template<typename T, typename ID>
struct msvc_register_type : msvc_extract_type<ID, T>
{
};
# else
template<typename ID>
struct msvc_extract_type
{
struct id2type;
};
template<typename T, int ID>
struct msvc_typeof : msvc_typeof_base<ID>
template<typename T, typename ID>
struct msvc_register_type : msvc_extract_type<ID>
{
struct msvc_typeof_base<ID>::id2type // This uses nice VC6-VC7 bugfeature
typedef msvc_extract_type<ID> base_type;
struct base_type::id2type // This uses nice VC6.5 and VC7.1 bugfeature
{
typedef T type;
};
};
# endif
template<int ID>
struct msvc_typeid_wrapper {
typedef typename msvc_typeof_base<ID>::id2type id2type;
typedef typename msvc_extract_type<constant<int,ID> >::id2type id2type;
typedef typename id2type::type type;
};
//Workaround for ETI-bug for VC6 and VC7
@@ -136,21 +155,48 @@ namespace boost
//Get the next available compile time constants index
BOOST_STATIC_CONSTANT(unsigned,value=BOOST_TYPEOF_INDEX(T));
//Instantiate the template
typedef typename msvc_typeof<T,value>::id2type type;
typedef typename msvc_register_type<T,constant<int,value> >::id2type type;
//Set the next compile time constants index
BOOST_STATIC_CONSTANT(unsigned,next=value+1);
//Increment the compile time constant (only needed when extensions are not active
BOOST_TYPEOF_NEXT_INDEX(next);
BOOST_TYPEOF_NEXT_INDEX(next);
};
template<typename T>
char (*encode_start(T const&))[encode_type<T>::value];
}
}
template<class T>
struct sizer
{
typedef char(*type)[encode_type<T>::value];
};
template<typename T> typename std::enable_if<
!std::is_function<T>::value,
typename sizer<T>::type>::type encode_start(T const&);
template<typename T> typename std::enable_if<
std::is_function<T>::value,
typename sizer<T>::type>::type encode_start(T&);
template<typename Organizer, typename T>
msvc_register_type<T,Organizer> typeof_register_type(const T&,Organizer* =0);
# define BOOST_TYPEOF(expr) \
boost::type_of::msvc_typeid_wrapper<sizeof(*boost::type_of::encode_start(expr))>::type
# define BOOST_TYPEOF_TPL(expr) typename BOOST_TYPEOF(expr)
# define BOOST_TYPEOF_NESTED_TYPEDEF_TPL(name,expr) \
struct name {\
enum {_typeof_register_value=sizeof(boost::type_of::typeof_register_type<name>(expr))};\
typedef typename boost::type_of::msvc_extract_type<name>::id2type id2type;\
typedef typename id2type::type type;\
};
# define BOOST_TYPEOF_NESTED_TYPEDEF(name,expr) \
struct name {\
enum {_typeof_register_value=sizeof(boost::type_of::typeof_register_type<name>(expr))};\
typedef boost::type_of::msvc_extract_type<name>::id2type id2type;\
typedef id2type::type type;\
};
}
}
#endif//BOOST_TYPEOF_MSVC_TYPEOF_IMPL_HPP_INCLUDED

View File

@@ -1,44 +0,0 @@
// Copyright (C) 2004 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_TYPEOF_POINTERS_DATA_MEMBERS_HPP_INCLUDED
#define BOOST_TYPEOF_POINTERS_DATA_MEMBERS_HPP_INCLUDED
#include <boost/typeof/encode_decode_params.hpp>
#include <boost/typeof/encode_decode.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
namespace boost
{
namespace type_of
{
namespace
{
enum {PTR_DATA_MEM_ID = BOOST_TYPEOF_UNIQUE_ID()};
template<class V, class P0, class P1>
struct encode_type_impl<V, P0 P1::*>
{
typedef BOOST_TYPEOF_ENCODE_PARAMS(2, PTR_DATA_MEM_ID) type;
};
template<class Iter>
struct decode_type_impl<mpl::size_t<PTR_DATA_MEM_ID>, Iter>
{
typedef Iter iter0;
BOOST_TYPEOF_DECODE_PARAMS(2)
template<class T> struct workaround{
typedef p0 T::* type;
};
typedef typename workaround<p1>::type type;
typedef iter2 iter;
};
}
}
}
#endif//BOOST_TYPEOF_POINTERS_DATA_MEMBERS_HPP_INCLUDED

View File

@@ -1,45 +0,0 @@
// Copyright (C) 2004 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_TYPEOF_REGISTER_FUNCTIONS_HPP_INCLUDED
#define BOOST_TYPEOF_REGISTER_FUNCTIONS_HPP_INCLUDED
#include <boost/preprocessor/repetition/enum.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/inc.hpp>
#include <boost/preprocessor/dec.hpp>
#include <boost/preprocessor/if.hpp>
#include <boost/preprocessor/arithmetic/add.hpp>
#include <boost/preprocessor/iteration/iterate.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
#ifndef BOOST_TYPEOF_LIMIT_FUNCTION_ARITY
#define BOOST_TYPEOF_LIMIT_FUNCTION_ARITY 10
#endif
enum
{
FUN_ID = BOOST_TYPEOF_UNIQUE_ID(),
FUN_PTR_ID = FUN_ID + 1 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
FUN_REF_ID = FUN_ID + 2 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
MEM_FUN_ID = FUN_ID + 3 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
CONST_MEM_FUN_ID = FUN_ID + 4 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
VOLATILE_MEM_FUN_ID = FUN_ID + 5 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY),
VOLATILE_CONST_MEM_FUN_ID = FUN_ID + 6 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY)
};
namespace boost
{
namespace type_of
{
# define BOOST_PP_ITERATION_LIMITS (0, BOOST_TYPEOF_LIMIT_FUNCTION_ARITY)
# define BOOST_PP_FILENAME_1 <boost/typeof/register_functions_iterate.hpp>
# include BOOST_PP_ITERATE()
}
}
#endif//BOOST_TYPEOF_REGISTER_FUNCTIONS_HPP_INCLUDED

View File

@@ -1,84 +0,0 @@
// Copyright (C) 2004 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#include <boost/typeof/encode_decode_params.hpp>
#define n BOOST_PP_ITERATION()
namespace
{
// function pointers
template<class V, class R BOOST_PP_ENUM_TRAILING_PARAMS(n, class P)>
struct encode_type_impl<V, R(*)(BOOST_PP_ENUM_PARAMS(n, P))>
{
typedef R BOOST_PP_CAT(P, n);
typedef BOOST_TYPEOF_ENCODE_PARAMS(BOOST_PP_INC(n), FUN_PTR_ID + n) type;
};
template<class Iter>
struct decode_type_impl<mpl::size_t<FUN_PTR_ID + n>, Iter>
{
typedef Iter iter0;
BOOST_TYPEOF_DECODE_PARAMS(BOOST_PP_INC(n))
typedef BOOST_PP_CAT(p, n)(*type)(BOOST_PP_ENUM_PARAMS(n, p));
typedef BOOST_PP_CAT(iter, BOOST_PP_INC(n)) iter;
};
// function references
template<class V, class R BOOST_PP_ENUM_TRAILING_PARAMS(n, class P)>
struct encode_type_impl<V, R(&)(BOOST_PP_ENUM_PARAMS(n, P))>
{
typedef R BOOST_PP_CAT(P, n);
typedef BOOST_TYPEOF_ENCODE_PARAMS(BOOST_PP_INC(n), FUN_REF_ID + n) type;
};
template<class Iter>
struct decode_type_impl<mpl::size_t<FUN_REF_ID + n>, Iter>
{
typedef Iter iter0;
BOOST_TYPEOF_DECODE_PARAMS(BOOST_PP_INC(n))
typedef BOOST_PP_CAT(p, n)(&type)(BOOST_PP_ENUM_PARAMS(n, p));
typedef BOOST_PP_CAT(iter, BOOST_PP_INC(n)) iter;
};
// functions
template<class V, class R BOOST_PP_ENUM_TRAILING_PARAMS(n, class P)>
struct encode_type_impl<V, R(BOOST_PP_ENUM_PARAMS(n, P))>
{
typedef R BOOST_PP_CAT(P, n);
typedef BOOST_TYPEOF_ENCODE_PARAMS(BOOST_PP_INC(n), FUN_ID + n) type;
};
template<class Iter>
struct decode_type_impl<mpl::size_t<FUN_ID + n>, Iter>
{
typedef Iter iter0;
BOOST_TYPEOF_DECODE_PARAMS(BOOST_PP_INC(n))
typedef BOOST_PP_CAT(p, n)(type)(BOOST_PP_ENUM_PARAMS(n, p));
typedef BOOST_PP_CAT(iter, BOOST_PP_INC(n)) iter;
};
// member functions
#define BOOST_TYPEOF_qualifier
#define BOOST_TYPEOF_id MEM_FUN_ID
#include <boost/typeof/register_mem_functions.hpp>
#define BOOST_TYPEOF_qualifier const
#define BOOST_TYPEOF_id CONST_MEM_FUN_ID
#include <boost/typeof/register_mem_functions.hpp>
#define BOOST_TYPEOF_qualifier volatile
#define BOOST_TYPEOF_id VOLATILE_MEM_FUN_ID
#include <boost/typeof/register_mem_functions.hpp>
#define BOOST_TYPEOF_qualifier volatile const
#define BOOST_TYPEOF_id VOLATILE_CONST_MEM_FUN_ID
#include <boost/typeof/register_mem_functions.hpp>
}
#undef n

View File

@@ -1,64 +0,0 @@
// Copyright (C) 2004 Arkadiy Vertleyb
// Copyright (C) 2004 Peder Holt
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_TYPEOF_REGISTER_FUNDAMENTAL_HPP_INCLUDED
#define BOOST_TYPEOF_REGISTER_FUNDAMENTAL_HPP_INCLUDED
#include <boost/typeof/typeof.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
BOOST_TYPEOF_REGISTER_TYPE(unsigned char)
BOOST_TYPEOF_REGISTER_TYPE(unsigned short)
BOOST_TYPEOF_REGISTER_TYPE(unsigned int)
BOOST_TYPEOF_REGISTER_TYPE(unsigned long)
BOOST_TYPEOF_REGISTER_TYPE(signed char)
BOOST_TYPEOF_REGISTER_TYPE(signed short)
BOOST_TYPEOF_REGISTER_TYPE(signed int)
BOOST_TYPEOF_REGISTER_TYPE(signed long)
BOOST_TYPEOF_REGISTER_TYPE(bool)
BOOST_TYPEOF_REGISTER_TYPE(char)
BOOST_TYPEOF_REGISTER_TYPE(float)
BOOST_TYPEOF_REGISTER_TYPE(double)
BOOST_TYPEOF_REGISTER_TYPE(long double)
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
// If the following line fails to compile and you're using the Intel
// compiler, see http://lists.boost.org/MailArchives/boost-users/msg06567.php,
// and define BOOST_NO_INTRINSIC_WCHAR_T on the command line.
BOOST_TYPEOF_REGISTER_TYPE(wchar_t)
#endif
#if (defined(BOOST_MSVC) && (BOOST_MSVC == 1200)) \
|| (defined(BOOST_INTEL_CXX_VERSION) && defined(_MSC_VER) && (BOOST_INTEL_CXX_VERSION <= 600)) \
|| (defined(__BORLANDC__) && (__BORLANDC__ == 0x600) && (_MSC_VER == 1200))
BOOST_TYPEOF_REGISTER_TYPE(unsigned __int8)
BOOST_TYPEOF_REGISTER_TYPE(__int8)
BOOST_TYPEOF_REGISTER_TYPE(unsigned __int16)
BOOST_TYPEOF_REGISTER_TYPE(__int16)
BOOST_TYPEOF_REGISTER_TYPE(unsigned __int32)
BOOST_TYPEOF_REGISTER_TYPE(__int32)
#ifdef __BORLANDC__
BOOST_TYPEOF_REGISTER_TYPE(unsigned __int64)
BOOST_TYPEOF_REGISTER_TYPE(__int64)
#endif
#endif
# if defined(BOOST_HAS_LONG_LONG)
BOOST_TYPEOF_REGISTER_TYPE(::boost::ulong_long_type)
BOOST_TYPEOF_REGISTER_TYPE(::boost::long_long_type)
#elif defined(BOOST_HAS_MS_INT64)
BOOST_TYPEOF_REGISTER_TYPE(unsigned __int64)
BOOST_TYPEOF_REGISTER_TYPE(__int64)
#endif
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TYPE(void)
#endif
#endif//BOOST_TYPEOF_REGISTER_FUNDAMENTAL_HPP_INCLUDED

View File

@@ -1,32 +0,0 @@
// Copyright (C) 2004 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#include <boost/typeof/encode_decode_params.hpp>
// member functions
template<class V, class T, class R BOOST_PP_ENUM_TRAILING_PARAMS(n, class P)>
struct encode_type_impl<V, R(T::*)(BOOST_PP_ENUM_PARAMS(n, P)) BOOST_TYPEOF_qualifier>
{
typedef R BOOST_PP_CAT(P, n);
typedef T BOOST_PP_CAT(P, BOOST_PP_INC(n));
typedef BOOST_TYPEOF_ENCODE_PARAMS(BOOST_PP_ADD(n, 2), BOOST_TYPEOF_id + n) type;
};
template<class Iter>
struct decode_type_impl<mpl::size_t<BOOST_TYPEOF_id + n>, Iter>
{
typedef Iter iter0;
BOOST_TYPEOF_DECODE_PARAMS(BOOST_PP_ADD(n, 2))
template<class T> struct workaround{
typedef BOOST_PP_CAT(p, n)(T::*type)(BOOST_PP_ENUM_PARAMS(n, p)) BOOST_TYPEOF_qualifier;
};
typedef typename workaround<BOOST_PP_CAT(p, BOOST_PP_INC(n))>::type type;
typedef BOOST_PP_CAT(iter, BOOST_PP_ADD(n, 2)) iter;
};
// undef parameters
#undef BOOST_TYPEOF_id
#undef BOOST_TYPEOF_qualifier

8
include/boost/typeof/std/bitset.hpp Executable file → Normal file
View File

@@ -2,16 +2,12 @@
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
// This is a generated file -- please do not modify by hand.
#ifndef BOOST_TYPEOF_STD_bitset_hpp_INCLUDED
#define BOOST_TYPEOF_STD_bitset_hpp_INCLUDED
// This header is no longer useful and is only retained for compatibility
#include <bitset>
#include <boost/typeof/typeof.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
BOOST_TYPEOF_REGISTER_TEMPLATE(std::bitset, (size_t))
#endif//BOOST_TYPEOF_STD_bitset_hpp_INCLUDED

8
include/boost/typeof/std/complex.hpp Executable file → Normal file
View File

@@ -2,16 +2,12 @@
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
// This is a generated file -- please do not modify by hand.
#ifndef BOOST_TYPEOF_STD_complex_hpp_INCLUDED
#define BOOST_TYPEOF_STD_complex_hpp_INCLUDED
// This header is no longer useful and is only retained for compatibility
#include <complex>
#include <boost/typeof/typeof.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
BOOST_TYPEOF_REGISTER_TEMPLATE(std::complex, 1)
#endif//BOOST_TYPEOF_STD_complex_hpp_INCLUDED

11
include/boost/typeof/std/deque.hpp Executable file → Normal file
View File

@@ -2,20 +2,13 @@
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
// This is a generated file -- please do not modify by hand.
#ifndef BOOST_TYPEOF_STD_deque_hpp_INCLUDED
#define BOOST_TYPEOF_STD_deque_hpp_INCLUDED
// This header is no longer useful and is only retained for compatibility
#include <deque>
#include <boost/typeof/typeof.hpp>
#include <boost/typeof/std/memory.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::deque, 1)
#endif//BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::deque, 2)
#endif//BOOST_TYPEOF_STD_deque_hpp_INCLUDED

29
include/boost/typeof/std/fstream.hpp Executable file → Normal file
View File

@@ -2,38 +2,13 @@
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
// This is a generated file -- please do not modify by hand.
#ifndef BOOST_TYPEOF_STD_fstream_hpp_INCLUDED
#define BOOST_TYPEOF_STD_fstream_hpp_INCLUDED
// This header is no longer useful and is only retained for compatibility
#include <fstream>
#include <boost/typeof/typeof.hpp>
#include <boost/typeof/std/string.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_filebuf, 1)
#endif//BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_filebuf, 2)
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_ifstream, 1)
#endif//BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_ifstream, 2)
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_ofstream, 1)
#endif//BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_ofstream, 2)
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_fstream, 1)
#endif//BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_fstream, 2)
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TYPE(std::filebuf)
BOOST_TYPEOF_REGISTER_TYPE(std::ifstream)
BOOST_TYPEOF_REGISTER_TYPE(std::ofstream)
BOOST_TYPEOF_REGISTER_TYPE(std::fstream)
#endif//BOOST_TYPEOF_COMPLIANT
#endif//BOOST_TYPEOF_STD_fstream_hpp_INCLUDED

43
include/boost/typeof/std/functional.hpp Executable file → Normal file
View File

@@ -2,48 +2,13 @@
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
// This is a generated file -- please do not modify by hand.
#ifndef BOOST_TYPEOF_STD_functional_hpp_INCLUDED
#define BOOST_TYPEOF_STD_functional_hpp_INCLUDED
#include <functional>
// This header is no longer useful and is only retained for compatibility
#include <boost/typeof/typeof.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
BOOST_TYPEOF_REGISTER_TEMPLATE(std::unary_function, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::binary_function, 3)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::plus, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::minus, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::multiplies, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::divides, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::modulus, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::negate, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::equal_to, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::not_equal_to, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::greater, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::less, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::greater_equal, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::less_equal, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::logical_and, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::logical_or, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::logical_not, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::unary_negate, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::binary_negate, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::binder1st, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::binder2nd, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::pointer_to_unary_function, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::pointer_to_binary_function, 3)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::mem_fun_t, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::mem_fun1_t, 3)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::mem_fun_ref_t, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::mem_fun1_ref_t, 3)
#if !BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::const_mem_fun_t, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::const_mem_fun1_t, 3)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::const_mem_fun_ref_t, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::const_mem_fun1_ref_t, 3)
#endif//BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1)
#include <boost/config.hpp>
#include <functional>
#endif//BOOST_TYPEOF_STD_functional_hpp_INCLUDED

12
include/boost/typeof/std/iostream.hpp Executable file → Normal file
View File

@@ -2,21 +2,13 @@
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
// This is a generated file -- please do not modify by hand.
#ifndef BOOST_TYPEOF_STD_iostream_hpp_INCLUDED
#define BOOST_TYPEOF_STD_iostream_hpp_INCLUDED
// This header is no longer useful and is only retained for compatibility
#include <iostream>
#include <boost/typeof/typeof.hpp>
#include <boost/typeof/std/string.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
BOOST_TYPEOF_REGISTER_TEMPLATE(std::fpos, 1)
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_ios, 1)
#endif//BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_ios, 2)
#endif//BOOST_TYPEOF_STD_iostream_hpp_INCLUDED

19
include/boost/typeof/std/istream.hpp Executable file → Normal file
View File

@@ -2,28 +2,13 @@
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
// This is a generated file -- please do not modify by hand.
#ifndef BOOST_TYPEOF_STD_istream_hpp_INCLUDED
#define BOOST_TYPEOF_STD_istream_hpp_INCLUDED
// This header is no longer useful and is only retained for compatibility
#include <istream>
#include <boost/typeof/typeof.hpp>
#include <boost/typeof/std/string.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_istream, 1)
#endif//BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_istream, 2)
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_iostream, 1)
#endif//BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_iostream, 2)
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TYPE(std::istream)
BOOST_TYPEOF_REGISTER_TYPE(std::iostream)
#endif//BOOST_TYPEOF_COMPLIANT
#endif//BOOST_TYPEOF_STD_istream_hpp_INCLUDED

66
include/boost/typeof/std/iterator.hpp Executable file → Normal file
View File

@@ -2,75 +2,13 @@
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
// This is a generated file -- please do not modify by hand.
#ifndef BOOST_TYPEOF_STD_iterator_hpp_INCLUDED
#define BOOST_TYPEOF_STD_iterator_hpp_INCLUDED
// This header is no longer useful and is only retained for compatibility
#include <iterator>
#include <boost/typeof/typeof.hpp>
#include <boost/typeof/std/string.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
BOOST_TYPEOF_REGISTER_TEMPLATE(std::iterator_traits, 1)
#if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1)
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::iterator, 2)
#endif//BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::iterator, 3)
#else
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::iterator, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::iterator, 3)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::iterator, 4)
#endif//BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::iterator, 5)
#endif//BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1)
BOOST_TYPEOF_REGISTER_TYPE(std::input_iterator_tag)
BOOST_TYPEOF_REGISTER_TYPE(std::output_iterator_tag)
BOOST_TYPEOF_REGISTER_TYPE(std::forward_iterator_tag)
BOOST_TYPEOF_REGISTER_TYPE(std::bidirectional_iterator_tag)
BOOST_TYPEOF_REGISTER_TYPE(std::random_access_iterator_tag)
#if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1)
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::reverse_iterator, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::reverse_iterator, 3)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::reverse_iterator, 4)
#endif//BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::reverse_iterator, 5)
#else
BOOST_TYPEOF_REGISTER_TEMPLATE(std::reverse_iterator, 1)
#endif//BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::back_insert_iterator, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::front_insert_iterator, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::insert_iterator, 1)
#if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1)
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::istream_iterator, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::istream_iterator, 2)
#endif//BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::istream_iterator, 3)
#else
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::istream_iterator, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::istream_iterator, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::istream_iterator, 3)
#endif//BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::istream_iterator, 4)
#endif//BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1)
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::ostream_iterator, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::ostream_iterator, 2)
#endif//BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::ostream_iterator, 3)
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::istreambuf_iterator, 1)
#endif//BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::istreambuf_iterator, 2)
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::ostreambuf_iterator, 1)
#endif//BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::ostreambuf_iterator, 2)
#endif//BOOST_TYPEOF_STD_iterator_hpp_INCLUDED

11
include/boost/typeof/std/list.hpp Executable file → Normal file
View File

@@ -2,20 +2,13 @@
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
// This is a generated file -- please do not modify by hand.
#ifndef BOOST_TYPEOF_STD_list_hpp_INCLUDED
#define BOOST_TYPEOF_STD_list_hpp_INCLUDED
// This header is no longer useful and is only retained for compatibility
#include <list>
#include <boost/typeof/typeof.hpp>
#include <boost/typeof/std/memory.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::list, 1)
#endif//BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::list, 2)
#endif//BOOST_TYPEOF_STD_list_hpp_INCLUDED

33
include/boost/typeof/std/locale.hpp Executable file → Normal file
View File

@@ -2,41 +2,12 @@
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
// This is a generated file -- please do not modify by hand.
#ifndef BOOST_TYPEOF_STD_locale_hpp_INCLUDED
#define BOOST_TYPEOF_STD_locale_hpp_INCLUDED
// This header is no longer useful and is only retained for compatibility
#include <locale>
#include <boost/typeof/typeof.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
BOOST_TYPEOF_REGISTER_TYPE(std::locale)
BOOST_TYPEOF_REGISTER_TYPE(std::ctype_base)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::ctype, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::ctype_byname, 1)
BOOST_TYPEOF_REGISTER_TYPE(std::codecvt_base)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::codecvt, 3)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::codecvt_byname, 3)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::num_get, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::num_put, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::numpunct, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::numpunct_byname, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::collate, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::collate_byname, 1)
BOOST_TYPEOF_REGISTER_TYPE(std::time_base)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::time_get, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::time_get_byname, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::time_put, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::time_put_byname, 2)
BOOST_TYPEOF_REGISTER_TYPE(std::money_base)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::money_get, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::money_put, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::moneypunct, (class)(bool))
BOOST_TYPEOF_REGISTER_TEMPLATE(std::moneypunct_byname, (class)(bool))
BOOST_TYPEOF_REGISTER_TYPE(std::messages_base)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::messages, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::messages_byname, 1)
#endif//BOOST_TYPEOF_STD_locale_hpp_INCLUDED

17
include/boost/typeof/std/map.hpp Executable file → Normal file
View File

@@ -2,28 +2,15 @@
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
// This is a generated file -- please do not modify by hand.
#ifndef BOOST_TYPEOF_STD_map_hpp_INCLUDED
#define BOOST_TYPEOF_STD_map_hpp_INCLUDED
// This header is no longer useful and is only retained for compatibility
#include <map>
#include <boost/typeof/typeof.hpp>
#include <boost/typeof/std/memory.hpp>
#include <boost/typeof/std/functional.hpp>
#include <boost/typeof/std/utility.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::map, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::map, 3)
#endif//BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::map, 4)
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::multimap, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::multimap, 3)
#endif//BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::multimap, 4)
#endif//BOOST_TYPEOF_STD_map_hpp_INCLUDED

13
include/boost/typeof/std/memory.hpp Executable file → Normal file
View File

@@ -2,18 +2,13 @@
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
// This is a generated file -- please do not modify by hand.
#ifndef BOOST_TYPEOF_STD_memory_hpp_INCLUDED
#define BOOST_TYPEOF_STD_memory_hpp_INCLUDED
#include <memory>
// This header is no longer useful and is only retained for compatibility
#include <boost/typeof/typeof.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
BOOST_TYPEOF_REGISTER_TEMPLATE(std::allocator, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::raw_storage_iterator, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::auto_ptr, 1)
#include <boost/config.hpp>
#include <memory>
#endif//BOOST_TYPEOF_STD_memory_hpp_INCLUDED

14
include/boost/typeof/std/ostream.hpp Executable file → Normal file
View File

@@ -2,23 +2,13 @@
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
// This is a generated file -- please do not modify by hand.
#ifndef BOOST_TYPEOF_STD_ostream_hpp_INCLUDED
#define BOOST_TYPEOF_STD_ostream_hpp_INCLUDED
// This header is no longer useful and is only retained for compatibility
#include <ostream>
#include <boost/typeof/typeof.hpp>
#include <boost/typeof/std/string.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_ostream, 1)
#endif//BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_ostream, 2)
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TYPE(std::ostream)
#endif//BOOST_TYPEOF_COMPLIANT
#endif//BOOST_TYPEOF_STD_ostream_hpp_INCLUDED

11
include/boost/typeof/std/queue.hpp Executable file → Normal file
View File

@@ -2,20 +2,13 @@
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
// This is a generated file -- please do not modify by hand.
#ifndef BOOST_TYPEOF_STD_queue_hpp_INCLUDED
#define BOOST_TYPEOF_STD_queue_hpp_INCLUDED
// This header is no longer useful and is only retained for compatibility
#include <queue>
#include <boost/typeof/typeof.hpp>
#include <boost/typeof/std/memory.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::queue, 1)
#endif//BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::queue, 2)
#endif//BOOST_TYPEOF_STD_queue_hpp_INCLUDED

17
include/boost/typeof/std/set.hpp Executable file → Normal file
View File

@@ -2,27 +2,14 @@
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
// This is a generated file -- please do not modify by hand.
#ifndef BOOST_TYPEOF_STD_set_hpp_INCLUDED
#define BOOST_TYPEOF_STD_set_hpp_INCLUDED
// This header is no longer useful and is only retained for compatibility
#include <set>
#include <boost/typeof/typeof.hpp>
#include <boost/typeof/std/memory.hpp>
#include <boost/typeof/std/functional.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::set, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::set, 2)
#endif//BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::set, 3)
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::multiset, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::multiset, 2)
#endif//BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::multiset, 3)
#endif//BOOST_TYPEOF_STD_set_hpp_INCLUDED

33
include/boost/typeof/std/sstream.hpp Executable file → Normal file
View File

@@ -2,43 +2,14 @@
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
// This is a generated file -- please do not modify by hand.
#ifndef BOOST_TYPEOF_STD_sstream_hpp_INCLUDED
#define BOOST_TYPEOF_STD_sstream_hpp_INCLUDED
// This header is no longer useful and is only retained for compatibility
#include <sstream>
#include <boost/typeof/typeof.hpp>
#include <boost/typeof/std/string.hpp>
#include <boost/typeof/std/memory.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_stringbuf, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_stringbuf, 2)
#endif//BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_stringbuf, 3)
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_istringstream, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_istringstream, 2)
#endif//BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_istringstream, 3)
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_ostringstream, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_ostringstream, 2)
#endif//BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_ostringstream, 3)
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_stringstream, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_stringstream, 2)
#endif//BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_stringstream, 3)
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TYPE(std::stringbuf)
BOOST_TYPEOF_REGISTER_TYPE(std::istringstream)
BOOST_TYPEOF_REGISTER_TYPE(std::ostringstream)
BOOST_TYPEOF_REGISTER_TYPE(std::stringstream)
#endif//BOOST_TYPEOF_COMPLIANT
#endif//BOOST_TYPEOF_STD_sstream_hpp_INCLUDED

11
include/boost/typeof/std/stack.hpp Executable file → Normal file
View File

@@ -2,20 +2,13 @@
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
// This is a generated file -- please do not modify by hand.
#ifndef BOOST_TYPEOF_STD_stack_hpp_INCLUDED
#define BOOST_TYPEOF_STD_stack_hpp_INCLUDED
// This header is no longer useful and is only retained for compatibility
#include <stack>
#include <boost/typeof/typeof.hpp>
#include <boost/typeof/std/memory.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::stack, 1)
#endif//BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::stack, 2)
#endif//BOOST_TYPEOF_STD_stack_hpp_INCLUDED

11
include/boost/typeof/std/streambuf.hpp Executable file → Normal file
View File

@@ -2,20 +2,13 @@
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
// This is a generated file -- please do not modify by hand.
#ifndef BOOST_TYPEOF_STD_streambuf_hpp_INCLUDED
#define BOOST_TYPEOF_STD_streambuf_hpp_INCLUDED
// This header is no longer useful and is only retained for compatibility
#include <streambuf>
#include <boost/typeof/typeof.hpp>
#include <boost/typeof/std/string.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_streambuf, 1)
#endif//BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_streambuf, 2)
#endif//BOOST_TYPEOF_STD_streambuf_hpp_INCLUDED

16
include/boost/typeof/std/string.hpp Executable file → Normal file
View File

@@ -2,25 +2,13 @@
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
// This is a generated file -- please do not modify by hand.
#ifndef BOOST_TYPEOF_STD_string_hpp_INCLUDED
#define BOOST_TYPEOF_STD_string_hpp_INCLUDED
// This header is no longer useful and is only retained for compatibility
#include <string>
#include <boost/typeof/typeof.hpp>
#include <boost/typeof/std/memory.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
BOOST_TYPEOF_REGISTER_TEMPLATE(std::char_traits, 1)
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_string, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_string, 2)
#endif//BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_string, 3)
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TYPE(std::string)
#endif//BOOST_TYPEOF_COMPLIANT
#endif//BOOST_TYPEOF_STD_string_hpp_INCLUDED

8
include/boost/typeof/std/utility.hpp Executable file → Normal file
View File

@@ -2,16 +2,12 @@
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
// This is a generated file -- please do not modify by hand.
#ifndef BOOST_TYPEOF_STD_utility_hpp_INCLUDED
#define BOOST_TYPEOF_STD_utility_hpp_INCLUDED
// This header is no longer useful and is only retained for compatibility
#include <utility>
#include <boost/typeof/typeof.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
BOOST_TYPEOF_REGISTER_TEMPLATE(std::pair, 2)
#endif//BOOST_TYPEOF_STD_utility_hpp_INCLUDED

14
include/boost/typeof/std/valarray.hpp Executable file → Normal file
View File

@@ -2,22 +2,12 @@
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
// This is a generated file -- please do not modify by hand.
#ifndef BOOST_TYPEOF_STD_valarray_hpp_INCLUDED
#define BOOST_TYPEOF_STD_valarray_hpp_INCLUDED
// This header is no longer useful and is only retained for compatibility
#include <valarray>
#include <boost/typeof/typeof.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
BOOST_TYPEOF_REGISTER_TEMPLATE(std::valarray, 1)
BOOST_TYPEOF_REGISTER_TYPE(std::slice)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::slice_array, 1)
BOOST_TYPEOF_REGISTER_TYPE(std::gslice)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::gslice_array, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::mask_array, 1)
BOOST_TYPEOF_REGISTER_TEMPLATE(std::indirect_array, 1)
#endif//BOOST_TYPEOF_STD_valarray_hpp_INCLUDED

11
include/boost/typeof/std/vector.hpp Executable file → Normal file
View File

@@ -2,20 +2,13 @@
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
// This is a generated file -- please do not modify by hand.
#ifndef BOOST_TYPEOF_STD_vector_hpp_INCLUDED
#define BOOST_TYPEOF_STD_vector_hpp_INCLUDED
// This header is no longer useful and is only retained for compatibility
#include <vector>
#include <boost/typeof/typeof.hpp>
#include <boost/typeof/std/memory.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
#ifdef BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::vector, 1)
#endif//BOOST_TYPEOF_COMPLIANT
BOOST_TYPEOF_REGISTER_TEMPLATE(std::vector, 2)
#endif//BOOST_TYPEOF_STD_vector_hpp_INCLUDED

View File

@@ -1,148 +0,0 @@
// Copyright (C) 2004 Arkadiy Vertleyb
// Copyright (C) 2005 Peder Holt
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_TYPEOF_TEMPLATE_ENCODING_HPP_INCLUDED
#define BOOST_TYPEOF_TEMPLATE_ENCODING_HPP_INCLUDED
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/repetition/enum_trailing.hpp>
#include <boost/preprocessor/control/iif.hpp>
#include <boost/preprocessor/detail/is_unary.hpp>
#include <boost/preprocessor/repetition/repeat.hpp>
#include <boost/preprocessor/tuple/eat.hpp>
#include <boost/preprocessor/seq/transform.hpp>
#include <boost/preprocessor/seq/for_each_i.hpp>
#include <boost/typeof/encode_decode.hpp>
#include <boost/typeof/int_encoding.hpp>
#include <boost/typeof/type_template_param.hpp>
#include <boost/typeof/integral_template_param.hpp>
#include <boost/typeof/template_template_param.hpp>
// The template parameter description, entered by the user,
// is converted into a polymorphic "object"
// that is used to generate the code responsible for
// encoding/decoding the parameter, etc.
// make sure to cat the sequence first, and only then add the prefix.
#define BOOST_TYPEOF_MAKE_OBJ(elem) BOOST_PP_CAT(\
BOOST_TYPEOF_MAKE_OBJ,\
BOOST_PP_SEQ_CAT((_) BOOST_TYPEOF_TO_SEQ(elem))\
)
#define BOOST_TYPEOF_TO_SEQ(tokens) BOOST_TYPEOF_ ## tokens ## _BOOST_TYPEOF
// BOOST_TYPEOF_REGISTER_TEMPLATE
#define BOOST_TYPEOF_REGISTER_TEMPLATE(Name, Params)\
BOOST_TYPEOF_REGISTER_TEMPLATE_IMPL(\
Name,\
BOOST_TYPEOF_MAKE_OBJS(BOOST_TYPEOF_TOSEQ(Params)),\
BOOST_PP_SEQ_SIZE(BOOST_TYPEOF_TOSEQ(Params)),\
BOOST_TYPEOF_UNIQUE_ID())\
#define BOOST_TYPEOF_OBJECT_MAKER(s, data, elem)\
BOOST_TYPEOF_MAKE_OBJ(elem)
#define BOOST_TYPEOF_MAKE_OBJS(Params)\
BOOST_PP_SEQ_TRANSFORM(BOOST_TYPEOF_OBJECT_MAKER, ~, Params)
// As suggested by Paul Mensonides:
#define BOOST_TYPEOF_TOSEQ(x)\
BOOST_PP_IIF(\
BOOST_PP_IS_UNARY(x),\
x BOOST_PP_TUPLE_EAT(3), BOOST_PP_REPEAT\
)(x, BOOST_TYPEOF_TOSEQ_2, ~)
#define BOOST_TYPEOF_TOSEQ_2(z, n, _) (class)
// BOOST_TYPEOF_VIRTUAL
#define BOOST_TYPEOF_CAT_4(a, b, c, d) BOOST_TYPEOF_CAT_4_I(a, b, c, d)
#define BOOST_TYPEOF_CAT_4_I(a, b, c, d) a ## b ## c ## d
#define BOOST_TYPEOF_VIRTUAL(Fun, Obj)\
BOOST_TYPEOF_CAT_4(BOOST_TYPEOF_, BOOST_PP_SEQ_HEAD(Obj), _, Fun)
// BOOST_TYPEOF_SEQ_ENUM[_TRAILING][_1]
// Two versions provided due to reentrancy issue
#define BOOST_TYPEOF_SEQ_EXPAND_ELEMENT(z,n,seq)\
BOOST_PP_SEQ_ELEM(0,seq) (z,n,BOOST_PP_SEQ_ELEM(n,BOOST_PP_SEQ_ELEM(1,seq)))
#define BOOST_TYPEOF_SEQ_ENUM(seq,macro)\
BOOST_PP_ENUM(BOOST_PP_SEQ_SIZE(seq),BOOST_TYPEOF_SEQ_EXPAND_ELEMENT,(macro)(seq))
#define BOOST_TYPEOF_SEQ_ENUM_TRAILING(seq,macro)\
BOOST_PP_ENUM_TRAILING(BOOST_PP_SEQ_SIZE(seq),BOOST_TYPEOF_SEQ_EXPAND_ELEMENT,(macro)(seq))
#define BOOST_TYPEOF_SEQ_EXPAND_ELEMENT_1(z,n,seq)\
BOOST_PP_SEQ_ELEM(0,seq) (z,n,BOOST_PP_SEQ_ELEM(n,BOOST_PP_SEQ_ELEM(1,seq)))
#define BOOST_TYPEOF_SEQ_ENUM_1(seq,macro)\
BOOST_PP_ENUM(BOOST_PP_SEQ_SIZE(seq),BOOST_TYPEOF_SEQ_EXPAND_ELEMENT_1,(macro)(seq))
#define BOOST_TYPEOF_SEQ_ENUM_TRAILING_1(seq,macro)\
BOOST_PP_ENUM_TRAILING(BOOST_PP_SEQ_SIZE(seq),BOOST_TYPEOF_SEQ_EXPAND_ELEMENT_1,(macro)(seq))
//
#define BOOST_TYPEOF_PLACEHOLDER(z, n, elem)\
BOOST_TYPEOF_VIRTUAL(PLACEHOLDER, elem)(elem)
#define BOOST_TYPEOF_PLACEHOLDER_TYPES(z, n, elem)\
BOOST_TYPEOF_VIRTUAL(PLACEHOLDER_TYPES, elem)(elem, n)
#define BOOST_TYPEOF_REGISTER_TEMPLATE_ENCODE_PARAM(r, data, n, elem)\
BOOST_TYPEOF_VIRTUAL(ENCODE, elem)(elem, n)
#define BOOST_TYPEOF_REGISTER_TEMPLATE_DECODE_PARAM(r, data, n, elem)\
BOOST_TYPEOF_VIRTUAL(DECODE, elem)(elem, n)
#define BOOST_TYPEOF_REGISTER_TEMPLATE_PARAM_PAIR(z, n, elem) \
BOOST_TYPEOF_VIRTUAL(EXPANDTYPE, elem)(elem) BOOST_PP_CAT(P, n)
#define BOOST_TYPEOF_REGISTER_DEFAULT_TEMPLATE_TYPE(Name,Params,ID)\
Name< BOOST_PP_ENUM_PARAMS(BOOST_PP_SEQ_SIZE(Params), P) >
//Since we are creating an internal decode struct, we need to use different template names, T instead of P.
#define BOOST_TYPEOF_REGISTER_DECODER_TYPE_PARAM_PAIR(z,n,elem) \
BOOST_TYPEOF_VIRTUAL(EXPANDTYPE, elem)(elem) BOOST_PP_CAT(T, n)
//Default template param decoding
#define BOOST_TYPEOF_TYPEDEF_DECODED_TEMPLATE_TYPE(Name,Params)\
typedef Name<BOOST_PP_ENUM_PARAMS(BOOST_PP_SEQ_SIZE(Params),P)> type;
//Branch the decoding
#define BOOST_TYPEOF_TYPEDEF_DECODED_TYPE(Name,Params)\
BOOST_PP_IF(BOOST_TYPEOF_HAS_TEMPLATES(Params),\
BOOST_TYPEOF_TYPEDEF_DECODED_TEMPLATE_TEMPLATE_TYPE,\
BOOST_TYPEOF_TYPEDEF_DECODED_TEMPLATE_TYPE)(Name,Params)
#define BOOST_TYPEOF_REGISTER_TEMPLATE_IMPL(Name, Params, Size, ID)\
namespace boost{namespace type_of{namespace{\
BOOST_TYPEOF_REGISTER_TEMPLATE_TEMPLATE_IMPL(Name, Params, ID)\
template<class V\
BOOST_TYPEOF_SEQ_ENUM_TRAILING(Params, BOOST_TYPEOF_REGISTER_TEMPLATE_PARAM_PAIR)\
>\
struct encode_type_impl<V, Name<BOOST_PP_ENUM_PARAMS(Size, P)> >\
{\
typedef typename push_back<V, boost::mpl::size_t<ID> >::type V0;\
BOOST_PP_SEQ_FOR_EACH_I(BOOST_TYPEOF_REGISTER_TEMPLATE_ENCODE_PARAM, ~, Params)\
typedef BOOST_PP_CAT(V, Size) type;\
};\
template<class Iter>\
struct decode_type_impl<boost::mpl::size_t<ID>, Iter>\
{\
typedef Iter iter0;\
BOOST_PP_SEQ_FOR_EACH_I(BOOST_TYPEOF_REGISTER_TEMPLATE_DECODE_PARAM, ~, Params)\
BOOST_TYPEOF_TYPEDEF_DECODED_TYPE(Name, Params)\
typedef BOOST_PP_CAT(iter, Size) iter;\
};\
}}}
#endif//BOOST_TYPEOF_TEMPLATE_ENCODING_HPP_INCLUDED

View File

@@ -1,126 +0,0 @@
// Copyright (C) 2005 Peder Holt
// Copyright (C) 2005 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_TYPEOF_TEMPLATE_TEMPLATE_PARAM_HPP_INCLUDED
#define BOOST_TYPEOF_TEMPLATE_TEMPLATE_PARAM_HPP_INCLUDED
#include <boost/preprocessor/logical/or.hpp>
#include <boost/preprocessor/seq/fold_left.hpp>
#include <boost/preprocessor/seq/enum.hpp>
#define BOOST_TYPEOF_MAKE_OBJ_template(x) BOOST_TYPEOF_TEMPLATE_PARAM(x)
#define BOOST_TYPEOF_TEMPLATE(X) template(X) BOOST_TYPEOF_EAT
#define BOOST_TYPEOF_template(X) (template(X))
#define BOOST_TYPEOF_TEMPLATE_PARAM(Params)\
(TEMPLATE_PARAM)\
(Params)
#define BOOST_TYPEOF_TEMPLATE_PARAM_GETPARAMS(This)\
BOOST_TYPEOF_TOSEQ(BOOST_PP_SEQ_ELEM(1, This))
//Encode / decode this
#define BOOST_TYPEOF_TEMPLATE_PARAM_ENCODE(This, n)\
typedef typename encode_template<BOOST_PP_CAT(V, n),\
BOOST_PP_CAT(P, n)<BOOST_TYPEOF_SEQ_ENUM(BOOST_TYPEOF_MAKE_OBJS(BOOST_TYPEOF_TEMPLATE_PARAM_GETPARAMS(This)),BOOST_TYPEOF_PLACEHOLDER)>\
>::type BOOST_PP_CAT(V, BOOST_PP_INC(n));
#define BOOST_TYPEOF_TEMPLATE_PARAM_DECODE(This, n)\
typedef decode_template< BOOST_PP_CAT(iter, n) > BOOST_PP_CAT(d, n);\
typedef typename BOOST_PP_CAT(d, n)::type BOOST_PP_CAT(P, n);\
typedef typename BOOST_PP_CAT(d, n)::iter BOOST_PP_CAT(iter,BOOST_PP_INC(n));
// template<class, unsigned int, ...> class
#define BOOST_TYPEOF_TEMPLATE_PARAM_EXPANDTYPE(This) \
template <BOOST_PP_SEQ_ENUM(BOOST_TYPEOF_TEMPLATE_PARAM_GETPARAMS(This))> class
#define BOOST_TYPEOF_TEMPLATE_PARAM_PLACEHOLDER(Param)\
Nested_Template_Template_Arguments_Not_Supported
//'template<class,int> class' is reduced to 'class'
#define BOOST_TYPEOF_TEMPLATE_PARAM_DECLARATION_TYPE(Param) class
// T3<int, (unsigned int)0, ...>
#define BOOST_TYPEOF_TEMPLATE_PARAM_PLACEHOLDER_TYPES(Param, n)\
BOOST_PP_CAT(T,n)<BOOST_TYPEOF_SEQ_ENUM_1(BOOST_TYPEOF_MAKE_OBJS(BOOST_TYPEOF_TEMPLATE_PARAM_GETPARAMS(Param)),BOOST_TYPEOF_PLACEHOLDER)>
#define BOOST_TYPEOF_TEMPLATE_PARAM_ISTEMPLATE 1
////////////////////////////
// move to encode_decode?
namespace boost
{
namespace type_of
{
namespace
{
template<class V, class Type_Not_Registered_With_Typeof_System> struct encode_template_impl;
template<class T, class Iter> struct decode_template_impl;
}
template<class V, class T> struct encode_template
: encode_template_impl<V, T>
{};
template<class Iter> struct decode_template
: decode_template_impl<typename Iter::type, typename Iter::next>
{};
}
}
////////////////////////////
// move to template_encoding.hpp?
//Template template registration
#define BOOST_TYPEOF_REGISTER_TYPE_FOR_TEMPLATE_TEMPLATE(Name,Params,ID)\
template<class V\
BOOST_TYPEOF_SEQ_ENUM_TRAILING(Params,BOOST_TYPEOF_REGISTER_TEMPLATE_PARAM_PAIR)\
>\
struct encode_template_impl<V,Name<\
BOOST_PP_ENUM_PARAMS(\
BOOST_PP_SEQ_SIZE(Params),\
P)> >\
: push_back<V, mpl::size_t<ID> >\
{\
};\
template<class Iter> struct decode_template_impl<mpl::size_t<ID>, Iter>\
{\
BOOST_PP_REPEAT(BOOST_PP_SEQ_SIZE(Params),BOOST_TYPEOF_TYPEDEF_INT_PN,_)\
typedef Name<BOOST_TYPEOF_SEQ_ENUM(Params,BOOST_TYPEOF_PLACEHOLDER)> type;\
typedef Iter iter;\
};
#define BOOST_TYPEOF_TYPEDEF_INT_PN(z,n,Params) typedef int BOOST_PP_CAT(P,n);
#define BOOST_TYPEOF_REGISTER_NOTHING(Name,Params,ID)
//Template template param decoding
#define BOOST_TYPEOF_TYPEDEF_DECODED_TEMPLATE_TEMPLATE_TYPE(Name,Params)\
template<BOOST_TYPEOF_SEQ_ENUM(Params,BOOST_TYPEOF_REGISTER_DECLARE_DECODER_TYPE_PARAM_PAIR)>\
struct decode_params;\
template<BOOST_TYPEOF_SEQ_ENUM(Params,BOOST_TYPEOF_REGISTER_DECODER_TYPE_PARAM_PAIR)>\
struct decode_params<BOOST_TYPEOF_SEQ_ENUM(Params,BOOST_TYPEOF_PLACEHOLDER_TYPES) >\
{\
typedef Name<BOOST_PP_ENUM_PARAMS(BOOST_PP_SEQ_SIZE(Params),T)> type;\
};\
typedef typename decode_params<BOOST_PP_ENUM_PARAMS(BOOST_PP_SEQ_SIZE(Params),P)>::type type;
#define BOOST_TYPEOF_REGISTER_DECLARE_DECODER_TYPE_PARAM_PAIR(z,n,elem) \
BOOST_TYPEOF_VIRTUAL(DECLARATION_TYPE, elem)(elem) BOOST_PP_CAT(T, n)
// BOOST_TYPEOF_HAS_TEMPLATES
#define BOOST_TYPEOF_HAS_TEMPLATES(Params)\
BOOST_PP_SEQ_FOLD_LEFT(BOOST_TYPEOF_HAS_TEMPLATES_OP, 0, Params)
#define BOOST_TYPEOF_HAS_TEMPLATES_OP(s, state, elem)\
BOOST_PP_OR(state, BOOST_TYPEOF_VIRTUAL(ISTEMPLATE, elem))
//Define template template arguments
#define BOOST_TYPEOF_REGISTER_TEMPLATE_TEMPLATE_IMPL(Name,Params,ID)\
BOOST_PP_IF(BOOST_TYPEOF_HAS_TEMPLATES(Params),\
BOOST_TYPEOF_REGISTER_NOTHING,\
BOOST_TYPEOF_REGISTER_TYPE_FOR_TEMPLATE_TEMPLATE)(Name,Params,ID)
#endif //BOOST_TYPEOF_TEMPLATE_TEMPLATE_PARAM_HPP_INCLUDED

View File

@@ -1,24 +0,0 @@
// Copyright (C) 2004 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_TYPEOF_TYPE_ENCODING_HPP_INCLUDED
#define BOOST_TYPEOF_TYPE_ENCODING_HPP_INCLUDED
#define BOOST_TYPEOF_REGISTER_TYPE_IMPL(T, Id) \
\
template<class V> struct encode_type_impl<V, T > \
: push_back<V, mpl::size_t<Id> > \
{}; \
template<class Iter> struct decode_type_impl<mpl::size_t<Id>, Iter> \
{ \
typedef T type; \
typedef Iter iter; \
};
#define BOOST_TYPEOF_REGISTER_TYPE(Type) \
namespace boost{namespace type_of{namespace{ \
BOOST_TYPEOF_REGISTER_TYPE_IMPL(Type, BOOST_TYPEOF_UNIQUE_ID()) \
}}}
#endif//BOOST_TYPEOF_TYPE_ENCODING_HPP_INCLUDED

View File

@@ -1,37 +0,0 @@
// Copyright (C) 2005 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_TYPEOF_TYPE_TEMPLATE_PARAM_HPP_INCLUDED
#define BOOST_TYPEOF_TYPE_TEMPLATE_PARAM_HPP_INCLUDED
#define BOOST_TYPEOF_class_BOOST_TYPEOF (class)
#define BOOST_TYPEOF_typename_BOOST_TYPEOF (typename)
#define BOOST_TYPEOF_MAKE_OBJ_class BOOST_TYPEOF_TYPE_PARAM
#define BOOST_TYPEOF_MAKE_OBJ_typename BOOST_TYPEOF_TYPE_PARAM
#define BOOST_TYPEOF_TYPE_PARAM\
(TYPE_PARAM)
#define BOOST_TYPEOF_TYPE_PARAM_EXPANDTYPE(Param) class
// TYPE_PARAM "virtual functions" implementation
#define BOOST_TYPEOF_TYPE_PARAM_ENCODE(This, n)\
typedef typename encode_type<\
BOOST_PP_CAT(V, n),\
BOOST_PP_CAT(P, n)\
>::type BOOST_PP_CAT(V, BOOST_PP_INC(n));
#define BOOST_TYPEOF_TYPE_PARAM_DECODE(This, n)\
typedef decode_type< BOOST_PP_CAT(iter, n) > BOOST_PP_CAT(d, n);\
typedef typename BOOST_PP_CAT(d, n)::type BOOST_PP_CAT(P, n);\
typedef typename BOOST_PP_CAT(d, n)::iter BOOST_PP_CAT(iter, BOOST_PP_INC(n));
#define BOOST_TYPEOF_TYPE_PARAM_PLACEHOLDER(Param) int
#define BOOST_TYPEOF_TYPE_PARAM_DECLARATION_TYPE(Param) class
#define BOOST_TYPEOF_TYPE_PARAM_PLACEHOLDER_TYPES(Param, n) BOOST_PP_CAT(T,n)
#define BOOST_TYPEOF_TYPE_PARAM_ISTEMPLATE 0
#endif//BOOST_TYPEOF_TYPE_TEMPLATE_PARAM_HPP_INCLUDED

85
include/boost/typeof/typeof.hpp Executable file → Normal file
View File

@@ -1,89 +1,34 @@
// Copyright (C) 2004 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
// 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)
#ifndef BOOST_TYPEOF_TYPEOF_HPP_INCLUDED
#define BOOST_TYPEOF_TYPEOF_HPP_INCLUDED
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/seq/cat.hpp>
#include <boost/preprocessor/expand.hpp>
#include <boost/config.hpp>
#include <boost/config/workaround.hpp>
// implementation
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1900)
#include <boost/typeof/config.hpp>
# include <boost/typeof/msvc/typeof_impl.hpp>
// BOOST_TYPEOF, BOOST_TYPEOF_TPL
# define BOOST_TYPEOF_REGISTER_TYPE(x)
# define BOOST_TYPEOF_REGISTER_TEMPLATE(x, params)
#if defined(BOOST_TYPEOF_NATIVE) && defined(BOOST_MSVC)
# define BOOST_TYPEOF_TEXT "using msvc 'native' imlementation"
# include <boost/typeof/message.hpp>
# include <boost/typeof/msvc/typeof_impl.hpp>
#else
#elif defined(BOOST_TYPEOF_COMPLIANT)
# define BOOST_TYPEOF_TEXT "using compliant imlementation"
# include <boost/typeof/message.hpp>
# include <boost/typeof/typeof_impl.hpp>
# include <boost/typeof/decltype.hpp>
#else//BOOST_TYPEOF_NATIVE
# define BOOST_TYPEOF_TEXT "using native imlementation"
# include <boost/typeof/message.hpp>
# if !defined BOOST_TYPEOF_KEYWORD
# define BOOST_TYPEOF_KEYWORD __typeof__
# endif
/* Native __typeof__ can accept either type or value.
Something like "int()" can be viewed either way, but
__typeof__ consideres it a type. We force it otherwise
to ensure consistensy with emulation */
namespace boost { namespace type_of {
template<class T> T& ensure_obj(const T&);
}}
# define BOOST_TYPEOF(expr) BOOST_TYPEOF_KEYWORD(boost::type_of::ensure_obj(expr))
# define BOOST_TYPEOF_TPL BOOST_TYPEOF
#endif
// auto
#define BOOST_AUTO(Var, Expr) BOOST_TYPEOF(Expr) Var = Expr
#define BOOST_AUTO_TPL(Var, Expr) BOOST_TYPEOF_TPL(Expr) Var = Expr
// lvalue typeof
# include <boost/typeof/lvalue_typeof.hpp>
// type/template encoding
#if defined(BOOST_TYPEOF_COMPLIANT)
# include <boost/typeof/type_encoding.hpp>
# include <boost/typeof/template_encoding.hpp>
#else //BOOST_TYPEOF_NATIVE
# define BOOST_TYPEOF_REGISTER_TYPE(x)
# define BOOST_TYPEOF_REGISTER_TEMPLATE(x, params)
#endif
#define BOOST_TYPEOF_UNIQUE_ID()\
BOOST_TYPEOF_REGISTRATION_GROUP * 0x10000 + __LINE__
BOOST_TYPEOF_REGISTRATION_GROUP * 0x10000 + __LINE__
#define BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()\
<boost/typeof/increment_registration_group.hpp>
<boost/typeof/incr_registration_group.hpp>
// register stuff
#include <boost/typeof/register_fundamental.hpp>
#if defined(BOOST_TYPEOF_COMPLIANT)
# include <boost/typeof/modifiers.hpp>
# include <boost/typeof/pointers_data_members.hpp>
# include <boost/typeof/register_functions.hpp>
#else //BOOST_TYPEOF_NATIVE
#endif
// auto
#define BOOST_AUTO(Var, Expr) auto Var = Expr
#define BOOST_AUTO_TPL(Var, Expr) auto Var = Expr
#endif//BOOST_TYPEOF_TYPEOF_HPP_INCLUDED

View File

@@ -1,59 +0,0 @@
// Copyright (C) 2004, 2005 Arkadiy Vertleyb
// Copyright (C) 2005 Peder Holt
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_TYPEOF_TYPEOF_IMPL_HPP_INCLUDED
#define BOOST_TYPEOF_TYPEOF_IMPL_HPP_INCLUDED
#include <boost/mpl/size_t.hpp>
#include <boost/preprocessor/repetition/enum.hpp>
#include <boost/typeof/encode_decode.hpp>
#include <boost/typeof/vector.hpp>
#define BOOST_TYPEOF_VECTOR(n) BOOST_PP_CAT(boost::type_of::vector, n)
#define BOOST_TYPEOF_sizer_item(z, n, _)\
char item ## n[V::item ## n ::value];
namespace boost { namespace type_of {
template<class V>
struct sizer
{
// char item0[V::item0::value];
// char item1[V::item1::value];
// ...
BOOST_PP_REPEAT(BOOST_TYPEOF_LIMIT_SIZE, BOOST_TYPEOF_sizer_item, ~)
};
template<class T>
sizer<typename encode_type<BOOST_TYPEOF_VECTOR(0)<>, T>::type> encode(const T&);
}}
#undef BOOST_TYPEOF_sizer_item
namespace boost { namespace type_of {
template<class V>
struct decode_begin
{
typedef typename decode_type<typename V::begin>::type type;
};
}}
#define BOOST_TYPEOF_TYPEITEM(z, n, expr)\
boost::mpl::size_t<sizeof(boost::type_of::encode(expr).item ## n)>
#define BOOST_TYPEOF_ENCODED_VECTOR(Expr) \
BOOST_TYPEOF_VECTOR(BOOST_TYPEOF_LIMIT_SIZE)< \
BOOST_PP_ENUM(BOOST_TYPEOF_LIMIT_SIZE, BOOST_TYPEOF_TYPEITEM, Expr) \
>
#define BOOST_TYPEOF(Expr)\
boost::type_of::decode_begin<BOOST_TYPEOF_ENCODED_VECTOR(Expr) >::type
#define BOOST_TYPEOF_TPL typename BOOST_TYPEOF
#endif//BOOST_TYPEOF_COMPLIANT_TYPEOF_IMPL_HPP_INCLUDED

View File

@@ -1,87 +0,0 @@
// Copyright (C) 2005 Arkadiy Vertleyb
// Copyright (C) 2005 Peder Holt
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_TYPEOF_VECTOR_HPP_INCLUDED
#define BOOST_TYPEOF_VECTOR_HPP_INCLUDED
#include <boost/mpl/int.hpp>
#include <boost/preprocessor/enum_params.hpp>
#include <boost/preprocessor/repeat.hpp>
#include <boost/preprocessor/repeat_from_to.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/inc.hpp>
#include <boost/preprocessor/comma_if.hpp>
#ifndef BOOST_TYPEOF_LIMIT_SIZE
# define BOOST_TYPEOF_LIMIT_SIZE 50
#endif
// iterator
#define BOOST_TYPEOF_spec_iter(z, n, _)\
template<class V>\
struct v_iter<V, mpl::int_<n> >\
{\
typedef typename V::item ## n type;\
typedef v_iter<V, mpl::int_<n + 1> > next;\
};
namespace boost{ namespace type_of{
template<class V, class Pos> struct v_iter; // not defined
BOOST_PP_REPEAT(BOOST_TYPEOF_LIMIT_SIZE, BOOST_TYPEOF_spec_iter, ~)
}}
#undef BOOST_TYPEOF_spec_iter
// vector
#define BOOST_TYPEOF_typedef_item(z, n, _)\
typedef P ## n item ## n;
#define BOOST_TYPEOF_typedef_fake_item(z, n, _)\
typedef mpl::int_<1> item ## n;
#define BOOST_TYPEOF_define_vector(z, n, _)\
template<BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_COMMA_IF(n) class T = void>\
struct vector ## n\
{\
typedef v_iter<vector ## n, boost::mpl::int_<0> > begin;\
BOOST_PP_REPEAT(n, BOOST_TYPEOF_typedef_item, ~)\
BOOST_PP_REPEAT_FROM_TO(n, BOOST_TYPEOF_LIMIT_SIZE, BOOST_TYPEOF_typedef_fake_item, ~)\
};
namespace boost{ namespace type_of{
BOOST_PP_REPEAT(BOOST_PP_INC(BOOST_TYPEOF_LIMIT_SIZE), BOOST_TYPEOF_define_vector, ~)
}}
#undef BOOST_TYPEOF_typedef_item
#undef BOOST_TYPEOF_typedef_fake_item
#undef BOOST_TYPEOF_define_vector
// push_back
#define BOOST_TYPEOF_spec_push_back(z, n, _)\
template<BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_COMMA_IF(n) class T>\
struct push_back<BOOST_PP_CAT(boost::type_of::vector, n)<BOOST_PP_ENUM_PARAMS(n, P)>, T>\
{\
typedef BOOST_PP_CAT(boost::type_of::vector, BOOST_PP_INC(n))<\
BOOST_PP_ENUM_PARAMS(n, P) BOOST_PP_COMMA_IF(n) T\
> type;\
};
namespace boost{ namespace type_of{
template<class V, class T> struct push_back; // not defined
BOOST_PP_REPEAT(BOOST_TYPEOF_LIMIT_SIZE, BOOST_TYPEOF_spec_push_back, ~)
}}
#undef BOOST_TYPEOF_spec_push_back
#endif//BOOST_TYPEOF_COMPLIANT_VECTOR_HPP_INCLUDED

16
index.html Normal file
View File

@@ -0,0 +1,16 @@
<!--
Copyright (C) 2006 Arkadiy Vertleyb
Use, modification and distribution is subject to the Boost Software
License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
-->
<html>
<head>
<meta http-equiv="refresh" content="0; URL=../../doc/html/typeof.html">
</head>
<body>
Automatic redirection failed, please go to
<a href="../../doc/html/typeof.html">../../doc/html/typeof.html</a>
</body>
</html>

17
meta/libraries.json Normal file
View File

@@ -0,0 +1,17 @@
{
"key": "typeof",
"name": "Typeof",
"authors": [
"Arkadiy Vertleyb",
"Peder Holt"
],
"description": "Typeof operator emulation.",
"category": [
"Emulation"
],
"maintainers": [
"Arkadiy Vertleyb <vertleyb -at- hotmail.com>",
"Peder Holt <peder.holt -at- gmail.com>"
],
"cxxstd": "11"
}

54
test/CMakeLists.txt Normal file
View File

@@ -0,0 +1,54 @@
# Copyright 2018-2020 Peter Dimov
# 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
include(BoostTest OPTIONAL RESULT_VARIABLE HAVE_BOOST_TEST)
if(NOT HAVE_BOOST_TEST)
return()
endif()
macro(typeof_test s1)
string(MAKE_C_IDENTIFIER ${s1} n1)
boost_test(TYPE compile SOURCES ${s1} ${ARGN} COMPILE_DEFINITIONS BOOST_TYPEOF_NATIVE NAME ${n1}_native)
boost_test(TYPE compile SOURCES ${s1} ${ARGN} COMPILE_DEFINITIONS BOOST_TYPEOF_EMULATION NAME ${n1}_emulation)
endmacro()
set(BOOST_TEST_LINK_LIBRARIES Boost::typeof Boost::core Boost::type_traits Boost::static_assert)
set(tests
data_member.cpp
function.cpp
function_binding.cpp
function_ptr.cpp
function_ptr_from_tpl.cpp
function_ref.cpp
member_function.cpp
modifiers.cpp
msvc_typeof_in_lambda.cpp
nested_typedef.cpp
noncopyable.cpp
std.cpp
template_dependent.cpp
template_enum.cpp
template_int.cpp
template_multiword.cpp
template_tpl.cpp
template_type.cpp
type.cpp
)
foreach(test IN LISTS tests)
typeof_test(${test})
endforeach()
boost_test(TYPE run SOURCES odr1.cpp odr2.cpp COMPILE_DEFINITIONS BOOST_TYPEOF_NATIVE NAME odr_native)
boost_test(TYPE run SOURCES odr1.cpp odr2.cpp COMPILE_DEFINITIONS BOOST_TYPEOF_EMULATED NAME odr_emulated)
boost_test(TYPE run SOURCES odr_no_uns1.cpp odr_no_uns2.cpp COMPILE_DEFINITIONS BOOST_TYPEOF_EMULATED NAME odr_no_uns)

61
test/Jamfile.v2 Normal file
View File

@@ -0,0 +1,61 @@
# Copyright (C) 2006 Vladimir Prus
# Copyright (C) 2006 Arkadiy Vertleyb
# Use, modification and distribution is subject to the Boost Software
# License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
# Boost Typeof Library test Jamfile
import testing ;
import set ;
project : requirements
<library>/boost/core//boost_core
;
# The special requirement is not ported yet.
#
#local rule special-requirements ( toolset variant : properties * )
#{
# # Tru64/CXX6.5 hangs on most tests, so just turn it off completely.
#
# if $(UNIX) && $(OS) = OSF
# {
# switch $(toolset)
# {
# case tru64cxx65* : properties =
# [ replace-properties $(properties) : <build>no ] ;
# }
# }
#
# return $(properties) ;
#}
rule typeof-test ( source )
{
return [ compile $(source) : <define>BOOST_TYPEOF_NATIVE :
$(source:B)_native ]
[ compile $(source) : <define>BOOST_TYPEOF_EMULATION :
$(source:B)_emulation ]
;
}
rule all-tests ( )
{
local all ;
# for local t in [ set.difference [ glob *.cpp ] : odr1.cpp odr2.cpp ]
for local t in [ set.difference [ glob *.cpp ] : [ glob odr*.cpp ] ]
{
all += [ typeof-test $(t) ] ;
}
all += [ run odr1.cpp odr2.cpp : : : <define>BOOST_TYPEOF_NATIVE :
odr_native ] ;
all += [ run odr1.cpp odr2.cpp : : : <define>BOOST_TYPEOF_EMULATION :
odr_emulation ] ;
all += [ run odr_no_uns1.cpp odr_no_uns2.cpp : : : <define>BOOST_TYPEOF_EMULATION :
odr_no_uns ] ;
return $(all) ;
}
test-suite "typeof"
: [ all-tests ]
;

View File

@@ -0,0 +1,17 @@
# Copyright 2018, 2019 Peter Dimov
# 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
cmake_minimum_required(VERSION 3.5...3.16)
project(cmake_install_test LANGUAGES CXX)
find_package(boost_typeof REQUIRED)
add_executable(main main.cpp)
target_link_libraries(main Boost::typeof)
enable_testing()
add_test(main main)
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)

View File

@@ -0,0 +1,11 @@
// Copyright 2017, 2021 Peter Dimov.
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/typeof/typeof.hpp>
int main()
{
BOOST_AUTO(x, 5);
return x == 5? 0: 1;
}

View File

@@ -0,0 +1,34 @@
# Copyright 2018, 2019 Peter Dimov
# 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
cmake_minimum_required(VERSION 3.5...3.20)
project(cmake_subdir_test LANGUAGES CXX)
add_subdirectory(../.. boostorg/typeof)
set(deps
# Primary dependencies
config
# Secondary dependencies
)
foreach(dep IN LISTS deps)
add_subdirectory(../../../${dep} boostorg/${dep})
endforeach()
# --target check
add_executable(main main.cpp)
target_link_libraries(main Boost::typeof)
enable_testing()
add_test(main main)
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)

View File

@@ -0,0 +1,11 @@
// Copyright 2017, 2021 Peter Dimov.
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/typeof/typeof.hpp>
int main()
{
BOOST_AUTO(x, 5);
return x == 5? 0: 1;
}

11
test/data_member.cpp Normal file
View File

@@ -0,0 +1,11 @@
// Copyright (C) 2006 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#include "test.hpp"
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
struct x;
BOOST_TYPEOF_REGISTER_TYPE(x)
BOOST_STATIC_ASSERT(boost::type_of::test<double x::*>::value);

10
test/function.cpp Normal file
View File

@@ -0,0 +1,10 @@
// Copyright (C) 2006 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#include "test.hpp"
BOOST_STATIC_ASSERT(boost::type_of::test<void()>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<double(bool)>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<void(...)>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<float(int, ...)>::value);

22
test/function_binding.cpp Normal file
View File

@@ -0,0 +1,22 @@
// Copyright (C) 2006 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#include <boost/typeof/typeof.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/static_assert.hpp>
int foo1(double);
int foo2(...);
int foo3(int, ...);
typedef int(&FREF1)(double);
typedef int(&FREF2)(...);
typedef int(&FREF3)(int, ...);
FREF1 fref1 = *foo1;
FREF2 fref2 = *foo2;
FREF3 fref3 = *foo3;
BOOST_STATIC_ASSERT((boost::is_same<BOOST_TYPEOF(fref1), int(double)>::value));
BOOST_STATIC_ASSERT((boost::is_same<BOOST_TYPEOF(fref2), int(...)>::value));
BOOST_STATIC_ASSERT((boost::is_same<BOOST_TYPEOF(fref3), int(int,...)>::value));

26
test/function_ptr.cpp Normal file
View File

@@ -0,0 +1,26 @@
// Copyright (C) 2006 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#include "test.hpp"
BOOST_STATIC_ASSERT(boost::type_of::test<double(*)()>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<double(*)(int, double, short, char*, bool, char, float, long, unsigned short)>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<void(*)()>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<void(*)(int, double, short, char*, bool, char, float, long, unsigned short)>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<void(*)(...)>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<void(*)(int, double, short, char*, bool, char, float, long, unsigned short, ...)>::value);
// check that const gets stripped from function pointer
int foo1(double);
int foo2(...);
typedef int(*PTR1)(double);
typedef int(*PTR2)(...);
typedef const PTR1 CPTR1;
typedef const PTR2 CPTR2;
CPTR1 cptr1 = foo1;
CPTR2 cptr2 = foo2;
BOOST_STATIC_ASSERT((boost::is_same<BOOST_TYPEOF(cptr1), PTR1>::value));
BOOST_STATIC_ASSERT((boost::is_same<BOOST_TYPEOF(cptr2), PTR2>::value));

View File

@@ -0,0 +1,28 @@
// Copyright (C) 2006 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#include <boost/typeof/typeof.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/static_assert.hpp>
void f1() {}
void f2(...) {}
template<class T>
struct tpl1
{
typedef BOOST_TYPEOF_TPL(&f1) type;
};
template<class T>
struct tpl2
{
typedef BOOST_TYPEOF_TPL(&f2) type;
};
typedef void(*fun1_type)();
typedef void(*fun2_type)(...);
BOOST_STATIC_ASSERT((boost::is_same<tpl1<void>::type, fun1_type>::value));
BOOST_STATIC_ASSERT((boost::is_same<tpl2<void>::type, fun2_type>::value));

10
test/function_ref.cpp Normal file
View File

@@ -0,0 +1,10 @@
// Copyright (C) 2006 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#include "test.hpp"
BOOST_STATIC_ASSERT(boost::type_of::test<void(&)()>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<int(&)(int, short)>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<int(&)(...)>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<int(&)(int,...)>::value);

10
test/member_function.cpp Normal file
View File

@@ -0,0 +1,10 @@
// Copyright (C) 2006 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#include "test.hpp"
BOOST_STATIC_ASSERT(boost::type_of::test<double(*)()>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<double(*)(int, double, short, char*, bool, char, float, long, unsigned short)>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<void(*)()>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<void(*)(int, double, short, char*, bool, char, float, long, unsigned short)>::value);

19
test/modifiers.cpp Normal file
View File

@@ -0,0 +1,19 @@
// Copyright (C) 2006 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#include "test.hpp"
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
struct x{};
BOOST_TYPEOF_REGISTER_TYPE(x)
BOOST_STATIC_ASSERT(boost::type_of::test<x*>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<x&>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<x[20]>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<const x>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<volatile x>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<volatile const x>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<const x&>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<const x*>::value);

View File

@@ -0,0 +1,74 @@
// Copyright (C) 2018 Tobias Loew
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#include <boost/config.hpp>
#include <boost/config/pragma_message.hpp>
#if defined(BOOST_NO_CXX11_LAMBDAS)
BOOST_PRAGMA_MESSAGE("Skipping test due to BOOST_NO_CXX11_LAMBDAS")
int main() {}
#elif defined(BOOST_NO_CXX11_AUTO_DECLARATIONS)
BOOST_PRAGMA_MESSAGE("Skipping test due to BOOST_NO_CXX11_AUTO_DECLARATIONS")
int main() {}
#else
#include <boost/typeof/typeof.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
namespace detail {
template<class T> inline T& deref(T& r) {
return r;
}
template<class T>
struct wrapper {
typedef T type;
};
template<class T> wrapper<T> wrap(T&);
};
BOOST_TYPEOF_REGISTER_TEMPLATE(::detail::wrapper, 1)
void test_typeof_in_lambda() {
// Visual Studio 2015 (BOOST_MSVC == 1900) had an internal compiler error with Boost 1.65 and 1.66 when using BOOST_SCOPE_EXIT inside a lambda
// the error was due to a change of include in boost/typeof/typeof.hpp (<boost/typeof/decltype.hpp> instead of <boost/typeof/native.hpp>)
// This test is an more or less minimal extract from the BOOST_SCOPE_EXIT macro expansions
// worked also with VS 2015 in version 1.65/1.66
int n;
typedef BOOST_TYPEOF(::detail::wrap(::detail::deref(n))) n_type_wrapped;
typedef n_type_wrapped::type n_type;
int test;
auto check_property = [&n,&test]() {
// internal compiler error with VS 2015 in version 1.65/1.66
// minimal extract from
//BOOST_SCOPE_EXIT(test) {
// test = 42;
//}BOOST_SCOPE_EXIT_END
// this compiles always (as long as the one before outside the lambda has the same name)
typedef BOOST_TYPEOF(::detail::wrap(::detail::deref(n))) n_type_wrapped;
typedef n_type_wrapped::type n_type;
// this fails with internal compiler error with VS 2015 in version 1.65/1.66
typedef BOOST_TYPEOF(::detail::wrap(::detail::deref(test))) test_type_wrapped;
typedef test_type_wrapped::type test_type;
};
}
int main() {
test_typeof_in_lambda();
return 0;
}
#endif

37
test/nested_typedef.cpp Normal file
View File

@@ -0,0 +1,37 @@
// Copyright (C) 2006 Peder Holt
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#include <boost/typeof/typeof.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/static_assert.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
void do_int(int) {}
struct {
template<typename T>
T operator[](const T& n) {return n;}
} int_p;
template<typename T> struct wrap
{
BOOST_TYPEOF_NESTED_TYPEDEF_TPL(nested,int_p[& do_int])
typedef typename nested::type type;
};
BOOST_TYPEOF_REGISTER_TEMPLATE(wrap,1)
template<typename T> struct parser
{
struct __rule {
static T & a_placeholder;
BOOST_TYPEOF_NESTED_TYPEDEF_TPL(nested,int_p[a_placeholder])
typedef typename nested::type type;
};
};
BOOST_STATIC_ASSERT((boost::is_same<wrap<double>::type,void(*)(int)>::value));
BOOST_STATIC_ASSERT((boost::is_same<parser<wrap<double> >::__rule::type,wrap<double> >::value));

36
test/noncopyable.cpp Normal file
View File

@@ -0,0 +1,36 @@
// Copyright (C) 2006 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#include "test.hpp"
#include <boost/noncopyable.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
struct x : boost::noncopyable
{
void foo() {}
void bar() const {}
};
BOOST_TYPEOF_REGISTER_TYPE(x)
x& make_ref()
{
static x result;
return result;
}
const x& make_const_ref()
{
static x result;
return result;
}
void foo()
{
BOOST_AUTO(& v1, make_ref());
v1.foo();
BOOST_AUTO(const& v2, make_const_ref());
v2.bar();
}

17
test/odr.hpp Normal file
View File

@@ -0,0 +1,17 @@
// Copyright (C) 2006 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
// boostinspect:nounnamed
#include <boost/typeof/typeof.hpp>
struct foo
{
typedef BOOST_TYPEOF(1 + 2.5) type;
};
namespace
{
typedef foo::type type;
}

12
test/odr1.cpp Normal file
View File

@@ -0,0 +1,12 @@
// Copyright (C) 2006 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#include "odr.hpp"
#include <iostream>
int main()
{
std::cout << "No ODR violation detected" << std::endl;
return 0;
}

5
test/odr2.cpp Normal file
View File

@@ -0,0 +1,5 @@
// Copyright (C) 2006 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#include "odr.hpp"

20
test/odr_no_uns1.cpp Normal file
View File

@@ -0,0 +1,20 @@
// Copyright (C) 2006 Arkadiy Vertleyb
// Copyright (C) 2006 Peder Holt
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#include "odr_no_uns1.hpp"
#include "odr_no_uns2.hpp"
void odr_no_uns1()
{
odr_test_1 t1;
odr_test_2 t2;
BOOST_AUTO(v1, t1);
BOOST_AUTO(v2, t2);
}
int main()
{
return 0;
}

19
test/odr_no_uns1.hpp Normal file
View File

@@ -0,0 +1,19 @@
// Copyright (C) 2006 Arkadiy Vertleyb
// Copyright (C) 2006 Peder Holt
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_TYPEOF_ODR_NO_UNS1_HPP_INCLUDED
#define BOOST_TYPEOF_ODR_NO_UNS1_HPP_INCLUDED
#define BOOST_TYPEOF_SUPPRESS_UNNAMED_NAMESPACE
#include <boost/typeof/typeof.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
struct odr_test_1
{};
BOOST_TYPEOF_REGISTER_TYPE(odr_test_1)
#endif//BOOST_TYPEOF_ODR_NO_UNS1_HPP_INCLUDED

15
test/odr_no_uns2.cpp Normal file
View File

@@ -0,0 +1,15 @@
// Copyright (C) 2006 Arkadiy Vertleyb
// Copyright (C) 2006 Peder Holt
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#include "odr_no_uns2.hpp"
#include "odr_no_uns1.hpp"
void odr_no_uns2()
{
odr_test_1 t1;
odr_test_2 t2;
BOOST_AUTO(v1, t1);
BOOST_AUTO(v2, t2);
}

19
test/odr_no_uns2.hpp Normal file
View File

@@ -0,0 +1,19 @@
// Copyright (C) 2006 Arkadiy Vertleyb
// Copyright (C) 2006 Peder Holt
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_TYPEOF_ODR_NO_UNS2_HPP_INCLUDED
#define BOOST_TYPEOF_ODR_NO_UNS2_HPP_INCLUDED
#define BOOST_TYPEOF_SUPPRESS_UNNAMED_NAMESPACE
#include <boost/typeof/typeof.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
struct odr_test_2
{};
BOOST_TYPEOF_REGISTER_TYPE(odr_test_2)
#endif//BOOST_TYPEOF_ODR_NO_UNS2_HPP_INCLUDED

78
test/std.cpp Normal file
View File

@@ -0,0 +1,78 @@
// Copyright (C) 2006 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#include "test.hpp"
#include <boost/typeof/std/string.hpp>
#include <boost/typeof/std/deque.hpp>
#include <boost/typeof/std/list.hpp>
#include <boost/typeof/std/queue.hpp>
#include <boost/typeof/std/stack.hpp>
#include <boost/typeof/std/vector.hpp>
#include <boost/typeof/std/map.hpp>
#include <boost/typeof/std/set.hpp>
#include <boost/typeof/std/bitset.hpp>
#include <boost/typeof/std/functional.hpp>
#include <boost/typeof/std/valarray.hpp>
#include <boost/typeof/std/locale.hpp>
#include <boost/typeof/std/iostream.hpp>
#include <boost/typeof/std/streambuf.hpp>
#include <boost/typeof/std/istream.hpp>
#include <boost/typeof/std/ostream.hpp>
#include <boost/typeof/std/sstream.hpp>
#include <boost/typeof/std/fstream.hpp>
#include <boost/typeof/std/iterator.hpp>
using namespace std;
// STL containers
BOOST_STATIC_ASSERT(boost::type_of::test<string>::value);
BOOST_STATIC_ASSERT(boost::type_of::test<deque<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<list<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<queue<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<stack<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<vector<int> >::value);
BOOST_STATIC_ASSERT((boost::type_of::test<map<int, int> >::value));
BOOST_STATIC_ASSERT((boost::type_of::test<multimap<int, int> >::value));
BOOST_STATIC_ASSERT(boost::type_of::test<set<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<multiset<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<bitset<10> >::value);
// function objects
#ifndef BOOST_NO_CXX98_FUNCTION_BASE
BOOST_STATIC_ASSERT((boost::type_of::test<unary_function<int, int> >::value));
BOOST_STATIC_ASSERT((boost::type_of::test<binary_function<int, int, int> >::value));
#endif//BOOST_NO_CXX98_FUNCTION_BASE
BOOST_STATIC_ASSERT(boost::type_of::test<plus<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<minus<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<multiplies<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<divides<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<modulus<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<negate<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<equal_to<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<not_equal_to<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<greater<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<less<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<greater_equal<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<less_equal<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<logical_and<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<logical_or<int> >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<logical_not<int> >::value);
#if BOOST_CXX_VERSION < 202000L
BOOST_STATIC_ASSERT(boost::type_of::test<unary_negate<negate<int> > >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<binary_negate<less<int> > >::value);
#endif
#ifndef BOOST_NO_CXX98_BINDERS
BOOST_STATIC_ASSERT(boost::type_of::test<binder1st<less<int> > >::value);
BOOST_STATIC_ASSERT(boost::type_of::test<binder2nd<less<int> > >::value);
#endif//BOOST_NO_CXX98_BINDERS
// valarray
BOOST_STATIC_ASSERT(boost::type_of::test<valarray<int> >::value);

View File

@@ -0,0 +1,15 @@
// Copyright (C) 2006 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#include "test.hpp"
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
template<class T, T n> struct t{};
BOOST_TYPEOF_REGISTER_TEMPLATE(t,
(class)
(BOOST_TYPEOF_INTEGRAL(P0))
)
BOOST_STATIC_ASSERT((boost::type_of::test<t<int, 5> >::value));

15
test/template_enum.cpp Normal file
View File

@@ -0,0 +1,15 @@
// Copyright (C) 2006 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#include "test.hpp"
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
enum E{ONE, TWO, THREE};
template<E e> struct t{};
BOOST_TYPEOF_REGISTER_TEMPLATE(t,
(BOOST_TYPEOF_INTEGRAL(E))
)
BOOST_STATIC_ASSERT(boost::type_of::test<t<TWO> >::value);

32
test/template_int.cpp Normal file
View File

@@ -0,0 +1,32 @@
// Copyright (C) 2006 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#include "test.hpp"
#include <climits>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
struct x;
BOOST_TYPEOF_REGISTER_TYPE(x)
template<
class T, char c, unsigned short us, int i, unsigned long ul,
bool b1, bool b2, signed char sc, unsigned u>
struct Tpl
{};
BOOST_TYPEOF_REGISTER_TEMPLATE(Tpl,
(class)
(char)
(unsigned short)
(int)
(unsigned long)
(bool)
(bool)
(signed char)
(unsigned)
)
BOOST_STATIC_ASSERT((boost::type_of::test<Tpl<int, 5, 4, -3, 2, true, false, -1, 5> >::value));
BOOST_STATIC_ASSERT((boost::type_of::test<Tpl<int, 1, 1, 0, ULONG_MAX, false, true, -1, 0> >::value));

View File

@@ -0,0 +1,14 @@
// Copyright (C) 2006 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#include "test.hpp"
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
template<unsigned long int n> struct t{};
BOOST_TYPEOF_REGISTER_TEMPLATE(t,
(BOOST_TYPEOF_INTEGRAL(unsigned long int))
)
BOOST_STATIC_ASSERT((boost::type_of::test<t<5> >::value));

26
test/template_tpl.cpp Normal file
View File

@@ -0,0 +1,26 @@
// Copyright (C) 2006 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#include "test.hpp"
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
template<class T, class U>
struct t0;
template<class T, int n>
struct t1;
template<template<class, class> class T, template<class, int> class U>
struct t2;
BOOST_TYPEOF_REGISTER_TEMPLATE(t0, 2)
BOOST_TYPEOF_REGISTER_TEMPLATE(t1, (class)(int))
BOOST_TYPEOF_REGISTER_TEMPLATE(t2,
(BOOST_TYPEOF_TEMPLATE(2))
(BOOST_TYPEOF_TEMPLATE((class)(int)))
)
BOOST_STATIC_ASSERT((boost::type_of::test<t2<t0, t1> >::value));

17
test/template_type.cpp Normal file
View File

@@ -0,0 +1,17 @@
// Copyright (C) 2006 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#include "test.hpp"
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
struct P1;
struct P2;
template<class P1, class P2> struct Tpl;
BOOST_TYPEOF_REGISTER_TYPE(P1)
BOOST_TYPEOF_REGISTER_TYPE(P2)
BOOST_TYPEOF_REGISTER_TEMPLATE(Tpl, 2)
BOOST_STATIC_ASSERT((boost::type_of::test<Tpl<P1, P2> >::value));

35
test/test.hpp Normal file
View File

@@ -0,0 +1,35 @@
// Copyright (C) 2005 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_TYPEOF_TEST_HPP_INCLUDED
#define BOOST_TYPEOF_TEST_HPP_INCLUDED
#include <boost/typeof/typeof.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/static_assert.hpp>
namespace boost { namespace type_of {
template<class T, class U>
struct test_wrapper{};
template<class T>
T test_make(T*);
template<class T>
struct test
{
BOOST_STATIC_CONSTANT(std::size_t,value = (boost::is_same<
BOOST_TYPEOF_TPL(test_make((test_wrapper<T, int>*)0)),
test_wrapper<T, int>
>::value)
);
};
}}
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::type_of::test_wrapper, 2)
#endif//BOOST_TYPEOF_TEST_HPP_INCLUDED

11
test/type.cpp Normal file
View File

@@ -0,0 +1,11 @@
// Copyright (C) 2006 Arkadiy Vertleyb
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
#include "test.hpp"
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
struct A;
BOOST_TYPEOF_REGISTER_TYPE(A)
BOOST_STATIC_ASSERT(boost::type_of::test<A>::value);