Compare commits

...

62 Commits

Author SHA1 Message Date
95b1ead06c Merge pull request #57 from grafikrobot/modular
Add support for modular build structure.
2025-05-03 03:11:14 +03:00
e46dd22b3c Enable example that was commented out to get clean builds. 2025-05-02 18:00:06 -05:00
1da3782f79 Move project global include to target local include. 2025-04-07 11:32:37 -05:00
71ff2a5254 Sync from upstream. 2025-04-04 21:39:13 -05:00
9238ef8e7f Avoid including deprecated atomic_count.hpp header. (#59)
boost/detail/atomic_count.hpp was moved into boost/smart_ptr/detail and
is now deprecated and emits warnings.
2025-03-01 16:25:20 -08:00
5ea93e34e1 gha update 2025-03-01 14:48:05 -08:00
40554e238c Fix lib build, re-enable some tests. 2024-08-14 23:22:20 -05:00
95854acc9a Update build deps. 2024-08-02 21:56:17 -05:00
b5bf79462e Move inter-lib dependencies to a project variable and into the build targets. 2024-07-23 22:34:22 -05:00
ec7442e3b7 Update copyright dates. 2024-07-20 22:52:03 -05:00
a27c2d5127 Bump B2 require to 5.2 2024-06-14 11:33:55 -05:00
64ca508153 Sync from upstream. 2024-06-02 13:49:17 -05:00
ece51fe0f7 Update ci.yml 2024-05-31 05:27:49 +03:00
399208b682 Make the library header-only in CMakeLists.txt 2024-05-31 04:48:39 +03:00
1c66828bb5 Add requires-b2 check to top-level build file. 2024-05-05 09:00:01 -05:00
fd72443067 Add missing NO_LIB usage requirements. 2024-04-28 20:15:04 -05:00
752185750d Switch to library requirements instead of source. As source puts extra source in install targets. 2024-03-29 21:15:58 -05:00
948578d5b4 Make the library modular usable. 2024-03-11 08:33:41 -05:00
b9170a02f1 cxx03 deprecated 2024-01-28 16:37:40 -08:00
f719cc1af5 Update ci.yml 2024-01-06 19:24:41 +02:00
ad15fefae7 Avoid -Wundef warnings 2024-01-06 16:30:15 +02:00
11f102a987 Revert "Don't double-rethrow std::exception_ptr (#53)"
This reverts commit ea70868a45.
2023-08-06 15:20:29 -07:00
fe23c01a93 Added sudo apt-get update before sudo apt-get install (#54)
* Added sudo apt-get update before sudo apt-get install

* Update gha
2023-08-05 13:19:51 -07:00
ea70868a45 Don't double-rethrow std::exception_ptr (#53)
It's unnecessary to throw and then rethrow std::exception_ptr, just derive clone_base separately.

nb. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110835
2023-08-04 18:28:03 -07:00
03aa58e06e GHA 2023-07-29 19:20:34 -07:00
0d69599d91 GHA update 2023-07-29 18:08:17 -07:00
652e8e01d2 GHA updates 2023-07-29 17:47:11 -07:00
b039b4ea18 Issue #49 2022-12-16 16:14:39 -08:00
89d8033fed Fix two cases of redefinition and hiding of local variables (#46) 2022-11-13 22:04:53 -08:00
bd347f048a refactor use core/enable_if.hpp over utility/enable_if.hpp (#44) 2022-08-31 21:59:50 -07:00
e2faee265d Merge pull request #43 from boostorg/pr/current-exception
Prefer using std::current_exception when available
2022-01-25 19:40:04 -08:00
7df9fc8a85 Merge pull request #41 from boostorg/pr/copy-exception
Use enable_current_exception instead of wrapexcept in copy_exception
2022-01-25 19:39:39 -08:00
9259706f08 Disable exception_ptr_test2 when exceptions aren't enabled 2022-01-26 01:49:45 +02:00
eafe6dbd5c Prefer using std::current_exception when available (refs #42) 2022-01-26 01:12:54 +02:00
941754ed23 Add exception_ptr_test2.cpp 2022-01-26 01:07:46 +02:00
0d205cd71f Use enable_current_exception instead of wrapexcept in copy_exception 2022-01-25 19:54:15 +02:00
b8e9e98b33 Categorized as "Error-handling" in meta/libraries.json 2021-11-06 15:03:14 -07:00
54f2228f78 suppress warning (#39)
MSVC warning C4100: 'x': unreferenced formal parameter
2021-10-05 18:37:31 -07:00
4d18ec3e0d Removed documentation references to BOOST_THROW_EXCEPTION_CURRENT_FUNCTION 2021-10-05 18:35:49 -07:00
929ae48aa0 Merge branch 'develop' into feature/exception_ptr_ctor 2021-10-01 15:03:12 -07:00
1dd151ae69 AppVeyor/GHA update 2021-10-01 15:02:19 -07:00
076211f4b4 AppVeyor matrix update 2021-09-30 22:59:30 -07:00
52da83a1d7 Removing 2a from clang++-8 2021-09-30 21:45:27 -07:00
1ed2045e07 Made std_exception_ptr_wrapper compatible with boost::throw_exception. 2021-09-30 19:28:36 -07:00
38769cfd6b Installing g++-11 in GHA/Ubuntu-20.0.4 2021-09-30 18:48:42 -07:00
fdfd8f49fb Removing Ubuntu 16.04 from GHA 2021-09-30 18:43:37 -07:00
c5367711b7 exception_ptr ctor for std::exception_ptr 2021-09-29 22:25:22 -07:00
3ae756dd49 Make library STATIC, remove unnecessary compile definitions 2021-06-10 04:35:48 +03:00
f93f374607 Regenerate CMakeLists.txt 2021-06-10 04:34:05 +03:00
5a5434e6e8 Update CMakeLists.txt 2021-06-10 01:14:07 +03:00
21f522e4b6 Pointing throw_exception documentation to Boost.ThrowException. 2021-02-16 22:56:32 -08:00
20c833978f Fix and unit test for issue #37 2021-02-11 16:02:14 -08:00
e69635b1a7 [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. (#36) 2021-01-19 17:33:31 -08:00
7c29501d59 add drone config [ci skip] (#35) 2021-01-07 23:36:55 -08:00
5abcc9fb50 Adding license file 2020-12-23 18:45:12 -08:00
18ace4a260 Updated documentation link in README.md 2020-12-23 18:44:11 -08:00
d133df008f README.md with a link to documentation 2020-12-22 23:37:51 -08:00
fdf1fee658 Added a link to LEAF in boost-exception.html 2020-12-22 19:13:46 -08:00
c445901088 GHA CI 2020-12-22 17:26:53 -08:00
083cfbafa3 Merge branch 'develop' of https://github.com/boostorg/exception into develop 2020-12-19 14:02:04 -08:00
8be818bc44 Added link to Boost LEAF 2020-12-19 14:01:57 -08:00
6a32b36566 Qualify call to copy_exception, because msvc-10.0 has std::copy_exception 2020-12-19 14:50:51 +02:00
65 changed files with 1136 additions and 246 deletions

59
.drone.star Normal file
View File

@ -0,0 +1,59 @@
# Use, modification, and distribution are
# subject to the Boost Software License, Version 1.0. (See accompanying
# file LICENSE.txt)
#
# Copyright Rene Rivera 2020.
# For Drone CI we use the Starlark scripting language to reduce duplication.
# As the yaml syntax for Drone CI is rather limited.
#
#
globalenv={}
linuxglobalimage="cppalliance/droneubuntu1404:1"
windowsglobalimage="cppalliance/dronevs2019"
def main(ctx):
return [
osx_cxx("TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,1 Job 0", "clang++", packages="", buildtype="boost", xcode_version="11.2", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': 'b6589fc6ab'}, globalenv=globalenv),
osx_cxx("TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,1 Job 1", "clang++", packages="", buildtype="boost", xcode_version="11.1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': '356a192b79'}, globalenv=globalenv),
osx_cxx("TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,1 Job 2", "clang++", packages="", buildtype="boost", xcode_version="11", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': 'da4b9237ba'}, globalenv=globalenv),
osx_cxx("TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,1 Job 3", "clang++", packages="", buildtype="boost", xcode_version="10.3", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': '77de68daec'}, globalenv=globalenv),
osx_cxx("TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,1 Job 4", "clang++", packages="", buildtype="boost", xcode_version="10.2", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': '1b64538924'}, globalenv=globalenv),
osx_cxx("TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,1 Job 5", "clang++", packages="", buildtype="boost", xcode_version="10.1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': 'ac3478d69a'}, globalenv=globalenv),
osx_cxx("TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,1 Job 6", "clang++", packages="", buildtype="boost", xcode_version="10", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': 'c1dfd96eea'}, globalenv=globalenv),
osx_cxx("TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,1 Job 7", "clang++", packages="", buildtype="boost", xcode_version="9.4", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': '902ba3cda1'}, globalenv=globalenv),
osx_cxx("TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,1 Job 8", "clang++", packages="", buildtype="boost", xcode_version="9.3", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': 'fe5dbbcea5'}, globalenv=globalenv),
osx_cxx("TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,1 Job 9", "clang++", packages="", buildtype="boost", xcode_version="9.2", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': '0ade7c2cf9'}, globalenv=globalenv),
osx_cxx("TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,1 Job 10", "clang++", packages="", buildtype="boost", xcode_version="9.1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': 'b1d5781111'}, globalenv=globalenv),
osx_cxx("TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,1 Job 11", "clang++", packages="", buildtype="boost", xcode_version="9", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': '17ba079149'}, globalenv=globalenv),
osx_cxx("TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,1 Job 12", "clang++", packages="", buildtype="boost", xcode_version="8.3", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': '7b52009b64'}, globalenv=globalenv),
osx_cxx("TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,1 Job 13", "clang++", packages="", buildtype="boost", xcode_version="8", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': 'bd307a3ec3'}, globalenv=globalenv),
osx_cxx("UBSAN=1 TOOLSET=clang COMPILER=clang++ CXXSTD Job 14", "clang++", packages="", buildtype="boost", environment={'UBSAN': '1', 'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '98,03,11,14,1z', 'UBSAN_OPTIONS': 'print_stacktrace=1', 'DRONE_JOB_UUID': 'fa35e19212'}, globalenv=globalenv),
linux_cxx("TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=98,03,11 Job 15", "g++-4.7", packages="g++-4.7", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-4.7', 'CXXSTD': '98,03,11', 'DRONE_JOB_UUID': 'f1abd67035'}, globalenv=globalenv),
linux_cxx("TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=98,03,11 Job 16", "g++-4.8", packages="g++-4.8", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-4.8', 'CXXSTD': '98,03,11', 'DRONE_JOB_UUID': '1574bddb75'}, globalenv=globalenv),
linux_cxx("TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=98,03,11 Job 17", "g++-4.9", packages="g++-4.9", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-4.9', 'CXXSTD': '98,03,11', 'DRONE_JOB_UUID': '0716d9708d'}, globalenv=globalenv),
linux_cxx("TOOLSET=gcc COMPILER=g++-5 CXXSTD=98,03,11,14 Job 18", "g++-5", packages="g++-5", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-5', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': '9e6a55b6b4'}, globalenv=globalenv),
linux_cxx("TOOLSET=gcc COMPILER=g++-6 CXXSTD=98,03,11,14 Job 19", "g++-6", packages="g++-6", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-6', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': 'b3f0c7f6bb'}, globalenv=globalenv),
linux_cxx("TOOLSET=gcc COMPILER=g++-7 CXXSTD=98,03,11,14 Job 20", "g++-7", packages="g++-7", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-7', 'CXXSTD': '98,03,11,14,17', 'DRONE_JOB_UUID': '91032ad7bb'}, globalenv=globalenv),
linux_cxx("TOOLSET=gcc COMPILER=g++-8 CXXSTD=98,03,11,14 Job 21", "g++-8", packages="g++-8", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-8', 'CXXSTD': '98,03,11,14,17', 'DRONE_JOB_UUID': '472b07b9fc'}, globalenv=globalenv),
linux_cxx("TOOLSET=gcc COMPILER=g++-9 CXXSTD=98,03,11,14 Job 22", "g++-9", packages="g++-9", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-9', 'CXXSTD': '98,03,11,14,17,2a', 'DRONE_JOB_UUID': '12c6fc06c9'}, globalenv=globalenv),
linux_cxx("UBSAN=1 TOOLSET=gcc COMPILER=g++-9 CXXSTD=98, Job 23", "g++-9", packages="g++-9", buildtype="boost", image=linuxglobalimage, environment={'UBSAN': '1', 'TOOLSET': 'gcc', 'COMPILER': 'g++-9', 'CXXSTD': '98,03,11,14,17,2a', 'UBSAN_OPTIONS': 'print_stacktrace=1', 'LINKFLAGS': '-fuse-ld=gold', 'DRONE_JOB_UUID': 'd435a6cdd7'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=/usr/bin/clang++ CXXST Job 24", "/usr/bin/clang++", packages="clang-3.3", llvm_os="precise", llvm_ver="3.8", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': '/usr/bin/clang++', 'CXXSTD': '98,03,11', 'DRONE_JOB_UUID': '4d134bc072'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=/usr/bin/clang++ CXXST Job 25", "/usr/bin/clang++", packages="clang-3.4", llvm_os="precise", llvm_ver="3.8", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': '/usr/bin/clang++', 'CXXSTD': '98,03,11', 'DRONE_JOB_UUID': 'f6e1126ced'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,1 Job 26", "clang++", packages="g++-4.9 g++-5 g++-6 clang-3.6 clang-3.7 clang-3.8 ruby-full ninja-build", llvm_os="precise", llvm_ver="3.8", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '98,03,11', 'DRONE_JOB_UUID': '887309d048'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=98, Job 27", "clang++", packages="clang-3.5 libstdc++-4.9-dev", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.5', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': 'bc33ea4e26'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=98, Job 28", "clang++", packages="clang-3.6 libstdc++-4.9-dev", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.6', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': '0a57cb53ba'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=98, Job 29", "clang++", packages="clang-3.7", llvm_os="precise", llvm_ver="3.7", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.7', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': '7719a1c782'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=98, Job 30", "clang++-3.8", packages="clang-3.8 libstdc++-4.9-dev", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.8', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': '22d200f867'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=98, Job 31", "clang++-3.9", packages="clang-3.9 libstdc++-4.9-dev", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.9', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': '632667547e'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=98, Job 32", "clang++-4.0", packages="clang-4.0", llvm_os="trusty", llvm_ver="4.0", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-4.0', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': 'cb4e5208b4'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=clang++-5.0 CXXSTD=98, Job 33", "clang++-5.0", packages="clang-5.0", llvm_os="trusty", llvm_ver="5.0", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-5.0', 'CXXSTD': '98,03,11,14,1z', 'DRONE_JOB_UUID': 'b6692ea5df'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=clang++-6.0 CXXSTD=98, Job 34", "clang++-6.0", packages="clang-6.0", llvm_os="trusty", llvm_ver="6.0", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-6.0', 'CXXSTD': '98,03,11,14,17', 'DRONE_JOB_UUID': 'f1f836cb4e'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=clang++-7 CXXSTD=98,03 Job 35", "clang++-7", packages="clang-7", llvm_os="trusty", llvm_ver="7", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-7', 'CXXSTD': '98,03,11,14,17,2a', 'DRONE_JOB_UUID': '972a67c481'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=clang++-8 CXXSTD=98,03 Job 36", "clang++-8", packages="clang-8", llvm_os="trusty", llvm_ver="8", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-8', 'CXXSTD': '98,03,11,14,17,2a', 'DRONE_JOB_UUID': 'fc074d5013'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=clang++-9 CXXSTD=98,03 Job 37", "clang++-9", packages="clang-9", llvm_os="xenial", llvm_ver="9", buildtype="boost", image="cppalliance/droneubuntu1604:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-9', 'CXXSTD': '98,03,11,14,17,2a', 'DRONE_JOB_UUID': 'cb7a1d775e'}, globalenv=globalenv),
linux_cxx("UBSAN=1 TOOLSET=clang COMPILER=clang++-8 CXXS Job 38", "clang++-8", packages="clang-8", llvm_os="trusty", llvm_ver="8", buildtype="boost", image=linuxglobalimage, environment={'UBSAN': '1', 'TOOLSET': 'clang', 'COMPILER': 'clang++-8', 'CXXSTD': '98,03,11,14,17,2a', 'UBSAN_OPTIONS': 'print_stacktrace=1', 'DRONE_JOB_UUID': '5b384ce32d'}, globalenv=globalenv),
]
# from https://github.com/boostorg/boost-ci
load("@boost_ci//ci/drone/:functions.star", "linux_cxx","windows_cxx","osx_cxx","freebsd_cxx")

3
.drone/after-success.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash

3
.drone/before-install.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash

3
.drone/before-script.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash

47
.drone/boost.sh Executable file
View File

@ -0,0 +1,47 @@
#!/bin/bash
set -ex
export TRAVIS_BUILD_DIR=$(pwd)
export DRONE_BUILD_DIR=$(pwd)
export TRAVIS_BRANCH=$DRONE_BRANCH
export VCS_COMMIT_ID=$DRONE_COMMIT
export GIT_COMMIT=$DRONE_COMMIT
export REPO_NAME=$DRONE_REPO
export PATH=~/.local/bin:/usr/local/bin:$PATH
echo '==================================> BEFORE_INSTALL'
. .drone/before-install.sh
echo '==================================> INSTALL'
gem install asciidoctor || echo "ERROR. Failed to install asciidoctor"
gem install coderay || echo "ERROR. Failed to install coderay"
cd ..
git clone -b master --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
git submodule update --init tools/build
git submodule update --init tools/inspect
git submodule update --init libs/config
git submodule update --init tools/boostdep
rm -rf libs/exception
mkdir libs/exception
cp -r $TRAVIS_BUILD_DIR/* libs/exception
python tools/boostdep/depinst/depinst.py exception
./bootstrap.sh
./b2 headers
cd libs/exception
echo '==================================> BEFORE_SCRIPT'
. $DRONE_BUILD_DIR/.drone/before-script.sh
echo '==================================> SCRIPT'
echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam
../../b2 test toolset=$TOOLSET cxxstd=$CXXSTD variant=debug,release ${UBSAN:+cxxflags=-fsanitize=address,undefined cxxflags=-fno-sanitize-recover=address,undefined linkflags=-fsanitize=address,undefined debug-symbols=on} ${LINKFLAGS:+linkflags=$LINKFLAGS}
../../b2 exception-handling=off rtti=off test toolset=$TOOLSET cxxstd=$CXXSTD variant=debug,release ${UBSAN:+cxxflags=-fsanitize=address,undefined cxxflags=-fno-sanitize-recover=address,undefined linkflags=-fsanitize=address,undefined debug-symbols=on} ${LINKFLAGS:+linkflags=$LINKFLAGS}
echo '==================================> AFTER_SUCCESS'
. $DRONE_BUILD_DIR/.drone/after-success.sh

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

@ -0,0 +1,292 @@
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"
os: ubuntu-latest
container: ubuntu:18.04
install: g++-4.8
- toolset: gcc-5
cxxstd: "11,14,1z"
os: ubuntu-latest
container: ubuntu:18.04
install: g++-5
- toolset: gcc-6
cxxstd: "11,14,1z"
os: ubuntu-latest
container: ubuntu:18.04
install: g++-6
- toolset: gcc-7
cxxstd: "11,14,17"
os: ubuntu-latest
container: ubuntu:18.04
- toolset: gcc-8
cxxstd: "11,14,17,2a"
os: ubuntu-20.04
install: g++-8
- toolset: gcc-9
cxxstd: "11,14,17,2a"
os: ubuntu-20.04
- toolset: gcc-10
cxxstd: "11,14,17,2a"
os: ubuntu-20.04
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"
os: ubuntu-latest
container: ubuntu:24.04
install: g++-13
- toolset: gcc-14
cxxstd: "11,14,17,20,2b"
os: ubuntu-latest
container: ubuntu:24.04
install: g++-14
- toolset: clang
compiler: clang++-3.9
cxxstd: "11,14"
os: ubuntu-latest
container: ubuntu:18.04
install: clang-3.9
- toolset: clang
compiler: clang++-4.0
cxxstd: "11,14"
os: ubuntu-latest
container: ubuntu:18.04
install: clang-4.0
- toolset: clang
compiler: clang++-5.0
cxxstd: "11,14,1z"
os: ubuntu-latest
container: ubuntu:18.04
install: clang-5.0
- toolset: clang
compiler: clang++-6.0
cxxstd: "11,14,17"
os: ubuntu-20.04
install: clang-6.0
- toolset: clang
compiler: clang++-7
cxxstd: "11,14,17"
os: ubuntu-20.04
install: clang-7
- toolset: clang
compiler: clang++-8
cxxstd: "11,14,17"
os: ubuntu-20.04
install: clang-8
- toolset: clang
compiler: clang++-9
cxxstd: "11,14,17"
os: ubuntu-20.04
install: clang-9
- toolset: clang
compiler: clang++-10
cxxstd: "11,14,17,2a"
os: ubuntu-20.04
- toolset: clang
compiler: clang++-11
cxxstd: "11,14,17,2a"
os: ubuntu-20.04
- toolset: clang
compiler: clang++-12
cxxstd: "11,14,17,20"
os: ubuntu-20.04
- toolset: clang
compiler: clang++-13
cxxstd: "11,14,17,20,2b"
container: ubuntu:22.04
os: ubuntu-latest
install: clang-13
- toolset: clang
compiler: clang++-14
cxxstd: "11,14,17,20,2b"
container: ubuntu:22.04
os: ubuntu-latest
install: clang-14
- toolset: clang
compiler: clang++-15
cxxstd: "11,14,17,20,2b"
container: ubuntu:22.04
os: ubuntu-latest
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 exception-handling=on,off rtti=on,off link=static,shared visibility=hidden,global
windows:
strategy:
fail-fast: false
matrix:
include:
- toolset: msvc-14.0
cxxstd: "14"
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,20,latest"
addrmd: 32,64
os: windows-2022
- toolset: gcc
cxxstd: "11,14,17,2a"
addrmd: 64
os: windows-2019
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- 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 exception-handling=on,off rtti=on,off embed-manifest-via=linker

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
/.vscode/ipch/*
/.vscode/settings.json
.DS_Store

View File

@ -1,30 +1,30 @@
# Copyright 2019 Mike Dev
# Generated by `boostdep --cmake exception`
# Copyright 2020, 2021 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt
#
# NOTE: CMake support for Boost.Exception is currently experimental at best
# and the interface is likely to change in the future
# https://www.boost.org/LICENSE_1_0.txt
cmake_minimum_required( VERSION 3.5 )
project( BoostException LANGUAGES CXX )
cmake_minimum_required(VERSION 3.5...3.20)
# We treat Boost.Exception as header only for now.
# See https://github.com/boostorg/exception/pull/17
# for more information.
project(boost_exception VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
add_library( boost_exception INTERFACE )
add_library( Boost::exception ALIAS boost_exception )
add_library(boost_exception INTERFACE)
add_library(Boost::exception ALIAS boost_exception)
target_include_directories( boost_exception INTERFACE include )
target_include_directories(boost_exception INTERFACE include)
target_link_libraries( boost_exception
INTERFACE
Boost::assert
Boost::config
Boost::core
Boost::smart_ptr
Boost::throw_exception
Boost::tuple
Boost::type_traits
target_link_libraries(boost_exception
INTERFACE
Boost::assert
Boost::config
Boost::core
Boost::smart_ptr
Boost::throw_exception
Boost::tuple
Boost::type_traits
)
if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
add_subdirectory(test)
endif()

23
LICENSE_1_0.txt Normal file
View File

@ -0,0 +1,23 @@
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

19
README.md Normal file
View File

@ -0,0 +1,19 @@
# Boost Exception
> Dynamic Exception Augmentation Library
## Documentation
https://boostorg.github.io/exception
## Support
* [cpplang on Slack](https://Cpplang.slack.com) (use the `#boost` channel)
* [Boost Users Mailing List](https://lists.boost.org/mailman/listinfo.cgi/boost-users)
* [Boost Developers Mailing List](https://lists.boost.org/mailman/listinfo.cgi/boost)
## Distribution
Boost Exception is included in official [Boost](https://www.boost.org/) releases.
Copyright (C) 2006-2021 Emil Dotchevski. Distributed under the [Boost Software License, Version 1.0](http://www.boost.org/LICENSE_1_0.txt).

View File

@ -16,6 +16,7 @@ environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
TOOLSET: msvc-9.0,msvc-10.0,msvc-11.0
ADDRMD: 32
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
TOOLSET: msvc-12.0,msvc-14.0
ADDRMD: 32,64
@ -29,18 +30,22 @@ environment:
ADDRMD: 64
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
TOOLSET: msvc-14.2
CXXSTD: 14,17
CXXSTD: 14,17,latest
ADDRMD: 32,64
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
ADDPATH: C:\cygwin\bin;
TOOLSET: gcc
CXXSTD: 03,11,14,1z
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
ADDPATH: C:\cygwin64\bin;
TOOLSET: gcc
CXXSTD: 03,11,14,1z
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
ADDPATH: C:\mingw\bin;
TOOLSET: gcc
CXXSTD: 03,11,14,1z
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
ADDPATH: C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin;
ADDPATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;
TOOLSET: gcc
CXXSTD: 03,11,14,1z

27
build.jam Normal file
View File

@ -0,0 +1,27 @@
# 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/assert//boost_assert
/boost/config//boost_config
/boost/core//boost_core
/boost/smart_ptr//boost_smart_ptr
/boost/throw_exception//boost_throw_exception
/boost/tuple//boost_tuple
/boost/type_traits//boost_type_traits ;
project /boost/exception
;
explicit
[ alias boost_exception : build//boost_exception ]
[ alias all : boost_exception example test ]
;
call-if : boost-library exception
: install boost_exception
;

View File

@ -5,10 +5,11 @@
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
project boost/exception
project
: source-location ../src
: common-requirements <include>../include <library>$(boost_dependencies)
: requirements <link>static
: usage-requirements <define>BOOST_EXCEPTION_NO_LIB=1
;
lib boost_exception : clone_current_exception_non_intrusive.cpp ;
boost-install boost_exception ;
lib boost_exception : clone_current_exception_non_intrusive.cpp : <exception-handling>on ;

View File

@ -21,19 +21,7 @@
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>BOOST_THROW_EXCEPTION</h3>
</div>
<div class="RenoIncludeDIV"><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="boost_throw_exception_hpp.html">boost/throw_exception.hpp</a></span>&gt;</p>
<div class="RenoIncludeDIV"><pre>#if !defined( BOOST_EXCEPTION_DISABLE )
#include &lt;<span class="RenoLink"><a href="boost_exception_exception_hpp.html">boost/exception/exception.hpp</a></span>&gt;
#include &lt;boost/current_function.hpp&gt;
#define <span class="RenoLink">BOOST_THROW_EXCEPTION</span>(x)\
::boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>( ::boost::<span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span>(x) &lt;&lt;\
::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_function</a></span>(<span class="RenoLink"><a href="configuration_macros.html">BOOST_THROW_EXCEPTION_CURRENT_FUNCTION</a></span>) &lt;&lt;\
::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_file</a></span>(__FILE__) &lt;&lt;\
::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_line</a></span>((int)__LINE__) )
#else
#define <span class="RenoLink">BOOST_THROW_EXCEPTION</span>(x) ::boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>(x)
#endif</pre>
</div></div><p>This macro takes an exception object, records the current function name, __FILE__ and __LINE__ in it, and forwards it to <span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>. To recover this information at the catch site, use <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>; the information is also included in the message returned by <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span>.</p>
<p>Please see <a href="https://www.boost.org/doc/libs/release/libs/throw_exception/doc/html/throw_exception.html">Boost.ThrowException</a>.</p>
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
See also: <span class="RenoPageList"><a href="boost-exception.html">Boost Exception</a>&nbsp;| <a href="boost_throw_exception_hpp.html">boost/throw_exception.hpp</a>&nbsp;| <a href="configuration_macros.html">Configuration Macros</a>&nbsp;| <a href="frequently_asked_questions.html">Frequently Asked Questions</a></span>
</div>

View File

@ -12,13 +12,14 @@
<div class="body-2">
<div>
<div id="boost_logo">
<a href="http://www.boost.org"><img style="border:0" src="../../../boost.png" alt="Boost" width="277" height="86"/></a>
<a href="http://www.boost.org"><img style="border:0" src="boost.png" alt="Boost" width="277" height="86"/></a>
</div>
<h1>Boost Exception</h1>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- 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) -->
<p><b style="color:red"><u>NOTE</u>:</b> When targeting C++11 or newer and Boost 1.75 or newer is available, it is recommended to use <a href="https://www.boost.org/doc/libs/release/libs/leaf/doc/html/index.html">Boost LEAF</a> instead of Boost Exception. LEAF serves a similar purpose but it has a more elegant interface, it is more efficient, and works with or without exception handling -- yet understands Boost Exception error information for compatibility with legacy source code. This <a href="https://www.boost.org/doc/libs/release/libs/leaf/doc/html/index.html#boost_exception">overview</a> explains the differences between the two APIs (Boost Exception is <u>not</u> deprecated and will continue to be supported, including C++03 compatibility).</p>
<div class="RenoIncludeDIV"><h2>Introduction</h2>
<p>The purpose of Boost Exception is to ease the design of exception class hierarchies and to help write exception handling and error reporting code.</p>
<p>It supports transporting of arbitrary data to the catch site, which is otherwise tricky due to the no-throw requirements (15.5.1) for exception types. Data can be added to any exception object, either directly in the throw-expression (15.1), or at a later time as the exception object propagates up the call stack.</p>

BIN
doc/boost.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

@ -27,7 +27,6 @@
#include &lt;boost/current_function.hpp&gt;
#define <span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span>(x)\
::boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>( ::boost::<span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span>(x) &lt;&lt;\
::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_function</a></span>(<span class="RenoLink"><a href="configuration_macros.html">BOOST_THROW_EXCEPTION_CURRENT_FUNCTION</a></span>) &lt;&lt;\
::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_file</a></span>(__FILE__) &lt;&lt;\
::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_line</a></span>((int)__LINE__) )
#else

View File

@ -22,18 +22,17 @@
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>Configuration Macros</h2>
</div>
<p>Boost Exception responds to the following configuration macros:</p>
<p><b>BOOST_NO_RTTI</b><span class="RenoBR">&nbsp;</span><br/><b>BOOST_NO_TYPEID</b></p>
<p><b>BOOST_NO_RTTI</b><span class="RenoBR">&nbsp;</span><br/><b>BOOST_NO_TYPEID</b> (both defined automatically by boost/config.hpp)</p>
<p>The first macro prevents Boost Exception from using dynamic_cast and dynamic typeid. If the second macro is also defined, Boost Exception does not use static typeid either. There are no observable degrading effects on the library functionality, except for the following:</p>
<blockquote><p>By default, the <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span> function template can be called with any exception type. If BOOST_NO_RTTI is defined, <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span> can be used only with objects of type boost::<span class="RenoLink"><a href="exception.html">exception</a></span>.</p></blockquote>
<h4>Note:</h4>
<p>The library needs RTTI functionality. Disabling the language RTTI support enables an internal RTTI system, which may have more or less overhead depending on the platform.</p>
<p><b>BOOST_EXCEPTION_DISABLE</b></p>
<p>By default, <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span> and <span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span> are integrated directly in the <span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span> function. Defining BOOST_EXCEPTION_DISABLE disables this integration.</p>
<p>Note that on some non-conformant compilers, for example MSVC 7.0 and older, as well as BCC, BOOST_EXCEPTION_DISABLE is implicitly defined in <span class="RenoLink"><a href="boost_throw_exception_hpp.html">boost/throw_exception.hpp</a></span>.</p>
<p><b>BOOST_NO_EXCEPTIONS</b></p>
<p><b>BOOST_NO_EXCEPTIONS</b> (defined automatically by boost/config.hpp)</p>
<p>This macro disables exception handling in Boost, forwarding all exceptions to a user-defined non-template version of boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>. However, unless BOOST_EXCEPTION_DISABLE is also defined, users can still examine the exception object for any data added at the point of the throw, or use boost::<span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span> (of course under BOOST_NO_EXCEPTIONS, the user-defined boost::throw_exception is not allowed to return to the caller.)</p>
<p><b>BOOST_THROW_EXCEPTION_CURRENT_FUNCTION</b></p>
<p>The <span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span> macro uses BOOST_THROW_EXCEPTION_CURRENT_FUNCTION to record the name of the current function in the exception object. Unless overridden by the user, BOOST_THROW_EXCEPTION_CURRENT_FUNCTION expands to BOOST_CURRENT_FUNCTION.</p>
<p>In addition, the following user-defined macros are recognized:</p>
<p><b>BOOST_EXCEPTION_DISABLE</b> (user-defined)</p>
<p>By default, <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span> and <span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span> are integrated directly in the <span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span> function. Defining BOOST_EXCEPTION_DISABLE disables this integration.</p>
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
See also: <span class="RenoPageList"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a>&nbsp;| <a href="boost-exception.html">Boost Exception</a>&nbsp;| <a href="boost_exception_all_hpp.html">boost/exception/all.hpp</a>&nbsp;| <a href="frequently_asked_questions.html">Frequently Asked Questions</a>&nbsp;| <a href="get_error_info.html">get_error_info</a></span>
</div>

View File

@ -25,7 +25,7 @@
<p>The cost is that boost::<span class="RenoLink"><a href="exception.html">exception</a></span> is added as a base of the exception emitted by boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span> (unless the passed type already derives from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>.)</p>
<p>Calling boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span> does not cause dynamic memory allocations.</p>
<h3>What is the cost of BOOST_THROW_EXCEPTION?</h3>
<p>In addition to calling boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>, <span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span> invokes __FILE__, __LINE__ and the <span class="RenoLink"><a href="configuration_macros.html">BOOST_THROW_EXCEPTION_CURRENT_FUNCTION</a></span> macros. The space required to store the information is already included in sizeof(boost::<span class="RenoLink"><a href="exception.html">exception</a></span>).</p>
<p>In addition to calling boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>, <span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span> invokes __FILE__ and __LINE__ macros. The space required to store the information is already included in sizeof(boost::<span class="RenoLink"><a href="exception.html">exception</a></span>).</p>
<p>Calling <span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span> does not cause dynamic memory allocations.</p>
<h3>Should I use boost::throw_exception or BOOST_THROW_EXCEPTION or just throw?</h3>
<p>The benefit of calling boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span> instead of using throw directly is that it ensures that the emitted exception derives from boost::<span class="RenoLink"><a href="exception.html">exception</a></span> and that it is compatible with boost::<span class="RenoLink"><a href="current_exception.html">current_exception</a></span>.</p>

View File

@ -29,15 +29,15 @@ boost
<span class="RenoLink"><a href="exception.html">exception</a></span>
{
protected:
<span class="RenoIncludeSPAN"> <span class="RenoLink"><a href="exception_constructors.html">exception</a></span>();
<span class="RenoLink"><a href="exception_constructors.html">exception</a></span>( <span class="RenoLink"><a href="exception.html">exception</a></span> const &amp; x );</span>
<span class="RenoIncludeSPAN"> <span class="RenoLink"><a href="exception_destructor.html">~exception</a></span>();</span>
};</span>
<span class="RenoLink"><a href="exception_constructors.html">exception</a></span>( <span class="RenoLink"><a href="exception.html">exception</a></span> const &amp; x );</span>
<span class="RenoIncludeSPAN"> <span class="RenoLink"><a href="exception_destructor.html">~exception</a></span>();</span>
};</span>
<span class="RenoIncludeSPAN">template &lt;class Tag,class T&gt;
class <span class="RenoLink"><a href="error_info.html">error_info</a></span>;</span>
class <span class="RenoLink"><a href="error_info.html">error_info</a></span>;</span>
typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct throw_function_,char const *&gt; throw_function;
typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct throw_file_,char const *&gt; throw_file;
typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct throw_line_,int&gt; throw_line;</span>
@ -60,14 +60,14 @@ boost
<span class="RenoLink"><a href="error_info.html">error_info</a></span>
{
public:
<span class="RenoIncludeSPAN"> typedef T <span class="RenoLink"><a href="error_info_value_type.html">value_type</a></span>;</span>
<span class="RenoIncludeSPAN"> <span class="RenoLink"><a href="error_info_error_info.html">error_info</a></span>( <span class="RenoLink"><a href="error_info_value_type.html">value_type</a></span> const &amp; v );</span>
<span class="RenoIncludeSPAN"> typedef T <span class="RenoLink"><a href="error_info_value_type.html">value_type</a></span>;</span>
<span class="RenoIncludeSPAN"> <span class="RenoLink"><a href="error_info_error_info.html">error_info</a></span>( <span class="RenoLink"><a href="error_info_value_type.html">value_type</a></span> const &amp; v );</span>
<span class="RenoIncludeSPAN"> <span class="RenoLink"><a href="error_info_value_type.html">value_type</a></span> const &amp; <span class="RenoLink"><a href="error_info_value.html">value</a></span>() const;
<span class="RenoLink"><a href="error_info_value_type.html">value_type</a></span> &amp; <span class="RenoLink"><a href="error_info_value.html">value</a></span>();</span>
};</span>
<span class="RenoLink"><a href="error_info_value_type.html">value_type</a></span> &amp; <span class="RenoLink"><a href="error_info_value.html">value</a></span>();</span>
};</span>
<span class="RenoIncludeSPAN">template &lt;class E, class Tag, class T&gt;
E const &amp; <span class="RenoLink"><a href="exception_operator_shl.html">operator&lt;&lt;</a></span>( E const &amp; x, <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;Tag,T&gt; const &amp; v );</span></span>
}</span></pre>
@ -104,11 +104,11 @@ boost
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">template &lt;class E&gt;
std::string <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span>( E const &amp; e, bool verbose=true );
std::string <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span>( <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> const &amp; p, bool verbose=true );</span>
<span class="RenoIncludeSPAN">char const * <span class="RenoLink"><a href="diagnostic_information_what.html">diagnostic_information_what</a></span>( boost::<span class="RenoLink"><a href="exception.html">exception</a></span> const &amp; e, bool verbose=true ) throw();</span>
std::string <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span>( <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> const &amp; p, bool verbose=true );</span>
<span class="RenoIncludeSPAN">char const * <span class="RenoLink"><a href="diagnostic_information_what.html">diagnostic_information_what</a></span>( boost::<span class="RenoLink"><a href="exception.html">exception</a></span> const &amp; e, bool verbose=true ) throw();</span>
<span class="RenoIncludeSPAN">std::string <span class="RenoLink"><a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information</a></span>();</span></span>
}</span></pre>
<p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="boost_exception_current_exception_cast_hpp.html">boost/exception/current_exception_cast.hpp</a></span>&gt;</p>
@ -130,17 +130,17 @@ boost
public boost::<span class="RenoLink"><a href="exception.html">exception</a></span>
{
---unspecified---
};</span>
<span class="RenoIncludeSPAN">typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct tag_original_exception_type,std::type_info const *&gt; <span class="RenoLink"><a href="original_exception_type.html">original_exception_type</a></span>;</span>
<span class="RenoIncludeSPAN">typedef ---unspecified--- <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span>;</span>
};</span>
<span class="RenoIncludeSPAN">typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct tag_original_exception_type,std::type_info const *&gt; <span class="RenoLink"><a href="original_exception_type.html">original_exception_type</a></span>;</span>
<span class="RenoIncludeSPAN">typedef ---unspecified--- <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span>;</span>
<span class="RenoIncludeSPAN">template &lt;class T&gt;
<span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> <span class="RenoLink"><a href="copy_exception.html">copy_exception</a></span>( T const &amp; e );</span>
<span class="RenoIncludeSPAN"><span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> <span class="RenoLink"><a href="current_exception.html">current_exception</a></span>();</span>
<span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> <span class="RenoLink"><a href="copy_exception.html">copy_exception</a></span>( T const &amp; e );</span>
<span class="RenoIncludeSPAN"><span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> <span class="RenoLink"><a href="current_exception.html">current_exception</a></span>();</span>
<span class="RenoIncludeSPAN">void <span class="RenoLink"><a href="rethrow_exception.html">rethrow_exception</a></span>( <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> const &amp; ep );</span></span>
}</span></pre>
<p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="boost_exception_enable_current_exception_hpp.html">boost/exception/enable_current_exception.hpp</a></span>&gt;</p>
@ -158,7 +158,6 @@ boost
#include &lt;boost/current_function.hpp&gt;
#define <span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span>(x)\
::boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>( ::boost::<span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span>(x) &lt;&lt;\
::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_function</a></span>(<span class="RenoLink"><a href="configuration_macros.html">BOOST_THROW_EXCEPTION_CURRENT_FUNCTION</a></span>) &lt;&lt;\
::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_file</a></span>(__FILE__) &lt;&lt;\
::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_line</a></span>((int)__LINE__) )
#else

View File

@ -21,28 +21,7 @@
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>throw_exception</h3>
</div>
<div class="RenoIncludeDIV"><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="boost_throw_exception_hpp.html">boost/throw_exception.hpp</a></span>&gt;</p>
<pre>namespace
boost
{
<span class="RenoIncludeSPAN">#ifdef BOOST_NO_EXCEPTIONS
void <span class="RenoLink">throw_exception</span>( std::exception const &amp; e ); // user defined
#else
template &lt;class E&gt;
void <span class="RenoLink">throw_exception</span>( E const &amp; e );
#endif</span>
}</pre>
</div><h4>Effects:</h4>
<div><ul><li> If BOOST_NO_EXCEPTIONS is not defined, boost::<span class="RenoLink">throw_exception</span>(e) throws an exception of unspecified type that derives publicly from E and from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>.</li>
<li> If BOOST_NO_EXCEPTIONS is defined, the function is left undefined, and the user is expected to supply an appropriate definition. Callers of <span class="RenoLink">throw_exception</span> are allowed to assume that the function never returns; therefore, if the user-defined <span class="RenoLink">throw_exception</span> returns, the behavior is undefined.</li>
</ul></div>
<h4>Requirements:</h4>
<p>E must derive publicly from std::exception. E may or may not derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>.</p>
<h4>Notes:</h4>
<div><ul><li> The emitted exception can be intercepted as E &amp;, std::exception &amp;, or boost::exception &amp;.</li>
<li> The emitted exception supports boost::<span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span>.</li>
<li> If BOOST_EXCEPTION_DISABLE is defined and BOOST_NO_EXCEPTIONS is not defined, boost::<span class="RenoLink">throw_exception</span>(e) equivalent to throw e.</li>
</ul></div>
<p>Please see <a href="https://www.boost.org/doc/libs/release/libs/throw_exception/doc/html/throw_exception.html">Boost.ThrowException</a>.</p>
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
See also: <span class="RenoPageList"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a>&nbsp;| <a href="boost-exception.html">Boost Exception</a>&nbsp;| <a href="boost_throw_exception_hpp.html">boost/throw_exception.hpp</a>&nbsp;| <a href="configuration_macros.html">Configuration Macros</a>&nbsp;| <a href="enable_current_exception.html">enable_current_exception</a>&nbsp;| <a href="frequently_asked_questions.html">Frequently Asked Questions</a>&nbsp;| <a href="tutorial_exception_ptr.html">Transporting of Exceptions Between Threads</a></span>
</div>

View File

@ -5,11 +5,13 @@
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
project : requirements <library>/boost/exception//boost_exception ;
exe example_io : example_io.cpp ;
obj error_info_1 : error_info_1.cpp ;
obj error_info_2 : error_info_2.cpp ;
obj cloning_1 : cloning_1.cpp ;
obj cloning_2 : cloning_2.cpp : <threading>multi ;
obj cloning_2 : cloning_2.cpp /boost/thread//boost_thread : <threading>multi ;
obj info_tuple : info_tuple.cpp ;
obj enable_error_info : enable_error_info.cpp ;
obj logging : logging.cpp ;

View File

@ -7,7 +7,7 @@
#define BOOST_EXCEPTION_7E83C166200811DE885E826156D89593
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
#if __GNUC__*100+__GNUC_MINOR__>301
#if defined(__GNUC__) && __GNUC__*100+__GNUC_MINOR__>301
#pragma GCC system_header
#endif
#ifdef __clang__

View File

@ -7,7 +7,7 @@
#define BOOST_EXCEPTION_81522C0EB56511DFAB613DB0DFD72085
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
#if __GNUC__*100+__GNUC_MINOR__>301
#if defined(__GNUC__) && __GNUC__*100+__GNUC_MINOR__>301
#pragma GCC system_header
#endif
#ifdef __clang__

View File

@ -14,7 +14,7 @@
#include <string>
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
#if __GNUC__*100+__GNUC_MINOR__>301
#if defined(__GNUC__) && __GNUC__*100+__GNUC_MINOR__>301
#pragma GCC system_header
#endif
#ifdef __clang__

View File

@ -7,14 +7,13 @@
#ifndef BOOST_EXCEPTION_618474C2DE1511DEB74A388C56D89593
#define BOOST_EXCEPTION_618474C2DE1511DEB74A388C56D89593
#include <boost/config.hpp>
#ifdef BOOST_NO_EXCEPTIONS
#error This header requires exception handling to be enabled.
#endif
#include <boost/exception/detail/requires_cxx11.hpp>
#include <boost/exception/exception.hpp>
#include <boost/exception/info.hpp>
#include <boost/exception/diagnostic_information.hpp>
#include <boost/exception/detail/clone_current_exception.hpp>
#ifndef BOOST_NO_EXCEPTIONS
# include <boost/exception/detail/clone_current_exception.hpp>
#endif
#include <boost/exception/detail/type_info.hpp>
#ifndef BOOST_NO_RTTI
#include <boost/core/demangle.hpp>
@ -27,7 +26,7 @@
#include <stdlib.h>
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
#if __GNUC__*100+__GNUC_MINOR__>301
#if defined(__GNUC__) && __GNUC__*100+__GNUC_MINOR__>301
#pragma GCC system_header
#endif
#ifdef __clang__
@ -41,21 +40,56 @@
namespace
boost
{
namespace
exception_detail
{
#ifndef BOOST_NO_CXX11_HDR_EXCEPTION
struct
std_exception_ptr_wrapper:
std::exception
{
std::exception_ptr p;
explicit std_exception_ptr_wrapper( std::exception_ptr const & ptr ) BOOST_NOEXCEPT:
p(ptr)
{
}
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
explicit std_exception_ptr_wrapper( std::exception_ptr && ptr ) BOOST_NOEXCEPT:
p(static_cast<std::exception_ptr &&>(ptr))
{
}
#endif
};
shared_ptr<exception_detail::clone_base const>
inline
wrap_exception_ptr( std::exception_ptr const & e )
{
exception_detail::clone_base const & base = boost::enable_current_exception(std_exception_ptr_wrapper(e));
return shared_ptr<exception_detail::clone_base const>(base.clone());
}
#endif
}
class exception_ptr;
BOOST_NORETURN void rethrow_exception( exception_ptr const & );
exception_ptr current_exception();
namespace exception_detail { void rethrow_exception_( exception_ptr const & ); }
class
exception_ptr
{
typedef boost::shared_ptr<exception_detail::clone_base const> impl;
impl ptr_;
friend void rethrow_exception( exception_ptr const & );
friend void exception_detail::rethrow_exception_( exception_ptr const & );
typedef exception_detail::clone_base const * (impl::*unspecified_bool_type)() const;
public:
exception_ptr()
{
}
#ifndef BOOST_NO_CXX11_HDR_EXCEPTION
exception_ptr( std::exception_ptr const & e ):
ptr_(exception_detail::wrap_exception_ptr(e))
{
}
#endif
explicit
exception_ptr( impl const & ptr ):
ptr_(ptr)
@ -77,14 +111,24 @@ boost
}
};
namespace
exception_detail
{
template <class E>
inline
exception_ptr
copy_exception_impl( E const & e )
{
return exception_ptr(boost::make_shared<E>(e));
}
}
template <class E>
inline
exception_ptr
copy_exception( E const & e )
{
E cp = e;
exception_detail::copy_boost_exception(&cp, &e);
return exception_ptr(boost::make_shared<wrapexcept<E> >(cp));
return exception_detail::copy_exception_impl(boost::enable_current_exception(e));
}
template <class T>
@ -92,7 +136,7 @@ boost
exception_ptr
make_exception_ptr( T const & e )
{
return copy_exception(e);
return boost::copy_exception(e);
}
#ifndef BOOST_NO_RTTI
@ -106,6 +150,7 @@ boost
}
#endif
#ifndef BOOST_NO_EXCEPTIONS
namespace
exception_detail
{
@ -308,24 +353,6 @@ boost
return boost::copy_exception(unknown_exception(e));
}
#ifndef BOOST_NO_CXX11_HDR_EXCEPTION
struct
std_exception_ptr_wrapper
{
std::exception_ptr p;
explicit std_exception_ptr_wrapper( std::exception_ptr const & ptr ) BOOST_NOEXCEPT:
p(ptr)
{
}
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
explicit std_exception_ptr_wrapper( std::exception_ptr && ptr ) BOOST_NOEXCEPT:
p(static_cast<std::exception_ptr &&>(ptr))
{
}
#endif
};
#endif
inline
exception_ptr
current_exception_impl()
@ -367,6 +394,9 @@ boost
{
return exception_ptr(shared_ptr<exception_detail::clone_base const>(e.clone()));
}
#ifdef BOOST_NO_CXX11_HDR_EXCEPTION
catch(
std::domain_error & e )
{
@ -439,29 +469,26 @@ boost
{
return exception_detail::current_exception_std_exception(e);
}
#ifdef BOOST_NO_CXX11_HDR_EXCEPTION
// this case can be handled losslesly with std::current_exception() (see below)
catch(
std::exception & e )
{
return exception_detail::current_exception_unknown_std_exception(e);
}
#endif
catch(
boost::exception & e )
{
return exception_detail::current_exception_unknown_boost_exception(e);
}
#endif // #ifdef BOOST_NO_CXX11_HDR_EXCEPTION
catch(
... )
{
#ifndef BOOST_NO_CXX11_HDR_EXCEPTION
try
{
// wrap the std::exception_ptr in a clone-enabled Boost.Exception object
exception_detail::clone_base const & base =
boost::enable_current_exception(std_exception_ptr_wrapper(std::current_exception()));
return exception_ptr(shared_ptr<exception_detail::clone_base const>(base.clone()));
return exception_ptr(std::current_exception());
}
catch(
...)
@ -499,34 +526,46 @@ boost
BOOST_ASSERT(ret);
return ret;
}
#endif // ifndef BOOST_NO_EXCEPTIONS
namespace
exception_detail
{
inline
void
rethrow_exception_( exception_ptr const & p )
{
BOOST_ASSERT(p);
#if defined( BOOST_NO_CXX11_HDR_EXCEPTION ) || defined( BOOST_NO_EXCEPTIONS )
p.ptr_->rethrow();
#else
try
{
p.ptr_->rethrow();
}
catch(
std_exception_ptr_wrapper const & wrp)
{
// if an std::exception_ptr was wrapped above then rethrow it
std::rethrow_exception(wrp.p);
}
#endif
}
}
BOOST_NORETURN
inline
void
rethrow_exception( exception_ptr const & p )
{
BOOST_ASSERT(p);
#ifndef BOOST_NO_CXX11_HDR_EXCEPTION
try
{
p.ptr_->rethrow();
}
catch(
exception_detail::std_exception_ptr_wrapper const & wrp)
{
// if an std::exception_ptr was wrapped above then rethrow it
std::rethrow_exception(wrp.p);
}
#else
p.ptr_->rethrow();
#endif
exception_detail::rethrow_exception_(p);
BOOST_ASSERT(0);
#if defined(UNDER_CE)
// some CE platforms don't define ::abort()
exit(-1);
#else
abort();
#endif
#if defined(UNDER_CE)
// some CE platforms don't define ::abort()
exit(-1);
#else
abort();
#endif
}
inline
@ -534,6 +573,9 @@ boost
diagnostic_information( exception_ptr const & p, bool verbose=true )
{
if( p )
#ifdef BOOST_NO_EXCEPTIONS
return "<unavailable> due to BOOST_NO_EXCEPTIONS";
#else
try
{
rethrow_exception(p);
@ -543,6 +585,7 @@ boost
{
return current_exception_diagnostic_information(verbose);
}
#endif
return "<empty>";
}

View File

@ -9,7 +9,7 @@
#include <ostream>
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
#if __GNUC__*100+__GNUC_MINOR__>301
#if defined(__GNUC__) && __GNUC__*100+__GNUC_MINOR__>301
#pragma GCC system_header
#endif
#ifdef __clang__

View File

@ -14,7 +14,7 @@
#include <cstdlib>
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
#if __GNUC__*100+__GNUC_MINOR__>301
#if defined(__GNUC__) && __GNUC__*100+__GNUC_MINOR__>301
#pragma GCC system_header
#endif
#ifdef __clang__

View File

@ -0,0 +1,24 @@
#ifndef BOOST_EXCEPTION_DETAIL_REQUIRES_CXX11_HPP_INCLUDED
#define BOOST_EXCEPTION_DETAIL_REQUIRES_CXX11_HPP_INCLUDED
// Copyright 2023 Peter Dimov
// Copyright 2024 Emil Dotchevski
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/config.hpp>
#include <boost/config/pragma_message.hpp>
#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || \
defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \
defined(BOOST_NO_CXX11_DECLTYPE) || \
defined(BOOST_NO_CXX11_CONSTEXPR) || \
defined(BOOST_NO_CXX11_NOEXCEPT) || \
defined(BOOST_NO_CXX11_NULLPTR) || \
defined(BOOST_NO_CXX11_SMART_PTR)
BOOST_PRAGMA_MESSAGE("C++03 support was deprecated in Boost.Exception 1.85 and will be removed in Boost.Exception 1.87.")
#endif
#endif

View File

@ -11,9 +11,10 @@
#include <boost/core/demangle.hpp>
#include <boost/current_function.hpp>
#include <string>
#include <string.h>
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
#if __GNUC__*100+__GNUC_MINOR__>301
#if defined(__GNUC__) && __GNUC__*100+__GNUC_MINOR__>301
#pragma GCC system_header
#endif
#ifdef __clang__
@ -69,7 +70,7 @@ boost
bool
operator<( type_info_ const & a, type_info_ const & b )
{
return 0!=(a.type_->before(*b.type_));
return a.type_!=b.type_ && strcmp(a.type_->name(), b.type_->name()) < 0;
}
};
}

View File

@ -9,7 +9,7 @@
#include <boost/config.hpp>
#include <boost/exception/get_error_info.hpp>
#include <boost/exception/info.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/core/enable_if.hpp>
#ifndef BOOST_NO_RTTI
#include <boost/core/demangle.hpp>
#endif
@ -21,7 +21,7 @@
#endif
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
#if __GNUC__*100+__GNUC_MINOR__>301
#if defined(__GNUC__) && __GNUC__*100+__GNUC_MINOR__>301
#pragma GCC system_header
#endif
#ifdef __clang__
@ -149,11 +149,11 @@ boost
if( f )
{
tmp << *f;
if( int const * l=get_error_info<throw_line>(*be) )
if( l )
tmp << '(' << *l << "): ";
}
tmp << "Throw in function ";
if( char const * const * fn=get_error_info<throw_function>(*be) )
if( fn )
tmp << *fn;
else
tmp << "(unknown)";

View File

@ -11,7 +11,7 @@
#include <string.h>
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
#if __GNUC__*100+__GNUC_MINOR__>301
#if defined(__GNUC__) && __GNUC__*100+__GNUC_MINOR__>301
#pragma GCC system_header
#endif
#ifdef __clang__

View File

@ -14,7 +14,7 @@
#include <boost/assert.hpp>
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
#if __GNUC__*100+__GNUC_MINOR__>301
#if defined(__GNUC__) && __GNUC__*100+__GNUC_MINOR__>301
#pragma GCC system_header
#endif
#ifdef __clang__

View File

@ -14,7 +14,7 @@
#include <map>
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
#if __GNUC__*100+__GNUC_MINOR__>301
#if defined(__GNUC__) && __GNUC__*100+__GNUC_MINOR__>301
#pragma GCC system_header
#endif
#ifdef __clang__
@ -31,7 +31,7 @@ boost
template <class Tag,class T>
inline
std::string
error_info_name( error_info<Tag,T> const & x )
error_info_name( error_info<Tag,T> const & )
{
return tag_type_name<Tag>();
}
@ -86,9 +86,6 @@ boost
if( info_.end()!=i )
{
shared_ptr<error_info_base> const & p = i->second;
#ifndef BOOST_NO_RTTI
BOOST_ASSERT( *BOOST_EXCEPTION_DYNAMIC_TYPEID(*p).type_==*ti.type_ );
#endif
return p;
}
return shared_ptr<error_info_base>();

View File

@ -10,7 +10,7 @@
#include <boost/tuple/tuple.hpp>
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
#if __GNUC__*100+__GNUC_MINOR__>301
#if defined(__GNUC__) && __GNUC__*100+__GNUC_MINOR__>301
#pragma GCC system_header
#endif
#ifdef __clang__

View File

@ -6,12 +6,12 @@
#ifndef BOOST_EXCEPTION_7E48761AD92811DC9011477D56D89593
#define BOOST_EXCEPTION_7E48761AD92811DC9011477D56D89593
#include <boost/utility/enable_if.hpp>
#include <boost/core/enable_if.hpp>
#include <boost/exception/detail/is_output_streamable.hpp>
#include <sstream>
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
#if __GNUC__*100+__GNUC_MINOR__>301
#if defined(__GNUC__) && __GNUC__*100+__GNUC_MINOR__>301
#pragma GCC system_header
#endif
#ifdef __clang__

View File

@ -11,7 +11,7 @@
#include <boost/assert.hpp>
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
#if __GNUC__*100+__GNUC_MINOR__>301
#if defined(__GNUC__) && __GNUC__*100+__GNUC_MINOR__>301
#pragma GCC system_header
#endif
#ifdef __clang__

View File

@ -7,9 +7,11 @@
"description": "The Boost Exception library supports transporting of arbitrary data in exception objects, and transporting of exceptions between threads.",
"documentation": "doc/boost-exception.html",
"category": [
"Error-handling",
"Emulation"
],
"maintainers": [
"Emil Dotchevski <emil -at- revergestudios.com>"
]
],
"cxxstd": "03"
}

View File

@ -3,11 +3,15 @@
//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 <boost/config.hpp>
#if defined( BOOST_NO_EXCEPTIONS )
# error This program requires exception handling.
#endif
#include <boost/throw_exception.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <boost/config.hpp>
class my_exception: public std::exception { };
int

View File

@ -3,7 +3,12 @@
//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)
#define BOOST_NO_EXCEPTIONS
#include <boost/config.hpp>
#if !defined( BOOST_NO_EXCEPTIONS )
# error This program requires exception handling disabled.
#endif
#include <boost/throw_exception.hpp>
#include <stdlib.h>

View File

@ -4,6 +4,13 @@
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#define BOOST_EXCEPTION_DISABLE
#include <boost/config.hpp>
#if defined( BOOST_NO_EXCEPTIONS )
# error This program requires exception handling.
#endif
#include <boost/throw_exception.hpp>
#include <boost/detail/lightweight_test.hpp>

View File

@ -3,8 +3,14 @@
//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)
#define BOOST_NO_EXCEPTIONS
#define BOOST_EXCEPTION_DISABLE
#include <boost/config.hpp>
#if !defined( BOOST_NO_EXCEPTIONS )
# error This program requires exception handling disabled.
#endif
#include <boost/throw_exception.hpp>
#include <stdlib.h>

View File

@ -7,11 +7,7 @@
import testing ;
project
: requirements
<link>static
<exception-handling>on
;
project : requirements <library>/boost/exception//boost_exception ;
#to_string
@ -23,29 +19,34 @@ compile-fail to_string_fail.cpp ;
#exception
run 1-throw_exception_test.cpp ;
run 2-throw_exception_no_exceptions_test.cpp ;
run 3-throw_exception_no_integration_test.cpp ;
run 4-throw_exception_no_both_test.cpp ;
run cloning_test.cpp ;
run copy_exception_test.cpp ../../thread/src/tss_null.cpp /boost//thread : : : <threading>multi ;
run unknown_exception_test.cpp ;
run exception_test.cpp ;
run enable_error_info_test.cpp helper1.cpp ;
run throw_exception_test.cpp helper2.cpp ;
run errno_test.cpp ;
run error_info_basic_test.cpp ;
run error_info_lv_test.cpp ;
run error_info_lv_const_test.cpp ;
run error_info_rv_test.cpp ;
run error_info_rv_const_test.cpp ;
run diagnostic_information_test.cpp ;
run 1-throw_exception_test.cpp : : : <exception-handling>on ;
run 2-throw_exception_no_exceptions_test.cpp : : : <exception-handling>off ;
run 3-throw_exception_no_integration_test.cpp : : : <exception-handling>on ;
run 4-throw_exception_no_both_test.cpp : : : <exception-handling>off ;
run cloning_test.cpp : : : <exception-handling>on ;
run copy_exception_test.cpp ../../thread/src/tss_null.cpp /boost/thread//boost_thread : : : <threading>multi <exception-handling>on ;
run copy_exception_no_exceptions_test.cpp : : : <exception-handling>off <rtti>on ;
run unknown_exception_test.cpp : : : <exception-handling>on ;
run exception_test.cpp : : : <exception-handling>on ;
run enable_error_info_test.cpp helper1.cpp : : : <exception-handling>on ;
run throw_exception_test.cpp helper2.cpp : : : <exception-handling>on ;
run errno_test.cpp : : : <exception-handling>on ;
run error_info_basic_test.cpp : : : <exception-handling>on ;
run error_info_lv_test.cpp : : : <exception-handling>on ;
run error_info_lv_const_test.cpp : : : <exception-handling>on ;
run error_info_rv_test.cpp : : : <exception-handling>on ;
run error_info_rv_const_test.cpp : : : <exception-handling>on ;
run diagnostic_information_test.cpp : : : <exception-handling>on ;
run refcount_ptr_test.cpp ;
run current_exception_cast_test.cpp ;
run current_exception_cast_test.cpp : : : <exception-handling>on ;
run no_exceptions_test.cpp : : : <exception-handling>off ;
run errinfos_test.cpp ;
run exception_ptr_test.cpp/<define>BOOST_ENABLE_NON_INTRUSIVE_EXCEPTION_PTR ../../thread/src/tss_null.cpp /boost/exception /boost//thread : : : <threading>multi : non_intrusive_exception_ptr_test ;
run exception_ptr_test.cpp ../../thread/src/tss_null.cpp /boost//thread : : : <threading>multi ;
run errinfos_test.cpp : : : <exception-handling>on ;
run exception_ptr_test.cpp/<define>BOOST_ENABLE_NON_INTRUSIVE_EXCEPTION_PTR ../../thread/src/tss_null.cpp /boost/exception//boost_exception /boost/thread//boost_thread : : : <threading>multi <exception-handling>on : non_intrusive_exception_ptr_test ;
run exception_ptr_test.cpp ../../thread/src/tss_null.cpp /boost/thread//boost_thread : : : <threading>multi <exception-handling>on ;
run exception_ptr_test2.cpp ;
lib visibility_test_lib : visibility_test_lib.cpp : <visibility>hidden <exception-handling>on ;
run visibility_test.cpp visibility_test_lib/<link>shared : : : <visibility>hidden <exception-handling>on ;
compile-fail exception_fail.cpp ;
compile-fail throw_exception_fail.cpp ;
@ -71,5 +72,3 @@ compile errinfo_file_name_hpp_test.cpp ;
compile errinfo_file_open_mode_hpp_test.cpp ;
compile errinfo_nested_exception_hpp_test.cpp ;
compile errinfo_type_info_name_hpp_test.cpp ;
compile bug_11874_test.cpp ;

View File

@ -1,10 +0,0 @@
//Copyright (c) 2006-2017 Emil Dotchevski and Reverge Studios, Inc.
//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 <boost/thread.hpp>
int main()
{
}

View File

@ -3,6 +3,12 @@
//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 <boost/config.hpp>
#if defined( BOOST_NO_EXCEPTIONS )
# error This program requires exception handling.
#endif
#include <boost/exception_ptr.hpp>
#include <boost/exception/get_error_info.hpp>
#include <boost/exception/errinfo_nested_exception.hpp>
@ -423,7 +429,9 @@ main()
test_std_exception_what<std::range_error>();
test_std_exception_what<std::overflow_error>();
test_std_exception_what<std::underflow_error>();
#if !defined(_GLIBCXX_USE_CXX11_ABI) || !_GLIBCXX_USE_CXX11_ABI
test_std_exception_what<std::ios_base::failure>();
#endif
test_std_exception_what<std::runtime_error>();
test_std_exception<std::bad_alloc>();
#ifndef BOOST_NO_TYPEID

View File

@ -0,0 +1,93 @@
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
//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)
#define BOOST_NORETURN
#include <boost/config.hpp>
#if !defined( BOOST_NO_EXCEPTIONS )
# error This program requires exception handling disabled.
#endif
#include <boost/exception_ptr.hpp>
#include <boost/exception/get_error_info.hpp>
#include <boost/detail/lightweight_test.hpp>
typedef boost::error_info<struct tag_answer,int> answer;
int exc_count;
struct
err:
virtual boost::exception,
virtual std::exception
{
err()
{
++exc_count;
}
err( err const & )
{
++exc_count;
}
virtual
~err() BOOST_NOEXCEPT_OR_NOTHROW
{
--exc_count;
}
private:
err & operator=( err const & );
};
namespace
{
bool throw_exception_called;
}
// It is not valid to return to the caller but we do for testing purposes.
namespace
boost
{
void
throw_exception( std::exception const & e )
{
throw_exception_called = true;
BOOST_TEST(dynamic_cast<err const *>(&e)!=0);
int const * ans=boost::get_error_info<answer>(e);
BOOST_TEST(ans && *ans==42);
}
struct source_location;
void
throw_exception( std::exception const & e, boost::source_location const & )
{
throw_exception_called = true;
BOOST_TEST(dynamic_cast<err const *>(&e)!=0);
int const * ans=boost::get_error_info<answer>(e);
BOOST_TEST(ans && *ans==42);
}
}
void
simple_test()
{
boost::exception_ptr p = boost::copy_exception(err() << answer(42));
throw_exception_called = false;
boost::exception_detail::rethrow_exception_(p);
BOOST_TEST(throw_exception_called);
}
int
main()
{
BOOST_TEST(++exc_count==1);
simple_test();
BOOST_TEST(!--exc_count);
return boost::report_errors();
}

View File

@ -3,14 +3,22 @@
//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 <boost/config.hpp>
#if defined( BOOST_NO_EXCEPTIONS )
# error This program requires exception handling.
#endif
#include <boost/exception_ptr.hpp>
#include <boost/exception/get_error_info.hpp>
#include <boost/thread.hpp>
#include <boost/detail/atomic_count.hpp>
#include <boost/smart_ptr/detail/atomic_count.hpp>
#include <boost/detail/lightweight_test.hpp>
typedef boost::error_info<struct tag_answer,int> answer;
int const thread_count = 100;
boost::detail::atomic_count exc_count(0);
struct
@ -39,20 +47,21 @@ err:
err & operator=( err const & );
};
class
future
{
public:
future ():
ready_ (false)
future():
ready_(false)
{
}
void
set_exception( boost::exception_ptr const & e )
{
boost::unique_lock<boost::mutex> lck (mux_);
boost::unique_lock<boost::mutex> lck(mux_);
exc_ = e;
ready_ = true;
cond_.notify_all();
@ -61,10 +70,10 @@ future
void
get_exception() const
{
boost::unique_lock<boost::mutex> lck (mux_);
while (! ready_)
cond_.wait (lck);
rethrow_exception (exc_);
boost::unique_lock<boost::mutex> lck(mux_);
while( !ready_ )
cond_.wait(lck);
rethrow_exception(exc_);
}
private:
@ -78,17 +87,17 @@ future
void
producer( future & f )
{
f.set_exception (boost::copy_exception (err () << answer(42)));
f.set_exception(boost::copy_exception(err() << answer(42)));
}
void
consumer()
{
future f;
boost::thread thr (boost::bind (&producer, boost::ref (f)));
boost::thread thr(boost::bind(&producer, boost::ref(f)));
try
{
f.get_exception ();
f.get_exception();
}
catch(
err & e )
@ -102,7 +111,7 @@ consumer()
void
consume()
{
for( int i=0; i!=100; ++i )
for( int i=0; i!=thread_count; ++i )
consumer();
}
@ -110,15 +119,15 @@ void
thread_test()
{
boost::thread_group grp;
for( int i=0; i!=100; ++i )
for( int i=0; i!=thread_count; ++i )
grp.create_thread(&consume);
grp.join_all ();
grp.join_all();
}
void
simple_test()
{
boost::exception_ptr p = boost::copy_exception(err());
boost::exception_ptr p = boost::copy_exception(err() << answer(42));
try
{
rethrow_exception(p);

View File

@ -3,6 +3,12 @@
//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 <boost/config.hpp>
#if defined( BOOST_NO_EXCEPTIONS )
# error This program requires exception handling.
#endif
#include <boost/exception/current_exception_cast.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <exception>

View File

@ -3,6 +3,12 @@
//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 <boost/config.hpp>
#if defined( BOOST_NO_EXCEPTIONS )
# error This program requires exception handling.
#endif
#include <boost/exception/diagnostic_information.hpp>
#include <boost/exception/info.hpp>
#include <boost/detail/lightweight_test.hpp>

View File

@ -3,6 +3,12 @@
//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 <boost/config.hpp>
#if defined( BOOST_NO_EXCEPTIONS )
# error This program requires exception handling.
#endif
#include "helper1.hpp"
#include <boost/exception/get_error_info.hpp>
#include <boost/exception/info.hpp>

View File

@ -3,6 +3,12 @@
//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 <boost/config.hpp>
#if defined( BOOST_NO_EXCEPTIONS )
# error This program requires exception handling.
#endif
#include <boost/exception/errinfo_api_function.hpp>
#include <boost/exception/errinfo_at_line.hpp>
#include <boost/exception/errinfo_errno.hpp>

View File

@ -3,6 +3,12 @@
//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 <boost/config.hpp>
#if defined( BOOST_NO_EXCEPTIONS )
# error This program requires exception handling.
#endif
#include <boost/exception/get_error_info.hpp>
#include <boost/exception/info.hpp>
#include <boost/detail/lightweight_test.hpp>

View File

@ -3,6 +3,12 @@
//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 <boost/config.hpp>
#if defined( BOOST_NO_EXCEPTIONS )
# error This program requires exception handling.
#endif
#include <boost/exception/error_info.hpp>
#include <boost/exception/exception.hpp>
#include <boost/exception/info.hpp>

View File

@ -3,6 +3,12 @@
//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 <boost/config.hpp>
#if defined( BOOST_NO_EXCEPTIONS )
# error This program requires exception handling.
#endif
#include <boost/exception/get_error_info.hpp>
#include <boost/exception/info_tuple.hpp>
#include <boost/exception_ptr.hpp>
@ -146,7 +152,7 @@ throw_catch_add_file_name( char const * name )
{
add_info(x,test_5(std::string(name)));
throw;
}
}
}
void

View File

@ -3,6 +3,12 @@
//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 <boost/config.hpp>
#if defined( BOOST_NO_EXCEPTIONS )
# error This program requires exception handling.
#endif
#include <boost/exception_ptr.hpp>
#include <boost/exception/info.hpp>
#include <boost/exception/get_error_info.hpp>
@ -10,7 +16,7 @@
#include <boost/function.hpp>
#include <boost/bind.hpp>
#include <boost/thread.hpp>
#include <boost/detail/atomic_count.hpp>
#include <boost/smart_ptr/detail/atomic_count.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <iostream>

View File

@ -0,0 +1,114 @@
// Copyright 2022 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/config.hpp>
#if defined(BOOST_NO_EXCEPTIONS)
#include <boost/config/pragma_message.hpp>
BOOST_PRAGMA_MESSAGE( "Skipping test because BOOST_NO_EXCEPTIONS is defined" )
int main() {}
#elif defined(BOOST_NO_CXX11_HDR_EXCEPTION)
#include <boost/config/pragma_message.hpp>
BOOST_PRAGMA_MESSAGE( "Skipping test because BOOST_NO_CXX11_HDR_EXCEPTION is defined" )
int main() {}
#else
#include <boost/exception_ptr.hpp>
#include <boost/exception/exception.hpp>
#include <boost/core/lightweight_test.hpp>
#include <exception>
#include <new>
#include <stdexcept>
class my_exception
{
};
class my_exception2: public std::exception
{
};
class my_exception3: public std::bad_alloc
{
};
class my_exception4: public std::exception, public boost::exception
{
};
class my_exception5: public std::logic_error, public virtual boost::exception
{
public:
my_exception5(): std::logic_error( "" ) {}
};
int main()
{
try
{
throw my_exception();
}
catch( ... )
{
boost::exception_ptr p = boost::current_exception();
BOOST_TEST_THROWS( boost::rethrow_exception( p ), my_exception );
}
try
{
throw my_exception2();
}
catch( ... )
{
boost::exception_ptr p = boost::current_exception();
BOOST_TEST_THROWS( boost::rethrow_exception( p ), my_exception2 );
BOOST_TEST_THROWS( boost::rethrow_exception( p ), std::exception );
}
try
{
throw my_exception3();
}
catch( ... )
{
boost::exception_ptr p = boost::current_exception();
BOOST_TEST_THROWS( boost::rethrow_exception( p ), my_exception3 );
BOOST_TEST_THROWS( boost::rethrow_exception( p ), std::bad_alloc );
}
try
{
throw my_exception4();
}
catch( ... )
{
boost::exception_ptr p = boost::current_exception();
BOOST_TEST_THROWS( boost::rethrow_exception( p ), my_exception4 );
BOOST_TEST_THROWS( boost::rethrow_exception( p ), std::exception );
BOOST_TEST_THROWS( boost::rethrow_exception( p ), boost::exception );
}
try
{
throw my_exception5();
}
catch( ... )
{
boost::exception_ptr p = boost::current_exception();
BOOST_TEST_THROWS( boost::rethrow_exception( p ), my_exception5 );
BOOST_TEST_THROWS( boost::rethrow_exception( p ), std::logic_error );
BOOST_TEST_THROWS( boost::rethrow_exception( p ), boost::exception );
}
return boost::report_errors();
}
#endif

View File

@ -3,6 +3,12 @@
//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 <boost/config.hpp>
#if defined( BOOST_NO_EXCEPTIONS )
# error This program requires exception handling.
#endif
#include <boost/exception/exception.hpp>
#include <boost/detail/lightweight_test.hpp>

View File

@ -3,6 +3,12 @@
//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 <boost/config.hpp>
#if defined( BOOST_NO_EXCEPTIONS )
# error This program requires exception handling.
#endif
#include <boost/exception/exception.hpp>
#include <stdexcept>
#include <string>

View File

@ -3,6 +3,12 @@
//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 <boost/config.hpp>
#if defined( BOOST_NO_EXCEPTIONS )
# error This program requires exception handling.
#endif
#include "helper2.hpp"
#include <boost/throw_exception.hpp>

View File

@ -3,8 +3,12 @@
//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)
#define BOOST_NO_EXCEPTIONS
#include <boost/config.hpp>
#if !defined( BOOST_NO_EXCEPTIONS )
# error This program requires exception handling disabled.
#endif
#include <boost/throw_exception.hpp>
#include <boost/exception/info.hpp>
#include <boost/exception/diagnostic_information.hpp>

View File

@ -3,6 +3,12 @@
//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 <boost/config.hpp>
#if defined( BOOST_NO_EXCEPTIONS )
# error This program requires exception handling.
#endif
#include "helper2.hpp"
#include <boost/exception/get_error_info.hpp>
#include <boost/exception/info.hpp>
@ -40,7 +46,7 @@ boost_throw_exception_test()
int const * line=boost::get_error_info<boost::throw_line>(x);
BOOST_TEST( file && *file );
BOOST_TEST( function && *function );
BOOST_TEST( line && *line==32 );
BOOST_TEST( line && *line==38 );
}
catch(
... )
@ -61,7 +67,7 @@ boost_throw_exception_test()
int const * data=boost::get_error_info<test_data>(x);
BOOST_TEST( file && *file );
BOOST_TEST( function && *function );
BOOST_TEST( line && *line==52 );
BOOST_TEST( line && *line==58 );
BOOST_TEST( data && *data==42 );
}
catch(

View File

@ -3,6 +3,12 @@
//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 <boost/config.hpp>
#if defined( BOOST_NO_EXCEPTIONS )
# error This program requires exception handling.
#endif
#include <boost/exception_ptr.hpp>
#include <boost/exception/get_error_info.hpp>
#include <boost/exception/info.hpp>

32
test/visibility_test.cpp Normal file
View File

@ -0,0 +1,32 @@
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
//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 <boost/config.hpp>
#if defined( BOOST_NO_EXCEPTIONS )
# error This program requires exception handling.
#endif
#include "visibility_test_lib.hpp"
#include <boost/exception/get_error_info.hpp>
#include <boost/detail/lightweight_test.hpp>
void BOOST_SYMBOL_IMPORT hidden_throw();
int
main()
{
try
{
hidden_throw();
BOOST_TEST(false);
}
catch(
my_exception & e )
{
BOOST_TEST(boost::get_error_info<my_info>(e) && *boost::get_error_info<my_info>(e)==42);
}
return boost::report_errors();
}

View File

@ -0,0 +1,9 @@
#include "visibility_test_lib.hpp"
#include <boost/throw_exception.hpp>
void
BOOST_SYMBOL_EXPORT
hidden_throw()
{
BOOST_THROW_EXCEPTION(my_exception() << my_info(42));
}

View File

@ -0,0 +1,15 @@
#ifndef HIDDEN_HPP_INCLUDED
#define HIDDEN_HPP_INCLUDED
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
//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 <boost/exception/info.hpp>
typedef boost::error_info<struct my_info_, int> my_info;
struct BOOST_SYMBOL_VISIBLE my_exception: virtual std::exception, virtual boost::exception { };
#endif