Compare commits

..

1 Commits

Author SHA1 Message Date
5c27cc10d7 Release 1.41.0
[SVN r57747]
2009-11-18 14:58:26 +00:00
108 changed files with 1591 additions and 19285 deletions

View File

@ -1,59 +0,0 @@
# 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")

View File

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

View File

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

View File

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

View File

@ -1,47 +0,0 @@
#!/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

View File

@ -1,248 +0,0 @@
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: "03,11"
os: ubuntu-latest
container: ubuntu:18.04
install: g++-4.8-multilib
address-model: 32,64
- toolset: gcc-5
cxxstd: "03,11,14,1z"
os: ubuntu-latest
container: ubuntu:18.04
install: g++-5-multilib
address-model: 32,64
- toolset: gcc-6
cxxstd: "03,11,14,1z"
os: ubuntu-latest
container: ubuntu:18.04
install: g++-6-multilib
address-model: 32,64
- toolset: gcc-7
cxxstd: "03,11,14,17"
os: ubuntu-latest
container: ubuntu:18.04
install: g++-7-multilib
address-model: 32,64
- toolset: gcc-8
cxxstd: "03,11,14,17,2a"
os: ubuntu-20.04
install: g++-8-multilib
address-model: 32,64
- toolset: gcc-9
cxxstd: "03,11,14,17,2a"
os: ubuntu-20.04
install: g++-9-multilib
address-model: 32,64
- toolset: gcc-10
cxxstd: "03,11,14,17,2a"
os: ubuntu-20.04
install: g++-10-multilib
address-model: 32,64
- toolset: gcc-11
cxxstd: "03,11,14,17,20"
os: ubuntu-20.04
install: g++-11-multilib
address-model: 32,64
- toolset: gcc-12
cxxstd: "03,11,14,17,20,2b"
os: ubuntu-22.04
install: g++-12-multilib
address-model: 32,64
- toolset: clang
compiler: clang++-3.9
cxxstd: "03,11,14"
os: ubuntu-latest
container: ubuntu:18.04
install: clang-3.9
- toolset: clang
compiler: clang++-4.0
cxxstd: "03,11,14"
os: ubuntu-latest
container: ubuntu:18.04
install: clang-4.0
- toolset: clang
compiler: clang++-5.0
cxxstd: "03,11,14,1z"
os: ubuntu-latest
container: ubuntu:18.04
install: clang-5.0
- toolset: clang
compiler: clang++-6.0
cxxstd: "03,11,14,17"
os: ubuntu-20.04
install: clang-6.0
- toolset: clang
compiler: clang++-7
cxxstd: "03,11,14,17"
os: ubuntu-20.04
install: clang-7
- toolset: clang
compiler: clang++-8
cxxstd: "03,11,14,17"
os: ubuntu-20.04
install: clang-8
- toolset: clang
compiler: clang++-9
cxxstd: "03,11,14,17,2a"
os: ubuntu-20.04
install: clang-9
- toolset: clang
compiler: clang++-10
cxxstd: "03,11,14,17,2a"
os: ubuntu-20.04
- toolset: clang
compiler: clang++-11
cxxstd: "03,11,14,17,2a"
os: ubuntu-20.04
- toolset: clang
compiler: clang++-12
cxxstd: "03,11,14,17,20"
os: ubuntu-20.04
- toolset: clang
compiler: clang++-13
cxxstd: "03,11,14,17,20,2b"
os: ubuntu-22.04
install: clang-13
- toolset: clang
compiler: clang++-14
cxxstd: "03,11,14,17,20,2b"
os: ubuntu-22.04
install: clang-14
- toolset: clang
cxxstd: "03,11,14,17,2a"
os: macos-11
- toolset: clang
cxxstd: "03,11,14,17,20,2b"
os: macos-12
runs-on: ${{matrix.os}}
container: ${{matrix.container}}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- name: Setup container environment
if: matrix.container
run: |
apt-get update
apt-get -y install sudo python git g++
- 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
python 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}} ${ADDRMD:+address-model=$ADDRMD} 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,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: "03,11,14,17,2a"
addrmd: 64
os: windows-2019
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 exception-handling=on,off rtti=on,off embed-manifest-via=linker

3
.gitignore vendored
View File

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

View File

@ -1,399 +0,0 @@
# Copyright 2016-2018 Peter Dimov
# Copyright 2018-2019 Emil Dotchevski
# 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
sudo: false
dist: trusty
python: "2.7"
os:
- linux
- osx
branches:
only:
- master
- develop
- /^feature.*/
env:
matrix:
- BOGUS_JOB=true
addons:
apt:
packages:
- g++-4.9
- g++-5
- g++-6
- clang-3.6
- clang-3.7
- clang-3.8
- ruby-full
# - python-3.6
- ninja-build
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise
- llvm-toolchain-precise-3.6
- llvm-toolchain-precise-3.7
- llvm-toolchain-precise-3.8
matrix:
exclude:
- env: BOGUS_JOB=true
include:
- os: osx
osx_image: xcode11.2
compiler: clang++
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
- os: osx
osx_image: xcode11.1
compiler: clang++
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
- os: osx
osx_image: xcode11
compiler: clang++
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
- os: osx
osx_image: xcode10.3
compiler: clang++
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
- os: osx
osx_image: xcode10.2
compiler: clang++
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
- os: osx
osx_image: xcode10.1
compiler: clang++
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
- os: osx
osx_image: xcode10
compiler: clang++
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
- os: osx
osx_image: xcode9.4
compiler: clang++
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
- os: osx
osx_image: xcode9.3
compiler: clang++
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
- os: osx
osx_image: xcode9.2
compiler: clang++
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
- os: osx
osx_image: xcode9.1
compiler: clang++
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
- os: osx
osx_image: xcode9
compiler: clang++
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
- os: osx
osx_image: xcode8.3
compiler: clang++
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
- os: osx
osx_image: xcode8
compiler: clang++
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z
- os: osx
compiler: clang++
env: UBSAN=1 TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11,14,1z UBSAN_OPTIONS=print_stacktrace=1
- os: linux
compiler: g++-4.7
env: TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=98,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=98,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=98,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=98,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=98,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=98,03,11,14,17
addons:
apt:
packages:
- g++-7
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: g++-8
env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=98,03,11,14,17
addons:
apt:
packages:
- g++-8
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: g++-9
env: TOOLSET=gcc COMPILER=g++-9 CXXSTD=98,03,11,14,17,2a
addons:
apt:
packages:
- g++-9
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: g++-9
env: UBSAN=1 TOOLSET=gcc COMPILER=g++-9 CXXSTD=98,03,11,14,17,2a UBSAN_OPTIONS=print_stacktrace=1 LINKFLAGS=-fuse-ld=gold
addons:
apt:
packages:
- g++-9
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: /usr/bin/clang++
env: TOOLSET=clang COMPILER=/usr/bin/clang++ CXXSTD=98,03,11
addons:
apt:
packages:
- clang-3.3
- os: linux
compiler: /usr/bin/clang++
env: TOOLSET=clang COMPILER=/usr/bin/clang++ CXXSTD=98,03,11
addons:
apt:
packages:
- clang-3.4
- os: linux
compiler: clang++
env: TOOLSET=clang COMPILER=clang++ CXXSTD=98,03,11
- os: linux
compiler: clang++-3.5
env: TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=98,03,11,14,1z
addons:
apt:
packages:
- clang-3.5
- libstdc++-4.9-dev
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: clang++-3.6
env: TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=98,03,11,14,1z
addons:
apt:
packages:
- clang-3.6
- libstdc++-4.9-dev
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: clang++-3.7
env: TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=98,03,11,14,1z
addons:
apt:
packages:
- clang-3.7
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.7
- os: linux
compiler: clang++-3.8
env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=98,03,11,14,1z
addons:
apt:
packages:
- clang-3.8
- libstdc++-4.9-dev
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: clang++-3.9
env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=98,03,11,14,1z
addons:
apt:
packages:
- clang-3.9
- libstdc++-4.9-dev
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: clang++-4.0
env: TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=98,03,11,14,1z
addons:
apt:
packages:
- clang-4.0
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-4.0
- os: linux
compiler: clang++-5.0
env: TOOLSET=clang COMPILER=clang++-5.0 CXXSTD=98,03,11,14,1z
addons:
apt:
packages:
- clang-5.0
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-5.0
- os: linux
compiler: clang++-6.0
env: TOOLSET=clang COMPILER=clang++-6.0 CXXSTD=98,03,11,14,17
addons:
apt:
packages:
- clang-6.0
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-6.0
- os: linux
compiler: clang++-7
env: TOOLSET=clang COMPILER=clang++-7 CXXSTD=98,03,11,14,17,2a
addons:
apt:
packages:
- clang-7
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-7
- os: linux
compiler: clang++-8
env: TOOLSET=clang COMPILER=clang++-8 CXXSTD=98,03,11,14,17,2a
addons:
apt:
packages:
- clang-8
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-8
- os: linux
dist: xenial
compiler: clang++-9
env: TOOLSET=clang COMPILER=clang++-9 CXXSTD=98,03,11,14,17,2a
addons:
apt:
packages:
- clang-9
sources:
- ubuntu-toolchain-r-test
- sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main'
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
- os: linux
compiler: clang++-8
env: UBSAN=1 TOOLSET=clang COMPILER=clang++-8 CXXSTD=98,03,11,14,17,2a UBSAN_OPTIONS=print_stacktrace=1
addons:
apt:
packages:
- clang-8
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-8
install:
- gem install asciidoctor
- gem 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
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}
notifications:
email:
on_success: always

View File

@ -1,32 +0,0 @@
# 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.5...3.20)
project(boost_exception VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
add_library(boost_exception STATIC
src/clone_current_exception_non_intrusive.cpp
)
add_library(Boost::exception ALIAS boost_exception)
target_include_directories(boost_exception PUBLIC include)
target_link_libraries(boost_exception
PUBLIC
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()

View File

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

View File

@ -1,19 +0,0 @@
# 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

@ -1,74 +0,0 @@
# Copyright 2016-2019 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
- /feature\/.*/
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
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
TOOLSET: msvc-14.1
CXXSTD: 14,17
ADDRMD: 32,64
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
TOOLSET: clang-win
CXXSTD: 14,17
ADDRMD: 64
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
TOOLSET: msvc-14.2
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-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;
TOOLSET: gcc
CXXSTD: 03,11,14,1z
install:
- set BOOST_BRANCH=develop
- if "%APPVEYOR_REPO_BRANCH%" == "master" set BOOST_BRANCH=master
- 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 tools/boost_install
- git submodule update --init libs/config
- git submodule update --init libs/headers
- git submodule update --init tools/boostdep
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\exception\
- python tools/boostdep/depinst/depinst.py exception
- cmd /c bootstrap
- b2 headers
build: off
test_script:
- PATH=%ADDPATH%%PATH%
- if not "%CXXSTD%" == "" set CXXSTD=cxxstd=%CXXSTD%
- if not "%ADDRMD%" == "" set ADDRMD=address-model=%ADDRMD%
- b2 -j3 libs/exception/test toolset=%TOOLSET% %CXXSTD% %ADDRMD% variant=debug,release

View File

@ -1,14 +0,0 @@
# Boost Exception Library build Jamfile
#
# 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)
project boost/exception
: source-location ../src
: requirements <link>static
;
lib boost_exception : clone_current_exception_non_intrusive.cpp ;
boost-install boost_exception ;

View File

@ -21,9 +21,21 @@
<!-- 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>
<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 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>(BOOST_CURRENT_FUNCTION) &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 BOOST_CURRENT_FUNCTION, __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>
</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>
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="frequently_asked_questions.html">Frequently Asked Questions</a></span>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->

View File

@ -12,14 +12,13 @@
<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>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

View File

@ -40,7 +40,7 @@
#include &lt;<span class="RenoLink"><a href="boost_exception_ptr_hpp.html">boost/exception_ptr.hpp</a></span>&gt;
#endif</span></pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
See also: <span class="RenoPageList"><a href="tutorial_diagnostic_information.html">Diagnostic Information</a>&nbsp;| <a href="tutorial_enable_error_info.html">Integrating Boost Exception in Existing Exception Class Hierarchies</a>&nbsp;| <a href="synopsis.html">Synopsis</a></span>
See also: <span class="RenoPageList"><a href="boost_exception_hpp.html">boost/exception.hpp</a>&nbsp;| <a href="tutorial_diagnostic_information.html">Diagnostic Information</a>&nbsp;| <a href="tutorial_enable_error_info.html">Integrating Boost Exception in Existing Exception Class Hierarchies</a>&nbsp;| <a href="synopsis.html">Synopsis</a></span>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->

View File

@ -30,11 +30,11 @@ boost
<span class="RenoIncludeSPAN"> class <span class="RenoLink"><a href="exception.html">exception</a></span>;</span>
<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>( E const &amp; e );
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>
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 );</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">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 ) 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>
}</pre>

View File

@ -0,0 +1,42 @@
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<title>boost/exception.hpp</title>
<link href='reno.css' type='text/css' rel='stylesheet'/>
</head>
<body>
<div class="body-0">
<div class="body-1">
<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>
</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) -->
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>boost/exception.hpp</h2>
</div>
<p>This header has been deprecated.</p>
<p>Please #include &lt;<span class="RenoLink"><a href="boost_exception_all_hpp.html">boost/exception/all.hpp</a></span>&gt; instead.</p>
</div><div class="RenoAutoDIV"></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) -->
<div id="footer">
<p>
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
</p>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -47,7 +47,7 @@ boost
<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>
}</pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
See also: <span class="RenoPageList"><a href="boost_exception_all_hpp.html">boost/exception/all.hpp</a>&nbsp;| <a href="copy_exception.html">copy_exception</a>&nbsp;| <a href="current_exception.html">current_exception</a>&nbsp;| <a href="diagnostic_information.html">diagnostic_information</a>&nbsp;| <a href="exception_ptr.html">exception_ptr</a>&nbsp;| <a href="original_exception_type.html">original_exception_type</a>&nbsp;| <a href="rethrow_exception.html">rethrow_exception</a>&nbsp;| <a href="synopsis.html">Synopsis</a>&nbsp;| <a href="unknown_exception.html">unknown_exception</a></span>
See also: <span class="RenoPageList"><a href="boost_exception_all_hpp.html">boost/exception/all.hpp</a>&nbsp;| <a href="copy_exception.html">copy_exception</a>&nbsp;| <a href="current_exception.html">current_exception</a>&nbsp;| <a href="exception_ptr.html">exception_ptr</a>&nbsp;| <a href="original_exception_type.html">original_exception_type</a>&nbsp;| <a href="rethrow_exception.html">rethrow_exception</a>&nbsp;| <a href="synopsis.html">Synopsis</a>&nbsp;| <a href="unknown_exception.html">unknown_exception</a></span>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->

View File

@ -27,6 +27,7 @@
#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>(BOOST_CURRENT_FUNCTION) &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,19 +22,18 @@
<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> (both defined automatically by boost/config.hpp)</p>
<p><b>BOOST_NO_RTTI</b><span class="RenoBR">&nbsp;</span><br/><b>BOOST_NO_TYPEID</b></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>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> (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>In addition, the following user-defined macros are recognized:</p>
<p><b>BOOST_EXCEPTION_DISABLE</b> (user-defined)</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>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>
</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>
See also: <span class="RenoPageList"><a href="boost-exception.html">Boost Exception</a>&nbsp;| <a href="boost_exception_all_hpp.html">boost/exception/all.hpp</a>&nbsp;| <a href="get_error_info.html">get_error_info</a></span>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->

View File

@ -39,7 +39,7 @@ catch(...)
return <span class="RenoLink"><a href="current_exception.html">current_exception</a></span>();
}</pre>
</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_exception_ptr_hpp.html">boost/exception_ptr.hpp</a>&nbsp;| <a href="current_exception.html">current_exception</a></span>
See also: <span class="RenoPageList"><a href="boost-exception.html">Boost Exception</a>&nbsp;| <a href="boost_exception_ptr_hpp.html">boost/exception_ptr.hpp</a></span>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->

View File

@ -29,7 +29,6 @@ boost
}</pre>
</div><h4>Requirements:</h4>
<p>The <span class="RenoLink">current_exception</span> function must not be called outside of a catch block.</p>
<p>In addition, to safely copy an exception from one thread to another, if the exception object is copied by <span class="RenoLink">current_exception</span> or <span class="RenoLink"><a href="copy_exception.html">copy_exception</a></span>, the two copies must not have shared state. Exceptions that have value-type semantics (as well as the boost::<span class="RenoLink"><a href="exception.html">exception</a></span> type itself) satisfy this requirement.</p>
<h4>Returns:</h4>
<div><ul><li> An <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> that refers to the currently handled exception or a copy of the currently handled exception.</li>
<li> If the function needs to allocate memory and the attempt fails, it returns an <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> that refers to an instance of std::bad_alloc.</li>
@ -38,13 +37,13 @@ boost
<p>Nothing.</p>
<h4>Notes:</h4>
<div><ul><li> It is unspecified whether the return values of two successive calls to <span class="RenoLink">current_exception</span> refer to the same exception object.</li>
<li> Correct implementation of <span class="RenoLink">current_exception</span> may require compiler support (e.g. C++11 <a href="https://en.cppreference.com/w/cpp/error/current_exception">std::current_exception()</a> is used when available, as specified by Boost.Config BOOST_NO_CXX11_HDR_EXCEPTION), unless <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span> was used at the time the currently handled exception object was passed to throw. Whenever <span class="RenoLink">current_exception</span> fails to properly copy the current exception object, it returns an <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> to an object of type that is as close as possible to the original exception type, using <span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span> as a final fallback. All such types derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, and:<div><ul><li> if the original exception object derives from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, then the boost::<span class="RenoLink"><a href="exception.html">exception</a></span> sub-object of the object referred to by the returned <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> is initialized by the boost::<span class="RenoLink"><a href="exception.html">exception</a></span> copy constructor;</li>
<li> Correct implementation of <span class="RenoLink">current_exception</span> may require compiler support, unless <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span> was used at the time the currently handled exception object was passed to throw. Whenever <span class="RenoLink">current_exception</span> fails to properly copy the current exception object, it returns an <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> to an object of type that is as close as possible to the original exception type, using <span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span> as a final fallback. All such types derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, and:<div><ul><li> if the original exception object derives from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, then the boost::<span class="RenoLink"><a href="exception.html">exception</a></span> sub-object of the object referred to by the returned <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> is initialized by the boost::<span class="RenoLink"><a href="exception.html">exception</a></span> copy constructor;</li>
<li> if available, the exception contains the std::type_info of the original exception object, accessible through <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>&lt;<span class="RenoLink"><a href="original_exception_type.html">original_exception_type</a></span>&gt;.</li>
</ul></div>
</li>
</ul></div>
</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_exception_ptr_hpp.html">boost/exception_ptr.hpp</a>&nbsp;| <a href="copy_exception.html">copy_exception</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="original_exception_type.html">original_exception_type</a>&nbsp;| <a href="unknown_exception.html">unknown_exception</a></span>
See also: <span class="RenoPageList"><a href="boost-exception.html">Boost Exception</a>&nbsp;| <a href="boost_exception_ptr_hpp.html">boost/exception_ptr.hpp</a>&nbsp;| <a href="copy_exception.html">copy_exception</a>&nbsp;| <a href="enable_current_exception.html">enable_current_exception</a>&nbsp;| <a href="exception_ptr.html">exception_ptr</a>&nbsp;| <a href="frequently_asked_questions.html">Frequently Asked Questions</a>&nbsp;| <a href="original_exception_type.html">original_exception_type</a>&nbsp;| <a href="unknown_exception.html">unknown_exception</a></span>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->

View File

@ -52,7 +52,7 @@ main()
}
}</pre>
</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_exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp</a>&nbsp;| <a href="diagnostic_information.html">diagnostic_information</a>&nbsp;| <a href="frequently_asked_questions.html">Frequently Asked Questions</a></span>
See also: <span class="RenoPageList"><a href="boost-exception.html">Boost Exception</a>&nbsp;| <a href="boost_exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp</a>&nbsp;| <a href="diagnostic_information.html">diagnostic_information</a></span>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->

View File

@ -21,26 +21,30 @@
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>diagnostic_information</h3>
</div>
<div class="RenoIncludeDIV"><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="boost_exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp</a></span>&gt;<span class="RenoBR">&nbsp;</span><br/><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="boost_exception_ptr_hpp.html">boost/exception_ptr.hpp</a></span>&gt;<span class="RenoBR">&nbsp;</span><br/></p>
<div class="RenoIncludeDIV"><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="boost_exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp</a></span>&gt;<span class="RenoBR">&nbsp;</span><br/></p>
<pre>namespace
boost
{
<span class="RenoIncludeSPAN"> template &lt;class E&gt;
std::string <span class="RenoLink">diagnostic_information</span>( E const &amp; e, bool verbose=true );
std::string <span class="RenoLink">diagnostic_information</span>( E const &amp; e );
std::string <span class="RenoLink">diagnostic_information</span>( <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> const &amp; p, bool verbose=true );</span>
std::string <span class="RenoLink">diagnostic_information</span>( <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> const &amp; p );</span>
}</pre>
</div><h4>Returns:</h4>
<p>A string value that contains varying amount of diagnostic information about the passed object:</p>
<div><ul><li> If E can be statically converted to either boost::<span class="RenoLink"><a href="exception.html">exception</a></span> or to std::exception, dynamic_cast is used to access both the boost::<span class="RenoLink"><a href="exception.html">exception</a></span> and std::exception subobjects of e; otherwise, the boost::<span class="RenoLink">diagnostic_information</span> template is not available.</li>
<li> The returned value contains the string representations of all <span class="RenoLink"><a href="error_info.html">error_info</a></span> objects stored in the boost::<span class="RenoLink"><a href="exception.html">exception</a></span> subobject through <span class="RenoLink"><a href="exception_operator_shl.html">operator&lt;&lt;</a></span>.</li>
<li> In addition, if verbose is true, it contains other diagnostic information relevant to the exception, including the string returned by std::exception::what().</li>
<p>A string value that contains varying amount of implementation-specific diagnostic information about the passed object:</p>
<div><ul><li>If E can be statically converted to boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, the returned value contains the string representations of all <span class="RenoLink"><a href="error_info.html">error_info</a></span> objects stored in the boost::<span class="RenoLink"><a href="exception.html">exception</a></span> through <span class="RenoLink"><a href="exception_operator_shl.html">operator&lt;&lt;</a></span>, along with other diagnostic information relevant to the exception. If e can be dynamically converted to std::exception, the returned value also contains the what() string.</li>
<li>Otherwise, if E can be statically converted std::exception:<div><ul><li>if e can be dynamically converted to boost::exception, the returned value is the same as if E could be statically converted to boost::<span class="RenoLink"><a href="exception.html">exception</a></span>;</li>
<li>otherwise the returned value contains the what() string.</li>
</ul></div>
<p>The string representation of each <span class="RenoLink"><a href="error_info.html">error_info</a></span> object is deduced by an unqualified call to to_string(x), where x is of type <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;Tag,T&gt;, for which Boost Exception defines a generic overload. It converts x.<span class="RenoLink"><a href="error_info_value.html">value</a></span>() to string, attempting to bind (at the time the <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;Tag,T&gt; template is instantiated) the following functions in order:</p>
<div><ol><li>Unqualified call to to_string(x.<span class="RenoLink"><a href="error_info_value.html">value</a></span>()) (the return value is expected to be of type std::string.)</li>
</li>
<li>Otherwise, the boost::<span class="RenoLink">diagnostic_information</span> template is not available.</li>
</ul></div>
<p>The string representation of each <span class="RenoLink"><a href="error_info.html">error_info</a></span> object is deduced by a function call that is bound at the time the <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;Tag,T&gt; template is instantiated. The following overload resolutions are attempted in order:</p>
<div><ol><li>Unqualified call to to_string(x), where x is of type <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;Tag,T&gt; (the return value is expected to be of type std::string.)</li>
<li>Unqualified call to to_string(x.<span class="RenoLink"><a href="error_info_value.html">value</a></span>()) (the return value is expected to be of type std::string.)</li>
<li>Unqualified call to s &lt;&lt; x.<span class="RenoLink"><a href="error_info_value.html">value</a></span>(), where s is a std::ostringstream.</li>
</ol></div>
<p>The first successfully bound function is used at the time <span class="RenoLink">diagnostic_information</span> is called; if both overload resolutions are unsuccessful, the system is unable to convert the <span class="RenoLink"><a href="error_info.html">error_info</a></span> object to string, and <i>an unspecified stub string value is used without issuing a compile error.</i></p>
<p>The first successfully bound function is used at the time <span class="RenoLink">diagnostic_information</span> is called; if all 3 overload resolutions are unsuccessful, the system is unable to convert the <span class="RenoLink"><a href="error_info.html">error_info</a></span> object to string, and <i>an unspecified stub string value is used without issuing a compile error.</i></p>
<p>The <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> overload of <span class="RenoLink">diagnostic_information</span> is equivalent to:</p>
<pre>if( p )
try
@ -49,9 +53,14 @@ boost
}
catch(...)
{
return <span class="RenoLink"><a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information</a></span>(verbose);
return <span class="RenoLink"><a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information</a></span>();
}
else return &lt;unspecified-string-value&gt;;</pre>
<h4>Notes:</h4>
<div><ul><li>The format of the returned string is unspecified.</li>
<li>The returned string is <i>not</i> user-friendly.</li>
<li>The returned string may include additional platform-specific diagnostic information.</li>
</ul></div>
<div class="RenoIncludeDIV"><h4>Example:</h4>
<p>this is a possible output from the <span class="RenoLink">diagnostic_information</span> function, as used in <i>libs/exception/example/example_io.cpp:</i></p>
<pre>example_io.cpp(70): Throw in function class boost::shared_ptr&lt;struct _iobuf&gt; __cdecl my_fopen(const char *,const char *)
@ -62,7 +71,7 @@ std::exception::what: example_io error
[struct boost::<span class="RenoLink"><a href="errinfo_file_name.html">errinfo_file_name</a></span>_ *] = tmp1.txt
[struct boost::<span class="RenoLink"><a href="errinfo_file_open_mode.html">errinfo_file_open_mode</a></span>_ *] = rb</pre>
</div></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_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp</a>&nbsp;| <a href="configuration_macros.html">Configuration Macros</a>&nbsp;| <a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information</a>&nbsp;| <a href="tutorial_diagnostic_information.html">Diagnostic Information</a>&nbsp;| <a href="diagnostic_information_what.html">diagnostic_information_what</a>&nbsp;| <a href="frequently_asked_questions.html">Frequently Asked Questions</a>&nbsp;| <a href="motivation.html">Motivation</a></span>
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_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp</a>&nbsp;| <a href="configuration_macros.html">Configuration Macros</a>&nbsp;| <a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information</a>&nbsp;| <a href="tutorial_diagnostic_information.html">Diagnostic Information</a>&nbsp;| <a href="diagnostic_information_what.html">diagnostic_information_what</a>&nbsp;| <a href="frequently_asked_questions.html">Frequently Asked Questions</a>&nbsp;| <a href="motivation.html">Motivation</a>&nbsp;| <a href="throw_exception.html">throw_exception</a></span>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->

View File

@ -25,7 +25,7 @@
<pre>namespace
boost
{
<span class="RenoIncludeSPAN"> char const * <span class="RenoLink">diagnostic_information_what</span>( boost::<span class="RenoLink"><a href="exception.html">exception</a></span> const &amp; e, bool verbose=true ) throw();</span>
<span class="RenoIncludeSPAN"> char const * <span class="RenoLink">diagnostic_information_what</span>( boost::<span class="RenoLink"><a href="exception.html">exception</a></span> const &amp; e ) throw();</span>
}</pre>
</div><p>The <span class="RenoLink">diagnostic_information_what</span> function is intended to be called from a user-defined std::exception::what() override. This allows diagnostic information to be returned as the what() string.</p>
<h4>Returns:</h4>

View File

@ -48,7 +48,7 @@ throw boost::<span class="RenoLink">enable_current_exception</span>(my_exception
<h4>Note:</h4>
<p>Instead of using the throw keyword directly, it is preferable to call boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>. This is guaranteed to throw an exception that derives from boost::<span class="RenoLink"><a href="exception.html">exception</a></span> and supports the <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> functionality.</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_exception_enable_current_exception_hpp.html">boost/exception/enable_current_exception.hpp</a>&nbsp;| <a href="configuration_macros.html">Configuration Macros</a>&nbsp;| <a href="copy_exception.html">copy_exception</a>&nbsp;| <a href="current_exception.html">current_exception</a>&nbsp;| <a href="tutorial_exception_ptr.html">Transporting of Exceptions Between Threads</a></span>
See also: <span class="RenoPageList"><a href="boost-exception.html">Boost Exception</a>&nbsp;| <a href="boost_exception_enable_current_exception_hpp.html">boost/exception/enable_current_exception.hpp</a>&nbsp;| <a href="configuration_macros.html">Configuration Macros</a>&nbsp;| <a href="copy_exception.html">copy_exception</a>&nbsp;| <a href="current_exception.html">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>&nbsp;| <a href="throw_exception.html">throw_exception</a></span>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->

View File

@ -37,7 +37,7 @@ boost
<h4>Throws:</h4>
<p>Nothing.</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_enable_error_info_hpp.html">boost/exception/enable_error_info.hpp</a>&nbsp;| <a href="configuration_macros.html">Configuration Macros</a>&nbsp;| <a href="frequently_asked_questions.html">Frequently Asked Questions</a>&nbsp;| <a href="tutorial_enable_error_info.html">Integrating Boost Exception in Existing Exception Class Hierarchies</a></span>
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_enable_error_info_hpp.html">boost/exception/enable_error_info.hpp</a>&nbsp;| <a href="configuration_macros.html">Configuration Macros</a>&nbsp;| <a href="frequently_asked_questions.html">Frequently Asked Questions</a>&nbsp;| <a href="tutorial_enable_error_info.html">Integrating Boost Exception in Existing Exception Class Hierarchies</a>&nbsp;| <a href="throw_exception.html">throw_exception</a></span>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->

View File

@ -40,7 +40,7 @@ boost
<p>To retrieve data from a boost::<span class="RenoLink">exception</span> object, use the <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span> function template.</p>
</div><div class="RenoHR"><hr/></div>
<h3>See Also:</h3>
<div class="RenoPageList"><a href="configuration_macros.html">Configuration Macros</a>&nbsp;| <a href="current_exception.html">current_exception</a>&nbsp;| <a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information</a>&nbsp;| <a href="tutorial_diagnostic_information.html">Diagnostic Information</a>&nbsp;| <a href="diagnostic_information.html">diagnostic_information</a>&nbsp;| <a href="diagnostic_information_what.html">diagnostic_information_what</a>&nbsp;| <a href="enable_current_exception.html">enable_current_exception</a>&nbsp;| <a href="enable_error_info.html">enable_error_info</a>&nbsp;| <a href="error_info.html">error_info</a>&nbsp;| <a href="exception_ptr.html">exception_ptr</a>&nbsp;| <a href="frequently_asked_questions.html">Frequently Asked Questions</a>&nbsp;| <a href="get_error_info.html">get_error_info</a>&nbsp;| <a href="motivation.html">Motivation</a>&nbsp;| <a href="tutorial_transporting_data.html">Transporting of Arbitrary Data to the Catch Site</a>&nbsp;| <a href="tutorial_exception_ptr.html">Transporting of Exceptions Between Threads</a>&nbsp;| <a href="throw_exception.html">throw_exception</a>&nbsp;| <a href="tuple_operator_shl.html">tuple/operator&lt;&lt;</a>&nbsp;| <a href="unknown_exception.html">unknown_exception</a></div>
<div class="RenoPageList"><a href="configuration_macros.html">Configuration Macros</a>&nbsp;| <a href="current_exception.html">current_exception</a>&nbsp;| <a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information</a>&nbsp;| <a href="tutorial_diagnostic_information.html">Diagnostic Information</a>&nbsp;| <a href="diagnostic_information.html">diagnostic_information</a>&nbsp;| <a href="diagnostic_information_what.html">diagnostic_information_what</a>&nbsp;| <a href="enable_current_exception.html">enable_current_exception</a>&nbsp;| <a href="enable_error_info.html">enable_error_info</a>&nbsp;| <a href="error_info.html">error_info</a>&nbsp;| <a href="exception_ptr.html">exception_ptr</a>&nbsp;| <a href="frequently_asked_questions.html">Frequently Asked Questions</a>&nbsp;| <a href="get_error_info.html">get_error_info</a>&nbsp;| <a href="motivation.html">Motivation</a>&nbsp;| <a href="tutorial_transporting_data.html">Transporting of Arbitrary Data to the Catch Site</a>&nbsp;| <a href="tutorial_exception_ptr.html">Transporting of Exceptions Between Threads</a>&nbsp;| <a href="tuple_operator_shl.html">tuple/operator&lt;&lt;</a>&nbsp;| <a href="unknown_exception.html">unknown_exception</a></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) -->

View File

@ -31,16 +31,15 @@ boost
<p>The referenced object remains valid at least as long as there is an <span class="RenoLink">exception_ptr</span> object that refers to it.</p>
<p>Two instances of <span class="RenoLink">exception_ptr</span> are equivalent and compare equal if and only if they refer to the same exception.</p>
<p>The default constructor of <span class="RenoLink">exception_ptr</span> produces the null value of the type. The null value is equivalent only to itself.</p>
<h4>Thread safety:</h4>
<p>The <span class="RenoLink">exception_ptr</span> type is "as thread-safe as built-in types":</p>
<div><ul><li> An <span class="RenoLink">exception_ptr</span> instance can be "read" simultaneously by multiple threads</li>
<li> Different <span class="RenoLink">exception_ptr</span> instances can be "written to" simultaneously by multiple threads, even when these instances refer to the same exception object</li>
<h4>Thread safety</h4>
<div><ul><li> It is legal for multiple threads to hold <span class="RenoLink">exception_ptr</span> references to the same exception object.</li>
<li> It is illegal for multiple threads to modify the same <span class="RenoLink">exception_ptr</span> object concurrently.</li>
<li> While calling <span class="RenoLink"><a href="current_exception.html">current_exception</a></span> makes a copy of the current exception object, it is still possible for the two copies to share internal state. Therefore, in general it is not safe to call <span class="RenoLink"><a href="rethrow_exception.html">rethrow_exception</a></span> concurrently to throw the same exception object into multiple threads.</li>
</ul></div>
<p>All other simultaneous accesses result in undefined behavior.</p>
<h4>Nesting of exceptions:</h4>
<p>An <span class="RenoLink">exception_ptr</span> can be added as <span class="RenoLink"><a href="error_info.html">error_info</a></span> to any boost::<span class="RenoLink"><a href="exception.html">exception</a></span>. This is a convenient way to nest exceptions. There is no limit on the depth of the nesting, however cyclic references result in undefined behavior.</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_exception_errinfo_nested_exception_hpp.html">boost/exception/errinfo_nested_exception.hpp</a>&nbsp;| <a href="boost_exception_ptr_hpp.html">boost/exception_ptr.hpp</a>&nbsp;| <a href="copy_exception.html">copy_exception</a>&nbsp;| <a href="current_exception.html">current_exception</a>&nbsp;| <a href="diagnostic_information.html">diagnostic_information</a>&nbsp;| <a href="enable_current_exception.html">enable_current_exception</a>&nbsp;| <a href="original_exception_type.html">original_exception_type</a>&nbsp;| <a href="rethrow_exception.html">rethrow_exception</a>&nbsp;| <a href="throw_exception.html">throw_exception</a>&nbsp;| <a href="unknown_exception.html">unknown_exception</a></span>
See also: <span class="RenoPageList"><a href="boost-exception.html">Boost Exception</a>&nbsp;| <a href="boost_exception_errinfo_nested_exception_hpp.html">boost/exception/errinfo_nested_exception.hpp</a>&nbsp;| <a href="boost_exception_ptr_hpp.html">boost/exception_ptr.hpp</a>&nbsp;| <a href="copy_exception.html">copy_exception</a>&nbsp;| <a href="current_exception.html">current_exception</a>&nbsp;| <a href="diagnostic_information.html">diagnostic_information</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="original_exception_type.html">original_exception_type</a>&nbsp;| <a href="rethrow_exception.html">rethrow_exception</a>&nbsp;| <a href="unknown_exception.html">unknown_exception</a></span>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->

View File

@ -21,35 +21,9 @@
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>Frequently Asked Questions</h2>
</div>
<h3>What is the cost of calling boost::throw_exception?</h3>
<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__ 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>
<p>The <span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span> macro also results in a call to boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>, but in addition it records in the exception object the __FILE__ and __LINE__ of the throw, as well as the pretty name of the function that throws. This enables boost::<span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span> to compose a more useful, if not user-friendly message.</p>
<p>Typical use of boost::<span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span> is:</p>
<pre>catch(...)
{
std::cerr &lt;&lt;
"Unexpected exception, diagnostic information follows:\n" &lt;&lt;
<span class="RenoLink"><a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information</a></span>();
}</pre>
<p>This is a possible message it may display -- the information in the first line is only available if <span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span> was used to throw:</p>
<pre>example_io.cpp(70): Throw in function class boost::shared_ptr&lt;struct _iobuf&gt; __cdecl my_fopen(const char *,const char *)
Dynamic exception type: class boost::exception_detail::clone_impl&lt;class fopen_error&gt;
std::exception::what: example_io error
[struct boost::<span class="RenoLink"><a href="errinfo_api_function.html">errinfo_api_function</a></span>_ *] = fopen
[struct boost::<span class="RenoLink"><a href="errinfo_errno.html">errinfo_errno</a></span>_ *] = 2, "No such file or directory"
[struct boost::<span class="RenoLink"><a href="errinfo_file_name.html">errinfo_file_name</a></span>_ *] = tmp1.txt
[struct boost::<span class="RenoLink"><a href="errinfo_file_open_mode.html">errinfo_file_open_mode</a></span>_ *] = rb</pre>
<p>In some development environments, the first line in that message can be clicked to show the location of the throw in the debugger, so it's easy to set a break point and run again to see the unexpected throw in the context of its call stack.</p>
<h3>Why doesn't boost::exception derive from std::exception?</h3>
<p>Despite that <span class="RenoLink"><a href="using_virtual_inheritance_in_exception_types.html">virtual inheritance should be used in deriving from base exception types</a></span>, quite often exception types (including the ones defined in the standard library) don't derive from std::exception virtually.</p>
<p>If boost::<span class="RenoLink"><a href="exception.html">exception</a></span> derives from std::exception, using the <span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span> function with such user-defined types would introduce dangerous ambiguity which would break all catch(std::exception &amp;) statements.</p>
<p>Of course, boost::<span class="RenoLink"><a href="exception.html">exception</a></span> should not be used to replace std::exception as a base type in exception type hierarchies. Instead, it should be included as a virtual base, in addition to std::exception (which should probably also be derived virtually.)</p>
<p>Despite that <span class="RenoLink"><a href="using_virtual_inheritance_in_exception_types.html">virtual inheritance should be used in deriving from base exception types</a></span>, many programmers fail to follow this principle when deriving from std::exception. If boost::<span class="RenoLink"><a href="exception.html">exception</a></span> derives from std::exception, using the <span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span> function with such user-defined types would introduce dangerous ambiguity which would break all catch(std::exception &amp;) statements.</p>
<p>Of course, boost::<span class="RenoLink"><a href="exception.html">exception</a></span> should not be used to replace std::exception as a base type in exception type hierarchies. Instead, it should be included as a virtual base, in addition to std::exception (which should also be derived virtually.)</p>
<h3>Why is boost::exception abstract?</h3>
<p>To prevent exception-neutral contexts from erroneously erasing the type of the original exception when adding <span class="RenoLink"><a href="error_info.html">error_info</a></span> to an active exception object:</p>
<pre>catch( boost::<span class="RenoLink"><a href="exception.html">exception</a></span> &amp; e )
@ -63,16 +37,55 @@ std::exception::what: example_io error
e <span class="RenoLink"><a href="exception_operator_shl.html">&lt;&lt;</a></span> foo_info(foo);
throw; //Okay, re-throwing the original exception object.
}</pre>
<h3>What is the space overhead of the boost::exception base class?</h3>
<p>The space overhead for the boost::exception data members is negligible in the context of exception handling. Throwing objects that derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span> does not by itself cause dynamic memory allocations.</p>
<p>Deriving from boost::<span class="RenoLink"><a href="exception.html">exception</a></span> enables any data to be added to exceptions, which usually does allocate memory. However, this memory is reclaimed when the exception has been handled, and since typically user code does not allocate memory during the unrolling of the stack, adding error info to exceptions should not cause memory fragmentation.</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>
<p>The <span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span> macro also results in a call to boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>, but in addition it records in the exception object the __FILE__ and __LINE__ of the throw, as well as the pretty name of the function that throws. This has virtually no overhead, yet enables boost::<span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span> to compose a more useful, if not user-friendly message.</p>
<p>Typical use of boost::<span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span> is:</p>
<pre>catch( boost::exception &amp; e )
{
std::cerr &lt;&lt; "OMG!" &lt;&lt; boost::diagnostic_information(e);
}
catch( ... )
{
std::cerr &lt;&lt; "OMG!!!";
}</pre>
<p>This is a possible message it may display, the first line is only possible if <span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span> is used:</p>
<pre>example_io.cpp(70): Throw in function class boost::shared_ptr&lt;struct _iobuf&gt; __cdecl my_fopen(const char *,const char *)
Dynamic exception type: class boost::exception_detail::clone_impl&lt;class fopen_error&gt;
std::exception::what: example_io error
[struct boost::<span class="RenoLink"><a href="errinfo_api_function.html">errinfo_api_function</a></span>_ *] = fopen
[struct boost::<span class="RenoLink"><a href="errinfo_errno.html">errinfo_errno</a></span>_ *] = 2, "No such file or directory"
[struct boost::<span class="RenoLink"><a href="errinfo_file_name.html">errinfo_file_name</a></span>_ *] = tmp1.txt
[struct boost::<span class="RenoLink"><a href="errinfo_file_open_mode.html">errinfo_file_open_mode</a></span>_ *] = rb</pre>
<h3>Why is boost::exception integrated in boost::throw_exception?</h3>
<p>The boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span> function predates the Boost Exception library and there has been some concern about its current behavior of injecting boost::<span class="RenoLink"><a href="exception.html">exception</a></span> as a base of any exception passed to boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>. Such concerns are dictated by the typical strict interpretation of a common principle in C and C++, that users only pay for features they actually use.</p>
<p>The problem is that users of Boost Exception can't by themselves cause a library to throw types that derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, and without this they can't use any of the Boost Exception facilities.</p>
<p>For example, if a user wants to use Boost Serialization in a separate thread, it is desirable to be able to transport exceptions emitted by that library into the main thread where they can be analyzed to generate a user-friendly message. This can be easily achieved using boost::<span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span>, but this requires that Boost Serialization throws exceptions using boost::<span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span>. If Boost Serialization calls boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span> to throw, this behavior happens automatically and transparently.</p>
<p>The cost of this integration is:</p>
<div><ul><li> In terms of space: a pointer and 3 ints are added to the static size of exception objects.</li>
<li> In terms of speed: the pointer is initialized to null at the point of the throw.</li>
<li> In terms of coupling: about 400 self-contained lines of C++ with no external includes.</li>
</ul></div>
<h3>Why use operator&lt;&lt; overload for adding info to exceptions?</h3>
<p>Before throwing an object of type that derives from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, it is often desirable to add one or more <span class="RenoLink"><a href="error_info.html">error_info</a></span> objects in it. The syntactic sugar provided by <span class="RenoLink"><a href="exception_operator_shl.html">operator&lt;&lt;</a></span> allows this to be done directly in a throw expression:</p>
<p>Before throwing an object of type that derives from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, it is often desirable to add one or more <span class="RenoLink"><a href="error_info.html">error_info</a></span> objects in it. The syntactic sugar provided by <span class="RenoLink"><a href="exception_operator_shl.html">exception/operator&lt;&lt;</a></span> allows this to be done directly in a throw expression:</p>
<pre>throw error() <span class="RenoLink"><a href="exception_operator_shl.html">&lt;&lt;</a></span> foo_info(foo) <span class="RenoLink"><a href="exception_operator_shl.html">&lt;&lt;</a></span> bar_info(bar);</pre>
<p>which saves typing compared to this possible alternative:</p>
<pre>error e;
e.add(foo_info(foo));
e.add(bar_info(bar));
throw e;</pre>
<p>and looks better than something like:</p>
<pre>throw error().add(foo_info(foo)).add(bar_info(bar));</pre>
<h3>Why is operator&lt;&lt; allowed to throw?</h3>
<p>This question is referring to the following issue. Consider this throw statement example:</p>
<pre>throw file_open_error() <span class="RenoLink"><a href="exception_operator_shl.html">&lt;&lt;</a></span> file_name(fn);</pre>
<p>The intention here is to throw a file_open_error, however if <span class="RenoLink"><a href="exception_operator_shl.html">operator&lt;&lt;</a></span> fails to copy the std::string contained in the file_name <span class="RenoLink"><a href="error_info.html">error_info</a></span> wrapper, a std::bad_alloc could propagate instead. This behavior seems undesirable to some programmers.</p>
<p>Bjarne Stroustrup, The C++ Programming Language, 3rd Edition, page 371:</p>
<blockquote><p><i>"Throwing an exception requires an object to throw. A C++ implementation is required to have enough spare memory to be able to throw bad_alloc in case of memory exhaustion. However, it is possible that throwing some other exception will cause memory exhaustion."</i></p></blockquote>
<p>Therefore, the language itself does not guarantee that an attempt to throw an exception is guaranteed to throw an object of the specified type; propagating a std::bad_alloc seems to be a possibility even outside of the scope of Boost Exception.</p>
<p>So, an attempt to throw any exception may already result in propagating std::bad_alloc instead.</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="motivation.html">Motivation</a></span>
</div>

View File

@ -43,7 +43,7 @@ boost
<h4>Note:</h4>
<p>The interface of <span class="RenoLink">get_error_info</span> may be affected by the build <span class="RenoLink"><a href="configuration_macros.html">configuration macros</a></span>.</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_get_error_info_hpp.html">boost/exception/get_error_info.hpp</a>&nbsp;| <a href="configuration_macros.html">Configuration Macros</a>&nbsp;| <a href="current_exception.html">current_exception</a>&nbsp;| <a href="error_info.html">error_info</a>&nbsp;| <a href="exception.html">exception</a>&nbsp;| <a href="motivation.html">Motivation</a></span>
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_get_error_info_hpp.html">boost/exception/get_error_info.hpp</a>&nbsp;| <a href="configuration_macros.html">Configuration Macros</a>&nbsp;| <a href="current_exception.html">current_exception</a>&nbsp;| <a href="error_info.html">error_info</a>&nbsp;| <a href="exception.html">exception</a>&nbsp;| <a href="motivation.html">Motivation</a>&nbsp;| <a href="throw_exception.html">throw_exception</a></span>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->

View File

@ -32,7 +32,7 @@ boost
<h4>Throws:</h4>
<p>The exception to which ep refers.</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_exception_ptr_hpp.html">boost/exception_ptr.hpp</a>&nbsp;| <a href="diagnostic_information.html">diagnostic_information</a></span>
See also: <span class="RenoPageList"><a href="boost-exception.html">Boost Exception</a>&nbsp;| <a href="boost_exception_ptr_hpp.html">boost/exception_ptr.hpp</a>&nbsp;| <a href="diagnostic_information.html">diagnostic_information</a>&nbsp;| <a href="exception_ptr.html">exception_ptr</a></span>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->

File diff suppressed because it is too large Load Diff

View File

@ -1,21 +0,0 @@
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<title>%s</title>
<link href='reno.css' type='text/css' rel='stylesheet'/>
</head>
<body>
<div class="body-0">
<div class="body-1">
<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>
</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) -->

View File

@ -1,16 +0,0 @@
<!-- 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) -->
<div id="footer">
<p>
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
</p>
</div>
</div>
</div>
</div>
</body>
</html>

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>
@ -103,12 +103,12 @@ boost
<span class="RenoIncludeSPAN"> class <span class="RenoLink"><a href="exception.html">exception</a></span>;</span>
<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>( E const &amp; e );
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 );</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 ) 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,6 +158,7 @@ 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>(BOOST_CURRENT_FUNCTION) &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,7 +21,25 @@
<!-- 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>
<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 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>Requirements:</h4>
<p>E must derive publicly from std::exception.</p>
<h4>Effects:</h4>
<div><ul><li> If BOOST_NO_EXCEPTIONS is not defined, boost::<span class="RenoLink">throw_exception</span>(e) is equivalent to throw boost::<span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span>(boost::<span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span>(e)), unless BOOST_EXCEPTION_DISABLE is defined, in which case boost::<span class="RenoLink">throw_exception</span>(e) is equivalent to throw e;</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>Note:</h4>
<p>Under BOOST_NO_EXCEPTIONS, unless BOOST_EXCEPTION_DISABLE is also defined, users can examine the passed exception object using boost::<span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>, or format an automatic diagnostic message using boost::<span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span>.</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

@ -35,14 +35,14 @@ error: //Base for all exception objects we throw.
public:
char const *
what() const BOOST_NOEXCEPT_OR_NOTHROW
what() const throw()
{
return "example_io error";
}
protected:
~error() BOOST_NOEXCEPT_OR_NOTHROW
~error() throw()
{
}
};

View File

@ -3,10 +3,9 @@
//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_EXCEPTION_316FDA946C0D11DEA9CBAE5255D89593
#define BOOST_EXCEPTION_316FDA946C0D11DEA9CBAE5255D89593
#ifndef UUID_316FDA946C0D11DEA9CBAE5255D89593
#define UUID_316FDA946C0D11DEA9CBAE5255D89593
#include <boost/config.hpp>
#include <boost/exception/diagnostic_information.hpp>
#include <boost/exception/error_info.hpp>
#include <boost/exception/exception.hpp>
@ -24,4 +23,5 @@
#include <boost/exception/errinfo_nested_exception.hpp>
#include <boost/exception_ptr.hpp>
#endif
#endif

View File

@ -3,20 +3,8 @@
//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_EXCEPTION_7E83C166200811DE885E826156D89593
#define BOOST_EXCEPTION_7E83C166200811DE885E826156D89593
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
#if __GNUC__*100+__GNUC_MINOR__>301
#pragma GCC system_header
#endif
#ifdef __clang__
#pragma clang system_header
#endif
#ifdef _MSC_VER
#pragma warning(push,1)
#endif
#endif
#ifndef UUID_7E83C166200811DE885E826156D89593
#define UUID_7E83C166200811DE885E826156D89593
namespace
boost
@ -43,7 +31,4 @@ boost
}
}
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(pop)
#endif
#endif

View File

@ -0,0 +1,19 @@
//Copyright (c) 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)
#ifndef UUID_61531AB0680611DEADD5846855D89593
#define UUID_61531AB0680611DEADD5846855D89593
#include <boost/config.hpp>
#if defined(BOOST_MSVC)
#define BOOST_ATTRIBUTE_NORETURN __declspec(noreturn)
#elif defined(__GNUC__)
#define BOOST_ATTRIBUTE_NORETURN __attribute__((noreturn))
#else
#define BOOST_ATTRIBUTE_NORETURN
#endif
#endif

View File

@ -1,62 +0,0 @@
//Copyright (c) 2006-2013 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)
#ifndef BOOST_EXCEPTION_81522C0EB56511DFAB613DB0DFD72085
#define BOOST_EXCEPTION_81522C0EB56511DFAB613DB0DFD72085
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
#if __GNUC__*100+__GNUC_MINOR__>301
#pragma GCC system_header
#endif
#ifdef __clang__
#pragma clang system_header
#endif
#ifdef _MSC_VER
#pragma warning(push,1)
#endif
#endif
#ifdef BOOST_NO_EXCEPTIONS
# error This header requires exception handling to be enabled.
#endif
namespace
boost
{
namespace
exception_detail
{
class clone_base;
#ifdef BOOST_ENABLE_NON_INTRUSIVE_EXCEPTION_PTR
int clone_current_exception_non_intrusive( clone_base const * & cloned );
#endif
namespace
clone_current_exception_result
{
int const success=0;
int const bad_alloc=1;
int const bad_exception=2;
int const not_supported=3;
}
inline
int
clone_current_exception( clone_base const * & cloned )
{
#ifdef BOOST_ENABLE_NON_INTRUSIVE_EXCEPTION_PTR
return clone_current_exception_non_intrusive(cloned);
#else
return clone_current_exception_result::not_supported;
#endif
}
}
}
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(pop)
#endif
#endif

View File

@ -1,30 +1,13 @@
//Copyright (c) 2006-2010 Emil Dotchevski and Reverge Studios, Inc.
//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)
#ifndef BOOST_EXCEPTION_CE6983AC753411DDA764247956D89593
#define BOOST_EXCEPTION_CE6983AC753411DDA764247956D89593
#ifndef UUID_CE6983AC753411DDA764247956D89593
#define UUID_CE6983AC753411DDA764247956D89593
#include <boost/config.hpp>
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
#include <boost/type_traits/is_nothrow_move_constructible.hpp>
#endif
#include <utility>
#include <string>
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
#if __GNUC__*100+__GNUC_MINOR__>301
#pragma GCC system_header
#endif
#ifdef __clang__
#pragma clang system_header
#endif
#ifdef _MSC_VER
#pragma warning(push,1)
#endif
#endif
namespace
boost
{
@ -36,11 +19,13 @@ boost
{
public:
virtual std::string name_value_string() const = 0;
virtual error_info_base * clone() const = 0;
virtual char const * tag_typeid_name() const = 0;
virtual std::string value_as_string() const = 0;
protected:
virtual
~error_info_base() BOOST_NOEXCEPT_OR_NOTHROW
~error_info_base() throw()
{
}
};
@ -51,57 +36,32 @@ boost
error_info:
public exception_detail::error_info_base
{
exception_detail::error_info_base *
clone() const
{
return new error_info<Tag,T>(*this);
}
public:
typedef T value_type;
error_info( value_type const & v ):
v_(v)
{
}
#if (__GNUC__*100+__GNUC_MINOR__!=406) //workaround for g++ bug
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
error_info( error_info const & x ):
v_(x.v_)
{
}
error_info( T && v ) BOOST_NOEXCEPT_IF(boost::is_nothrow_move_constructible<T>::value):
v_(std::move(v))
{
}
error_info( error_info && x ) BOOST_NOEXCEPT_IF(boost::is_nothrow_move_constructible<T>::value):
v_(std::move(x.v_))
{
}
#endif
#endif
~error_info() BOOST_NOEXCEPT_OR_NOTHROW
{
}
error_info( value_type const & value );
~error_info() throw();
value_type const &
value() const
{
return v_;
return value_;
}
value_type &
value()
{
return v_;
return value_;
}
private:
error_info & operator=( error_info const & );
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
error_info & operator=( error_info && x );
#endif
std::string name_value_string() const;
value_type v_;
char const * tag_typeid_name() const;
std::string value_as_string() const;
value_type value_;
};
}
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(pop)
#endif
#endif

View File

@ -1,623 +0,0 @@
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
//Copyright (c) 2019 Dario Menendez, Banco Santander
//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_EXCEPTION_618474C2DE1511DEB74A388C56D89593
#define BOOST_EXCEPTION_618474C2DE1511DEB74A388C56D89593
#include <boost/config.hpp>
#include <boost/exception/exception.hpp>
#include <boost/exception/info.hpp>
#include <boost/exception/diagnostic_information.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>
#endif
#include <boost/shared_ptr.hpp>
#include <boost/make_shared.hpp>
#include <stdexcept>
#include <new>
#include <ios>
#include <stdlib.h>
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
#if __GNUC__*100+__GNUC_MINOR__>301
#pragma GCC system_header
#endif
#ifdef __clang__
#pragma clang system_header
#endif
#ifdef _MSC_VER
#pragma warning(push,1)
#endif
#endif
namespace
boost
{
namespace
exception_detail
{
#ifndef BOOST_NO_CXX11_HDR_EXCEPTION
class
BOOST_SYMBOL_VISIBLE
std_exception_ptr_clone_impl:
public virtual clone_base
{
std::exception_ptr p_;
public:
explicit std_exception_ptr_clone_impl( std::exception_ptr const & ptr ) BOOST_NOEXCEPT:
p_(ptr)
{
}
~std_exception_ptr_clone_impl() BOOST_NOEXCEPT_OR_NOTHROW
{
}
private:
std_exception_ptr_clone_impl( std_exception_ptr_clone_impl const & x ):
p_(x.p_)
{
}
clone_base const*
clone() const
{
return new std_exception_ptr_clone_impl(*this);
}
void
rethrow() const
{
std::rethrow_exception(p_);
}
};
shared_ptr<exception_detail::clone_base const>
inline
wrap_exception_ptr( std::exception_ptr const & e )
{
exception_detail::clone_base const & base = std_exception_ptr_clone_impl(e);
return shared_ptr<exception_detail::clone_base const>(base.clone());
}
#endif
}
class exception_ptr;
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 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)
{
}
bool
operator==( exception_ptr const & other ) const
{
return ptr_==other.ptr_;
}
bool
operator!=( exception_ptr const & other ) const
{
return ptr_!=other.ptr_;
}
operator unspecified_bool_type() const
{
return ptr_?&impl::get:0;
}
};
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 )
{
return exception_detail::copy_exception_impl(boost::enable_current_exception(e));
}
template <class T>
inline
exception_ptr
make_exception_ptr( T const & e )
{
return boost::copy_exception(e);
}
#ifndef BOOST_NO_RTTI
typedef error_info<struct tag_original_exception_type,std::type_info const *> original_exception_type;
inline
std::string
to_string( original_exception_type const & x )
{
return core::demangle(x.value()->name());
}
#endif
#ifndef BOOST_NO_EXCEPTIONS
namespace
exception_detail
{
struct
bad_alloc_:
boost::exception,
std::bad_alloc
{
~bad_alloc_() BOOST_NOEXCEPT_OR_NOTHROW { }
};
struct
bad_exception_:
boost::exception,
std::bad_exception
{
~bad_exception_() BOOST_NOEXCEPT_OR_NOTHROW { }
};
template <class Exception>
exception_ptr
get_static_exception_object()
{
Exception ba;
exception_detail::clone_impl<Exception> c(ba);
#ifndef BOOST_EXCEPTION_DISABLE
c <<
throw_function(BOOST_CURRENT_FUNCTION) <<
throw_file(__FILE__) <<
throw_line(__LINE__);
#endif
static exception_ptr ep(shared_ptr<exception_detail::clone_base const>(new exception_detail::clone_impl<Exception>(c)));
return ep;
}
template <class Exception>
struct
exception_ptr_static_exception_object
{
static exception_ptr const e;
};
template <class Exception>
exception_ptr const
exception_ptr_static_exception_object<Exception>::
e = get_static_exception_object<Exception>();
}
#if defined(__GNUC__)
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
# pragma GCC visibility push (default)
# endif
#endif
class
unknown_exception:
public boost::exception,
public std::exception
{
public:
unknown_exception()
{
}
explicit
unknown_exception( std::exception const & e )
{
add_original_type(e);
}
explicit
unknown_exception( boost::exception const & e ):
boost::exception(e)
{
add_original_type(e);
}
~unknown_exception() BOOST_NOEXCEPT_OR_NOTHROW
{
}
private:
template <class E>
void
add_original_type( E const & e )
{
#ifndef BOOST_NO_RTTI
(*this) << original_exception_type(&typeid(e));
#endif
}
};
#if defined(__GNUC__)
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
# pragma GCC visibility pop
# endif
#endif
namespace
exception_detail
{
template <class T>
class
current_exception_std_exception_wrapper:
public T,
public boost::exception
{
public:
explicit
current_exception_std_exception_wrapper( T const & e1 ):
T(e1)
{
add_original_type(e1);
}
current_exception_std_exception_wrapper( T const & e1, boost::exception const & e2 ):
T(e1),
boost::exception(e2)
{
add_original_type(e1);
}
~current_exception_std_exception_wrapper() BOOST_NOEXCEPT_OR_NOTHROW
{
}
private:
template <class E>
void
add_original_type( E const & e )
{
#ifndef BOOST_NO_RTTI
(*this) << original_exception_type(&typeid(e));
#endif
}
};
#ifdef BOOST_NO_RTTI
template <class T>
boost::exception const *
get_boost_exception( T const * )
{
try
{
throw;
}
catch(
boost::exception & x )
{
return &x;
}
catch(...)
{
return 0;
}
}
#else
template <class T>
boost::exception const *
get_boost_exception( T const * x )
{
return dynamic_cast<boost::exception const *>(x);
}
#endif
template <class T>
inline
exception_ptr
current_exception_std_exception( T const & e1 )
{
if( boost::exception const * e2 = get_boost_exception(&e1) )
return boost::copy_exception(current_exception_std_exception_wrapper<T>(e1,*e2));
else
return boost::copy_exception(current_exception_std_exception_wrapper<T>(e1));
}
inline
exception_ptr
current_exception_unknown_exception()
{
return boost::copy_exception(unknown_exception());
}
inline
exception_ptr
current_exception_unknown_boost_exception( boost::exception const & e )
{
return boost::copy_exception(unknown_exception(e));
}
inline
exception_ptr
current_exception_unknown_std_exception( std::exception const & e )
{
if( boost::exception const * be = get_boost_exception(&e) )
return current_exception_unknown_boost_exception(*be);
else
return boost::copy_exception(unknown_exception(e));
}
inline
exception_ptr
current_exception_impl()
{
exception_detail::clone_base const * e=0;
switch(
exception_detail::clone_current_exception(e) )
{
case exception_detail::clone_current_exception_result::
success:
{
BOOST_ASSERT(e!=0);
return exception_ptr(shared_ptr<exception_detail::clone_base const>(e));
}
case exception_detail::clone_current_exception_result::
bad_alloc:
{
BOOST_ASSERT(!e);
return exception_detail::exception_ptr_static_exception_object<bad_alloc_>::e;
}
case exception_detail::clone_current_exception_result::
bad_exception:
{
BOOST_ASSERT(!e);
return exception_detail::exception_ptr_static_exception_object<bad_exception_>::e;
}
default:
BOOST_ASSERT(0);
case exception_detail::clone_current_exception_result::
not_supported:
{
BOOST_ASSERT(!e);
try
{
throw;
}
catch(
exception_detail::clone_base & e )
{
return exception_ptr(shared_ptr<exception_detail::clone_base const>(e.clone()));
}
#ifdef BOOST_NO_CXX11_HDR_EXCEPTION
catch(
std::domain_error & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::invalid_argument & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::length_error & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::out_of_range & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::logic_error & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::range_error & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::overflow_error & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::underflow_error & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::ios_base::failure & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::runtime_error & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::bad_alloc & e )
{
return exception_detail::current_exception_std_exception(e);
}
#ifndef BOOST_NO_TYPEID
catch(
std::bad_cast & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::bad_typeid & e )
{
return exception_detail::current_exception_std_exception(e);
}
#endif
catch(
std::bad_exception & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::exception & e )
{
return exception_detail::current_exception_unknown_std_exception(e);
}
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
{
return exception_ptr(std::current_exception());
}
catch(
...)
{
return exception_detail::current_exception_unknown_exception();
}
#else
return exception_detail::current_exception_unknown_exception();
#endif
}
}
}
}
}
inline
exception_ptr
current_exception()
{
exception_ptr ret;
try
{
ret=exception_detail::current_exception_impl();
}
catch(
std::bad_alloc & )
{
ret=exception_detail::exception_ptr_static_exception_object<exception_detail::bad_alloc_>::e;
}
catch(
... )
{
ret=exception_detail::exception_ptr_static_exception_object<exception_detail::bad_exception_>::e;
}
BOOST_ASSERT(ret);
return ret;
}
#endif // ifndef BOOST_NO_EXCEPTIONS
namespace
exception_detail
{
inline
void
rethrow_exception_( exception_ptr const & p )
{
BOOST_ASSERT(p);
p.ptr_->rethrow();
}
}
BOOST_NORETURN
inline
void
rethrow_exception( exception_ptr const & p )
{
exception_detail::rethrow_exception_(p);
BOOST_ASSERT(0);
#if defined(UNDER_CE)
// some CE platforms don't define ::abort()
exit(-1);
#else
abort();
#endif
}
inline
std::string
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);
}
catch(
... )
{
return current_exception_diagnostic_information(verbose);
}
#endif
return "<empty>";
}
inline
std::string
to_string( exception_ptr const & p )
{
std::string s='\n'+diagnostic_information(p);
std::string padding(" ");
std::string r;
bool f=false;
for( std::string::const_iterator i=s.begin(),e=s.end(); i!=e; ++i )
{
if( f )
r+=padding;
char c=*i;
r+=c;
f=(c=='\n');
}
return r;
}
}
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(pop)
#endif
#endif

View File

@ -0,0 +1,33 @@
//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)
#ifndef UUID_DC4208C6417811DEBF11E1EC55D89593
#define UUID_DC4208C6417811DEBF11E1EC55D89593
namespace
boost
{
namespace
exception_detail
{
class
exception_ptr_base
{
public:
virtual void _rethrow() const=0;
virtual bool _empty() const=0;
protected:
virtual
~exception_ptr_base() throw()
{
}
};
}
}
#endif

View File

@ -3,44 +3,19 @@
//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_EXCEPTION_898984B4076411DD973EDFA055D89593
#define BOOST_EXCEPTION_898984B4076411DD973EDFA055D89593
#ifndef UUID_898984B4076411DD973EDFA055D89593
#define UUID_898984B4076411DD973EDFA055D89593
#include <ostream>
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
#if __GNUC__*100+__GNUC_MINOR__>301
#pragma GCC system_header
#endif
#ifdef __clang__
#pragma clang system_header
#endif
#ifdef _MSC_VER
#pragma warning(push,1)
#endif
#endif
namespace
boost
{
namespace
to_string_detail
{
struct
partial_ordering_helper1
{
template <class CharT,class Traits>
partial_ordering_helper1( std::basic_ostream<CharT,Traits> & );
};
struct
partial_ordering_helper2
{
template <class T>
partial_ordering_helper2( T const & );
};
char operator<<( partial_ordering_helper1, partial_ordering_helper2 );
template <class T,class CharT,class Traits>
char operator<<( std::basic_ostream<CharT,Traits> &, T const & );
template <class T,class CharT,class Traits>
struct
@ -60,7 +35,4 @@ boost
};
}
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(pop)
#endif
#endif

View File

@ -3,27 +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)
#ifndef BOOST_EXCEPTION_6F463AC838DF11DDA3E6909F56D89593
#define BOOST_EXCEPTION_6F463AC838DF11DDA3E6909F56D89593
#ifndef UUID_6F463AC838DF11DDA3E6909F56D89593
#define UUID_6F463AC838DF11DDA3E6909F56D89593
#include <boost/exception/detail/type_info.hpp>
#include <iomanip>
#include <ios>
#include <string>
#include <sstream>
#include <cstdlib>
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
#if __GNUC__*100+__GNUC_MINOR__>301
#pragma GCC system_header
#endif
#ifdef __clang__
#pragma clang system_header
#endif
#ifdef _MSC_VER
#pragma warning(push,1)
#endif
#endif
namespace
boost
@ -34,11 +21,11 @@ boost
template <class T>
inline
std::string
object_hex_dump( T const & x, std::size_t max_size=16 )
object_hex_dump( T const & x, size_t max_size=16 )
{
std::ostringstream s;
s << "type: " << type_name<T>() << ", size: " << sizeof(T) << ", dump: ";
std::size_t n=sizeof(T)>max_size?max_size:sizeof(T);
size_t n=sizeof(T)>max_size?max_size:sizeof(T);
s.fill('0');
s.width(2);
unsigned char const * b=reinterpret_cast<unsigned char const *>(&x);
@ -50,7 +37,4 @@ boost
}
}
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(pop)
#endif
#endif

View File

@ -1,17 +0,0 @@
//Copyright (c) 2006-2008 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)
#ifndef BOOST_EXCEPTION_837060E885AF11E68DA91D15E31AC075
#define BOOST_EXCEPTION_837060E885AF11E68DA91D15E31AC075
#ifdef BOOST_EXCEPTION_MINI_BOOST
#include <memory>
namespace boost { namespace exception_detail { using std::shared_ptr; } }
#else
#include <boost/shared_ptr.hpp>
namespace boost { namespace exception_detail { using boost::shared_ptr; } }
#endif
#endif

View File

@ -1,88 +1,130 @@
//Copyright (c) 2006-2010 Emil Dotchevski and Reverge Studios, Inc.
//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)
#ifndef BOOST_EXCEPTION_C3E1741C754311DDB2834CCA55D89593
#define BOOST_EXCEPTION_C3E1741C754311DDB2834CCA55D89593
#ifndef UUID_C3E1741C754311DDB2834CCA55D89593
#define UUID_C3E1741C754311DDB2834CCA55D89593
#include <boost/config.hpp>
#include <boost/core/typeinfo.hpp>
#include <boost/core/demangle.hpp>
#include <boost/detail/sp_typeinfo.hpp>
#include <boost/current_function.hpp>
#include <string>
#include <string.h>
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
#if __GNUC__*100+__GNUC_MINOR__>301
#pragma GCC system_header
#endif
#ifdef __clang__
#pragma clang system_header
#endif
#ifdef _MSC_VER
#pragma warning(push,1)
#endif
#endif
namespace
boost
{
template <class T>
inline
std::string
char const *
tag_type_name()
{
#ifdef BOOST_NO_TYPEID
return BOOST_CURRENT_FUNCTION;
#else
return core::demangle(typeid(T*).name());
return typeid(T*).name();
#endif
}
template <class T>
inline
std::string
char const *
type_name()
{
#ifdef BOOST_NO_TYPEID
return BOOST_CURRENT_FUNCTION;
#else
return core::demangle(typeid(T).name());
return typeid(T).name();
#endif
}
namespace
exception_detail
{
#ifdef BOOST_NO_TYPEID
struct
type_info_
{
core::typeinfo const * type_;
detail::sp_typeinfo type_;
char const * name_;
explicit
type_info_( core::typeinfo const & type ):
type_(&type)
type_info_( detail::sp_typeinfo type, char const * name ):
type_(type),
name_(name)
{
}
friend
bool
operator==( type_info_ const & a, type_info_ const & b )
{
return a.type_==b.type_;
}
friend
bool
operator<( type_info_ const & a, type_info_ const & b )
{
return a.type_!=b.type_ && strcmp(a.type_->name(), b.type_->name()) < 0;
return a.type_<b.type_;
}
char const *
name() const
{
return name_;
}
};
#else
struct
type_info_
{
detail::sp_typeinfo const * type_;
explicit
type_info_( detail::sp_typeinfo const & type ):
type_(&type)
{
}
type_info_( detail::sp_typeinfo const & type, char const * ):
type_(&type)
{
}
friend
bool
operator==( type_info_ const & a, type_info_ const & b )
{
return (*a.type_)==(*b.type_);
}
friend
bool
operator<( type_info_ const & a, type_info_ const & b )
{
return 0!=(a.type_->before(*b.type_));
}
char const *
name() const
{
return type_->name();
}
};
#endif
inline
bool
operator!=( type_info_ const & a, type_info_ const & b )
{
return !(a==b);
}
}
}
#define BOOST_EXCEPTION_STATIC_TYPEID(T) ::boost::exception_detail::type_info_(BOOST_CORE_TYPEID(T))
#define BOOST_EXCEPTION_STATIC_TYPEID(T) ::boost::exception_detail::type_info_(BOOST_SP_TYPEID(T),::boost::tag_type_name<T>())
#ifndef BOOST_NO_RTTI
#define BOOST_EXCEPTION_DYNAMIC_TYPEID(x) ::boost::exception_detail::type_info_(typeid(x))
#endif
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(pop)
#endif
#endif

View File

@ -1,64 +1,18 @@
//Copyright (c) 2006-2010 Emil Dotchevski and Reverge Studios, Inc.
//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)
#ifndef BOOST_EXCEPTION_0552D49838DD11DD90146B8956D89593
#define BOOST_EXCEPTION_0552D49838DD11DD90146B8956D89593
#ifndef UUID_0552D49838DD11DD90146B8956D89593
#define UUID_0552D49838DD11DD90146B8956D89593
#include <boost/config.hpp>
#include <boost/exception/get_error_info.hpp>
#include <boost/exception/info.hpp>
#include <boost/core/enable_if.hpp>
#ifndef BOOST_NO_RTTI
#include <boost/core/demangle.hpp>
#endif
#include <boost/exception/detail/exception_ptr_base.hpp>
#include <boost/utility/enable_if.hpp>
#include <exception>
#include <sstream>
#include <string>
#ifndef BOOST_NO_EXCEPTIONS
#include <boost/exception/current_exception_cast.hpp>
#endif
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
#if __GNUC__*100+__GNUC_MINOR__>301
#pragma GCC system_header
#endif
#ifdef __clang__
#pragma clang system_header
#endif
#ifdef _MSC_VER
#pragma warning(push,1)
#endif
#endif
#ifndef BOOST_NO_EXCEPTIONS
namespace
boost
{
namespace
exception_detail
{
std::string diagnostic_information_impl( boost::exception const *, std::exception const *, bool, bool );
}
inline
std::string
current_exception_diagnostic_information( bool verbose=true)
{
boost::exception const * be=current_exception_cast<boost::exception const>();
std::exception const * se=current_exception_cast<std::exception const>();
if( be || se )
return exception_detail::diagnostic_information_impl(be,se,true,verbose);
#if defined(__GLIBCXX__) && __cplusplus >= 201103L && !defined(BOOST_NO_RTTI)
else if (auto* p=std::current_exception().__cxa_exception_type())
return "Dynamic exception type: "+boost::core::demangle(p->name());
#endif
else
return "No diagnostic information available.";
}
}
#endif
namespace
boost
@ -66,68 +20,57 @@ boost
namespace
exception_detail
{
inline
exception const *
get_boost_exception( exception const * e )
template <class T>
struct
enable_boost_exception_overload
{
return e;
}
struct yes { char q[100]; };
typedef char no;
static yes check(exception const *);
static no check(...);
enum e { value=sizeof(check((T*)0))==sizeof(yes) };
};
inline
exception const *
get_boost_exception( ... )
template <class T>
struct
enable_std_exception_overload
{
return 0;
}
inline
std::exception const *
get_std_exception( std::exception const * e )
{
return e;
}
inline
std::exception const *
get_std_exception( ... )
{
return 0;
}
struct yes { char q[100]; };
typedef char no;
static yes check(std::exception const *);
static no check(...);
enum e { value = !enable_boost_exception_overload<T>::value && sizeof(check((T*)0))==sizeof(yes) };
};
inline
char const *
get_diagnostic_information( exception const & x, char const * header )
{
if( error_info_container * c=x.data_.get() )
#ifndef BOOST_NO_EXCEPTIONS
try
{
try
{
#endif
error_info_container * c=x.data_.get();
if( !c )
x.data_.adopt(c=new exception_detail::error_info_container_impl);
char const * di=c->diagnostic_information(header);
BOOST_ASSERT(di!=0);
return di;
return c->diagnostic_information(header);
#ifndef BOOST_NO_EXCEPTIONS
}
catch(...)
{
return 0;
}
}
catch(...)
{
}
#endif
return 0;
}
inline
std::string
diagnostic_information_impl( boost::exception const * be, std::exception const * se, bool with_what, bool verbose )
diagnostic_information_impl( boost::exception const * be, std::exception const * se, bool with_what )
{
if( !be && !se )
return "Unknown exception.";
BOOST_ASSERT(be||se);
#ifndef BOOST_NO_RTTI
if( !be )
be=dynamic_cast<boost::exception const *>(se);
if( !se )
se=dynamic_cast<std::exception const *>(be);
se = dynamic_cast<std::exception const *>(be);
if( !be )
be = dynamic_cast<boost::exception const *>(se);
#endif
char const * wh=0;
if( with_what && se )
@ -137,65 +80,62 @@ boost
return wh;
}
std::ostringstream tmp;
if( be && verbose )
if( be )
{
char const * const * f=get_error_info<throw_file>(*be);
int const * l=get_error_info<throw_line>(*be);
char const * const * fn=get_error_info<throw_function>(*be);
if( !f && !l && !fn )
tmp << "Throw location unknown (consider using BOOST_THROW_EXCEPTION)\n";
else
if( char const * const * f=get_error_info<throw_file>(*be) )
{
if( f )
{
tmp << *f;
if( l )
tmp << '(' << *l << "): ";
}
tmp << "Throw in function ";
if( fn )
tmp << *fn;
else
tmp << "(unknown)";
tmp << '\n';
tmp << *f;
if( int const * l=get_error_info<throw_line>(*be) )
tmp << '(' << *l << "): ";
}
tmp << "Throw in function ";
if( char const * const * fn=get_error_info<throw_function>(*be) )
tmp << *fn;
else
tmp << "(unknown)";
tmp << '\n';
}
#ifndef BOOST_NO_RTTI
if ( verbose )
tmp << std::string("Dynamic exception type: ") <<
core::demangle((be?(BOOST_EXCEPTION_DYNAMIC_TYPEID(*be)):(BOOST_EXCEPTION_DYNAMIC_TYPEID(*se))).type_->name()) << '\n';
tmp << std::string("Dynamic exception type: ") <<
(be?BOOST_EXCEPTION_DYNAMIC_TYPEID(*be):BOOST_EXCEPTION_DYNAMIC_TYPEID(*se)).name() << '\n';
#endif
if( with_what && se && verbose )
tmp << "std::exception::what: " << (wh ? wh : "(null)") << '\n';
if( with_what && se )
tmp << "std::exception::what: " << wh << '\n';
if( be )
if( char const * s=exception_detail::get_diagnostic_information(*be,tmp.str().c_str()) )
if( *s )
return std::string(s);
return s;
return tmp.str();
}
}
template <class T>
std::string
diagnostic_information( T const & e, bool verbose=true )
inline
typename enable_if<exception_detail::enable_boost_exception_overload<T>,std::string>::type
diagnostic_information( T const & e )
{
return exception_detail::diagnostic_information_impl(exception_detail::get_boost_exception(&e),exception_detail::get_std_exception(&e),true,verbose);
return exception_detail::diagnostic_information_impl(&e,0,true);
}
template <class T>
inline
typename enable_if<exception_detail::enable_std_exception_overload<T>,std::string>::type
diagnostic_information( T const & e )
{
return exception_detail::diagnostic_information_impl(0,&e,true);
}
inline
char const *
diagnostic_information_what( exception const & e, bool verbose=true ) BOOST_NOEXCEPT_OR_NOTHROW
diagnostic_information_what( exception const & e ) throw()
{
char const * w=0;
#ifndef BOOST_NO_EXCEPTIONS
try
{
#endif
(void) exception_detail::diagnostic_information_impl(&e,0,false,verbose);
if( char const * di=exception_detail::get_diagnostic_information(e,0) )
return di;
else
return "Failed to produce boost::diagnostic_information_what()";
(void) exception_detail::diagnostic_information_impl(&e,0,false);
return exception_detail::get_diagnostic_information(e,0);
#ifndef BOOST_NO_EXCEPTIONS
}
catch(
@ -207,7 +147,40 @@ boost
}
}
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(pop)
#ifndef BOOST_NO_EXCEPTIONS
#include <boost/exception/current_exception_cast.hpp>
namespace
boost
{
inline
std::string
current_exception_diagnostic_information()
{
boost::exception const * be=current_exception_cast<boost::exception const>();
std::exception const * se=current_exception_cast<std::exception const>();
if( be || se )
return exception_detail::diagnostic_information_impl(be,se,true);
else
return "No diagnostic information available.";
}
inline
std::string
diagnostic_information( exception_detail::exception_ptr_base const & p )
{
if( !p._empty() )
try
{
p._rethrow();
}
catch(
... )
{
return current_exception_diagnostic_information();
}
return "<empty>";
}
}
#endif
#endif

View File

@ -3,9 +3,4 @@
//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_EXCEPTION_851700A4F7CF11E6B2EE06DD14915323
#define BOOST_EXCEPTION_851700A4F7CF11E6B2EE06DD14915323
#include <boost/exception/exception.hpp>
#endif

View File

@ -3,9 +3,4 @@
//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_EXCEPTION_A0F7404AF7CF11E6908227DD14915323
#define BOOST_EXCEPTION_A0F7404AF7CF11E6908227DD14915323
#include <boost/exception/exception.hpp>
#endif

View File

@ -3,10 +3,10 @@
//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_EXCEPTION_DDFBB4546C1211DEA4659E9055D89593
#define BOOST_EXCEPTION_DDFBB4546C1211DEA4659E9055D89593
#ifndef UUID_DDFBB4546C1211DEA4659E9055D89593
#define UUID_DDFBB4546C1211DEA4659E9055D89593
#include <boost/exception/error_info.hpp>
#include "boost/exception/error_info.hpp"
namespace
boost

View File

@ -3,8 +3,8 @@
//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_EXCEPTION_E7255CE26C1211DE85800C9155D89593
#define BOOST_EXCEPTION_E7255CE26C1211DE85800C9155D89593
#ifndef UUID_E7255CE26C1211DE85800C9155D89593
#define UUID_E7255CE26C1211DE85800C9155D89593
namespace
boost

View File

@ -3,26 +3,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)
#ifndef BOOST_EXCEPTION_F0EE17BE6C1211DE87FF459155D89593
#define BOOST_EXCEPTION_F0EE17BE6C1211DE87FF459155D89593
#ifndef UUID_F0EE17BE6C1211DE87FF459155D89593
#define UUID_F0EE17BE6C1211DE87FF459155D89593
#include <boost/exception/info.hpp>
#include "boost/exception/info.hpp"
#include <errno.h>
#include <string.h>
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
#if __GNUC__*100+__GNUC_MINOR__>301
#pragma GCC system_header
#endif
#ifdef __clang__
#pragma clang system_header
#endif
#ifdef _MSC_VER
#pragma warning(push,1)
#pragma warning(disable:4996)
#endif
#endif
namespace
boost
{
@ -40,12 +27,9 @@ boost
{
std::ostringstream tmp;
int v=e.value();
tmp << '[' << error_info_name(e) << "] = " << v << ", \"" << strerror(v) << "\"\n";
tmp << v << ", \"" << strerror(v) << "\"";
return tmp.str();
}
}
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(pop)
#endif
#endif

View File

@ -3,8 +3,8 @@
//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_EXCEPTION_F79E6EE26C1211DEB26E929155D89593
#define BOOST_EXCEPTION_F79E6EE26C1211DEB26E929155D89593
#ifndef UUID_F79E6EE26C1211DEB26E929155D89593
#define UUID_F79E6EE26C1211DEB26E929155D89593
#include <stdio.h>

View File

@ -3,8 +3,8 @@
//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_EXCEPTION_FEE5120A6C1211DE94E8BC9155D89593
#define BOOST_EXCEPTION_FEE5120A6C1211DE94E8BC9155D89593
#ifndef UUID_FEE5120A6C1211DE94E8BC9155D89593
#define UUID_FEE5120A6C1211DE94E8BC9155D89593
#include <string>

View File

@ -3,8 +3,8 @@
//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_EXCEPTION_056F1F266C1311DE8E74299255D89593
#define BOOST_EXCEPTION_056F1F266C1311DE8E74299255D89593
#ifndef UUID_056F1F266C1311DE8E74299255D89593
#define UUID_056F1F266C1311DE8E74299255D89593
#include <string>

View File

@ -3,13 +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)
#ifndef BOOST_EXCEPTION_45CC9A82B77511DEB330FC4956D89593
#define BOOST_EXCEPTION_45CC9A82B77511DEB330FC4956D89593
#ifndef UUID_45CC9A82B77511DEB330FC4956D89593
#define UUID_45CC9A82B77511DEB330FC4956D89593
namespace
boost
{
namespace exception_detail { class clone_base; }
template <class Tag,class T> class error_info;
class exception_ptr;
typedef error_info<struct errinfo_nested_exception_,exception_ptr> errinfo_nested_exception;

View File

@ -3,8 +3,8 @@
//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_EXCEPTION_0E11109E6C1311DEB7EA649255D89593
#define BOOST_EXCEPTION_0E11109E6C1311DEB7EA649255D89593
#ifndef UUID_0E11109E6C1311DEB7EA649255D89593
#define UUID_0E11109E6C1311DEB7EA649255D89593
#include <string>

View File

@ -3,7 +3,4 @@
//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_EXCEPTION_EE7ECCA0433B11E1923E37064924019B
#define BOOST_EXCEPTION_EE7ECCA0433B11E1923E37064924019B
namespace boost { template <class Tag,class T> class error_info; }
#endif

View File

@ -0,0 +1,396 @@
//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)
#ifndef UUID_274DA366004E11DCB1DDFE2E56D89593
#define UUID_274DA366004E11DCB1DDFE2E56D89593
namespace
boost
{
namespace
exception_detail
{
template <class T>
class
refcount_ptr
{
public:
refcount_ptr():
px_(0)
{
}
~refcount_ptr()
{
release();
}
refcount_ptr( refcount_ptr const & x ):
px_(x.px_)
{
add_ref();
}
refcount_ptr &
operator=( refcount_ptr const & x )
{
adopt(x.px_);
return *this;
}
void
adopt( T * px )
{
release();
px_=px;
add_ref();
}
T *
get() const
{
return px_;
}
private:
T * px_;
void
add_ref()
{
if( px_ )
px_->add_ref();
}
void
release()
{
if( px_ )
px_->release();
}
};
}
////////////////////////////////////////////////////////////////////////
template <class Tag,class T>
class error_info;
typedef error_info<struct throw_function_,char const *> throw_function;
typedef error_info<struct throw_file_,char const *> throw_file;
typedef error_info<struct throw_line_,int> throw_line;
template <>
class
error_info<throw_function_,char const *>
{
public:
typedef char const * value_type;
value_type v_;
explicit
error_info( value_type v ):
v_(v)
{
}
};
template <>
class
error_info<throw_file_,char const *>
{
public:
typedef char const * value_type;
value_type v_;
explicit
error_info( value_type v ):
v_(v)
{
}
};
template <>
class
error_info<throw_line_,int>
{
public:
typedef int value_type;
value_type v_;
explicit
error_info( value_type v ):
v_(v)
{
}
};
template <class E,class Tag,class T>
E const & operator<<( E const &, error_info<Tag,T> const & );
class exception;
template <class>
class shared_ptr;
namespace
exception_detail
{
class error_info_base;
struct type_info_;
struct
error_info_container
{
virtual char const * diagnostic_information( char const * ) const = 0;
virtual shared_ptr<error_info_base> get( type_info_ const & ) const = 0;
virtual void set( shared_ptr<error_info_base> const &, type_info_ const & ) = 0;
virtual void add_ref() const = 0;
virtual void release() const = 0;
protected:
virtual
~error_info_container() throw()
{
}
};
template <class>
struct get_info;
template <>
struct get_info<throw_function>;
template <>
struct get_info<throw_file>;
template <>
struct get_info<throw_line>;
char const * get_diagnostic_information( exception const &, char const * );
}
class
exception
{
protected:
exception():
throw_function_(0),
throw_file_(0),
throw_line_(-1)
{
}
#ifdef __HP_aCC
//On HP aCC, this protected copy constructor prevents throwing boost::exception.
//On all other platforms, the same effect is achieved by the pure virtual destructor.
exception( exception const & x ) throw():
data_(x.data_),
throw_function_(x.throw_function_),
throw_file_(x.throw_file_),
throw_line_(x.throw_line_)
{
}
#endif
virtual ~exception() throw()
#ifndef __HP_aCC
= 0 //Workaround for HP aCC, =0 incorrectly leads to link errors.
#endif
;
private:
template <class E>
friend
E const &
operator<<( E const & x, throw_function const & y )
{
x.throw_function_=y.v_;
return x;
}
template <class E>
friend
E const &
operator<<( E const & x, throw_file const & y )
{
x.throw_file_=y.v_;
return x;
}
template <class E>
friend
E const &
operator<<( E const & x, throw_line const & y )
{
x.throw_line_=y.v_;
return x;
}
friend char const * exception_detail::get_diagnostic_information( exception const &, char const * );
template <class E,class Tag,class T>
friend E const & operator<<( E const &, error_info<Tag,T> const & );
template <class>
friend struct exception_detail::get_info;
friend struct exception_detail::get_info<throw_function>;
friend struct exception_detail::get_info<throw_file>;
friend struct exception_detail::get_info<throw_line>;
mutable exception_detail::refcount_ptr<exception_detail::error_info_container> data_;
mutable char const * throw_function_;
mutable char const * throw_file_;
mutable int throw_line_;
};
inline
exception::
~exception() throw()
{
}
////////////////////////////////////////////////////////////////////////
namespace
exception_detail
{
template <class T>
struct
error_info_injector:
public T,
public exception
{
explicit
error_info_injector( T const & x ):
T(x)
{
}
~error_info_injector() throw()
{
}
};
struct large_size { char c[256]; };
large_size dispatch( exception * );
struct small_size { };
small_size dispatch( void * );
template <class,int>
struct enable_error_info_helper;
template <class T>
struct
enable_error_info_helper<T,sizeof(large_size)>
{
typedef T type;
};
template <class T>
struct
enable_error_info_helper<T,sizeof(small_size)>
{
typedef error_info_injector<T> type;
};
template <class T>
struct
enable_error_info_return_type
{
typedef typename enable_error_info_helper<T,sizeof(dispatch((T*)0))>::type type;
};
}
template <class T>
inline
typename
exception_detail::enable_error_info_return_type<T>::type
enable_error_info( T const & x )
{
typedef typename exception_detail::enable_error_info_return_type<T>::type rt;
return rt(x);
}
////////////////////////////////////////////////////////////////////////
namespace
exception_detail
{
class
clone_base
{
public:
virtual clone_base const * clone() const = 0;
virtual void rethrow() const = 0;
virtual
~clone_base() throw()
{
}
};
inline
void
copy_boost_exception( exception * a, exception const * b )
{
*a = *b;
}
inline
void
copy_boost_exception( void *, void const * )
{
}
template <class T>
class
clone_impl:
public T,
public clone_base
{
public:
explicit
clone_impl( T const & x ):
T(x)
{
copy_boost_exception(this,&x);
}
~clone_impl() throw()
{
}
private:
clone_base const *
clone() const
{
return new clone_impl(*this);
}
void
rethrow() const
{
throw*this;
}
};
}
template <class T>
inline
exception_detail::clone_impl<T>
enable_current_exception( T const & x )
{
return exception_detail::clone_impl<T>(x);
}
}
#endif

View File

@ -3,27 +3,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)
#ifndef BOOST_EXCEPTION_1A590226753311DD9E4CCF6156D89593
#define BOOST_EXCEPTION_1A590226753311DD9E4CCF6156D89593
#ifndef UUID_1A590226753311DD9E4CCF6156D89593
#define UUID_1A590226753311DD9E4CCF6156D89593
#include <boost/config.hpp>
#include <boost/exception/exception.hpp>
#include <boost/exception/detail/error_info_impl.hpp>
#include <boost/exception/detail/type_info.hpp>
#include <boost/exception/detail/shared_ptr.hpp>
#include <boost/assert.hpp>
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
#if __GNUC__*100+__GNUC_MINOR__>301
#pragma GCC system_header
#endif
#ifdef __clang__
#pragma clang system_header
#endif
#ifdef _MSC_VER
#pragma warning(push,1)
#endif
#endif
#include <boost/shared_ptr.hpp>
namespace
boost
@ -132,7 +118,4 @@ boost
#endif
}
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(pop)
#endif
#endif

View File

@ -1,54 +1,57 @@
//Copyright (c) 2006-2010 Emil Dotchevski and Reverge Studios, Inc.
//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)
#ifndef BOOST_EXCEPTION_8D22C4CA9CC811DCAA9133D256D89593
#define BOOST_EXCEPTION_8D22C4CA9CC811DCAA9133D256D89593
#ifndef UUID_8D22C4CA9CC811DCAA9133D256D89593
#define UUID_8D22C4CA9CC811DCAA9133D256D89593
#include <boost/config.hpp>
#include <boost/exception/exception.hpp>
#include <boost/exception/to_string_stub.hpp>
#include <boost/exception/detail/error_info_impl.hpp>
#include <boost/exception/detail/shared_ptr.hpp>
#include <boost/shared_ptr.hpp>
#include <map>
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
#if __GNUC__*100+__GNUC_MINOR__>301
#pragma GCC system_header
#endif
#ifdef __clang__
#pragma clang system_header
#endif
#ifdef _MSC_VER
#pragma warning(push,1)
#endif
#endif
namespace
boost
{
template <class Tag,class T>
inline
std::string
error_info_name( error_info<Tag,T> const & )
typename enable_if<has_to_string<T>,std::string>::type
to_string( error_info<Tag,T> const & x )
{
return to_string(x.value());
}
template <class Tag,class T>
inline
error_info<Tag,T>::
error_info( value_type const & value ):
value_(value)
{
}
template <class Tag,class T>
inline
error_info<Tag,T>::
~error_info() throw()
{
}
template <class Tag,class T>
inline
char const *
error_info<Tag,T>::
tag_typeid_name() const
{
return tag_type_name<Tag>();
}
template <class Tag,class T>
inline
std::string
to_string( error_info<Tag,T> const & x )
{
return '[' + error_info_name(x) + "] = " + to_string_stub(x.value()) + '\n';
}
template <class Tag,class T>
inline
std::string
error_info<Tag,T>::
name_value_string() const
value_as_string() const
{
return to_string_stub(*this);
}
@ -57,7 +60,7 @@ boost
exception_detail
{
class
error_info_container_impl BOOST_FINAL:
error_info_container_impl:
public error_info_container
{
public:
@ -67,7 +70,7 @@ boost
{
}
~error_info_container_impl() BOOST_NOEXCEPT_OR_NOTHROW
~error_info_container_impl() throw()
{
}
@ -86,6 +89,9 @@ 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)==ti );
#endif
return p;
}
return shared_ptr<error_info_base>();
@ -96,12 +102,13 @@ boost
{
if( header )
{
BOOST_ASSERT(*header!=0);
std::ostringstream tmp;
tmp << header;
for( error_info_map::const_iterator i=info_.begin(),end=info_.end(); i!=end; ++i )
{
error_info_base const & x = *i->second;
tmp << x.name_value_string();
shared_ptr<error_info_base const> const & x = i->second;
tmp << '[' << x->tag_typeid_name() << "] = " << x->value_as_string() << '\n';
}
tmp.str().swap(diagnostic_info_str_);
}
@ -117,163 +124,34 @@ boost
mutable std::string diagnostic_info_str_;
mutable int count_;
error_info_container_impl( error_info_container_impl const & );
error_info_container_impl & operator=( error_info_container const & );
void
add_ref() const
{
++count_;
}
bool
void
release() const
{
if( --count_ )
return false;
else
{
if( !--count_ )
delete this;
return true;
}
}
refcount_ptr<error_info_container>
clone() const
{
refcount_ptr<error_info_container> p;
error_info_container_impl * c=new error_info_container_impl;
p.adopt(c);
for( error_info_map::const_iterator i=info_.begin(),e=info_.end(); i!=e; ++i )
{
shared_ptr<error_info_base> cp(i->second->clone());
c->info_.insert(std::make_pair(i->first,cp));
}
return p;
}
};
template <class E,class Tag,class T>
inline
E const &
set_info( E const & x, error_info<Tag,T> const & v )
{
typedef error_info<Tag,T> error_info_tag_t;
shared_ptr<error_info_tag_t> p( new error_info_tag_t(v) );
exception_detail::error_info_container * c=x.data_.get();
if( !c )
x.data_.adopt(c=new exception_detail::error_info_container_impl);
c->set(p,BOOST_EXCEPTION_STATIC_TYPEID(error_info_tag_t));
return x;
}
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
template <class E,class Tag,class T>
E const & set_info( E const &, error_info<Tag,T> && );
template <class T>
struct set_info_rv;
template <class Tag,class T>
struct
set_info_rv<error_info<Tag,T> >
{
template <class E,class Tag1,class T1>
friend E const & set_info( E const &, error_info<Tag1,T1> && );
template <class E>
static
E const &
set( E const & x, error_info<Tag,T> && v )
{
typedef error_info<Tag,T> error_info_tag_t;
shared_ptr<error_info_tag_t> p( new error_info_tag_t(std::move(v)) );
exception_detail::error_info_container * c=x.data_.get();
if( !c )
x.data_.adopt(c=new exception_detail::error_info_container_impl);
c->set(p,BOOST_EXCEPTION_STATIC_TYPEID(error_info_tag_t));
return x;
}
};
template <>
struct
set_info_rv<throw_function>
{
template <class E,class Tag1,class T1>
friend E const & set_info( E const &, error_info<Tag1,T1> && );
template <class E>
static
E const &
set( E const & x, throw_function && y )
{
x.throw_function_=y.v_;
return x;
}
};
template <>
struct
set_info_rv<throw_file>
{
template <class E,class Tag1,class T1>
friend E const & set_info( E const &, error_info<Tag1,T1> && );
template <class E>
static
E const &
set( E const & x, throw_file && y )
{
x.throw_file_=y.v_;
return x;
}
};
template <>
struct
set_info_rv<throw_line>
{
template <class E,class Tag1,class T1>
friend E const & set_info( E const &, error_info<Tag1,T1> && );
template <class E>
static
E const &
set( E const & x, throw_line && y )
{
x.throw_line_=y.v_;
return x;
}
};
template <class E,class Tag,class T>
inline
E const &
set_info( E const & x, error_info<Tag,T> && v )
{
return set_info_rv<error_info<Tag,T> >::template set<E>(x,std::move(v));
}
#endif
template <class T>
struct
derives_boost_exception
{
enum e { value = (sizeof(dispatch_boost_exception((T*)0))==sizeof(large_size)) };
};
}
template <class E,class Tag,class T>
inline
typename enable_if<exception_detail::derives_boost_exception<E>,E const &>::type
E const &
operator<<( E const & x, error_info<Tag,T> const & v )
{
return exception_detail::set_info(x,v);
typedef error_info<Tag,T> error_info_tag_t;
shared_ptr<error_info_tag_t> p( new error_info_tag_t(v) );
exception_detail::error_info_container * c;
if( !(c=x.data_.get()) )
x.data_.adopt(c=new exception_detail::error_info_container_impl);
c->set(p,BOOST_EXCEPTION_STATIC_TYPEID(error_info_tag_t));
return x;
}
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
template <class E,class Tag,class T>
inline
typename enable_if<exception_detail::derives_boost_exception<E>,E const &>::type
operator<<( E const & x, error_info<Tag,T> && v )
{
return exception_detail::set_info(x,std::move(v));
}
#endif
}
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(pop)
#endif
#endif

View File

@ -3,51 +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)
#ifndef BOOST_EXCEPTION_63EE924290FB11DC87BB856555D89593
#define BOOST_EXCEPTION_63EE924290FB11DC87BB856555D89593
#ifndef UUID_63EE924290FB11DC87BB856555D89593
#define UUID_63EE924290FB11DC87BB856555D89593
#include <boost/exception/info.hpp>
#include <boost/tuple/tuple.hpp>
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
#if __GNUC__*100+__GNUC_MINOR__>301
#pragma GCC system_header
#endif
#ifdef __clang__
#pragma clang system_header
#endif
#ifdef _MSC_VER
#pragma warning(push,1)
#endif
#endif
namespace
boost
{
template <
class E >
inline
E const &
operator<<(
E const & x,
tuple< > const & v )
{
return x;
}
template <
class E,
class Tag1,class T1 >
inline
E const &
operator<<(
E const & x,
tuple<
error_info<Tag1,T1> > const & v )
{
return x << v.template get<0>();
}
template <
class E,
class Tag1,class T1,
@ -100,7 +64,4 @@ boost
}
}
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(pop)
#endif
#endif

View File

@ -3,38 +3,21 @@
//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_EXCEPTION_7E48761AD92811DC9011477D56D89593
#define BOOST_EXCEPTION_7E48761AD92811DC9011477D56D89593
#ifndef UUID_7E48761AD92811DC9011477D56D89593
#define UUID_7E48761AD92811DC9011477D56D89593
#include <boost/core/enable_if.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/exception/detail/is_output_streamable.hpp>
#include <sstream>
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
#if __GNUC__*100+__GNUC_MINOR__>301
#pragma GCC system_header
#endif
#ifdef __clang__
#pragma clang system_header
#endif
#ifdef _MSC_VER
#pragma warning(push,1)
#endif
#endif
namespace
boost
{
template <class T,class U>
std::string to_string( std::pair<T,U> const & );
std::string to_string( std::exception const & );
namespace
to_string_detail
{
template <class T>
typename disable_if<is_output_streamable<T>,char>::type to_string( T const & );
using boost::to_string;
template <class,bool IsOutputStreamable>
struct has_to_string_impl;
@ -88,7 +71,4 @@ boost
}
}
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(pop)
#endif
#endif

View File

@ -3,25 +3,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)
#ifndef BOOST_EXCEPTION_E788439ED9F011DCB181F25B55D89593
#define BOOST_EXCEPTION_E788439ED9F011DCB181F25B55D89593
#ifndef UUID_E788439ED9F011DCB181F25B55D89593
#define UUID_E788439ED9F011DCB181F25B55D89593
#include <boost/exception/to_string.hpp>
#include <boost/exception/detail/object_hex_dump.hpp>
#include <boost/assert.hpp>
#ifndef BOOST_EXCEPTION_ENABLE_WARNINGS
#if __GNUC__*100+__GNUC_MINOR__>301
#pragma GCC system_header
#endif
#ifdef __clang__
#pragma clang system_header
#endif
#ifdef _MSC_VER
#pragma warning(push,1)
#endif
#endif
namespace
boost
{
@ -107,17 +95,6 @@ boost
{
return exception_detail::to_string_dispatch::dispatch(x,s);
}
template <class T,class U,class Stub>
inline
std::string
to_string_stub( std::pair<T,U> const & x, Stub s )
{
return std::string("(") + to_string_stub(x.first,s) + ',' + to_string_stub(x.second,s) + ')';
}
}
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
#pragma warning(pop)
#endif
#endif

View File

@ -3,9 +3,459 @@
//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_EXCEPTION_FA5836A2CADA11DC8CD47C8555D89593
#define BOOST_EXCEPTION_FA5836A2CADA11DC8CD47C8555D89593
#ifndef UUID_FA5836A2CADA11DC8CD47C8555D89593
#define UUID_FA5836A2CADA11DC8CD47C8555D89593
#include <boost/exception/detail/exception_ptr.hpp>
#include <boost/config.hpp>
#ifdef BOOST_NO_EXCEPTIONS
#error This header requires exception handling to be enabled.
#endif
#include <boost/exception/exception.hpp>
#include <boost/exception/info.hpp>
#include <boost/exception/diagnostic_information.hpp>
#include <boost/exception/detail/type_info.hpp>
#include <boost/shared_ptr.hpp>
#include <stdexcept>
#include <new>
#include <ios>
namespace
boost
{
#ifndef BOOST_NO_RTTI
typedef error_info<struct tag_original_exception_type,std::type_info const *> original_exception_type;
inline
std::string
to_string( original_exception_type const & x )
{
return x.value()->name();
}
#endif
class exception_ptr;
exception_ptr current_exception();
void rethrow_exception( exception_ptr const & );
class
exception_ptr:
public exception_detail::exception_ptr_base
{
typedef bool exception_ptr::*unspecified_bool_type;
friend exception_ptr current_exception();
friend void rethrow_exception( exception_ptr const & );
shared_ptr<exception_detail::clone_base const> c_;
bool bad_alloc_;
struct
bad_alloc_tag
{
};
explicit
exception_ptr( bad_alloc_tag ):
bad_alloc_(true)
{
}
explicit
exception_ptr( shared_ptr<exception_detail::clone_base const> const & c ):
c_(c),
bad_alloc_(false)
{
BOOST_ASSERT(c);
}
void
_rethrow() const
{
BOOST_ASSERT(*this);
if( bad_alloc_ )
throw enable_current_exception(std::bad_alloc());
else
c_->rethrow();
}
bool
_empty() const
{
return !bad_alloc_ && !c_;
}
public:
exception_ptr():
bad_alloc_(false)
{
}
operator unspecified_bool_type() const
{
return _empty() ? 0 : &exception_ptr::bad_alloc_;
}
friend
bool
operator==( exception_ptr const & a, exception_ptr const & b )
{
return a.c_==b.c_ && a.bad_alloc_==b.bad_alloc_;
}
friend
bool
operator!=( exception_ptr const & a, exception_ptr const & b )
{
return !(a==b);
}
};
class
unknown_exception:
public exception,
public std::exception,
public exception_detail::clone_base
{
public:
unknown_exception()
{
}
explicit
unknown_exception( std::exception const & e )
{
add_original_type(e);
}
explicit
unknown_exception( boost::exception const & e ):
boost::exception(e)
{
add_original_type(e);
}
~unknown_exception() throw()
{
}
private:
exception_detail::clone_base const *
clone() const
{
return new unknown_exception(*this);
}
void
rethrow() const
{
throw*this;
}
template <class E>
void
add_original_type( E const & e )
{
#ifndef BOOST_NO_RTTI
(*this) << original_exception_type(&typeid(e));
#endif
}
};
namespace
exception_detail
{
template <class T>
class
current_exception_std_exception_wrapper:
public T,
public boost::exception,
public clone_base
{
public:
explicit
current_exception_std_exception_wrapper( T const & e1 ):
T(e1)
{
add_original_type(e1);
}
current_exception_std_exception_wrapper( T const & e1, boost::exception const & e2 ):
T(e1),
boost::exception(e2)
{
add_original_type(e1);
}
~current_exception_std_exception_wrapper() throw()
{
}
private:
clone_base const *
clone() const
{
return new current_exception_std_exception_wrapper(*this);
}
void
rethrow() const
{
throw *this;
}
template <class E>
void
add_original_type( E const & e )
{
#ifndef BOOST_NO_RTTI
(*this) << original_exception_type(&typeid(e));
#endif
}
};
#ifdef BOOST_NO_RTTI
template <class T>
exception const *
get_boost_exception( T const * )
{
try
{
throw;
}
catch(
exception & x )
{
return &x;
}
catch(...)
{
return 0;
}
}
#else
template <class T>
exception const *
get_boost_exception( T const * x )
{
return dynamic_cast<exception const *>(x);
}
#endif
template <class T>
inline
shared_ptr<clone_base const>
current_exception_std_exception( T const & e1 )
{
if( boost::exception const * e2 = get_boost_exception(&e1) )
return shared_ptr<current_exception_std_exception_wrapper<T> const>(new current_exception_std_exception_wrapper<T>(e1,*e2));
else
return shared_ptr<current_exception_std_exception_wrapper<T> const>(new current_exception_std_exception_wrapper<T>(e1));
}
inline
shared_ptr<clone_base const>
current_exception_unknown_exception()
{
return shared_ptr<unknown_exception const>(new unknown_exception());
}
inline
shared_ptr<clone_base const>
current_exception_unknown_boost_exception( boost::exception const & e )
{
return shared_ptr<unknown_exception const>(new unknown_exception(e));
}
inline
shared_ptr<clone_base const>
current_exception_unknown_std_exception( std::exception const & e )
{
if( boost::exception const * be = get_boost_exception(&e) )
return current_exception_unknown_boost_exception(*be);
else
return shared_ptr<unknown_exception const>(new unknown_exception(e));
}
inline
shared_ptr<clone_base const>
current_exception_impl()
{
try
{
throw;
}
catch(
exception_detail::clone_base & e )
{
return shared_ptr<exception_detail::clone_base const>(e.clone());
}
catch(
std::domain_error & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::invalid_argument & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::length_error & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::out_of_range & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::logic_error & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::range_error & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::overflow_error & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::underflow_error & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::ios_base::failure & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::runtime_error & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::bad_alloc & e )
{
return exception_detail::current_exception_std_exception(e);
}
#ifndef BOOST_NO_TYPEID
catch(
std::bad_cast & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::bad_typeid & e )
{
return exception_detail::current_exception_std_exception(e);
}
#endif
catch(
std::bad_exception & e )
{
return exception_detail::current_exception_std_exception(e);
}
catch(
std::exception & e )
{
return exception_detail::current_exception_unknown_std_exception(e);
}
catch(
boost::exception & e )
{
return exception_detail::current_exception_unknown_boost_exception(e);
}
catch(
... )
{
return exception_detail::current_exception_unknown_exception();
}
}
}
inline
exception_ptr
current_exception()
{
try
{
return exception_ptr(exception_detail::current_exception_impl());
}
catch(
std::bad_alloc & )
{
}
catch(
... )
{
try
{
return exception_ptr(exception_detail::current_exception_std_exception(std::bad_exception()));
}
catch(
std::bad_alloc & )
{
}
catch(
... )
{
BOOST_ASSERT(0);
}
}
return exception_ptr(exception_ptr::bad_alloc_tag());
}
template <class T>
inline
exception_ptr
copy_exception( T const & e )
{
try
{
throw enable_current_exception(e);
}
catch(
... )
{
return current_exception();
}
}
inline
void
rethrow_exception( exception_ptr const & p )
{
p._rethrow();
}
inline
std::string
to_string( exception_ptr const & p )
{
std::string s='\n'+diagnostic_information(p);
std::string padding(" ");
std::string r;
bool f=false;
for( std::string::const_iterator i=s.begin(),e=s.end(); i!=e; ++i )
{
if( f )
r+=padding;
char c=*i;
r+=c;
f=(c=='\n');
}
return r;
}
}
#endif

View File

@ -0,0 +1,74 @@
#ifndef BOOST_THROW_EXCEPTION_HPP_INCLUDED
#define BOOST_THROW_EXCEPTION_HPP_INCLUDED
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
//
// boost/throw_exception.hpp
//
// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
// Copyright (c) 2008-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)
//
// http://www.boost.org/libs/utility/throw_exception.html
//
#include <boost/exception/detail/attribute_noreturn.hpp>
#include <boost/detail/workaround.hpp>
#include <exception>
#if !defined( BOOST_EXCEPTION_DISABLE ) && defined( __BORLANDC__ ) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x593) )
# define BOOST_EXCEPTION_DISABLE
#endif
#if !defined( BOOST_EXCEPTION_DISABLE ) && defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, < 1310 )
# define BOOST_EXCEPTION_DISABLE
#endif
#if !defined( BOOST_EXCEPTION_DISABLE )
# include <boost/exception/exception.hpp>
# include <boost/current_function.hpp>
# define BOOST_THROW_EXCEPTION(x) ::boost::throw_exception(::boost::enable_error_info(x) <<\
::boost::throw_function(BOOST_CURRENT_FUNCTION) <<\
::boost::throw_file(__FILE__) <<\
::boost::throw_line((int)__LINE__))
#else
# define BOOST_THROW_EXCEPTION(x) ::boost::throw_exception(x)
#endif
namespace boost
{
#ifdef BOOST_NO_EXCEPTIONS
void throw_exception( std::exception const & e ); // user defined
#else
inline void throw_exception_assert_compatibility( std::exception const & ) { }
template<class E> BOOST_ATTRIBUTE_NORETURN inline void throw_exception( E const & e )
{
//All boost exceptions are required to derive from std::exception,
//to ensure compatibility with BOOST_NO_EXCEPTIONS.
throw_exception_assert_compatibility(e);
#ifndef BOOST_EXCEPTION_DISABLE
throw enable_current_exception(enable_error_info(e));
#else
throw e;
#endif
}
#endif
} // namespace boost
#endif // #ifndef BOOST_THROW_EXCEPTION_HPP_INCLUDED

View File

@ -1,17 +0,0 @@
{
"key": "exception",
"name": "Exception",
"authors": [
"Emil Dotchevski"
],
"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

@ -1,349 +0,0 @@
//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)
//This MSVC-specific cpp file implements non-intrusive cloning of exception objects.
//Based on an exception_ptr implementation by Anthony Williams.
#ifdef BOOST_NO_EXCEPTIONS
#error This file requires exception handling to be enabled.
#endif
#include <boost/config.hpp>
#include <boost/exception/detail/clone_current_exception.hpp>
#if defined(BOOST_ENABLE_NON_INTRUSIVE_EXCEPTION_PTR) && defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))
//Non-intrusive cloning support implemented below, only for MSVC versions mentioned above.
//Thanks Anthony Williams!
//Thanks to Martin Weiss for implementing 64-bit support!
#include <boost/exception/exception.hpp>
#include <boost/shared_ptr.hpp>
#include <windows.h>
#include <malloc.h>
namespace
{
unsigned const exception_maximum_parameters=15;
unsigned const exception_noncontinuable=1;
#if _MSC_VER==1310
int const exception_info_offset=0x74;
#elif ((_MSC_VER==1400 || _MSC_VER==1500) && !defined _M_X64)
int const exception_info_offset=0x80;
#elif ((_MSC_VER==1400 || _MSC_VER==1500) && defined _M_X64)
int const exception_info_offset=0xE0;
#else
int const exception_info_offset=-1;
#endif
struct
exception_record
{
unsigned long ExceptionCode;
unsigned long ExceptionFlags;
exception_record * ExceptionRecord;
void * ExceptionAddress;
unsigned long NumberParameters;
ULONG_PTR ExceptionInformation[exception_maximum_parameters];
};
struct
exception_pointers
{
exception_record * ExceptionRecord;
void * ContextRecord;
};
unsigned const cpp_exception_code=0xE06D7363;
unsigned const cpp_exception_magic_flag=0x19930520;
#ifdef _M_X64
unsigned const cpp_exception_parameter_count=4;
#else
unsigned const cpp_exception_parameter_count=3;
#endif
struct
dummy_exception_type
{
};
typedef int(dummy_exception_type::*normal_copy_constructor_ptr)(void * src);
typedef int(dummy_exception_type::*copy_constructor_with_virtual_base_ptr)(void * src,void * dst);
typedef void (dummy_exception_type::*destructor_ptr)();
union
cpp_copy_constructor
{
void * address;
normal_copy_constructor_ptr normal_copy_constructor;
copy_constructor_with_virtual_base_ptr copy_constructor_with_virtual_base;
};
union
cpp_destructor
{
void * address;
destructor_ptr destructor;
};
enum
cpp_type_flags
{
class_is_simple_type=1,
class_has_virtual_base=4
};
// ATTENTION: On x86 fields such as type_info and copy_constructor are really pointers
// but on 64bit these are 32bit offsets from HINSTANCE. Hints on the 64bit handling from
// http://blogs.msdn.com/b/oldnewthing/archive/2010/07/30/10044061.aspx .
struct
cpp_type_info
{
unsigned flags;
int type_info;
int this_offset;
int vbase_descr;
int vbase_offset;
unsigned long size;
int copy_constructor;
};
struct
cpp_type_info_table
{
unsigned count;
int info;
};
struct
cpp_exception_type
{
unsigned flags;
int destructor;
int custom_handler;
int type_info_table;
};
struct
exception_object_deleter
{
cpp_exception_type const & et_;
size_t image_base_;
exception_object_deleter( cpp_exception_type const & et, size_t image_base ):
et_(et),
image_base_(image_base)
{
}
void
operator()( void * obj )
{
BOOST_ASSERT(obj!=0);
dummy_exception_type* dummy_exception_ptr = static_cast<dummy_exception_type *>(obj);
if( et_.destructor )
{
cpp_destructor destructor;
destructor.address = reinterpret_cast<void *>(et_.destructor + image_base_);
(dummy_exception_ptr->*(destructor.destructor))();
}
free(obj);
}
};
cpp_type_info const &
get_cpp_type_info( cpp_exception_type const & et, size_t image_base )
{
cpp_type_info_table * const typearray = reinterpret_cast<cpp_type_info_table * const>(et.type_info_table + image_base);
cpp_type_info * const ti = reinterpret_cast<cpp_type_info * const>(typearray->info + image_base);
BOOST_ASSERT(ti!=0);
return *ti;
}
void
copy_msvc_exception( void * dst, void * src, cpp_type_info const & ti, size_t image_base )
{
cpp_copy_constructor copy_constructor;
copy_constructor.address = reinterpret_cast<void *>(ti.copy_constructor + image_base);
if( !(ti.flags & class_is_simple_type) && copy_constructor.normal_copy_constructor )
{
dummy_exception_type * dummy_exception_ptr = static_cast<dummy_exception_type *>(dst);
if( ti.flags & class_has_virtual_base )
(dummy_exception_ptr->*(copy_constructor.copy_constructor_with_virtual_base))(src,dst);
else
(dummy_exception_ptr->*(copy_constructor.normal_copy_constructor))(src);
}
else
memmove(dst,src,ti.size);
}
boost::shared_ptr<void>
clone_msvc_exception( void * src, cpp_exception_type const & et, size_t image_base )
{
BOOST_ASSERT(src!=0);
cpp_type_info const & ti=get_cpp_type_info(et,image_base);
if( void * dst = malloc(ti.size) )
{
try
{
copy_msvc_exception(dst,src,ti,image_base);
}
catch(
... )
{
free(dst);
throw;
}
return boost::shared_ptr<void>(dst,exception_object_deleter(et,image_base));
}
else
throw std::bad_alloc();
}
class
cloned_exception:
public boost::exception_detail::clone_base
{
cloned_exception( cloned_exception const & );
cloned_exception & operator=( cloned_exception const & );
cpp_exception_type const & et_;
size_t image_base_;
boost::shared_ptr<void> exc_;
public:
cloned_exception( EXCEPTION_RECORD const * record ):
et_(*reinterpret_cast<cpp_exception_type const *>(record->ExceptionInformation[2])),
image_base_((cpp_exception_parameter_count==4) ? record->ExceptionInformation[3] : 0),
exc_(clone_msvc_exception(reinterpret_cast<void *>(record->ExceptionInformation[1]),et_,image_base_))
{
}
cloned_exception( void * exc, cpp_exception_type const & et, size_t image_base ):
et_(et),
image_base_(image_base),
exc_(clone_msvc_exception(exc,et_,image_base))
{
}
~cloned_exception() BOOST_NOEXCEPT_OR_NOTHROW
{
}
boost::exception_detail::clone_base const *
clone() const
{
return new cloned_exception(exc_.get(),et_,image_base_);
}
void
rethrow() const
{
cpp_type_info const & ti=get_cpp_type_info(et_,image_base_);
void * dst = _alloca(ti.size);
copy_msvc_exception(dst,exc_.get(),ti,image_base_);
ULONG_PTR args[cpp_exception_parameter_count];
args[0]=cpp_exception_magic_flag;
args[1]=reinterpret_cast<ULONG_PTR>(dst);
args[2]=reinterpret_cast<ULONG_PTR>(&et_);
if (cpp_exception_parameter_count==4)
args[3]=image_base_;
RaiseException(cpp_exception_code,EXCEPTION_NONCONTINUABLE,cpp_exception_parameter_count,args);
}
};
bool
is_cpp_exception( EXCEPTION_RECORD const * record )
{
return record &&
(record->ExceptionCode==cpp_exception_code) &&
(record->NumberParameters==cpp_exception_parameter_count) &&
(record->ExceptionInformation[0]==cpp_exception_magic_flag);
}
unsigned long
exception_cloning_filter( int & result, boost::exception_detail::clone_base const * & ptr, void * info_ )
{
BOOST_ASSERT(exception_info_offset>=0);
BOOST_ASSERT(info_!=0);
EXCEPTION_RECORD* record = static_cast<EXCEPTION_POINTERS *>(info_)->ExceptionRecord;
if( is_cpp_exception(record) )
{
if( !record->ExceptionInformation[2] )
record = *reinterpret_cast<EXCEPTION_RECORD * *>(reinterpret_cast<char *>(_errno())+exception_info_offset);
if( is_cpp_exception(record) && record->ExceptionInformation[2] )
try
{
ptr = new cloned_exception(record);
result = boost::exception_detail::clone_current_exception_result::success;
}
catch(
std::bad_alloc & )
{
result = boost::exception_detail::clone_current_exception_result::bad_alloc;
}
catch(
... )
{
result = boost::exception_detail::clone_current_exception_result::bad_exception;
}
}
return EXCEPTION_EXECUTE_HANDLER;
}
}
namespace
boost
{
namespace
exception_detail
{
int
clone_current_exception_non_intrusive( clone_base const * & cloned )
{
BOOST_ASSERT(!cloned);
int result = clone_current_exception_result::not_supported;
if( exception_info_offset>=0 )
{
clone_base const * ptr=0;
__try
{
throw;
}
__except(exception_cloning_filter(result,ptr,GetExceptionInformation()))
{
}
if( result==clone_current_exception_result::success )
cloned=ptr;
}
BOOST_ASSERT(result!=clone_current_exception_result::success || cloned);
return result;
}
}
}
#else
//On all other compilers, return clone_current_exception_result::not_supported.
//On such platforms, only the intrusive enable_current_exception() cloning will work.
namespace
boost
{
namespace
exception_detail
{
int
clone_current_exception_non_intrusive( clone_base const * & )
{
return clone_current_exception_result::not_supported;
}
}
}
#endif

View File

@ -3,12 +3,6 @@
//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>

View File

@ -3,24 +3,21 @@
//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 disabled.
#endif
#define BOOST_NO_EXCEPTIONS
#include <boost/throw_exception.hpp>
#include <stdlib.h>
#include <boost/detail/lightweight_test.hpp>
class my_exception: public std::exception { };
bool called=false;
namespace
boost
{
void
throw_exception( std::exception const & )
{
exit(0);
called=true;
}
}
@ -28,5 +25,6 @@ int
main()
{
boost::throw_exception(my_exception());
return 1;
BOOST_TEST(called);
return boost::report_errors();
}

View File

@ -4,13 +4,6 @@
//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,26 +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)
#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>
#include <boost/detail/lightweight_test.hpp>
class my_exception: public std::exception { };
bool called=false;
namespace
boost
{
void
throw_exception( std::exception const & )
{
exit(0);
called=true;
}
}
@ -30,5 +26,6 @@ int
main()
{
boost::throw_exception(my_exception());
return 1;
BOOST_TEST(called);
return boost::report_errors();
}

View File

@ -1,12 +1,14 @@
# Boost Exception Library test Jamfile
#
# Copyright (c) 2006-2013 Emil Dotchevski and Reverge Studios, Inc.
# 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)
import testing ;
project : requirements <exception-handling>on ;
#to_string
run is_output_streamable_test.cpp ;
@ -17,35 +19,23 @@ compile-fail to_string_fail.cpp ;
#exception
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 : : : <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 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 ;
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_test.cpp ;
run diagnostic_information_test.cpp ;
run refcount_ptr_test.cpp ;
run current_exception_cast_test.cpp : : : <exception-handling>on ;
run current_exception_cast_test.cpp ;
run no_exceptions_test.cpp : : : <exception-handling>off ;
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//thread : : : <threading>multi <exception-handling>on : non_intrusive_exception_ptr_test ;
run exception_ptr_test.cpp ../../thread/src/tss_null.cpp /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 ;
run errinfos_test.cpp ;
compile-fail exception_fail.cpp ;
compile-fail throw_exception_fail.cpp ;
compile-fail error_info_const_fail.cpp ;
@ -55,6 +45,7 @@ compile-fail error_info_const_fail.cpp ;
compile exception_ptr_hpp_test.cpp ;
compile diagnostic_information_hpp_test.cpp ;
compile error_info_hpp_test.cpp ;
compile exception_hpp_test.cpp ;
compile get_error_info_hpp_test.cpp ;
compile info_hpp_test.cpp ;
compile info_tuple_hpp_test.cpp ;

View File

@ -3,19 +3,16 @@
//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>
#include <boost/detail/lightweight_test.hpp>
#include <boost/detail/workaround.hpp>
#include <string>
#include <ios>
#if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x610))
struct my_tag {};
#endif
typedef boost::error_info<struct my_tag,int> my_info;
@ -80,7 +77,7 @@ derives_std_boost_exception:
{
}
char const * what() const BOOST_NOEXCEPT_OR_NOTHROW
char const * what() const throw()
{
return wh_;
}
@ -150,15 +147,9 @@ test_std_exception()
#ifndef BOOST_NO_RTTI
std::type_info const * const * t=boost::get_error_info<boost::original_exception_type>(x);
BOOST_TEST(t!=0 && *t!=0 && **t==typeid(T));
std::string s=diagnostic_information(x);
BOOST_TEST(!s.empty());
#endif
}
catch(
T & )
{
}
catch(
... )
{
BOOST_TEST(false);
@ -189,7 +180,7 @@ test_std_exception_what()
catch(
T & x )
{
BOOST_TEST(std::string(x.what()).find("what")!=std::string::npos);
BOOST_TEST(std::string("what")==x.what());
boost::exception_ptr p = boost::current_exception();
BOOST_TEST(!(p==boost::exception_ptr()));
BOOST_TEST(p!=boost::exception_ptr());
@ -202,7 +193,7 @@ test_std_exception_what()
catch(
T & x )
{
BOOST_TEST(std::string(x.what()).find("what")!=std::string::npos);
BOOST_TEST(std::string("what")==x.what());
}
catch(
... )
@ -229,10 +220,6 @@ test_std_exception_what()
#endif
}
catch(
T & )
{
}
catch(
... )
{
BOOST_TEST(false);
@ -402,11 +389,6 @@ main()
BOOST_TEST(false);
}
catch(
derives_std_exception & )
{
//Yay! Non-intrusive cloning supported!
}
catch(
boost::unknown_exception & e )
{
#ifndef BOOST_NO_RTTI
@ -429,9 +411,7 @@ 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
@ -458,14 +438,6 @@ main()
BOOST_TEST(false);
}
catch(
derives_std_boost_exception & x )
{
//Yay! Non-intrusive cloning supported!
BOOST_TEST(boost::get_error_info<my_info>(x));
if( int const * p=boost::get_error_info<my_info>(x) )
BOOST_TEST(*p==42);
}
catch(
boost::unknown_exception & x )
{
BOOST_TEST(boost::get_error_info<my_info>(x));
@ -527,14 +499,6 @@ main()
BOOST_TEST(false);
}
catch(
derives_boost_exception & x )
{
//Yay! Non-intrusive cloning supported!
BOOST_TEST(boost::get_error_info<my_info>(x));
if( int const * p=boost::get_error_info<my_info>(x) )
BOOST_TEST(*p==42);
}
catch(
boost::unknown_exception & x )
{
BOOST_TEST(boost::get_error_info<my_info>(x));
@ -592,7 +556,7 @@ main()
}
try
{
throw boost::enable_current_exception(derives_std_boost_exception("what2") << boost::errinfo_nested_exception(p) );
throw boost::enable_current_exception(derives_std_boost_exception("what2") << boost::errinfo_nested_exception(p) );
}
catch(
... )

View File

@ -1,93 +0,0 @@
//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,138 +3,26 @@
//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/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
err:
virtual boost::exception,
virtual std::exception
test_exception:
std::exception
{
err()
{
++exc_count;
}
err( err const & )
{
++exc_count;
}
virtual
~err() BOOST_NOEXCEPT_OR_NOTHROW
{
--exc_count;
}
private:
err & operator=( err const & );
};
class
future
int
main()
{
public:
future():
ready_(false)
{
}
void
set_exception( boost::exception_ptr const & e )
{
boost::unique_lock<boost::mutex> lck(mux_);
exc_ = e;
ready_ = true;
cond_.notify_all();
}
void
get_exception() const
{
boost::unique_lock<boost::mutex> lck(mux_);
while( !ready_ )
cond_.wait(lck);
rethrow_exception(exc_);
}
private:
bool ready_;
boost::exception_ptr exc_;
mutable boost::mutex mux_;
mutable boost::condition_variable cond_;
};
void
producer( future & f )
{
f.set_exception(boost::copy_exception(err() << answer(42)));
}
void
consumer()
{
future f;
boost::thread thr(boost::bind(&producer, boost::ref(f)));
try
{
f.get_exception();
}
catch(
err & e )
{
int const * ans=boost::get_error_info<answer>(e);
BOOST_TEST(ans && *ans==42);
}
thr.join();
}
void
consume()
{
for( int i=0; i!=thread_count; ++i )
consumer();
}
void
thread_test()
{
boost::thread_group grp;
for( int i=0; i!=thread_count; ++i )
grp.create_thread(&consume);
grp.join_all();
}
void
simple_test()
{
boost::exception_ptr p = boost::copy_exception(err() << answer(42));
boost::exception_ptr p = boost::copy_exception(test_exception());
try
{
rethrow_exception(p);
BOOST_TEST(false);
}
catch(
err & )
test_exception & )
{
}
catch(
@ -142,14 +30,5 @@ simple_test()
{
BOOST_TEST(false);
}
}
int
main()
{
BOOST_TEST(++exc_count==1);
simple_test();
thread_test();
BOOST_TEST(!--exc_count);
return boost::report_errors();
}

View File

@ -3,12 +3,6 @@
//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,18 +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>
#include <boost/detail/workaround.hpp>
#if BOOST_WORKAROUND(BOOST_CODEGEARC, BOOST_TESTED_AT(0x610))
#if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x610))
struct test_tag1 {};
struct test_tag2 {};
#endif
@ -25,7 +19,10 @@ typedef boost::error_info<struct test_tag2,int> tagged_int2;
std::string
to_string( tagged_int2 const & x )
{
return '[' +boost::error_info_name(x) + "] = " + (x.value()==42 ? "fourty-two" : "bad value");
if( x.value()==42 )
return "fourty-two";
else
return "bad value";
}
struct
@ -34,7 +31,7 @@ error1:
boost::exception
{
char const *
what() const BOOST_NOEXCEPT_OR_NOTHROW
what() const throw()
{
return "error1";
}
@ -51,7 +48,7 @@ error3:
std::exception
{
char const *
what() const BOOST_NOEXCEPT_OR_NOTHROW
what() const throw()
{
return "error3";
}
@ -63,7 +60,7 @@ error4:
boost::exception
{
char const *
what() const BOOST_NOEXCEPT_OR_NOTHROW
what() const throw()
{
return diagnostic_information_what(*this);
}
@ -203,17 +200,6 @@ main()
std::string di=current_exception_diagnostic_information();
test3(di);
}
try
{
throw error4();
}
catch(
error4 & x )
{
std::string di1=boost::diagnostic_information(x);
std::string wh1=x.what();
BOOST_TEST(wh1==di1);
}
try
{
error4 x; x << tagged_int1(42) << tagged_int2(42);

View File

@ -3,12 +3,6 @@
//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,12 +3,6 @@
//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>
@ -40,7 +34,7 @@ main()
e <<
errinfo_api_function("failed_api_function") <<
errinfo_at_line(42) <<
errinfo_errno(0) <<
errinfo_errno(errno) <<
errinfo_file_handle(weak_ptr<FILE>()) <<
errinfo_file_name("filename.txt") <<
errinfo_file_open_mode("rb");
@ -49,7 +43,7 @@ main()
#else
BOOST_THROW_EXCEPTION(e<<errinfo_type_info_name(typeid(int).name()));
#endif
BOOST_ERROR("BOOST_THROW_EXCEPTION failed to throw.");
BOOST_TEST(false);
}
catch(
boost::exception & e )

View File

@ -3,18 +3,16 @@
//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>
#include <boost/detail/workaround.hpp>
#include <errno.h>
#if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x610))
struct tag_errno {};
#endif
typedef boost::error_info<struct tag_errno,int> info_errno;
class
@ -30,6 +28,7 @@ main()
{
errno=1;
throw my_exception() << info_errno(errno);
BOOST_TEST(false);
}
catch(
my_exception & x )

View File

@ -1,35 +0,0 @@
//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 <boost/exception/error_info.hpp>
#include <boost/exception/exception.hpp>
#include <boost/exception/info.hpp>
#include <boost/exception/get_error_info.hpp>
#include <boost/core/lightweight_test.hpp>
#include <string>
#include <string.h>
struct my_exception: virtual boost::exception {};
typedef boost::error_info<struct error_info_string_, std::string> error_info_string;
int
main()
{
try
{
throw my_exception() << error_info_string("doh");
}
catch( my_exception & e )
{
BOOST_TEST(boost::get_error_info<error_info_string>(e) && !strcmp(boost::get_error_info<error_info_string>(e)->c_str(),"doh"));
}
return boost::report_errors();
}

View File

@ -1,13 +0,0 @@
//Copyright (c) 2006-2015 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>
template <class E,class I>
E const &
add_info( E const & e, I const & i )
{
return e << i;
}
#include "error_info_test.hpp"

View File

@ -1,13 +0,0 @@
//Copyright (c) 2006-2015 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>
template <class E,class I>
E const &
add_info( E const & e, I i )
{
return e << i;
}
#include "error_info_test.hpp"

View File

@ -1,28 +0,0 @@
//Copyright (c) 2006-2015 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>
#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
int
main()
{
return 0;
}
#else
template <class I>
I const
rv_const( I i )
{
return i;
}
template <class E,class I>
E const &
add_info( E const & e, I i )
{
return e << rv_const(i);
}
#include "error_info_test.hpp"
#endif

View File

@ -1,22 +0,0 @@
//Copyright (c) 2006-2015 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>
#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
int
main()
{
return 0;
}
#else
template <class E,class I>
E const &
add_info( E const & e, I i )
{
return e << std::move(i);
}
#include "error_info_test.hpp"
#endif

View File

@ -1,17 +1,10 @@
//Copyright (c) 2006-2015 Emil Dotchevski and Reverge Studios, Inc.
//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 <boost/exception/get_error_info.hpp>
#include <boost/exception/info_tuple.hpp>
#include <boost/exception_ptr.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <boost/detail/workaround.hpp>
@ -42,6 +35,16 @@ user_data
}
};
#if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x610))
struct tag_test_1 {};
struct tag_test_2 {};
struct tag_test_3 {};
struct tag_test_4 {};
struct tag_test_5 {};
struct tag_test_6 {};
struct tag_user_data {};
#endif
typedef boost::error_info<struct tag_test_1,int> test_1;
typedef boost::error_info<struct tag_test_2,unsigned int> test_2;
typedef boost::error_info<struct tag_test_3,float> test_3;
@ -75,7 +78,7 @@ basic_test()
try
{
test_exception x;
add_info(add_info(add_info(x,test_1(1)),test_2(2u)),test_3(3.14159f));
x << test_1(1) << test_2(2u) << test_3(3.14159f);
throw x;
}
catch(
@ -92,7 +95,7 @@ basic_test()
try
{
test_exception x;
add_info(add_info(add_info(x,test_1(1)),test_2(2u)),test_3(3.14159f));
x << test_1(1) << test_2(2u) << test_3(3.14159f);
throw x;
}
catch(
@ -111,7 +114,7 @@ exception_safety_test()
test_exception x;
try
{
add_info(x,test_4(throws_on_copy()));
x << test_4(throws_on_copy());
BOOST_TEST(false);
}
catch(
@ -130,13 +133,13 @@ throw_empty()
void
throw_test_1( char const * value )
{
throw add_info(test_exception(),test_5(std::string(value)));
throw test_exception() << test_5(std::string(value));
}
void
throw_test_2()
{
throw add_info(test_exception(),test_6(non_printable()));
throw test_exception() << test_6(non_printable());
}
void
@ -150,9 +153,9 @@ throw_catch_add_file_name( char const * name )
catch(
boost::exception & x )
{
add_info(x,test_5(std::string(name)));
x << test_5(std::string(name));
throw;
}
}
}
void
@ -255,41 +258,12 @@ test_catch_add_info()
void
test_add_tuple()
{
typedef boost::tuple<> tuple_test_;
typedef boost::tuple<test_1> tuple_test_1;
typedef boost::tuple<test_1,test_2> tuple_test_12;
typedef boost::tuple<test_1,test_2,test_3> tuple_test_123;
typedef boost::tuple<test_1,test_2,test_3,test_5> tuple_test_1235;
typedef boost::tuple<test_1,test_2> test_12;
typedef boost::tuple<test_1,test_2,test_3> test_123;
typedef boost::tuple<test_1,test_2,test_3,test_5> test_1235;
try
{
throw add_info(test_exception(),tuple_test_());
}
catch(
test_exception & )
{
}
catch(
... )
{
BOOST_TEST(false);
}
try
{
throw add_info(test_exception(),tuple_test_1(42));
}
catch(
test_exception & x )
{
BOOST_TEST( *boost::get_error_info<test_1>(x)==42 );
}
catch(
... )
{
BOOST_TEST(false);
}
try
{
throw add_info(test_exception(),tuple_test_12(42,42u));
throw test_exception() << test_12(42,42u);
}
catch(
test_exception & x )
@ -304,7 +278,7 @@ test_add_tuple()
}
try
{
throw add_info(test_exception(),tuple_test_123(42,42u,42.0f));
throw test_exception() << test_123(42,42u,42.0f);
}
catch(
test_exception & x )
@ -320,7 +294,7 @@ test_add_tuple()
}
try
{
throw add_info(test_exception(),tuple_test_1235(42,42u,42.0f,std::string("42")));
throw test_exception() << test_1235(42,42u,42.0f,std::string("42"));
}
catch(
test_exception & x )
@ -338,12 +312,13 @@ test_add_tuple()
}
void
test_lifetime1()
test_lifetime()
{
int count=0;
try
{
throw add_info(test_exception(),test_7(user_data(count)));
throw test_exception() << test_7(user_data(count));
BOOST_TEST(false);
}
catch(
boost::exception & x )
@ -359,19 +334,6 @@ test_lifetime1()
BOOST_TEST(!count);
}
void
test_lifetime2()
{
int count=0;
{
boost::exception_ptr ep;
test_exception e; add_info(e,test_7(user_data(count)));
ep=boost::copy_exception(e);
BOOST_TEST(count>0);
}
BOOST_TEST(!count);
}
bool
is_const( int const * )
{
@ -403,8 +365,7 @@ main()
test_basic_throw_catch();
test_catch_add_info();
test_add_tuple();
test_lifetime1();
test_lifetime2();
test_lifetime();
test_const();
return boost::report_errors();
}

View File

@ -0,0 +1,7 @@
//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.hpp>
#include <boost/exception.hpp>

View File

@ -1,184 +0,0 @@
//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 <boost/exception_ptr.hpp>
#include <boost/exception/info.hpp>
#include <boost/exception/get_error_info.hpp>
#include <boost/exception/diagnostic_information.hpp>
#include <boost/function.hpp>
#include <boost/bind.hpp>
#include <boost/thread.hpp>
#include <boost/detail/atomic_count.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <iostream>
class thread_handle;
boost::shared_ptr<thread_handle> create_thread( boost::function<void()> const & f );
void join( thread_handle & t );
class
thread_handle
{
thread_handle( thread_handle const & );
thread_handle & operator=( thread_handle const & );
boost::exception_ptr err_;
boost::thread t_;
static
void
thread_wrapper( boost::function<void()> const & f, boost::exception_ptr & ep )
{
BOOST_ASSERT(!ep);
try
{
f();
}
catch(...)
{
ep = boost::current_exception();
}
}
explicit
thread_handle( boost::function<void()> const & f ):
t_(boost::bind(thread_wrapper,f,boost::ref(err_)))
{
}
friend boost::shared_ptr<thread_handle> create_thread( boost::function<void()> const & f );
friend void join( thread_handle & t );
};
boost::shared_ptr<thread_handle>
create_thread( boost::function<void()> const & f )
{
boost::shared_ptr<thread_handle> t( new thread_handle(f) );
return t;
}
void
join( thread_handle & t )
{
t.t_.join();
assert(t.err_);
rethrow_exception(t.err_);
}
boost::detail::atomic_count exc_count(0);
struct
exc:
virtual boost::exception,
virtual std::exception
{
exc()
{
++exc_count;
}
exc( exc const & e ):
boost::exception(e),
std::exception(e)
{
++exc_count;
}
virtual
~exc() BOOST_NOEXCEPT_OR_NOTHROW
{
--exc_count;
}
private:
exc & operator=( exc const & );
};
typedef boost::error_info<struct answer_,int> answer;
void
thread_func()
{
BOOST_THROW_EXCEPTION(exc() << answer(42));
}
void
check( boost::shared_ptr<thread_handle> const & t )
{
try
{
join(*t);
BOOST_TEST(false);
}
catch(
exc & e )
{
int const * a = boost::get_error_info<answer>(e);
BOOST_TEST(a && *a==42);
}
}
void
test_deep_copy()
{
int const * p1=0;
boost::exception_ptr p;
try
{
BOOST_THROW_EXCEPTION(exc() << answer(42));
BOOST_ERROR("BOOST_THROW_EXCEPTION didn't throw");
}
catch(
exc & e )
{
p1=boost::get_error_info<answer>(e);
p=boost::current_exception();
}
BOOST_TEST(p1!=0);
BOOST_TEST(p);
try
{
boost::rethrow_exception(p);
BOOST_ERROR("rethrow_exception didn't throw");
}
catch(
exc & e )
{
int const * p2=boost::get_error_info<answer>(e);
BOOST_TEST(p2!=0 && *p2==42);
BOOST_TEST(p2!=p1);
}
}
int
main()
{
test_deep_copy();
BOOST_TEST(++exc_count==1);
try
{
std::vector< boost::shared_ptr<thread_handle> > threads;
std::generate_n(std::inserter(threads,threads.end()),1,boost::bind(create_thread,thread_func));
std::for_each(threads.begin(),threads.end(),check);
return boost::report_errors();
}
catch(
... )
{
std::cerr <<
"Caught unexpected exception.\n"
"Output from current_exception_diagnostic_information:\n" <<
boost::current_exception_diagnostic_information() << std::endl;
return 42;
}
BOOST_TEST(!--exc_count);
}

View File

@ -1,114 +0,0 @@
// 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,12 +3,6 @@
//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,12 +3,6 @@
//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,8 +3,8 @@
//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_EXCEPTION_4AEB7924CA2E11DC888A8C9355D89593
#define BOOST_EXCEPTION_4AEB7924CA2E11DC888A8C9355D89593
#ifndef UUID_4AEB7924CA2E11DC888A8C9355D89593
#define UUID_4AEB7924CA2E11DC888A8C9355D89593
namespace
boost

View File

@ -3,12 +3,6 @@
//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>
@ -26,7 +20,7 @@ boost
}
derives_boost_exception::
~derives_boost_exception() BOOST_NOEXCEPT_OR_NOTHROW
~derives_boost_exception() throw()
{
}
@ -38,7 +32,7 @@ boost
}
derives_boost_exception_virtually::
~derives_boost_exception_virtually() BOOST_NOEXCEPT_OR_NOTHROW
~derives_boost_exception_virtually() throw()
{
}
@ -50,7 +44,7 @@ boost
}
derives_std_exception::
~derives_std_exception() BOOST_NOEXCEPT_OR_NOTHROW
~derives_std_exception() throw()
{
}

View File

@ -3,8 +3,8 @@
//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_EXCEPTION_BC765EB4CA2A11DCBDC5828355D89593
#define BOOST_EXCEPTION_BC765EB4CA2A11DCBDC5828355D89593
#ifndef UUID_BC765EB4CA2A11DCBDC5828355D89593
#define UUID_BC765EB4CA2A11DCBDC5828355D89593
#include <boost/exception/exception.hpp>
#include <exception>
@ -21,7 +21,7 @@ boost
public std::exception
{
explicit derives_boost_exception( int x );
virtual ~derives_boost_exception() BOOST_NOEXCEPT_OR_NOTHROW;
virtual ~derives_boost_exception() throw();
int x_;
};
@ -31,7 +31,7 @@ boost
public std::exception
{
explicit derives_boost_exception_virtually( int x );
virtual ~derives_boost_exception_virtually() BOOST_NOEXCEPT_OR_NOTHROW;
virtual ~derives_boost_exception_virtually() throw();
int x_;
};
@ -40,7 +40,7 @@ boost
public std::exception
{
explicit derives_std_exception( int x );
virtual ~derives_std_exception() BOOST_NOEXCEPT_OR_NOTHROW;
virtual ~derives_std_exception() throw();
int x_;
};

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