diff --git a/examples/capture_in_exception.cpp b/examples/capture_in_exception.cpp index 8fe9688..83fa73f 100644 --- a/examples/capture_in_exception.cpp +++ b/examples/capture_in_exception.cpp @@ -8,7 +8,7 @@ // for the version that does not use exception handling. #include -#include +#include #include #include #include diff --git a/examples/capture_in_result.cpp b/examples/capture_in_result.cpp index be0de38..c1a9be7 100644 --- a/examples/capture_in_result.cpp +++ b/examples/capture_in_result.cpp @@ -8,7 +8,7 @@ // for the version that uses exception handling. #include -#include +#include #include #include #include diff --git a/examples/error_log.cpp b/examples/error_log.cpp index 00b67f4..54e37d6 100644 --- a/examples/error_log.cpp +++ b/examples/error_log.cpp @@ -13,7 +13,7 @@ // only printed. #include -#include +#include #include #include #include diff --git a/examples/error_trace.cpp b/examples/error_trace.cpp index 9c131da..3f55c4f 100644 --- a/examples/error_trace.cpp +++ b/examples/error_trace.cpp @@ -13,7 +13,7 @@ // a std::deque, rather than just printed in-place. #include -#include +#include #include #include #include diff --git a/examples/exception_to_result.cpp b/examples/exception_to_result.cpp index fe751aa..88ecea3 100644 --- a/examples/exception_to_result.cpp +++ b/examples/exception_to_result.cpp @@ -9,8 +9,7 @@ #include #include -#include -#include +#include #include namespace leaf = boost::leaf; diff --git a/examples/lua_callback_eh.cpp b/examples/lua_callback_eh.cpp index 8470bb2..4e23353 100644 --- a/examples/lua_callback_eh.cpp +++ b/examples/lua_callback_eh.cpp @@ -10,7 +10,7 @@ extern "C" { #include "lua.h" #include "lauxlib.h" } -#include +#include #include #include #include diff --git a/examples/lua_callback_result.cpp b/examples/lua_callback_result.cpp index ac8b71a..1d7f457 100644 --- a/examples/lua_callback_result.cpp +++ b/examples/lua_callback_result.cpp @@ -10,7 +10,7 @@ extern "C" { #include "lua.h" #include "lauxlib.h" } -#include +#include #include #include #include diff --git a/examples/print_file/print_file_eh.cpp b/examples/print_file/print_file_eh.cpp index 5adb655..15684bc 100644 --- a/examples/print_file/print_file_eh.cpp +++ b/examples/print_file/print_file_eh.cpp @@ -10,7 +10,7 @@ // handling is in print_file_result.cpp. #include -#include +#include #include #include #include diff --git a/examples/print_file/print_file_eh_error_tags.cpp b/examples/print_file/print_file_eh_error_tags.cpp index e87078a..d84d42a 100644 --- a/examples/print_file/print_file_eh_error_tags.cpp +++ b/examples/print_file/print_file_eh_error_tags.cpp @@ -10,7 +10,7 @@ // handling is in print_file_result.cpp. #include -#include +#include #include #include #include diff --git a/examples/print_file/print_file_outcome_result.cpp b/examples/print_file/print_file_outcome_result.cpp index b9c1afe..9993e44 100644 --- a/examples/print_file/print_file_outcome_result.cpp +++ b/examples/print_file/print_file_outcome_result.cpp @@ -10,7 +10,7 @@ // This version does not use exception handling. #include -#include +#include #include #include #include @@ -39,7 +39,7 @@ using result = outcome::std_result; // To enable LEAF to work with outcome::result, we need to specialize the is_result_type template: namespace boost { namespace leaf { - template struct is_result_type>: std::true_type { }; + template struct is_result_type>: std::true_type { }; } } diff --git a/examples/print_file/print_file_result.cpp b/examples/print_file/print_file_result.cpp index 2aeb5e0..63a6349 100644 --- a/examples/print_file/print_file_result.cpp +++ b/examples/print_file/print_file_result.cpp @@ -10,7 +10,7 @@ // handling is in print_file_eh.cpp. #include -#include +#include #include #include #include diff --git a/examples/print_file/print_file_result_error_tags.cpp b/examples/print_file/print_file_result_error_tags.cpp index 5520dfe..0854cb5 100644 --- a/examples/print_file/print_file_result_error_tags.cpp +++ b/examples/print_file/print_file_result_error_tags.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include #include diff --git a/examples/print_half.cpp b/examples/print_half.cpp index c5989bb..a22a02b 100644 --- a/examples/print_half.cpp +++ b/examples/print_half.cpp @@ -6,7 +6,7 @@ // This program is an adaptation of the following Boost Outcome example: // https://github.com/ned14/outcome/blob/master/doc/src/snippets/using_result.cpp -#include +#include #include #include #include diff --git a/gen/generate_single_header.py b/gen/generate_single_header.py index b1f74a2..b344517 100644 --- a/gen/generate_single_header.py +++ b/gen/generate_single_header.py @@ -51,7 +51,7 @@ def _main(): help="Non-empty include file prefix (e.g. a/b)") args = parser.parse_args() - regex_includes = re.compile(r"""^\s*#[\t ]*include\s*("|\<)(?P%s.*)("|\>)""" % args.prefix) + regex_includes = re.compile(r"""^\s*#[\t\s]*include[\t\s]*("|\<)(?P%s.*)("|\>)""" % args.prefix) print("Rebuilding %s:" % args.input) with open(args.output, 'w') as output_file, open(args.input, 'r') as input_file: append(args.input, input_file, output_file, regex_includes, args.path) diff --git a/include/boost/leaf/all.hpp b/include/boost/leaf/all.hpp index 39e161e..6d41441 100644 --- a/include/boost/leaf/all.hpp +++ b/include/boost/leaf/all.hpp @@ -6,186 +6,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 -#line 1 "boost/leaf/config.hpp" -#ifndef BOOST_LEAF_CONFIG_HPP_INCLUDED -#define BOOST_LEAF_CONFIG_HPP_INCLUDED - -// Copyright (c) 2018-2020 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) - -// The following is based on Boost Config. - -// (C) Copyright John Maddock 2001 - 2003. -// (C) Copyright Martin Wille 2003. -// (C) Copyright Guillaume Melquiond 2003. - -#if defined(__clang__) -# pragma clang system_header -#elif (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_LEAF_ENABLE_WARNINGS) -# pragma GCC system_header -#elif defined(_MSC_VER) && !defined(BOOST_LEAF_ENABLE_WARNINGS) -# pragma warning(push,1) -#endif - -//////////////////////////////////////// - -// Configure BOOST_LEAF_NO_EXCEPTIONS, unless already #defined -#ifndef BOOST_LEAF_NO_EXCEPTIONS - -# if defined __clang__ && !defined(__ibmxl__) -// Clang C++ emulates GCC, so it has to appear early. - -# if !__has_feature(cxx_exceptions) -# define BOOST_LEAF_NO_EXCEPTIONS -# endif - -# elif defined __DMC__ -// Digital Mars C++ - -# if !defined(_CPPUNWIND) -# define BOOST_LEAF_NO_EXCEPTIONS -# endif - -# elif defined(__GNUC__) && !defined(__ibmxl__) -// GNU C++: - -# if !defined(__EXCEPTIONS) -# define BOOST_LEAF_NO_EXCEPTIONS -# endif - -# elif defined __KCC -// Kai C++ - -# if !defined(_EXCEPTIONS) -# define BOOST_LEAF_NO_EXCEPTIONS -# endif - -# elif defined __CODEGEARC__ -// CodeGear - must be checked for before Borland - -# if !defined(_CPPUNWIND) && !defined(__EXCEPTIONS) -# define BOOST_LEAF_NO_EXCEPTIONS -# endif - -# elif defined __BORLANDC__ -// Borland - -# if !defined(_CPPUNWIND) && !defined(__EXCEPTIONS) -# define BOOST_LEAF_NO_EXCEPTIONS -# endif - -# elif defined __MWERKS__ -// Metrowerks CodeWarrior - -# if !__option(exceptions) -# define BOOST_LEAF_NO_EXCEPTIONS -# endif - -# elif defined(__IBMCPP__) && defined(__COMPILER_VER__) && defined(__MVS__) -// IBM z/OS XL C/C++ - -# if !defined(_CPPUNWIND) && !defined(__EXCEPTIONS) -# define BOOST_LEAF_NO_EXCEPTIONS -# endif - -# elif defined(__ibmxl__) -// IBM XL C/C++ for Linux (Little Endian) - -# if !__has_feature(cxx_exceptions) -# define BOOST_LEAF_NO_EXCEPTIONS -# endif - -# elif defined _MSC_VER -// Microsoft Visual C++ -// -// Must remain the last #elif since some other vendors (Metrowerks, for -// example) also #define _MSC_VER - -# if !defined(_CPPUNWIND) -# define BOOST_LEAF_NO_EXCEPTIONS -# endif -# endif - -#endif - -#ifdef BOOST_NORETURN -# define BOOST_LEAF_NORETURN BOOST_NORETURN -#else -# if defined(_MSC_VER) -# define BOOST_LEAF_NORETURN __declspec(noreturn) -# elif defined(__GNUC__) -# define BOOST_LEAF_NORETURN __attribute__ ((__noreturn__)) -# elif defined(__has_attribute) && defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x5130) -# if __has_attribute(noreturn) -# define BOOST_LEAF_NORETURN [[noreturn]] -# endif -# elif defined(__has_cpp_attribute) -# if __has_cpp_attribute(noreturn) -# define BOOST_LEAF_NORETURN [[noreturn]] -# endif -# endif -#endif -#if !defined(BOOST_LEAF_NORETURN) -# define BOOST_LEAF_NORETURN -#endif - -//////////////////////////////////////// - -#ifndef BOOST_LEAF_DIAGNOSTICS -# define BOOST_LEAF_DIAGNOSTICS 1 -#endif - -#if BOOST_LEAF_DIAGNOSTICS!=0 && BOOST_LEAF_DIAGNOSTICS!=1 -# error BOOST_LEAF_DIAGNOSTICS must be 0 or 1. -#endif - -//////////////////////////////////////// - -#ifdef _MSC_VER -# define BOOST_LEAF_ALWAYS_INLINE __forceinline -#else -# define BOOST_LEAF_ALWAYS_INLINE __attribute__((always_inline)) inline -#endif - -//////////////////////////////////////// - -#ifndef BOOST_LEAF_NODISCARD -# if __cplusplus >= 201703L -# define BOOST_LEAF_NODISCARD [[nodiscard]] -# else -# define BOOST_LEAF_NODISCARD -# endif -#endif - -//////////////////////////////////////// - -#ifndef BOOST_LEAF_CONSTEXPR -# if __cplusplus > 201402L -# define BOOST_LEAF_CONSTEXPR constexpr -# define BOOST_LEAF_STD_UNCAUGHT_EXCEPTIONS 1 -# else -# define BOOST_LEAF_CONSTEXPR -# define BOOST_LEAF_STD_UNCAUGHT_EXCEPTIONS 0 -# endif -#endif - -//////////////////////////////////////// - -#ifndef BOOST_LEAF_ASSERT -# ifdef BOOST_ASSERT -# define BOOST_LEAF_ASSERT BOOST_ASSERT -# else -# include -# define BOOST_LEAF_ASSERT assert -# endif -#endif - -#endif -// <<< #include -#line 10 "../../include/boost/leaf/detail/all.hpp" // >>> #include #line 1 "boost/leaf/capture.hpp" #ifndef BOOST_LEAF_CAPTURE_HPP_INCLUDED @@ -684,6 +504,186 @@ namespace boost { namespace leaf { # pragma warning(push,1) #endif +// >>> #include +#line 1 "boost/leaf/config.hpp" +#ifndef BOOST_LEAF_CONFIG_HPP_INCLUDED +#define BOOST_LEAF_CONFIG_HPP_INCLUDED + +// Copyright (c) 2018-2020 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) + +// The following is based on Boost Config. + +// (C) Copyright John Maddock 2001 - 2003. +// (C) Copyright Martin Wille 2003. +// (C) Copyright Guillaume Melquiond 2003. + +#if defined(__clang__) +# pragma clang system_header +#elif (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_LEAF_ENABLE_WARNINGS) +# pragma GCC system_header +#elif defined(_MSC_VER) && !defined(BOOST_LEAF_ENABLE_WARNINGS) +# pragma warning(push,1) +#endif + +//////////////////////////////////////// + +// Configure BOOST_LEAF_NO_EXCEPTIONS, unless already #defined +#ifndef BOOST_LEAF_NO_EXCEPTIONS + +# if defined __clang__ && !defined(__ibmxl__) +// Clang C++ emulates GCC, so it has to appear early. + +# if !__has_feature(cxx_exceptions) +# define BOOST_LEAF_NO_EXCEPTIONS +# endif + +# elif defined __DMC__ +// Digital Mars C++ + +# if !defined(_CPPUNWIND) +# define BOOST_LEAF_NO_EXCEPTIONS +# endif + +# elif defined(__GNUC__) && !defined(__ibmxl__) +// GNU C++: + +# if !defined(__EXCEPTIONS) +# define BOOST_LEAF_NO_EXCEPTIONS +# endif + +# elif defined __KCC +// Kai C++ + +# if !defined(_EXCEPTIONS) +# define BOOST_LEAF_NO_EXCEPTIONS +# endif + +# elif defined __CODEGEARC__ +// CodeGear - must be checked for before Borland + +# if !defined(_CPPUNWIND) && !defined(__EXCEPTIONS) +# define BOOST_LEAF_NO_EXCEPTIONS +# endif + +# elif defined __BORLANDC__ +// Borland + +# if !defined(_CPPUNWIND) && !defined(__EXCEPTIONS) +# define BOOST_LEAF_NO_EXCEPTIONS +# endif + +# elif defined __MWERKS__ +// Metrowerks CodeWarrior + +# if !__option(exceptions) +# define BOOST_LEAF_NO_EXCEPTIONS +# endif + +# elif defined(__IBMCPP__) && defined(__COMPILER_VER__) && defined(__MVS__) +// IBM z/OS XL C/C++ + +# if !defined(_CPPUNWIND) && !defined(__EXCEPTIONS) +# define BOOST_LEAF_NO_EXCEPTIONS +# endif + +# elif defined(__ibmxl__) +// IBM XL C/C++ for Linux (Little Endian) + +# if !__has_feature(cxx_exceptions) +# define BOOST_LEAF_NO_EXCEPTIONS +# endif + +# elif defined _MSC_VER +// Microsoft Visual C++ +// +// Must remain the last #elif since some other vendors (Metrowerks, for +// example) also #define _MSC_VER + +# if !defined(_CPPUNWIND) +# define BOOST_LEAF_NO_EXCEPTIONS +# endif +# endif + +#endif + +#ifdef BOOST_NORETURN +# define BOOST_LEAF_NORETURN BOOST_NORETURN +#else +# if defined(_MSC_VER) +# define BOOST_LEAF_NORETURN __declspec(noreturn) +# elif defined(__GNUC__) +# define BOOST_LEAF_NORETURN __attribute__ ((__noreturn__)) +# elif defined(__has_attribute) && defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x5130) +# if __has_attribute(noreturn) +# define BOOST_LEAF_NORETURN [[noreturn]] +# endif +# elif defined(__has_cpp_attribute) +# if __has_cpp_attribute(noreturn) +# define BOOST_LEAF_NORETURN [[noreturn]] +# endif +# endif +#endif +#if !defined(BOOST_LEAF_NORETURN) +# define BOOST_LEAF_NORETURN +#endif + +//////////////////////////////////////// + +#ifndef BOOST_LEAF_DIAGNOSTICS +# define BOOST_LEAF_DIAGNOSTICS 1 +#endif + +#if BOOST_LEAF_DIAGNOSTICS!=0 && BOOST_LEAF_DIAGNOSTICS!=1 +# error BOOST_LEAF_DIAGNOSTICS must be 0 or 1. +#endif + +//////////////////////////////////////// + +#ifdef _MSC_VER +# define BOOST_LEAF_ALWAYS_INLINE __forceinline +#else +# define BOOST_LEAF_ALWAYS_INLINE __attribute__((always_inline)) inline +#endif + +//////////////////////////////////////// + +#ifndef BOOST_LEAF_NODISCARD +# if __cplusplus >= 201703L +# define BOOST_LEAF_NODISCARD [[nodiscard]] +# else +# define BOOST_LEAF_NODISCARD +# endif +#endif + +//////////////////////////////////////// + +#ifndef BOOST_LEAF_CONSTEXPR +# if __cplusplus > 201402L +# define BOOST_LEAF_CONSTEXPR constexpr +# define BOOST_LEAF_STD_UNCAUGHT_EXCEPTIONS 1 +# else +# define BOOST_LEAF_CONSTEXPR +# define BOOST_LEAF_STD_UNCAUGHT_EXCEPTIONS 0 +# endif +#endif + +//////////////////////////////////////// + +#ifndef BOOST_LEAF_ASSERT +# ifdef BOOST_ASSERT +# define BOOST_LEAF_ASSERT BOOST_ASSERT +# else +# include +# define BOOST_LEAF_ASSERT assert +# endif +#endif + +#endif +// <<< #include +#line 18 "boost/leaf/detail/optional.hpp" #include #include @@ -2397,7 +2397,7 @@ namespace boost { namespace leaf { #endif // <<< #include -#line 11 "../../include/boost/leaf/detail/all.hpp" +#line 10 "../../include/boost/leaf/detail/all.hpp" // >>> #include #line 1 "boost/leaf/common.hpp" #ifndef BOOST_LEAF_COMMON_HPP_INCLUDED @@ -2494,7 +2494,7 @@ namespace boost { namespace leaf { #endif // <<< #include -#line 12 "../../include/boost/leaf/detail/all.hpp" +#line 11 "../../include/boost/leaf/detail/all.hpp" // >>> #include #line 1 "boost/leaf/context.hpp" #ifndef BOOST_LEAF_CONTEXT_HPP_INCLUDED @@ -2799,189 +2799,125 @@ namespace boost { namespace leaf { //////////////////////////////////////////// - namespace leaf_detail - { - template - class context_base - { - context_base( context_base const & ) = delete; - context_base & operator=( context_base const & ) = delete; - - public: - - using Tup = deduce_e_tuple; - - private: - - Tup tup_; -#if !defined(BOOST_LEAF_NO_THREADS) && !defined(NDEBUG) - std::thread::id thread_id_; -#endif - bool is_active_; - - protected: - - BOOST_LEAF_CONSTEXPR error_id propagate_captured_errors( error_id err_id ) noexcept - { - tuple_for_each::value,Tup>::propagate_captured(tup_, err_id.value()); - return err_id; - } - - BOOST_LEAF_CONSTEXPR context_base( context_base && x ) noexcept: - tup_(std::move(x.tup_)), - is_active_(false) - { - BOOST_LEAF_ASSERT(!x.is_active()); - } - - public: - - BOOST_LEAF_CONSTEXPR context_base() noexcept: - is_active_(false) - { - } - - ~context_base() noexcept - { - BOOST_LEAF_ASSERT(!is_active()); - } - - BOOST_LEAF_CONSTEXPR Tup const & tup() const noexcept - { - return tup_; - } - - BOOST_LEAF_CONSTEXPR Tup & tup() noexcept - { - return tup_; - } - - BOOST_LEAF_CONSTEXPR void activate() noexcept - { - using namespace leaf_detail; - BOOST_LEAF_ASSERT(!is_active()); - tuple_for_each::value,Tup>::activate(tup_); -#if BOOST_LEAF_DIAGNOSTICS - if( unexpected_requested::value ) - ++tl_unexpected_enabled<>::counter; -#endif -#if !defined(BOOST_LEAF_NO_THREADS) && !defined(NDEBUG) - thread_id_ = std::this_thread::get_id(); -#endif - is_active_ = true; - } - - BOOST_LEAF_CONSTEXPR void deactivate() noexcept - { - using namespace leaf_detail; - BOOST_LEAF_ASSERT(is_active()); - is_active_ = false; -#if !defined(BOOST_LEAF_NO_THREADS) && !defined(NDEBUG) - BOOST_LEAF_ASSERT(std::this_thread::get_id() == thread_id_); - thread_id_ = std::thread::id(); -#endif -#if BOOST_LEAF_DIAGNOSTICS - if( unexpected_requested::value ) - --tl_unexpected_enabled<>::counter; -#endif - tuple_for_each::value,Tup>::deactivate(tup_); - } - - BOOST_LEAF_CONSTEXPR void propagate() noexcept - { - tuple_for_each::value,Tup>::propagate(tup_); - } - - BOOST_LEAF_CONSTEXPR bool is_active() const noexcept - { - return is_active_; - } - - void print( std::ostream & os ) const - { - tuple_for_each::value,Tup>::print(os, &tup_, 0); - } - - template - BOOST_LEAF_CONSTEXPR R handle_error( error_id, H && ... ) const; - - template - BOOST_LEAF_CONSTEXPR R handle_error( error_id, H && ... ); - - template - decltype(std::declval()()) try_catch_( TryBlock &&, H && ... ); - }; - - template - class nocatch_context: public context_base - { - public: - - template - BOOST_LEAF_CONSTEXPR - typename std::decay()().value())>::type - try_handle_all( TryBlock &&, H && ... h ); - - template - BOOST_LEAF_NODISCARD BOOST_LEAF_CONSTEXPR - typename std::decay()())>::type - try_handle_some( TryBlock &&, H && ... ); - }; - - template - class catch_context: public context_base - { - public: - - template - BOOST_LEAF_CONSTEXPR - typename std::decay()().value())>::type - try_handle_all( TryBlock &&, H && ... ); - - template - BOOST_LEAF_NODISCARD BOOST_LEAF_CONSTEXPR - typename std::decay()())>::type - try_handle_some( TryBlock &&, H && ... ); - }; - - template - struct catch_requested; - - template <> - struct catch_requested<> - { - constexpr static bool value = false; - }; - - template - struct catch_requested - { - constexpr static bool value = handler_argument_traits::requires_catch || catch_requested::value; - }; - - template - struct select_context_base_impl; - - template - struct select_context_base_impl - { - using type = nocatch_context; - }; - - - template - struct select_context_base_impl - { - using type = catch_context; - }; - - template - using select_context_base = typename select_context_base_impl::value, E...>::type; - } - template - class context: public leaf_detail::select_context_base + class context { + context( context const & ) = delete; + context & operator=( context const & ) = delete; + + public: + + using Tup = leaf_detail::deduce_e_tuple; + + private: + + Tup tup_; +#if !defined(BOOST_LEAF_NO_THREADS) && !defined(NDEBUG) + std::thread::id thread_id_; +#endif + bool is_active_; + + protected: + + BOOST_LEAF_CONSTEXPR error_id propagate_captured_errors( error_id err_id ) noexcept + { + leaf_detail::tuple_for_each::value,Tup>::propagate_captured(tup_, err_id.value()); + return err_id; + } + + public: + + BOOST_LEAF_CONSTEXPR context( context && x ) noexcept: + tup_(std::move(x.tup_)), + is_active_(false) + { + BOOST_LEAF_ASSERT(!x.is_active()); + } + + BOOST_LEAF_CONSTEXPR context() noexcept: + is_active_(false) + { + } + + ~context() noexcept + { + BOOST_LEAF_ASSERT(!is_active()); + } + + BOOST_LEAF_CONSTEXPR Tup const & tup() const noexcept + { + return tup_; + } + + BOOST_LEAF_CONSTEXPR Tup & tup() noexcept + { + return tup_; + } + + BOOST_LEAF_CONSTEXPR void activate() noexcept + { + using namespace leaf_detail; + BOOST_LEAF_ASSERT(!is_active()); + tuple_for_each::value,Tup>::activate(tup_); +#if BOOST_LEAF_DIAGNOSTICS + if( unexpected_requested::value ) + ++tl_unexpected_enabled<>::counter; +#endif +#if !defined(BOOST_LEAF_NO_THREADS) && !defined(NDEBUG) + thread_id_ = std::this_thread::get_id(); +#endif + is_active_ = true; + } + + BOOST_LEAF_CONSTEXPR void deactivate() noexcept + { + using namespace leaf_detail; + BOOST_LEAF_ASSERT(is_active()); + is_active_ = false; +#if !defined(BOOST_LEAF_NO_THREADS) && !defined(NDEBUG) + BOOST_LEAF_ASSERT(std::this_thread::get_id() == thread_id_); + thread_id_ = std::thread::id(); +#endif +#if BOOST_LEAF_DIAGNOSTICS + if( unexpected_requested::value ) + --tl_unexpected_enabled<>::counter; +#endif + tuple_for_each::value,Tup>::deactivate(tup_); + } + + BOOST_LEAF_CONSTEXPR void propagate() noexcept + { + leaf_detail::tuple_for_each::value,Tup>::propagate(tup_); + } + + BOOST_LEAF_CONSTEXPR bool is_active() const noexcept + { + return is_active_; + } + + void print( std::ostream & os ) const + { + leaf_detail::tuple_for_each::value,Tup>::print(os, &tup_, 0); + } + + template + BOOST_LEAF_CONSTEXPR R handle_error( error_id, H && ... ) const; + + template + BOOST_LEAF_CONSTEXPR R handle_error( error_id, H && ... ); + + template + decltype(std::declval()()) try_catch_( TryBlock &&, H && ... ); + + template + BOOST_LEAF_CONSTEXPR + typename std::decay()().value())>::type + try_handle_all( TryBlock &&, H && ... h ); + + template + BOOST_LEAF_NODISCARD BOOST_LEAF_CONSTEXPR + typename std::decay()())>::type + try_handle_some( TryBlock &&, H && ... ); }; //////////////////////////////////////// @@ -3068,11 +3004,29 @@ namespace boost { namespace leaf { #endif // <<< #include -#line 13 "../../include/boost/leaf/detail/all.hpp" -// >>> #include -#line 1 "boost/leaf/handle_error.hpp" -#ifndef BOOST_LEAF_HANDLE_ERROR_HPP_INCLUDED -#define BOOST_LEAF_HANDLE_ERROR_HPP_INCLUDED +#line 12 "../../include/boost/leaf/detail/all.hpp" +// >>> #include +#line 1 "boost/leaf/handle_errors.hpp" +#ifndef BOOST_LEAF_HANDLE_ERRORS_HPP_INCLUDED +#define BOOST_LEAF_HANDLE_ERRORS_HPP_INCLUDED + +// Copyright (c) 2018-2020 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) + +#if defined(__clang__) +# pragma clang system_header +#elif (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_LEAF_ENABLE_WARNINGS) +# pragma GCC system_header +#elif defined(_MSC_VER) && !defined(BOOST_LEAF_ENABLE_WARNINGS) +# pragma warning(push,1) +#endif + +// >>> #include +#line 1 "boost/leaf/detail/handle.hpp" +#ifndef BOOST_LEAF_DETAIL_HANDLE_HPP_INCLUDED +#define BOOST_LEAF_DETAIL_HANDLE_HPP_INCLUDED // Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. @@ -3175,24 +3129,6 @@ namespace boost { namespace leaf { //////////////////////////////////////// -#ifndef BOOST_LEAF_NO_EXCEPTIONS - - namespace leaf_detail - { - template - BOOST_LEAF_CONSTEXPR inline Ex * get_exception( error_info const & ei ) - { - if( ei.exception_caught() ) - if( Ex * ex = dynamic_cast(ei.exception()) ) - return ex; - return 0; - } - } - -#endif - - //////////////////////////////////////// - #if BOOST_LEAF_DIAGNOSTICS class diagnostic_info: public error_info @@ -3673,74 +3609,26 @@ namespace boost { namespace leaf { //////////////////////////////////////// - namespace leaf_detail + template + template + BOOST_LEAF_CONSTEXPR BOOST_LEAF_ALWAYS_INLINE + R + context:: + handle_error( error_id id, H && ... h ) const { - template - template - BOOST_LEAF_CONSTEXPR BOOST_LEAF_ALWAYS_INLINE - R - context_base:: - handle_error( error_id id, H && ... h ) const - { - BOOST_LEAF_ASSERT(!is_active()); - return handle_error_(tup(), error_info(id), std::forward(h)...); - } + BOOST_LEAF_ASSERT(!is_active()); + return leaf_detail::handle_error_(tup(), error_info(id), std::forward(h)...); + } - template - template - BOOST_LEAF_CONSTEXPR BOOST_LEAF_ALWAYS_INLINE - R - context_base:: - handle_error( error_id id, H && ... h ) - { - BOOST_LEAF_ASSERT(!is_active()); - return handle_error_(tup(), error_info(id), std::forward(h)...); - } - - template - template - BOOST_LEAF_CONSTEXPR BOOST_LEAF_ALWAYS_INLINE - typename std::decay()().value())>::type - nocatch_context:: - try_handle_all( TryBlock && try_block, H && ... h ) - { - using namespace leaf_detail; - static_assert(is_result_type()())>::value, "The return type of the try_block passed to a try_handle_all function must be registered with leaf::is_result_type"); - auto active_context = activate_context(*this); - if( auto r = std::forward(try_block)() ) - return r.value(); - else - { - error_id id = r.error(); - this->deactivate(); - using R = typename std::decay()().value())>::type; - return this->template handle_error(std::move(id), std::forward(h)...); - } - } - - template - template - BOOST_LEAF_NODISCARD BOOST_LEAF_CONSTEXPR BOOST_LEAF_ALWAYS_INLINE - typename std::decay()())>::type - nocatch_context:: - try_handle_some( TryBlock && try_block, H && ... h ) - { - using namespace leaf_detail; - static_assert(is_result_type()())>::value, "The return type of the try_block passed to a try_handle_some function must be registered with leaf::is_result_type"); - auto active_context = activate_context(*this); - if( auto r = std::forward(try_block)() ) - return r; - else - { - error_id id = r.error(); - this->deactivate(); - using R = typename std::decay()())>::type; - auto rr = this->template handle_error(std::move(id), std::forward(h)..., [&r]()->R { return std::move(r); }); - if( !rr ) - this->propagate(); - return rr; - } - } + template + template + BOOST_LEAF_CONSTEXPR BOOST_LEAF_ALWAYS_INLINE + R + context:: + handle_error( error_id id, H && ... h ) + { + BOOST_LEAF_ASSERT(!is_active()); + return leaf_detail::handle_error_(tup(), error_info(id), std::forward(h)...); } //////////////////////////////////////// @@ -3768,13 +3656,89 @@ namespace boost { namespace leaf { } } #endif -// <<< #include -#line 16 "../../include/boost/leaf/detail/all.hpp" +// <<< #include +#line 18 "boost/leaf/handle_errors.hpp" + +#ifdef BOOST_LEAF_NO_EXCEPTIONS +// >>> # include +#line 1 "boost/leaf/detail/ctx_nocatch.hpp" +#ifndef BOOST_LEAF_DETAIL_CTX_NOCATCH_HPP_INCLUDED +#define BOOST_LEAF_DETAIL_CTX_NOCATCH_HPP_INCLUDED + +// Copyright (c) 2018-2020 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) + +#if defined(__clang__) +# pragma clang system_header +#elif (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_LEAF_ENABLE_WARNINGS) +# pragma GCC system_header +#elif defined(_MSC_VER) && !defined(BOOST_LEAF_ENABLE_WARNINGS) +# pragma warning(push,1) +#endif + #ifndef BOOST_LEAF_NO_EXCEPTIONS -// >>> # include -#line 1 "boost/leaf/handle_exception.hpp" -#ifndef BOOST_LEAF_HANDLE_EXCEPTION_HPP_INCLUDED -#define BOOST_LEAF_HANDLE_EXCEPTION_HPP_INCLUDED +# error This header requires exception handling to be disabled +#endif + +namespace boost { namespace leaf { + + template + template + BOOST_LEAF_CONSTEXPR BOOST_LEAF_ALWAYS_INLINE + typename std::decay()().value())>::type + context:: + try_handle_all( TryBlock && try_block, H && ... h ) + { + using namespace leaf_detail; + static_assert(is_result_type()())>::value, "The return type of the try_block passed to a try_handle_all function must be registered with leaf::is_result_type"); + auto active_context = activate_context(*this); + if( auto r = std::forward(try_block)() ) + return r.value(); + else + { + error_id id = r.error(); + this->deactivate(); + using R = typename std::decay()().value())>::type; + return this->template handle_error(std::move(id), std::forward(h)...); + } + } + + template + template + BOOST_LEAF_NODISCARD BOOST_LEAF_CONSTEXPR BOOST_LEAF_ALWAYS_INLINE + typename std::decay()())>::type + context:: + try_handle_some( TryBlock && try_block, H && ... h ) + { + using namespace leaf_detail; + static_assert(is_result_type()())>::value, "The return type of the try_block passed to a try_handle_some function must be registered with leaf::is_result_type"); + auto active_context = activate_context(*this); + if( auto r = std::forward(try_block)() ) + return r; + else + { + error_id id = r.error(); + this->deactivate(); + using R = typename std::decay()())>::type; + auto rr = this->template handle_error(std::move(id), std::forward(h)..., [&r]()->R { return std::move(r); }); + if( !rr ) + this->propagate(); + return rr; + } + } + +} } + +#endif +// <<< # include +#line 21 "boost/leaf/handle_errors.hpp" +#else +// >>> # include +#line 1 "boost/leaf/detail/ctx_catch.hpp" +#ifndef BOOST_LEAF_DETAIL_CTX_CATCH_HPP_INCLUDED +#define BOOST_LEAF_DETAIL_CTX_CATCH_HPP_INCLUDED // Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. @@ -3925,7 +3889,7 @@ namespace boost { namespace leaf { #endif // <<< #include -#line 25 "boost/leaf/handle_exception.hpp" +#line 23 "boost/leaf/detail/ctx_catch.hpp" namespace boost { namespace leaf { @@ -3944,63 +3908,60 @@ namespace boost { namespace leaf { } } - namespace leaf_detail + template + template + BOOST_LEAF_CONSTEXPR inline + typename std::decay()().value())>::type + context:: + try_handle_all( TryBlock && try_block, H && ... h ) { - template - template - BOOST_LEAF_CONSTEXPR inline - typename std::decay()().value())>::type - catch_context:: - try_handle_all( TryBlock && try_block, H && ... h ) + using namespace leaf_detail; + static_assert(is_result_type()())>::value, "The return type of the try_block passed to a try_handle_all function must be registered with leaf::is_result_type"); + auto active_context = activate_context(*this); + if( auto r = this->try_catch_( + [&] + { + return std::forward(try_block)(); + }, + std::forward(h)...) ) + return r.value(); + else { - using namespace leaf_detail; - static_assert(is_result_type()())>::value, "The return type of the try_block passed to a try_handle_all function must be registered with leaf::is_result_type"); - auto active_context = activate_context(*this); - if( auto r = this->try_catch_( - [&] - { - return std::forward(try_block)(); - }, - std::forward(h)...) ) - return r.value(); - else - { - error_id id = r.error(); - if( this->is_active() ) - this->deactivate(); - using R = typename std::decay()().value())>::type; - return this->template handle_error(std::move(id), std::forward(h)...); - } + error_id id = r.error(); + if( this->is_active() ) + this->deactivate(); + using R = typename std::decay()().value())>::type; + return this->template handle_error(std::move(id), std::forward(h)...); } + } - template - template - BOOST_LEAF_NODISCARD BOOST_LEAF_CONSTEXPR inline - typename std::decay()())>::type - catch_context:: - try_handle_some( TryBlock && try_block, H && ... h ) + template + template + BOOST_LEAF_NODISCARD BOOST_LEAF_CONSTEXPR inline + typename std::decay()())>::type + context:: + try_handle_some( TryBlock && try_block, H && ... h ) + { + using namespace leaf_detail; + static_assert(is_result_type()())>::value, "The return type of the try_block passed to a try_handle_some function must be registered with leaf::is_result_type"); + auto active_context = activate_context(*this); + if( auto r = this->try_catch_( + [&] + { + return std::forward(try_block)(); + }, + std::forward(h)...) ) + return r; + else { - using namespace leaf_detail; - static_assert(is_result_type()())>::value, "The return type of the try_block passed to a try_handle_some function must be registered with leaf::is_result_type"); - auto active_context = activate_context(*this); - if( auto r = this->try_catch_( - [&] - { - return std::forward(try_block)(); - }, - std::forward(h)...) ) - return r; - else - { - error_id id = r.error(); - if( this->is_active() ) - this->deactivate(); - using R = typename std::decay()())>::type; - auto rr = this->template handle_error(std::move(id), std::forward(h)..., [&r]()->R { return std::move(r); }); - if( !rr ) - this->propagate(); - return rr; - } + error_id id = r.error(); + if( this->is_active() ) + this->deactivate(); + using R = typename std::decay()())>::type; + auto rr = this->template handle_error(std::move(id), std::forward(h)..., [&r]()->R { return std::move(r); }); + if( !rr ) + this->propagate(); + return rr; } } @@ -4024,39 +3985,27 @@ namespace boost { namespace leaf { exception_info_base(ex) { } + } - template - template - inline - decltype(std::declval()()) - context_base:: - try_catch_( TryBlock && try_block, H && ... h ) + template + template + inline + decltype(std::declval()()) + context:: + try_catch_( TryBlock && try_block, H && ... h ) + { + using namespace leaf_detail; + BOOST_LEAF_ASSERT(is_active()); + using R = decltype(std::declval()()); + try + { + return std::forward(try_block)(); + } + catch( capturing_exception const & cap ) { - using namespace leaf_detail; - BOOST_LEAF_ASSERT(is_active()); - using R = decltype(std::declval()()); try { - return std::forward(try_block)(); - } - catch( capturing_exception const & cap ) - { - try - { - cap.unload_and_rethrow_original_exception(); - } - catch( std::exception & ex ) - { - deactivate(); - return handle_error_(this->tup(), error_info(exception_info_(&ex)), std::forward(h)..., - []() -> R { throw; } ); - } - catch(...) - { - deactivate(); - return handle_error_(this->tup(), error_info(exception_info_(0)), std::forward(h)..., - []() -> R { throw; } ); - } + cap.unload_and_rethrow_original_exception(); } catch( std::exception & ex ) { @@ -4071,6 +4020,18 @@ namespace boost { namespace leaf { []() -> R { throw; } ); } } + catch( std::exception & ex ) + { + deactivate(); + return handle_error_(this->tup(), error_info(exception_info_(&ex)), std::forward(h)..., + []() -> R { throw; } ); + } + catch(...) + { + deactivate(); + return handle_error_(this->tup(), error_info(exception_info_(0)), std::forward(h)..., + []() -> R { throw; } ); + } } //////////////////////////////////////// @@ -4124,62 +4085,6 @@ namespace boost { namespace leaf { std::forward(h)...); } - //////////////////////////////////////// - - namespace leaf_detail - { - template - BOOST_LEAF_CONSTEXPR inline bool check_exception_pack( std::exception const & ex, Ex const * ) noexcept - { - return dynamic_cast(&ex)!=0; - } - - template - BOOST_LEAF_CONSTEXPR inline bool check_exception_pack( std::exception const & ex, Ex const *, ExRest const * ... ex_rest ) noexcept - { - return dynamic_cast(&ex)!=0 || check_exception_pack(ex, ex_rest...); - } - - BOOST_LEAF_CONSTEXPR inline bool check_exception_pack( std::exception const & ) noexcept - { - return true; - } - } - - template - struct catch_ - { - using error_type = void; - std::exception const & matched; - - BOOST_LEAF_CONSTEXPR static bool evaluate(std::exception const & ex) noexcept - { - return leaf_detail::check_exception_pack(ex, static_cast(0)...); - } - }; - - template - struct catch_ - { - using error_type = void; - Ex const & matched; - - BOOST_LEAF_CONSTEXPR static Ex const * evaluate(std::exception const & ex) noexcept - { - return dynamic_cast(&ex); - } - - explicit catch_( std::exception const & ex ): - matched(*dynamic_cast(&ex)) - { - } - }; - - template - struct is_predicate>: std::true_type - { - }; - } } // Boost Exception Integration @@ -4202,7 +4107,13 @@ namespace boost { namespace leaf { }; template - BOOST_LEAF_CONSTEXPR Ex * get_exception( error_info const & ); + BOOST_LEAF_CONSTEXPR inline Ex * get_exception( error_info const & ei ) + { + if( ei.exception_caught() ) + if( Ex * ex = dynamic_cast(ei.exception()) ) + return ex; + return 0; + } template struct dependent_type { using type = T; }; @@ -4243,9 +4154,13 @@ namespace boost { namespace leaf { } } #endif -// <<< # include -#line 18 "../../include/boost/leaf/detail/all.hpp" +// <<< # include +#line 23 "boost/leaf/handle_errors.hpp" #endif + +#endif +// <<< #include +#line 15 "../../include/boost/leaf/detail/all.hpp" // >>> #include #line 1 "boost/leaf/pred.hpp" #ifndef BOOST_LEAF_PRED_HPP_INCLUDED @@ -4479,11 +4394,72 @@ namespace boost { namespace leaf { { }; + //////////////////////////////////////// + + +#ifndef BOOST_LEAF_NO_EXCEPTIONS + + namespace leaf_detail + { + template + BOOST_LEAF_CONSTEXPR inline bool check_exception_pack( std::exception const & ex, Ex const * ) noexcept + { + return dynamic_cast(&ex)!=0; + } + + template + BOOST_LEAF_CONSTEXPR inline bool check_exception_pack( std::exception const & ex, Ex const *, ExRest const * ... ex_rest ) noexcept + { + return dynamic_cast(&ex)!=0 || check_exception_pack(ex, ex_rest...); + } + + BOOST_LEAF_CONSTEXPR inline bool check_exception_pack( std::exception const & ) noexcept + { + return true; + } + } + + template + struct catch_ + { + using error_type = void; + std::exception const & matched; + + BOOST_LEAF_CONSTEXPR static bool evaluate(std::exception const & ex) noexcept + { + return leaf_detail::check_exception_pack(ex, static_cast(0)...); + } + }; + + template + struct catch_ + { + using error_type = void; + Ex const & matched; + + BOOST_LEAF_CONSTEXPR static Ex const * evaluate(std::exception const & ex) noexcept + { + return dynamic_cast(&ex); + } + + explicit catch_( std::exception const & ex ): + matched(*dynamic_cast(&ex)) + { + } + }; + + template + struct is_predicate>: std::true_type + { + }; + +#endif + } } #endif // <<< #include -#line 21 "../../include/boost/leaf/detail/all.hpp" +#line 17 "../../include/boost/leaf/detail/all.hpp" // >>> #include #line 1 "boost/leaf/result.hpp" #ifndef BOOST_LEAF_RESULT_HPP_INCLUDED @@ -4924,6 +4900,6 @@ namespace boost { namespace leaf { #endif // <<< #include -#line 22 "../../include/boost/leaf/detail/all.hpp" +#line 18 "../../include/boost/leaf/detail/all.hpp" #endif diff --git a/include/boost/leaf/context.hpp b/include/boost/leaf/context.hpp index e00bca5..6b04c63 100644 --- a/include/boost/leaf/context.hpp +++ b/include/boost/leaf/context.hpp @@ -142,189 +142,125 @@ namespace boost { namespace leaf { //////////////////////////////////////////// - namespace leaf_detail - { - template - class context_base - { - context_base( context_base const & ) = delete; - context_base & operator=( context_base const & ) = delete; - - public: - - using Tup = deduce_e_tuple; - - private: - - Tup tup_; -#if !defined(BOOST_LEAF_NO_THREADS) && !defined(NDEBUG) - std::thread::id thread_id_; -#endif - bool is_active_; - - protected: - - BOOST_LEAF_CONSTEXPR error_id propagate_captured_errors( error_id err_id ) noexcept - { - tuple_for_each::value,Tup>::propagate_captured(tup_, err_id.value()); - return err_id; - } - - BOOST_LEAF_CONSTEXPR context_base( context_base && x ) noexcept: - tup_(std::move(x.tup_)), - is_active_(false) - { - BOOST_LEAF_ASSERT(!x.is_active()); - } - - public: - - BOOST_LEAF_CONSTEXPR context_base() noexcept: - is_active_(false) - { - } - - ~context_base() noexcept - { - BOOST_LEAF_ASSERT(!is_active()); - } - - BOOST_LEAF_CONSTEXPR Tup const & tup() const noexcept - { - return tup_; - } - - BOOST_LEAF_CONSTEXPR Tup & tup() noexcept - { - return tup_; - } - - BOOST_LEAF_CONSTEXPR void activate() noexcept - { - using namespace leaf_detail; - BOOST_LEAF_ASSERT(!is_active()); - tuple_for_each::value,Tup>::activate(tup_); -#if BOOST_LEAF_DIAGNOSTICS - if( unexpected_requested::value ) - ++tl_unexpected_enabled<>::counter; -#endif -#if !defined(BOOST_LEAF_NO_THREADS) && !defined(NDEBUG) - thread_id_ = std::this_thread::get_id(); -#endif - is_active_ = true; - } - - BOOST_LEAF_CONSTEXPR void deactivate() noexcept - { - using namespace leaf_detail; - BOOST_LEAF_ASSERT(is_active()); - is_active_ = false; -#if !defined(BOOST_LEAF_NO_THREADS) && !defined(NDEBUG) - BOOST_LEAF_ASSERT(std::this_thread::get_id() == thread_id_); - thread_id_ = std::thread::id(); -#endif -#if BOOST_LEAF_DIAGNOSTICS - if( unexpected_requested::value ) - --tl_unexpected_enabled<>::counter; -#endif - tuple_for_each::value,Tup>::deactivate(tup_); - } - - BOOST_LEAF_CONSTEXPR void propagate() noexcept - { - tuple_for_each::value,Tup>::propagate(tup_); - } - - BOOST_LEAF_CONSTEXPR bool is_active() const noexcept - { - return is_active_; - } - - void print( std::ostream & os ) const - { - tuple_for_each::value,Tup>::print(os, &tup_, 0); - } - - template - BOOST_LEAF_CONSTEXPR R handle_error( error_id, H && ... ) const; - - template - BOOST_LEAF_CONSTEXPR R handle_error( error_id, H && ... ); - - template - decltype(std::declval()()) try_catch_( TryBlock &&, H && ... ); - }; - - template - class nocatch_context: public context_base - { - public: - - template - BOOST_LEAF_CONSTEXPR - typename std::decay()().value())>::type - try_handle_all( TryBlock &&, H && ... h ); - - template - BOOST_LEAF_NODISCARD BOOST_LEAF_CONSTEXPR - typename std::decay()())>::type - try_handle_some( TryBlock &&, H && ... ); - }; - - template - class catch_context: public context_base - { - public: - - template - BOOST_LEAF_CONSTEXPR - typename std::decay()().value())>::type - try_handle_all( TryBlock &&, H && ... ); - - template - BOOST_LEAF_NODISCARD BOOST_LEAF_CONSTEXPR - typename std::decay()())>::type - try_handle_some( TryBlock &&, H && ... ); - }; - - template - struct catch_requested; - - template <> - struct catch_requested<> - { - constexpr static bool value = false; - }; - - template - struct catch_requested - { - constexpr static bool value = handler_argument_traits::requires_catch || catch_requested::value; - }; - - template - struct select_context_base_impl; - - template - struct select_context_base_impl - { - using type = nocatch_context; - }; - - - template - struct select_context_base_impl - { - using type = catch_context; - }; - - template - using select_context_base = typename select_context_base_impl::value, E...>::type; - } - template - class context: public leaf_detail::select_context_base + class context { + context( context const & ) = delete; + context & operator=( context const & ) = delete; + + public: + + using Tup = leaf_detail::deduce_e_tuple; + + private: + + Tup tup_; +#if !defined(BOOST_LEAF_NO_THREADS) && !defined(NDEBUG) + std::thread::id thread_id_; +#endif + bool is_active_; + + protected: + + BOOST_LEAF_CONSTEXPR error_id propagate_captured_errors( error_id err_id ) noexcept + { + leaf_detail::tuple_for_each::value,Tup>::propagate_captured(tup_, err_id.value()); + return err_id; + } + + public: + + BOOST_LEAF_CONSTEXPR context( context && x ) noexcept: + tup_(std::move(x.tup_)), + is_active_(false) + { + BOOST_LEAF_ASSERT(!x.is_active()); + } + + BOOST_LEAF_CONSTEXPR context() noexcept: + is_active_(false) + { + } + + ~context() noexcept + { + BOOST_LEAF_ASSERT(!is_active()); + } + + BOOST_LEAF_CONSTEXPR Tup const & tup() const noexcept + { + return tup_; + } + + BOOST_LEAF_CONSTEXPR Tup & tup() noexcept + { + return tup_; + } + + BOOST_LEAF_CONSTEXPR void activate() noexcept + { + using namespace leaf_detail; + BOOST_LEAF_ASSERT(!is_active()); + tuple_for_each::value,Tup>::activate(tup_); +#if BOOST_LEAF_DIAGNOSTICS + if( unexpected_requested::value ) + ++tl_unexpected_enabled<>::counter; +#endif +#if !defined(BOOST_LEAF_NO_THREADS) && !defined(NDEBUG) + thread_id_ = std::this_thread::get_id(); +#endif + is_active_ = true; + } + + BOOST_LEAF_CONSTEXPR void deactivate() noexcept + { + using namespace leaf_detail; + BOOST_LEAF_ASSERT(is_active()); + is_active_ = false; +#if !defined(BOOST_LEAF_NO_THREADS) && !defined(NDEBUG) + BOOST_LEAF_ASSERT(std::this_thread::get_id() == thread_id_); + thread_id_ = std::thread::id(); +#endif +#if BOOST_LEAF_DIAGNOSTICS + if( unexpected_requested::value ) + --tl_unexpected_enabled<>::counter; +#endif + tuple_for_each::value,Tup>::deactivate(tup_); + } + + BOOST_LEAF_CONSTEXPR void propagate() noexcept + { + leaf_detail::tuple_for_each::value,Tup>::propagate(tup_); + } + + BOOST_LEAF_CONSTEXPR bool is_active() const noexcept + { + return is_active_; + } + + void print( std::ostream & os ) const + { + leaf_detail::tuple_for_each::value,Tup>::print(os, &tup_, 0); + } + + template + BOOST_LEAF_CONSTEXPR R handle_error( error_id, H && ... ) const; + + template + BOOST_LEAF_CONSTEXPR R handle_error( error_id, H && ... ); + + template + decltype(std::declval()()) try_catch_( TryBlock &&, H && ... ); + + template + BOOST_LEAF_CONSTEXPR + typename std::decay()().value())>::type + try_handle_all( TryBlock &&, H && ... h ); + + template + BOOST_LEAF_NODISCARD BOOST_LEAF_CONSTEXPR + typename std::decay()())>::type + try_handle_some( TryBlock &&, H && ... ); }; //////////////////////////////////////// diff --git a/include/boost/leaf/detail/all.hpp b/include/boost/leaf/detail/all.hpp index e7902e6..a73fbf6 100644 --- a/include/boost/leaf/detail/all.hpp +++ b/include/boost/leaf/detail/all.hpp @@ -6,16 +6,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 #include #include #include #include #include -#include -#ifndef BOOST_LEAF_NO_EXCEPTIONS -# include -#endif +#include #include #include #include diff --git a/include/boost/leaf/handle_exception.hpp b/include/boost/leaf/detail/ctx_catch.hpp similarity index 55% rename from include/boost/leaf/handle_exception.hpp rename to include/boost/leaf/detail/ctx_catch.hpp index eab670c..d2c2762 100644 --- a/include/boost/leaf/handle_exception.hpp +++ b/include/boost/leaf/detail/ctx_catch.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_LEAF_HANDLE_EXCEPTION_HPP_INCLUDED -#define BOOST_LEAF_HANDLE_EXCEPTION_HPP_INCLUDED +#ifndef BOOST_LEAF_DETAIL_CTX_CATCH_HPP_INCLUDED +#define BOOST_LEAF_DETAIL_CTX_CATCH_HPP_INCLUDED // Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. @@ -14,12 +14,10 @@ # pragma warning(push,1) #endif -#include #ifdef BOOST_LEAF_NO_EXCEPTIONS # error This header requires exception handling #endif -#include #include #include @@ -40,63 +38,60 @@ namespace boost { namespace leaf { } } - namespace leaf_detail + template + template + BOOST_LEAF_CONSTEXPR inline + typename std::decay()().value())>::type + context:: + try_handle_all( TryBlock && try_block, H && ... h ) { - template - template - BOOST_LEAF_CONSTEXPR inline - typename std::decay()().value())>::type - catch_context:: - try_handle_all( TryBlock && try_block, H && ... h ) + using namespace leaf_detail; + static_assert(is_result_type()())>::value, "The return type of the try_block passed to a try_handle_all function must be registered with leaf::is_result_type"); + auto active_context = activate_context(*this); + if( auto r = this->try_catch_( + [&] + { + return std::forward(try_block)(); + }, + std::forward(h)...) ) + return r.value(); + else { - using namespace leaf_detail; - static_assert(is_result_type()())>::value, "The return type of the try_block passed to a try_handle_all function must be registered with leaf::is_result_type"); - auto active_context = activate_context(*this); - if( auto r = this->try_catch_( - [&] - { - return std::forward(try_block)(); - }, - std::forward(h)...) ) - return r.value(); - else - { - error_id id = r.error(); - if( this->is_active() ) - this->deactivate(); - using R = typename std::decay()().value())>::type; - return this->template handle_error(std::move(id), std::forward(h)...); - } + error_id id = r.error(); + if( this->is_active() ) + this->deactivate(); + using R = typename std::decay()().value())>::type; + return this->template handle_error(std::move(id), std::forward(h)...); } + } - template - template - BOOST_LEAF_NODISCARD BOOST_LEAF_CONSTEXPR inline - typename std::decay()())>::type - catch_context:: - try_handle_some( TryBlock && try_block, H && ... h ) + template + template + BOOST_LEAF_NODISCARD BOOST_LEAF_CONSTEXPR inline + typename std::decay()())>::type + context:: + try_handle_some( TryBlock && try_block, H && ... h ) + { + using namespace leaf_detail; + static_assert(is_result_type()())>::value, "The return type of the try_block passed to a try_handle_some function must be registered with leaf::is_result_type"); + auto active_context = activate_context(*this); + if( auto r = this->try_catch_( + [&] + { + return std::forward(try_block)(); + }, + std::forward(h)...) ) + return r; + else { - using namespace leaf_detail; - static_assert(is_result_type()())>::value, "The return type of the try_block passed to a try_handle_some function must be registered with leaf::is_result_type"); - auto active_context = activate_context(*this); - if( auto r = this->try_catch_( - [&] - { - return std::forward(try_block)(); - }, - std::forward(h)...) ) - return r; - else - { - error_id id = r.error(); - if( this->is_active() ) - this->deactivate(); - using R = typename std::decay()())>::type; - auto rr = this->template handle_error(std::move(id), std::forward(h)..., [&r]()->R { return std::move(r); }); - if( !rr ) - this->propagate(); - return rr; - } + error_id id = r.error(); + if( this->is_active() ) + this->deactivate(); + using R = typename std::decay()())>::type; + auto rr = this->template handle_error(std::move(id), std::forward(h)..., [&r]()->R { return std::move(r); }); + if( !rr ) + this->propagate(); + return rr; } } @@ -120,39 +115,27 @@ namespace boost { namespace leaf { exception_info_base(ex) { } + } - template - template - inline - decltype(std::declval()()) - context_base:: - try_catch_( TryBlock && try_block, H && ... h ) + template + template + inline + decltype(std::declval()()) + context:: + try_catch_( TryBlock && try_block, H && ... h ) + { + using namespace leaf_detail; + BOOST_LEAF_ASSERT(is_active()); + using R = decltype(std::declval()()); + try + { + return std::forward(try_block)(); + } + catch( capturing_exception const & cap ) { - using namespace leaf_detail; - BOOST_LEAF_ASSERT(is_active()); - using R = decltype(std::declval()()); try { - return std::forward(try_block)(); - } - catch( capturing_exception const & cap ) - { - try - { - cap.unload_and_rethrow_original_exception(); - } - catch( std::exception & ex ) - { - deactivate(); - return handle_error_(this->tup(), error_info(exception_info_(&ex)), std::forward(h)..., - []() -> R { throw; } ); - } - catch(...) - { - deactivate(); - return handle_error_(this->tup(), error_info(exception_info_(0)), std::forward(h)..., - []() -> R { throw; } ); - } + cap.unload_and_rethrow_original_exception(); } catch( std::exception & ex ) { @@ -167,6 +150,18 @@ namespace boost { namespace leaf { []() -> R { throw; } ); } } + catch( std::exception & ex ) + { + deactivate(); + return handle_error_(this->tup(), error_info(exception_info_(&ex)), std::forward(h)..., + []() -> R { throw; } ); + } + catch(...) + { + deactivate(); + return handle_error_(this->tup(), error_info(exception_info_(0)), std::forward(h)..., + []() -> R { throw; } ); + } } //////////////////////////////////////// @@ -220,62 +215,6 @@ namespace boost { namespace leaf { std::forward(h)...); } - //////////////////////////////////////// - - namespace leaf_detail - { - template - BOOST_LEAF_CONSTEXPR inline bool check_exception_pack( std::exception const & ex, Ex const * ) noexcept - { - return dynamic_cast(&ex)!=0; - } - - template - BOOST_LEAF_CONSTEXPR inline bool check_exception_pack( std::exception const & ex, Ex const *, ExRest const * ... ex_rest ) noexcept - { - return dynamic_cast(&ex)!=0 || check_exception_pack(ex, ex_rest...); - } - - BOOST_LEAF_CONSTEXPR inline bool check_exception_pack( std::exception const & ) noexcept - { - return true; - } - } - - template - struct catch_ - { - using error_type = void; - std::exception const & matched; - - BOOST_LEAF_CONSTEXPR static bool evaluate(std::exception const & ex) noexcept - { - return leaf_detail::check_exception_pack(ex, static_cast(0)...); - } - }; - - template - struct catch_ - { - using error_type = void; - Ex const & matched; - - BOOST_LEAF_CONSTEXPR static Ex const * evaluate(std::exception const & ex) noexcept - { - return dynamic_cast(&ex); - } - - explicit catch_( std::exception const & ex ): - matched(*dynamic_cast(&ex)) - { - } - }; - - template - struct is_predicate>: std::true_type - { - }; - } } // Boost Exception Integration @@ -298,7 +237,13 @@ namespace boost { namespace leaf { }; template - BOOST_LEAF_CONSTEXPR Ex * get_exception( error_info const & ); + BOOST_LEAF_CONSTEXPR inline Ex * get_exception( error_info const & ei ) + { + if( ei.exception_caught() ) + if( Ex * ex = dynamic_cast(ei.exception()) ) + return ex; + return 0; + } template struct dependent_type { using type = T; }; diff --git a/include/boost/leaf/detail/ctx_nocatch.hpp b/include/boost/leaf/detail/ctx_nocatch.hpp new file mode 100644 index 0000000..70f538e --- /dev/null +++ b/include/boost/leaf/detail/ctx_nocatch.hpp @@ -0,0 +1,70 @@ +#ifndef BOOST_LEAF_DETAIL_CTX_NOCATCH_HPP_INCLUDED +#define BOOST_LEAF_DETAIL_CTX_NOCATCH_HPP_INCLUDED + +// Copyright (c) 2018-2020 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) + +#if defined(__clang__) +# pragma clang system_header +#elif (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_LEAF_ENABLE_WARNINGS) +# pragma GCC system_header +#elif defined(_MSC_VER) && !defined(BOOST_LEAF_ENABLE_WARNINGS) +# pragma warning(push,1) +#endif + +#ifndef BOOST_LEAF_NO_EXCEPTIONS +# error This header requires exception handling to be disabled +#endif + +namespace boost { namespace leaf { + + template + template + BOOST_LEAF_CONSTEXPR BOOST_LEAF_ALWAYS_INLINE + typename std::decay()().value())>::type + context:: + try_handle_all( TryBlock && try_block, H && ... h ) + { + using namespace leaf_detail; + static_assert(is_result_type()())>::value, "The return type of the try_block passed to a try_handle_all function must be registered with leaf::is_result_type"); + auto active_context = activate_context(*this); + if( auto r = std::forward(try_block)() ) + return r.value(); + else + { + error_id id = r.error(); + this->deactivate(); + using R = typename std::decay()().value())>::type; + return this->template handle_error(std::move(id), std::forward(h)...); + } + } + + template + template + BOOST_LEAF_NODISCARD BOOST_LEAF_CONSTEXPR BOOST_LEAF_ALWAYS_INLINE + typename std::decay()())>::type + context:: + try_handle_some( TryBlock && try_block, H && ... h ) + { + using namespace leaf_detail; + static_assert(is_result_type()())>::value, "The return type of the try_block passed to a try_handle_some function must be registered with leaf::is_result_type"); + auto active_context = activate_context(*this); + if( auto r = std::forward(try_block)() ) + return r; + else + { + error_id id = r.error(); + this->deactivate(); + using R = typename std::decay()())>::type; + auto rr = this->template handle_error(std::move(id), std::forward(h)..., [&r]()->R { return std::move(r); }); + if( !rr ) + this->propagate(); + return rr; + } + } + +} } + +#endif diff --git a/include/boost/leaf/handle_error.hpp b/include/boost/leaf/detail/handle.hpp similarity index 85% rename from include/boost/leaf/handle_error.hpp rename to include/boost/leaf/detail/handle.hpp index 2fd896c..eaf7ef9 100644 --- a/include/boost/leaf/handle_error.hpp +++ b/include/boost/leaf/detail/handle.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_LEAF_HANDLE_ERROR_HPP_INCLUDED -#define BOOST_LEAF_HANDLE_ERROR_HPP_INCLUDED +#ifndef BOOST_LEAF_DETAIL_HANDLE_HPP_INCLUDED +#define BOOST_LEAF_DETAIL_HANDLE_HPP_INCLUDED // Copyright (c) 2018-2020 Emil Dotchevski and Reverge Studios, Inc. @@ -103,24 +103,6 @@ namespace boost { namespace leaf { //////////////////////////////////////// -#ifndef BOOST_LEAF_NO_EXCEPTIONS - - namespace leaf_detail - { - template - BOOST_LEAF_CONSTEXPR inline Ex * get_exception( error_info const & ei ) - { - if( ei.exception_caught() ) - if( Ex * ex = dynamic_cast(ei.exception()) ) - return ex; - return 0; - } - } - -#endif - - //////////////////////////////////////// - #if BOOST_LEAF_DIAGNOSTICS class diagnostic_info: public error_info @@ -601,74 +583,26 @@ namespace boost { namespace leaf { //////////////////////////////////////// - namespace leaf_detail + template + template + BOOST_LEAF_CONSTEXPR BOOST_LEAF_ALWAYS_INLINE + R + context:: + handle_error( error_id id, H && ... h ) const { - template - template - BOOST_LEAF_CONSTEXPR BOOST_LEAF_ALWAYS_INLINE - R - context_base:: - handle_error( error_id id, H && ... h ) const - { - BOOST_LEAF_ASSERT(!is_active()); - return handle_error_(tup(), error_info(id), std::forward(h)...); - } + BOOST_LEAF_ASSERT(!is_active()); + return leaf_detail::handle_error_(tup(), error_info(id), std::forward(h)...); + } - template - template - BOOST_LEAF_CONSTEXPR BOOST_LEAF_ALWAYS_INLINE - R - context_base:: - handle_error( error_id id, H && ... h ) - { - BOOST_LEAF_ASSERT(!is_active()); - return handle_error_(tup(), error_info(id), std::forward(h)...); - } - - template - template - BOOST_LEAF_CONSTEXPR BOOST_LEAF_ALWAYS_INLINE - typename std::decay()().value())>::type - nocatch_context:: - try_handle_all( TryBlock && try_block, H && ... h ) - { - using namespace leaf_detail; - static_assert(is_result_type()())>::value, "The return type of the try_block passed to a try_handle_all function must be registered with leaf::is_result_type"); - auto active_context = activate_context(*this); - if( auto r = std::forward(try_block)() ) - return r.value(); - else - { - error_id id = r.error(); - this->deactivate(); - using R = typename std::decay()().value())>::type; - return this->template handle_error(std::move(id), std::forward(h)...); - } - } - - template - template - BOOST_LEAF_NODISCARD BOOST_LEAF_CONSTEXPR BOOST_LEAF_ALWAYS_INLINE - typename std::decay()())>::type - nocatch_context:: - try_handle_some( TryBlock && try_block, H && ... h ) - { - using namespace leaf_detail; - static_assert(is_result_type()())>::value, "The return type of the try_block passed to a try_handle_some function must be registered with leaf::is_result_type"); - auto active_context = activate_context(*this); - if( auto r = std::forward(try_block)() ) - return r; - else - { - error_id id = r.error(); - this->deactivate(); - using R = typename std::decay()())>::type; - auto rr = this->template handle_error(std::move(id), std::forward(h)..., [&r]()->R { return std::move(r); }); - if( !rr ) - this->propagate(); - return rr; - } - } + template + template + BOOST_LEAF_CONSTEXPR BOOST_LEAF_ALWAYS_INLINE + R + context:: + handle_error( error_id id, H && ... h ) + { + BOOST_LEAF_ASSERT(!is_active()); + return leaf_detail::handle_error_(tup(), error_info(id), std::forward(h)...); } //////////////////////////////////////// diff --git a/include/boost/leaf/handle_errors.hpp b/include/boost/leaf/handle_errors.hpp new file mode 100644 index 0000000..76dc974 --- /dev/null +++ b/include/boost/leaf/handle_errors.hpp @@ -0,0 +1,25 @@ +#ifndef BOOST_LEAF_HANDLE_ERRORS_HPP_INCLUDED +#define BOOST_LEAF_HANDLE_ERRORS_HPP_INCLUDED + +// Copyright (c) 2018-2020 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) + +#if defined(__clang__) +# pragma clang system_header +#elif (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_LEAF_ENABLE_WARNINGS) +# pragma GCC system_header +#elif defined(_MSC_VER) && !defined(BOOST_LEAF_ENABLE_WARNINGS) +# pragma warning(push,1) +#endif + +#include + +#ifdef BOOST_LEAF_NO_EXCEPTIONS +# include +#else +# include +#endif + +#endif diff --git a/include/boost/leaf/pred.hpp b/include/boost/leaf/pred.hpp index 5ff95e8..88aa9f3 100644 --- a/include/boost/leaf/pred.hpp +++ b/include/boost/leaf/pred.hpp @@ -230,6 +230,67 @@ namespace boost { namespace leaf { { }; + //////////////////////////////////////// + + +#ifndef BOOST_LEAF_NO_EXCEPTIONS + + namespace leaf_detail + { + template + BOOST_LEAF_CONSTEXPR inline bool check_exception_pack( std::exception const & ex, Ex const * ) noexcept + { + return dynamic_cast(&ex)!=0; + } + + template + BOOST_LEAF_CONSTEXPR inline bool check_exception_pack( std::exception const & ex, Ex const *, ExRest const * ... ex_rest ) noexcept + { + return dynamic_cast(&ex)!=0 || check_exception_pack(ex, ex_rest...); + } + + BOOST_LEAF_CONSTEXPR inline bool check_exception_pack( std::exception const & ) noexcept + { + return true; + } + } + + template + struct catch_ + { + using error_type = void; + std::exception const & matched; + + BOOST_LEAF_CONSTEXPR static bool evaluate(std::exception const & ex) noexcept + { + return leaf_detail::check_exception_pack(ex, static_cast(0)...); + } + }; + + template + struct catch_ + { + using error_type = void; + Ex const & matched; + + BOOST_LEAF_CONSTEXPR static Ex const * evaluate(std::exception const & ex) noexcept + { + return dynamic_cast(&ex); + } + + explicit catch_( std::exception const & ex ): + matched(*dynamic_cast(&ex)) + { + } + }; + + template + struct is_predicate>: std::true_type + { + }; + +#endif + } } #endif diff --git a/meson.build b/meson.build index 3ca7729..10e316d 100644 --- a/meson.build +++ b/meson.build @@ -148,8 +148,7 @@ tests = [ '_hpp_context_test', '_hpp_error_test', '_hpp_exception_test', - '_hpp_handle_error_test', - '_hpp_handle_exception_test', + '_hpp_handle_errors_test', '_hpp_on_error_test', '_hpp_pred_test', '_hpp_result_test', diff --git a/test/BOOST_LEAF_ASSIGN_test.cpp b/test/BOOST_LEAF_ASSIGN_test.cpp index 0434ee6..e12e276 100644 --- a/test/BOOST_LEAF_ASSIGN_test.cpp +++ b/test/BOOST_LEAF_ASSIGN_test.cpp @@ -4,7 +4,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include +#include #include "lightweight_test.hpp" namespace leaf = boost::leaf; diff --git a/test/BOOST_LEAF_AUTO_test.cpp b/test/BOOST_LEAF_AUTO_test.cpp index 32cfeba..92212cc 100644 --- a/test/BOOST_LEAF_AUTO_test.cpp +++ b/test/BOOST_LEAF_AUTO_test.cpp @@ -4,7 +4,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include +#include #include "lightweight_test.hpp" namespace leaf = boost::leaf; diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 73244a4..2bd2b16 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -25,8 +25,7 @@ compile _hpp_common_test.cpp ; compile _hpp_context_test.cpp ; compile _hpp_error_test.cpp ; compile _hpp_exception_test.cpp ; -compile _hpp_handle_error_test.cpp ; -compile _hpp_handle_exception_test.cpp ; +compile _hpp_handle_errors_test.cpp ; compile _hpp_on_error_test.cpp ; compile _hpp_pred_test.cpp ; compile _hpp_result_test.cpp ; diff --git a/test/_compile-fail-arg_boost_error_info_1.cpp b/test/_compile-fail-arg_boost_error_info_1.cpp index c0415cd..585ec2e 100644 --- a/test/_compile-fail-arg_boost_error_info_1.cpp +++ b/test/_compile-fail-arg_boost_error_info_1.cpp @@ -3,7 +3,7 @@ // 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 +#include #include #include diff --git a/test/_compile-fail-arg_boost_error_info_2.cpp b/test/_compile-fail-arg_boost_error_info_2.cpp index c0415cd..585ec2e 100644 --- a/test/_compile-fail-arg_boost_error_info_2.cpp +++ b/test/_compile-fail-arg_boost_error_info_2.cpp @@ -3,7 +3,7 @@ // 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 +#include #include #include diff --git a/test/_compile-fail-arg_catch_1.cpp b/test/_compile-fail-arg_catch_1.cpp index fdfa2b3..eb14d0d 100644 --- a/test/_compile-fail-arg_catch_1.cpp +++ b/test/_compile-fail-arg_catch_1.cpp @@ -3,7 +3,7 @@ // 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 +#include #include #include diff --git a/test/_compile-fail-arg_catch_2.cpp b/test/_compile-fail-arg_catch_2.cpp index 48197a4..0bee9ff 100644 --- a/test/_compile-fail-arg_catch_2.cpp +++ b/test/_compile-fail-arg_catch_2.cpp @@ -3,7 +3,7 @@ // 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 +#include #include #include diff --git a/test/_compile-fail-arg_match_1.cpp b/test/_compile-fail-arg_match_1.cpp index 7fdf083..d7a3ea8 100644 --- a/test/_compile-fail-arg_match_1.cpp +++ b/test/_compile-fail-arg_match_1.cpp @@ -3,7 +3,7 @@ // 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 +#include #include #include diff --git a/test/_compile-fail-arg_match_2.cpp b/test/_compile-fail-arg_match_2.cpp index c963f7e..e3980c6 100644 --- a/test/_compile-fail-arg_match_2.cpp +++ b/test/_compile-fail-arg_match_2.cpp @@ -3,7 +3,7 @@ // 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 +#include #include #include diff --git a/test/_compile-fail-arg_rvalue_ref.cpp b/test/_compile-fail-arg_rvalue_ref.cpp index aee5208..480360a 100644 --- a/test/_compile-fail-arg_rvalue_ref.cpp +++ b/test/_compile-fail-arg_rvalue_ref.cpp @@ -3,7 +3,7 @@ // 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 +#include #include namespace leaf = boost::leaf; diff --git a/test/_compile-fail-diagnostic_info.cpp b/test/_compile-fail-diagnostic_info.cpp index 40b2cd7..8d24f7d 100644 --- a/test/_compile-fail-diagnostic_info.cpp +++ b/test/_compile-fail-diagnostic_info.cpp @@ -3,7 +3,7 @@ // 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 +#include namespace leaf = boost::leaf; diff --git a/test/_compile-fail-error_info.cpp b/test/_compile-fail-error_info.cpp index a768c86..7f30588 100644 --- a/test/_compile-fail-error_info.cpp +++ b/test/_compile-fail-error_info.cpp @@ -3,7 +3,7 @@ // 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 +#include namespace leaf = boost::leaf; diff --git a/test/_compile-fail-verbose_diagnostic_info.cpp b/test/_compile-fail-verbose_diagnostic_info.cpp index f3a39ad..c129013 100644 --- a/test/_compile-fail-verbose_diagnostic_info.cpp +++ b/test/_compile-fail-verbose_diagnostic_info.cpp @@ -3,7 +3,7 @@ // 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 +#include namespace leaf = boost::leaf; diff --git a/test/_hpp_handle_error_test.cpp b/test/_hpp_handle_errors_test.cpp similarity index 75% rename from test/_hpp_handle_error_test.cpp rename to test/_hpp_handle_errors_test.cpp index 5b97aa6..fd96491 100644 --- a/test/_hpp_handle_error_test.cpp +++ b/test/_hpp_handle_errors_test.cpp @@ -3,6 +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 -#include +#include +#include int main() { return 0; } diff --git a/test/_hpp_handle_exception_test.cpp b/test/_hpp_handle_exception_test.cpp deleted file mode 100644 index 3e10aea..0000000 --- a/test/_hpp_handle_exception_test.cpp +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2018-2020 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 -#ifndef BOOST_LEAF_NO_EXCEPTIONS -#include -#include -#endif -int main() { return 0; } diff --git a/test/accumulate_basic_test.cpp b/test/accumulate_basic_test.cpp index 05a16b0..7eb0947 100644 --- a/test/accumulate_basic_test.cpp +++ b/test/accumulate_basic_test.cpp @@ -4,7 +4,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include +#include #include #include "lightweight_test.hpp" diff --git a/test/accumulate_nested_error_exception_test.cpp b/test/accumulate_nested_error_exception_test.cpp index 204d131..4616388 100644 --- a/test/accumulate_nested_error_exception_test.cpp +++ b/test/accumulate_nested_error_exception_test.cpp @@ -17,7 +17,7 @@ int main() #else #include -#include +#include #include #include "lightweight_test.hpp" diff --git a/test/accumulate_nested_error_result_test.cpp b/test/accumulate_nested_error_result_test.cpp index f2b0739..1e4b91e 100644 --- a/test/accumulate_nested_error_result_test.cpp +++ b/test/accumulate_nested_error_result_test.cpp @@ -4,7 +4,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include +#include #include #include "lightweight_test.hpp" diff --git a/test/accumulate_nested_new_error_exception_test.cpp b/test/accumulate_nested_new_error_exception_test.cpp index 578bf34..77a801f 100644 --- a/test/accumulate_nested_new_error_exception_test.cpp +++ b/test/accumulate_nested_new_error_exception_test.cpp @@ -17,7 +17,7 @@ int main() #else #include -#include +#include #include #include "lightweight_test.hpp" diff --git a/test/accumulate_nested_new_error_result_test.cpp b/test/accumulate_nested_new_error_result_test.cpp index 4afcc6b..b453aa9 100644 --- a/test/accumulate_nested_new_error_result_test.cpp +++ b/test/accumulate_nested_new_error_result_test.cpp @@ -4,7 +4,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include +#include #include #include "lightweight_test.hpp" diff --git a/test/accumulate_nested_success_exception_test.cpp b/test/accumulate_nested_success_exception_test.cpp index 10e1546..97605e8 100644 --- a/test/accumulate_nested_success_exception_test.cpp +++ b/test/accumulate_nested_success_exception_test.cpp @@ -17,7 +17,7 @@ int main() #else #include -#include +#include #include "lightweight_test.hpp" namespace leaf = boost::leaf; diff --git a/test/accumulate_nested_success_result_test.cpp b/test/accumulate_nested_success_result_test.cpp index 0ce4799..9c4d86c 100644 --- a/test/accumulate_nested_success_result_test.cpp +++ b/test/accumulate_nested_success_result_test.cpp @@ -4,7 +4,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include +#include #include #include "lightweight_test.hpp" diff --git a/test/boost_exception_test.cpp b/test/boost_exception_test.cpp index fdcd4b0..127bd94 100644 --- a/test/boost_exception_test.cpp +++ b/test/boost_exception_test.cpp @@ -16,7 +16,7 @@ int main() #else -#include +#include #include #include #include diff --git a/test/capture_exception_async_test.cpp b/test/capture_exception_async_test.cpp index b240390..44d53ad 100644 --- a/test/capture_exception_async_test.cpp +++ b/test/capture_exception_async_test.cpp @@ -17,7 +17,7 @@ int main() #else #include -#include +#include #include #include #include "lightweight_test.hpp" diff --git a/test/capture_exception_result_async_test.cpp b/test/capture_exception_result_async_test.cpp index e7bb421..993abc4 100644 --- a/test/capture_exception_result_async_test.cpp +++ b/test/capture_exception_result_async_test.cpp @@ -18,7 +18,7 @@ int main() #include #include -#include +#include #include "lightweight_test.hpp" #include diff --git a/test/capture_exception_state_test.cpp b/test/capture_exception_state_test.cpp index 2b8020a..3c92589 100644 --- a/test/capture_exception_state_test.cpp +++ b/test/capture_exception_state_test.cpp @@ -17,7 +17,7 @@ int main() #else #include -#include +#include #include #include "lightweight_test.hpp" diff --git a/test/capture_exception_unload_test.cpp b/test/capture_exception_unload_test.cpp index 50dbd37..92338b9 100644 --- a/test/capture_exception_unload_test.cpp +++ b/test/capture_exception_unload_test.cpp @@ -17,7 +17,7 @@ int main() #else #include -#include +#include #include #include #include "lightweight_test.hpp" diff --git a/test/capture_result_async_test.cpp b/test/capture_result_async_test.cpp index 13a63ae..53bba09 100644 --- a/test/capture_result_async_test.cpp +++ b/test/capture_result_async_test.cpp @@ -18,7 +18,7 @@ int main() #include #include -#include +#include #include #include "lightweight_test.hpp" #include diff --git a/test/capture_result_state_test.cpp b/test/capture_result_state_test.cpp index 2ca0580..51ed095 100644 --- a/test/capture_result_state_test.cpp +++ b/test/capture_result_state_test.cpp @@ -5,7 +5,7 @@ #include #include -#include +#include #include "lightweight_test.hpp" namespace leaf = boost::leaf; diff --git a/test/capture_result_unload_test.cpp b/test/capture_result_unload_test.cpp index 25fa82c..aa3205d 100644 --- a/test/capture_result_unload_test.cpp +++ b/test/capture_result_unload_test.cpp @@ -5,7 +5,7 @@ #include #include -#include +#include #include "_test_ec.hpp" #include "lightweight_test.hpp" diff --git a/test/context_activator_test.cpp b/test/context_activator_test.cpp index 3e80dac..bb98d08 100644 --- a/test/context_activator_test.cpp +++ b/test/context_activator_test.cpp @@ -4,7 +4,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include +#include #include #include "lightweight_test.hpp" diff --git a/test/context_deduction_test.cpp b/test/context_deduction_test.cpp index c3616c7..fd2fcd5 100644 --- a/test/context_deduction_test.cpp +++ b/test/context_deduction_test.cpp @@ -6,10 +6,7 @@ #include #include #include -#include -#ifndef BOOST_LEAF_NO_EXCEPTIONS -# include -#endif +#include #include "_test_ec.hpp" namespace leaf = boost::leaf; diff --git a/test/ctx_handle_all_test.cpp b/test/ctx_handle_all_test.cpp index 379770a..1a7bbd6 100644 --- a/test/ctx_handle_all_test.cpp +++ b/test/ctx_handle_all_test.cpp @@ -4,7 +4,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include +#include #include #include "lightweight_test.hpp" #include diff --git a/test/ctx_handle_some_test.cpp b/test/ctx_handle_some_test.cpp index d57df1d..6469d21 100644 --- a/test/ctx_handle_some_test.cpp +++ b/test/ctx_handle_some_test.cpp @@ -4,7 +4,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include +#include #include #include "lightweight_test.hpp" diff --git a/test/ctx_remote_handle_all_test.cpp b/test/ctx_remote_handle_all_test.cpp index c49b9f2..c53ad58 100644 --- a/test/ctx_remote_handle_all_test.cpp +++ b/test/ctx_remote_handle_all_test.cpp @@ -4,7 +4,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include +#include #include #include "lightweight_test.hpp" #include diff --git a/test/ctx_remote_handle_some_test.cpp b/test/ctx_remote_handle_some_test.cpp index e5d2309..14e514e 100644 --- a/test/ctx_remote_handle_some_test.cpp +++ b/test/ctx_remote_handle_some_test.cpp @@ -4,7 +4,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include +#include #include #include "lightweight_test.hpp" diff --git a/test/defer_basic_test.cpp b/test/defer_basic_test.cpp index 69e8b28..4618fc6 100644 --- a/test/defer_basic_test.cpp +++ b/test/defer_basic_test.cpp @@ -4,7 +4,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include +#include #include #include "lightweight_test.hpp" diff --git a/test/defer_nested_error_exception_test.cpp b/test/defer_nested_error_exception_test.cpp index d261606..5f4ac04 100644 --- a/test/defer_nested_error_exception_test.cpp +++ b/test/defer_nested_error_exception_test.cpp @@ -17,7 +17,7 @@ int main() #else #include -#include +#include #include #include "lightweight_test.hpp" diff --git a/test/defer_nested_error_result_test.cpp b/test/defer_nested_error_result_test.cpp index 2906f2c..c18160c 100644 --- a/test/defer_nested_error_result_test.cpp +++ b/test/defer_nested_error_result_test.cpp @@ -4,7 +4,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include +#include #include #include "lightweight_test.hpp" diff --git a/test/defer_nested_new_error_exception_test.cpp b/test/defer_nested_new_error_exception_test.cpp index 68b15eb..916b08c 100644 --- a/test/defer_nested_new_error_exception_test.cpp +++ b/test/defer_nested_new_error_exception_test.cpp @@ -17,7 +17,7 @@ int main() #else #include -#include +#include #include #include "lightweight_test.hpp" diff --git a/test/defer_nested_new_error_result_test.cpp b/test/defer_nested_new_error_result_test.cpp index f90febd..3b20f49 100644 --- a/test/defer_nested_new_error_result_test.cpp +++ b/test/defer_nested_new_error_result_test.cpp @@ -4,7 +4,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include +#include #include #include "lightweight_test.hpp" diff --git a/test/defer_nested_success_exception_test.cpp b/test/defer_nested_success_exception_test.cpp index c963de1..156fbfd 100644 --- a/test/defer_nested_success_exception_test.cpp +++ b/test/defer_nested_success_exception_test.cpp @@ -17,7 +17,7 @@ int main() #else #include -#include +#include #include "lightweight_test.hpp" namespace leaf = boost::leaf; diff --git a/test/defer_nested_success_result_test.cpp b/test/defer_nested_success_result_test.cpp index a7f0d90..338ddce 100644 --- a/test/defer_nested_success_result_test.cpp +++ b/test/defer_nested_success_result_test.cpp @@ -4,7 +4,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include +#include #include #include "lightweight_test.hpp" diff --git a/test/diagnostic_info_test.cpp b/test/diagnostic_info_test.cpp index e402398..82f651d 100644 --- a/test/diagnostic_info_test.cpp +++ b/test/diagnostic_info_test.cpp @@ -4,10 +4,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#ifndef BOOST_LEAF_NO_EXCEPTIONS -# include -#endif -#include +#include #include #include #include "lightweight_test.hpp" diff --git a/test/error_code_test.cpp b/test/error_code_test.cpp index c5532de..38d7ab5 100644 --- a/test/error_code_test.cpp +++ b/test/error_code_test.cpp @@ -3,7 +3,7 @@ // 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 +#include #include #include #include "_test_res.hpp" diff --git a/test/exception_test.cpp b/test/exception_test.cpp index bc13058..af3f142 100644 --- a/test/exception_test.cpp +++ b/test/exception_test.cpp @@ -16,7 +16,7 @@ int main() #else -#include +#include #include #include #include diff --git a/test/exception_to_result_test.cpp b/test/exception_to_result_test.cpp index 6a65dd0..2ccfda8 100644 --- a/test/exception_to_result_test.cpp +++ b/test/exception_to_result_test.cpp @@ -18,7 +18,7 @@ int main() #include #include -#include +#include #include "lightweight_test.hpp" namespace leaf = boost::leaf; diff --git a/test/handle_all_other_result_test.cpp b/test/handle_all_other_result_test.cpp index b410dad..a55ba80 100644 --- a/test/handle_all_other_result_test.cpp +++ b/test/handle_all_other_result_test.cpp @@ -3,7 +3,7 @@ // 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 +#include #include "_test_res.hpp" #include "lightweight_test.hpp" diff --git a/test/handle_all_test.cpp b/test/handle_all_test.cpp index 0c61632..6b4a178 100644 --- a/test/handle_all_test.cpp +++ b/test/handle_all_test.cpp @@ -3,7 +3,7 @@ // 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 +#include #include #include #include "_test_ec.hpp" diff --git a/test/handle_basic_test.cpp b/test/handle_basic_test.cpp index 0171fee..a37153d 100644 --- a/test/handle_basic_test.cpp +++ b/test/handle_basic_test.cpp @@ -4,10 +4,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#ifndef BOOST_LEAF_NO_EXCEPTIONS -# include -#endif -#include +#include #include #include #include "lightweight_test.hpp" diff --git a/test/handle_some_other_result_test.cpp b/test/handle_some_other_result_test.cpp index d7ccb56..c516b6a 100644 --- a/test/handle_some_other_result_test.cpp +++ b/test/handle_some_other_result_test.cpp @@ -3,7 +3,7 @@ // 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 +#include #include #include "_test_res.hpp" #include "lightweight_test.hpp" diff --git a/test/handle_some_test.cpp b/test/handle_some_test.cpp index 631119b..0ab5905 100644 --- a/test/handle_some_test.cpp +++ b/test/handle_some_test.cpp @@ -3,7 +3,7 @@ // 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 +#include #include #include #include "_test_ec.hpp" diff --git a/test/match_member_test.cpp b/test/match_member_test.cpp index 2e95528..a6c8b59 100644 --- a/test/match_member_test.cpp +++ b/test/match_member_test.cpp @@ -15,7 +15,7 @@ int main() #else -#include +#include #include #include #include diff --git a/test/match_test.cpp b/test/match_test.cpp index f4dc014..f9d5e89 100644 --- a/test/match_test.cpp +++ b/test/match_test.cpp @@ -3,7 +3,7 @@ // 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 +#include #include #include #include diff --git a/test/match_value_test.cpp b/test/match_value_test.cpp index 3d2340b..97b37b6 100644 --- a/test/match_value_test.cpp +++ b/test/match_value_test.cpp @@ -3,7 +3,7 @@ // 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 +#include #include #include #include diff --git a/test/multiple_errors_test.cpp b/test/multiple_errors_test.cpp index 7fac7df..68e49fc 100644 --- a/test/multiple_errors_test.cpp +++ b/test/multiple_errors_test.cpp @@ -4,11 +4,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#ifdef BOOST_LEAF_NO_EXCEPTIONS -# include -#else -# include -#endif +#include #include #include diff --git a/test/preload_basic_test.cpp b/test/preload_basic_test.cpp index a75da74..990ade3 100644 --- a/test/preload_basic_test.cpp +++ b/test/preload_basic_test.cpp @@ -4,7 +4,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include +#include #include #include "lightweight_test.hpp" diff --git a/test/preload_exception_test.cpp b/test/preload_exception_test.cpp index 979c269..d44f3e3 100644 --- a/test/preload_exception_test.cpp +++ b/test/preload_exception_test.cpp @@ -17,7 +17,7 @@ int main() #else #include -#include +#include #include #include "lightweight_test.hpp" diff --git a/test/preload_nested_error_exception_test.cpp b/test/preload_nested_error_exception_test.cpp index 9ccdd6f..87ab478 100644 --- a/test/preload_nested_error_exception_test.cpp +++ b/test/preload_nested_error_exception_test.cpp @@ -17,7 +17,7 @@ int main() #else #include -#include +#include #include #include "lightweight_test.hpp" diff --git a/test/preload_nested_error_result_test.cpp b/test/preload_nested_error_result_test.cpp index a69b078..4536d71 100644 --- a/test/preload_nested_error_result_test.cpp +++ b/test/preload_nested_error_result_test.cpp @@ -4,7 +4,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include +#include #include #include "lightweight_test.hpp" diff --git a/test/preload_nested_new_error_exception_test.cpp b/test/preload_nested_new_error_exception_test.cpp index 6cdeb51..78ffdc7 100644 --- a/test/preload_nested_new_error_exception_test.cpp +++ b/test/preload_nested_new_error_exception_test.cpp @@ -17,7 +17,7 @@ int main() #else #include -#include +#include #include #include "lightweight_test.hpp" diff --git a/test/preload_nested_new_error_result_test.cpp b/test/preload_nested_new_error_result_test.cpp index 22739eb..531dbe4 100644 --- a/test/preload_nested_new_error_result_test.cpp +++ b/test/preload_nested_new_error_result_test.cpp @@ -4,7 +4,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include +#include #include #include "lightweight_test.hpp" diff --git a/test/preload_nested_success_exception_test.cpp b/test/preload_nested_success_exception_test.cpp index f5144a9..6884c8e 100644 --- a/test/preload_nested_success_exception_test.cpp +++ b/test/preload_nested_success_exception_test.cpp @@ -17,7 +17,7 @@ int main() #else #include -#include +#include #include "lightweight_test.hpp" namespace leaf = boost::leaf; diff --git a/test/preload_nested_success_result_test.cpp b/test/preload_nested_success_result_test.cpp index 8906691..727cf69 100644 --- a/test/preload_nested_success_result_test.cpp +++ b/test/preload_nested_success_result_test.cpp @@ -4,7 +4,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include +#include #include #include "lightweight_test.hpp" diff --git a/test/result_bad_result_test.cpp b/test/result_bad_result_test.cpp index b08a28e..e84d5be 100644 --- a/test/result_bad_result_test.cpp +++ b/test/result_bad_result_test.cpp @@ -16,7 +16,7 @@ int main() #else -#include +#include #include #include #include "lightweight_test.hpp" diff --git a/test/result_load_test.cpp b/test/result_load_test.cpp index 518afc5..ca5cd7f 100644 --- a/test/result_load_test.cpp +++ b/test/result_load_test.cpp @@ -4,7 +4,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include +#include #include #include "lightweight_test.hpp" diff --git a/test/result_ref_test.cpp b/test/result_ref_test.cpp index 5e4796c..64c30fa 100644 --- a/test/result_ref_test.cpp +++ b/test/result_ref_test.cpp @@ -5,7 +5,7 @@ #include #include -#include +#include #include "lightweight_test.hpp" namespace leaf = boost::leaf; diff --git a/test/result_state_test.cpp b/test/result_state_test.cpp index c1ab8f9..95dad00 100644 --- a/test/result_state_test.cpp +++ b/test/result_state_test.cpp @@ -5,7 +5,7 @@ #include #include -#include +#include #include "lightweight_test.hpp" namespace leaf = boost::leaf; diff --git a/test/try_catch_error_id_test.cpp b/test/try_catch_error_id_test.cpp index 420e02e..666f0e4 100644 --- a/test/try_catch_error_id_test.cpp +++ b/test/try_catch_error_id_test.cpp @@ -16,7 +16,7 @@ int main() #else -#include +#include #include #include #include "lightweight_test.hpp" diff --git a/test/try_catch_test.cpp b/test/try_catch_test.cpp index 28aa8b4..5b84b53 100644 --- a/test/try_catch_test.cpp +++ b/test/try_catch_test.cpp @@ -16,7 +16,7 @@ int main() #else -#include +#include #include #include "lightweight_test.hpp" diff --git a/test/try_exception_and_result_test.cpp b/test/try_exception_and_result_test.cpp index 2d3c16a..2f37ae8 100644 --- a/test/try_exception_and_result_test.cpp +++ b/test/try_exception_and_result_test.cpp @@ -16,7 +16,7 @@ int main() #else -#include +#include #include #include #include "lightweight_test.hpp"