diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 000000000..d586a3f13 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,45 @@ +name: build-binaries + +on: + workflow_dispatch: + push: + branches: + - main + - dev/ruby31 + - dev/ruby32 + - dev/actions + pull_request: + +jobs: + windows: + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1.1 + + - name: Build app for release + run: msbuild Build\SURubyDebugger.sln -property:Configuration=Release + + - uses: actions/upload-artifact@v3 + with: + name: ruby-debugger-win + path: Build/x64/Release/SURubyDebugger.dll + + macos: + runs-on: macos-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Build app for release + run: | + cd Build + xcodebuild -scheme SURubyDebugger -configuration Release -derivedDataPath output + + - uses: actions/upload-artifact@v3 + with: + name: ruby-debugger-mac + path: Build/output/Build/Products/Release/SURubyDebugger.dylib diff --git a/Build/SURubyDebugger.xcodeproj/project.pbxproj b/Build/SURubyDebugger.xcodeproj/project.pbxproj index db717dace..6d52e1bb8 100644 --- a/Build/SURubyDebugger.xcodeproj/project.pbxproj +++ b/Build/SURubyDebugger.xcodeproj/project.pbxproj @@ -22,8 +22,22 @@ 33CC243418D57BE30079FC3E /* StackFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 33CC243218D57BE30079FC3E /* StackFrame.h */; }; 33CC243B18D5808E0079FC3E /* Ruby.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 33CC243918D5808E0079FC3E /* Ruby.framework */; }; CE5F5B2125123C3300237692 /* IDebuggerUI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE5F5B2025123C3300237692 /* IDebuggerUI.h */; }; + F9D3F8562912B20000BE62A9 /* SURubyDebugger.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = 33CC241118D57AB80079FC3E /* SURubyDebugger.dylib */; }; /* End PBXBuildFile section */ +/* Begin PBXCopyFilesBuildPhase section */ + F9D3F8552912B1E700BE62A9 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "/Applications/SketchUp 2094/SketchUp.app/Contents/Frameworks"; + dstSubfolderSpec = 0; + files = ( + F9D3F8562912B20000BE62A9 /* SURubyDebugger.dylib in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ 33B5057B18D65A33000C89F1 /* DebugServerExports.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DebugServerExports.cpp; path = ../DebugServer/DebugServerExports.cpp; sourceTree = ""; }; 33B5057C18D65A33000C89F1 /* DebugServerExports.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DebugServerExports.h; path = ../DebugServer/DebugServerExports.h; sourceTree = ""; }; @@ -147,6 +161,7 @@ 33CC240D18D57AB80079FC3E /* Sources */, 33CC240E18D57AB80079FC3E /* Frameworks */, 33CC240F18D57AB80079FC3E /* Headers */, + F9D3F8552912B1E700BE62A9 /* CopyFiles */, ); buildRules = ( ); @@ -163,7 +178,7 @@ 33CC240818D57AB80079FC3E /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1250; + LastUpgradeCheck = 1310; ORGANIZATIONNAME = "Bugra Barin"; }; buildConfigurationList = 33CC240B18D57AB80079FC3E /* Build configuration list for PBXProject "SURubyDebugger" */; @@ -308,6 +323,7 @@ "$(SRCROOT)/../ThirdParty/include", "$(SRCROOT)/../ThirdParty/include/ruby/mac", ); + OTHER_CFLAGS = "-fdeclspec"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; @@ -325,6 +341,7 @@ "$(SRCROOT)/../ThirdParty/include", "$(SRCROOT)/../ThirdParty/include/ruby/mac", ); + OTHER_CFLAGS = "-fdeclspec"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; diff --git a/Build/SURubyDebugger.xcodeproj/xcshareddata/xcschemes/SURubyDebugger.xcscheme b/Build/SURubyDebugger.xcodeproj/xcshareddata/xcschemes/SURubyDebugger.xcscheme index 204c8e001..b689b2505 100644 --- a/Build/SURubyDebugger.xcodeproj/xcshareddata/xcschemes/SURubyDebugger.xcscheme +++ b/Build/SURubyDebugger.xcodeproj/xcshareddata/xcschemes/SURubyDebugger.xcscheme @@ -1,6 +1,6 @@ + + + + + + DynamicLibrary true Unicode - v142 + v143 DynamicLibrary false true Unicode - v142 + v143 @@ -62,7 +62,7 @@ Windows true $(SolutionDir)../ThirdParty/lib/Debug/x64 - x64-msvcrt-ruby270.lib;%(AdditionalDependencies) + x64-ucrt-ruby320.lib;%(AdditionalDependencies) set TARGETDIR=$(TargetDir) @@ -89,7 +89,7 @@ call $(SolutionDir)postbuild.bat true true $(SolutionDir)../ThirdParty/lib/Release/x64 - x64-msvcrt-ruby270.lib;%(AdditionalDependencies) + x64-ucrt-ruby320.lib;%(AdditionalDependencies) set TARGETDIR=$(TargetDir) diff --git a/DebugServer/DebuggerSettings.h b/DebugServer/DebuggerSettings.h index 57402893a..f0c741359 100644 --- a/DebugServer/DebuggerSettings.h +++ b/DebugServer/DebuggerSettings.h @@ -7,6 +7,7 @@ #include +#include #include #include diff --git a/DebugServer/Resource.aps b/DebugServer/Resource.aps index 91e5b2264..0b4a28205 100644 Binary files a/DebugServer/Resource.aps and b/DebugServer/Resource.aps differ diff --git a/DebugServer/Resource.rc b/DebugServer/Resource.rc index 07109e725..59ee0d09f 100644 Binary files a/DebugServer/Resource.rc and b/DebugServer/Resource.rc differ diff --git a/DebugServer/Server.cpp b/DebugServer/Server.cpp index 29b1e5512..4303e17e2 100644 --- a/DebugServer/Server.cpp +++ b/DebugServer/Server.cpp @@ -1,7 +1,18 @@ -// SketchUp Ruby API Debugger. Copyright 2013 Trimble Navigation Ltd. +// SketchUp Ruby API Debugger. Copyright 2013-2022 Trimble Inc. // Authors: // - Bugra Barin -// +// - Thomas Thomassen + +// Ruby keeps messing with the global namespace. +// In this case it redefines memcpy which causes problems for boost. +// This kludge of undefining memcpy after the Ruby headers allows the +// standard memcpy to be available to boost. +#include +#include +#include +// Undo things Ruby do to the global namespace. +#undef memcpy + #include "./Server.h" #include "./DebuggerSettings.h" #include "./FindSubstringCaseInsensitive.h" @@ -10,10 +21,6 @@ #include #include -#include -#include -#include - #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wcomma" #include diff --git a/DebugServer/stdafx.h b/DebugServer/stdafx.h index 3076631b9..4f3b8b689 100644 --- a/DebugServer/stdafx.h +++ b/DebugServer/stdafx.h @@ -14,6 +14,26 @@ #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers #define NOMINMAX + +// Kludge from Server.cpp duplicated here because the Windows build uses pre-compiled +// headers. These includes must be done after the macros above that exclude bad things +// the Windows API does to the global namespace. +// +// Ruby keeps messing with the global namespace. +// In this case it redefines memcpy which causes problems for boost. +// This kludge of undefining memcpy after the Ruby headers allows the +// standard memcpy to be available to boost. +#include +#include +#include +// Undo things Ruby do to the global namespace. This must be done before including +// any standard headers or Win32 API headers. +#undef memcpy +#undef access +#undef fstat +#undef lstat +#undef stati128 + // Windows Header Files: #include #include diff --git a/Development.md b/Development.md index 82b21e8bf..32dde15e7 100644 --- a/Development.md +++ b/Development.md @@ -20,3 +20,7 @@ TODO: 3. Tag commit it was built from. 4. Upload binaries to GitHub Releases. 5. Update README.md to refer to new download URL and versions. + +## Automation + +TODO: Setup action to publish release no GitHub when creating new tag. https://trstringer.com/github-actions-create-release-upload-artifacts/ diff --git a/README.md b/README.md index fc56db97d..36a102ee3 100644 --- a/README.md +++ b/README.md @@ -3,38 +3,55 @@ SketchUp Ruby API Debugger This is a Ruby debugger framework for SketchUp 2014 and later. The `ruby-debug-ide` protocol has been mostly implemented so any Ruby IDE that supports this protocol should work. -| IDE | Stable (1.0.3.0) | Stable (1.1.0.0) | Stable (1.2.0.0) | Stable (1.3.0.0) | Stable (1.4.0.0) | -| --- | --- | --- | --- | --- | --- | -| [Aptana RadRails](https://github.com/SketchUp/sketchup-ruby-debugger/wiki/How-to-set-up-an-IDE-for-debugging-Ruby-extensions-in-SketchUp) | Good | *Untested* | *Untested* | *Untested* | *Untested* | -| NetBeans (with Ruby community plugin) | Good | *Untested* | *Untested* | *Untested* | *Untested* | -| [RubyMine](https://github.com/SketchUp/sketchup-ruby-api-tutorials/wiki/RubyMine-Debugger-Setup) | Good | Good | Good | *Untested* | *Untested* | -| [VS Code](https://github.com/SketchUp/sketchup-ruby-api-tutorials/wiki/VSCode-Debugger-Setup) (with `vscode-ruby` extension) | Not supported | Good | Good | Good | Good | +| IDE | Stable (1.2.0) | Stable (1.3.0) | Stable (1.4.0) | Stable (1.5.0) | +| --- | --- | --- | --- | --- | +| [RubyMine](https://github.com/SketchUp/sketchup-ruby-api-tutorials/wiki/RubyMine-Debugger-Setup) | *Untested* | Good | Good | Good | +| [VS Code](https://github.com/SketchUp/sketchup-ruby-api-tutorials/wiki/VSCode-Debugger-Setup) (with `vscode-ruby` extension) | Not supported | Good | Good | Good | ## Instructions for Windows: + - Download the pre-built dynamic library (SURubyDebugger.dll) from the [latest release](https://github.com/SketchUp/sketchup-ruby-debugger/releases) or build from the sources. - Copy the DLL into the SketchUp installation directory. As the exact path will depend on the version of SketchUp you have installed, look for a folder similar to the following: ``` -C:\Program Files\SketchUp\SketchUp 2022\ +C:\Program Files\SketchUp\SketchUp 2024\ C:\Program Files (x86)\SketchUp\SketchUp 2015\ ``` - Start SketchUp from the command line or the "Run..." dialog: ``` -SketchUp.exe -rdebug "ide port=7000" +SketchUp.exe -rdebug "ide port=6123" ``` ## Instructions for Mac OS X: + - Install SketchUp 2014 Maintenance 1 Release (version 14.1.1283) or later. - Download `SURubyDebugger.dylib` into the Frameworks directory of the app bundle: ``` -curl -L https://github.com/SketchUp/sketchup-ruby-debugger/releases/download/1.4.0.0/SURubyDebugger.dylib -o /Applications/SketchUp\ 2022/SketchUp.app/Contents/Frameworks/SURubyDebugger.dylib +curl -L https://github.com/SketchUp/sketchup-ruby-debugger/releases/download/1.5.0.0/SURubyDebugger.dylib -o /Applications/SketchUp\ 2024/SketchUp.app/Contents/Frameworks/SURubyDebugger.dylib ``` - Run SketchUp from the command line: ``` -open -a /Applications/SketchUp\ 2022/SketchUp.app --args -rdebug "ide port=7000" +/Applications/SketchUp\ 2024/SketchUp.app/Contents/MacOS/SketchUp -rdebug "ide port=6123" +``` +Alternatively: +``` +open -a /Applications/SketchUp\ 2024/SketchUp.app --args -rdebug "ide port=6123" +``` + +## Known Issues + +If the connection cannot be made, for instance the port is in use, the debugger will crash. + +These docs previously used port 7000 as an example, but as of macOS Monterey that is now in use by the OS itself. + +To list active ports on macOS: + +``` +sudo lsof -i -P | grep LISTEN | grep :$PORT ``` ## Command-line arguments: + When launching SketchUp with debugging enabled, the following command-line arguments are supported: ``` @@ -46,6 +63,7 @@ When launching SketchUp with debugging enabled, the following command-line argum - `wait` - Instructs the SketchUp debugger to wait for an initial connection from an IDE before allowing execution to continue. This is necessary to debug scripts that run automatically, for instance when an extension is loaded. When using this option, the SketchUp process will appear to be frozen until an IDE is attached. ## Notes: + While most common debugging functionality has been implemented, there are few TODOs: - Debugging of multi-threaded execution - Function breakpoints diff --git a/ThirdParty/include/boost/accumulators/statistics/p_square_cumulative_distribution.hpp b/ThirdParty/include/boost/accumulators/statistics/p_square_cumulative_distribution.hpp index 5e08b5129..cd4713045 100644 --- a/ThirdParty/include/boost/accumulators/statistics/p_square_cumulative_distribution.hpp +++ b/ThirdParty/include/boost/accumulators/statistics/p_square_cumulative_distribution.hpp @@ -8,9 +8,9 @@ #ifndef BOOST_ACCUMULATORS_STATISTICS_P_SQUARE_CUMULATIVE_DISTRIBUTION_HPP_03_19_2012 #define BOOST_ACCUMULATORS_STATISTICS_P_SQUARE_CUMULATIVE_DISTRIBUTION_HPP_03_19_2012 -#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__) +#if defined(_MSC_VER) || defined(__BORLANDC__) && !defined(__clang__) || defined(__DMC__) # pragma message ("Warning: This header is deprecated. Please use: boost/accumulators/statistics/p_square_cumul_dist.hpp") -#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__) +#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__) || defined(__BORLANDC__) # warning "This header is deprecated. Please use: boost/accumulators/statistics/p_square_cumul_dist.hpp" #endif diff --git a/ThirdParty/include/boost/accumulators/statistics/weighted_p_square_cumulative_distribution.hpp b/ThirdParty/include/boost/accumulators/statistics/weighted_p_square_cumulative_distribution.hpp index 918970e8d..11580371c 100644 --- a/ThirdParty/include/boost/accumulators/statistics/weighted_p_square_cumulative_distribution.hpp +++ b/ThirdParty/include/boost/accumulators/statistics/weighted_p_square_cumulative_distribution.hpp @@ -8,9 +8,9 @@ #ifndef BOOST_ACCUMULATORS_STATISTICS_WEIGHTED_P_SQUARE_CUMULATIVE_DISTRIBUTION_HPP_03_19_2012 #define BOOST_ACCUMULATORS_STATISTICS_WEIGHTED_P_SQUARE_CUMULATIVE_DISTRIBUTION_HPP_03_19_2012 -#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__) +#if defined(_MSC_VER) || defined(__BORLANDC__) && !defined(__clang__) || defined(__DMC__) # pragma message ("Warning: This header is deprecated. Please use: boost/accumulators/statistics/weighted_p_square_cumul_dist.hpp") -#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__) +#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__) || defined(__BORLANDC__) # warning "This header is deprecated. Please use: boost/accumulators/statistics/weighted_p_square_cumul_dist.hpp" #endif diff --git a/ThirdParty/include/boost/algorithm/apply_permutation.hpp b/ThirdParty/include/boost/algorithm/apply_permutation.hpp index 225ae5783..124c31efe 100644 --- a/ThirdParty/include/boost/algorithm/apply_permutation.hpp +++ b/ThirdParty/include/boost/algorithm/apply_permutation.hpp @@ -19,7 +19,6 @@ #define BOOST_ALGORITHM_APPLY_PERMUTATION_HPP #include -#include #include #include diff --git a/ThirdParty/include/boost/algorithm/clamp.hpp b/ThirdParty/include/boost/algorithm/clamp.hpp index 82a99bde0..1378f95b4 100644 --- a/ThirdParty/include/boost/algorithm/clamp.hpp +++ b/ThirdParty/include/boost/algorithm/clamp.hpp @@ -26,14 +26,14 @@ #include #include #include -#include // for identity -#include // for boost::disable_if +#include // for boost::type_identity +#include // for boost::disable_if namespace boost { namespace algorithm { /// \fn clamp ( T const& val, -/// typename boost::mpl::identity::type const & lo, -/// typename boost::mpl::identity::type const & hi, Pred p ) +/// typename boost::type_identity::type const & lo, +/// typename boost::type_identity::type const & hi, Pred p ) /// \return the value "val" brought into the range [ lo, hi ] /// using the comparison predicate p. /// If p ( val, lo ) return lo. @@ -48,8 +48,8 @@ namespace boost { namespace algorithm { /// template BOOST_CXX14_CONSTEXPR T const & clamp ( T const& val, - typename boost::mpl::identity::type const & lo, - typename boost::mpl::identity::type const & hi, Pred p ) + typename boost::type_identity::type const & lo, + typename boost::type_identity::type const & hi, Pred p ) { // assert ( !p ( hi, lo )); // Can't assert p ( lo, hi ) b/c they might be equal return p ( val, lo ) ? lo : p ( hi, val ) ? hi : val; @@ -57,8 +57,8 @@ namespace boost { namespace algorithm { /// \fn clamp ( T const& val, -/// typename boost::mpl::identity::type const & lo, -/// typename boost::mpl::identity::type const & hi ) +/// typename boost::identity::type const & lo, +/// typename boost::identity::type const & hi ) /// \return the value "val" brought into the range [ lo, hi ]. /// If the value is less than lo, return lo. /// If the value is greater than "hi", return hi. @@ -70,8 +70,8 @@ namespace boost { namespace algorithm { /// template BOOST_CXX14_CONSTEXPR T const& clamp ( const T& val, - typename boost::mpl::identity::type const & lo, - typename boost::mpl::identity::type const & hi ) + typename boost::type_identity::type const & lo, + typename boost::type_identity::type const & hi ) { return boost::algorithm::clamp ( val, lo, hi, std::less()); } diff --git a/ThirdParty/include/boost/algorithm/cxx11/copy_if.hpp b/ThirdParty/include/boost/algorithm/cxx11/copy_if.hpp index d3914bf20..307c21310 100644 --- a/ThirdParty/include/boost/algorithm/cxx11/copy_if.hpp +++ b/ThirdParty/include/boost/algorithm/cxx11/copy_if.hpp @@ -126,6 +126,86 @@ copy_until ( const Range &r, OutputIterator result, Predicate p ) return boost::algorithm::copy_until (boost::begin (r), boost::end(r), result, p); } +/// \fn copy_if_while ( InputIterator first, InputIterator last, OutputIterator result, CopyPredicate copy_pred, TerminatePred term_pred ) +/// \brief Copies all the elements from the input range that satisfy the +/// copy predicate to the output range while the termination predicate is +/// satisfied. +/// \return The updated output iterator +/// +/// \param first The start of the input sequence +/// \param last One past the end of the input sequence +/// \param result An output iterator to write the results into +/// \param copy_pred A predicate for testing whether to the current element +/// \param term_pred A predicate for testing whether to end the copy operation +template +BOOST_CXX14_CONSTEXPR std::pair +copy_if_while ( InputIterator first, InputIterator last, OutputIterator result, CopyPredicate copy_pred, TerminatePred term_pred) +{ + for ( ; first != last && term_pred(*first); ++first ) { + if (copy_pred(*first)) { + *result++ = *first; + } + } + return std::make_pair(first, result); +} + +/// \fn copy_if_while ( const Range& r, OutputIterator result, CopyPredicate copy_pred, TerminatePred term_pred ) +/// \brief Copies all the elements from the input range that satisfy the +/// copy predicate to the output range while the termination predicate is +/// satisfied. +/// \return The updated output iterator +/// +/// \param r The input range +/// \param result An output iterator to write the results into +/// \param copy_pred A predicate for testing whether to the current element +/// \param term_pred A predicate for testing whether to end the copy operation +template +BOOST_CXX14_CONSTEXPR std::pair::type, OutputIterator> +copy_if_while ( const Range& r, OutputIterator result, CopyPredicate copy_pred, TerminatePred term_pred) +{ + return boost::algorithm::copy_if_while(boost::begin(r), boost::end(r), result, copy_pred, term_pred); +} + +/// \fn copy_if_until ( InputIterator first, InputIterator last, OutputIterator result, CopyPredicate copy_pred, TerminatePred term_pred ) +/// \brief Copies all the elements from the input range that satisfy the +/// copy predicate to the output range until the termination predicate is +/// satisfied. +/// \return The updated output iterator +/// +/// \param first The start of the input sequence +/// \param last One past the end of the input sequence +/// \param result An output iterator to write the results into +/// \param copy_pred A predicate for testing whether to the current element +/// \param term_pred A predicate for testing whether to end the copy operation +template +BOOST_CXX14_CONSTEXPR std::pair +copy_if_until ( InputIterator first, InputIterator last, OutputIterator result, CopyPredicate copy_pred, TerminatePred term_pred) +{ + for ( ; first != last && !term_pred(*first); ++first ) { + if (copy_pred(*first)) { + *result++ = *first; + } + } + return std::make_pair(first, result); +} + +/// \fn copy_if_until ( const Range& r, OutputIterator result, CopyPredicate copy_pred, TerminatePred term_pred ) +/// \brief Copies all the elements from the input range that satisfy the +/// copy predicate to the output range until the termination predicate is +/// satisfied. +/// \return The updated output iterator +/// +/// \param r The input range +/// \param result An output iterator to write the results into +/// \param copy_pred A predicate for testing whether to the current element +/// \param term_pred A predicate for testing whether to end the copy operation +template +BOOST_CXX14_CONSTEXPR std::pair::type, OutputIterator> +copy_if_until ( const Range& r, OutputIterator result, CopyPredicate copy_pred, TerminatePred term_pred) +{ + return boost::algorithm::copy_if_until(boost::begin(r), boost::end(r), result, copy_pred, term_pred); +} + }} // namespace boost and algorithm #endif // BOOST_ALGORITHM_COPY_IF_HPP diff --git a/ThirdParty/include/boost/algorithm/cxx11/is_sorted.hpp b/ThirdParty/include/boost/algorithm/cxx11/is_sorted.hpp index 0aa812236..e02fb3645 100644 --- a/ThirdParty/include/boost/algorithm/cxx11/is_sorted.hpp +++ b/ThirdParty/include/boost/algorithm/cxx11/is_sorted.hpp @@ -22,7 +22,7 @@ #include #include -#include +#include // for boost::type_identity namespace boost { namespace algorithm { @@ -127,7 +127,7 @@ namespace boost { namespace algorithm { /// \param p A binary predicate that returns true if two elements are ordered. /// template - BOOST_CXX14_CONSTEXPR typename boost::lazy_disable_if_c< boost::is_same::value, boost::mpl::identity >::type + BOOST_CXX14_CONSTEXPR typename boost::lazy_disable_if_c< boost::is_same::value, boost::type_identity >::type is_sorted ( const R &range, Pred p ) { return boost::algorithm::is_sorted ( boost::begin ( range ), boost::end ( range ), p ); diff --git a/ThirdParty/include/boost/algorithm/cxx17/inclusive_scan.hpp b/ThirdParty/include/boost/algorithm/cxx17/inclusive_scan.hpp index 57812670a..fcc9bc2da 100644 --- a/ThirdParty/include/boost/algorithm/cxx17/inclusive_scan.hpp +++ b/ThirdParty/include/boost/algorithm/cxx17/inclusive_scan.hpp @@ -9,8 +9,8 @@ /// \brief Combine the (transformed) elements of a sequence (or two) into a single value. /// \author Marshall Clow -#ifndef BOOST_ALGORITHM_TRANSFORM_REDUCE_HPP -#define BOOST_ALGORITHM_TRANSFORM_REDUCE_HPP +#ifndef BOOST_ALGORITHM_INCLUSIVE_SCAN_HPP +#define BOOST_ALGORITHM_INCLUSIVE_SCAN_HPP #include // for std::plus #include // for std::iterator_traits @@ -58,4 +58,4 @@ OutputIterator inclusive_scan(InputIterator first, InputIterator last, }} // namespace boost and algorithm -#endif // BOOST_ALGORITHM_TRANSFORM_REDUCE_HPP +#endif // BOOST_ALGORITHM_INCLUSIVE_SCAN_HPP diff --git a/ThirdParty/include/boost/algorithm/cxx17/transform_exclusive_scan.hpp b/ThirdParty/include/boost/algorithm/cxx17/transform_exclusive_scan.hpp index 68318a59a..86446b803 100644 --- a/ThirdParty/include/boost/algorithm/cxx17/transform_exclusive_scan.hpp +++ b/ThirdParty/include/boost/algorithm/cxx17/transform_exclusive_scan.hpp @@ -22,6 +22,21 @@ namespace boost { namespace algorithm { +/// \fn transform_exclusive_scan ( InputIterator first, InputIterator last, OutputIterator result, BinaryOperation bOp, UnaryOperation uOp, T init ) +/// \brief Transforms elements from the input range with uOp and then combines +/// those transformed elements with bOp such that the n-1th element and the nth +/// element are combined. Exclusivity means that the nth element is not +/// included in the nth combination. +/// \return The updated output iterator +/// +/// \param first The start of the input sequence +/// \param last The end of the input sequence +/// \param result The output iterator to write the results into +/// \param bOp The operation for combining transformed input elements +/// \param uOp The operation for transforming input elements +/// \param init The initial value +/// +/// \note This function is part of the C++17 standard library template OutputIterator transform_exclusive_scan(InputIterator first, InputIterator last, diff --git a/ThirdParty/include/boost/algorithm/cxx17/transform_inclusive_scan.hpp b/ThirdParty/include/boost/algorithm/cxx17/transform_inclusive_scan.hpp index 31607703e..9d877c02d 100644 --- a/ThirdParty/include/boost/algorithm/cxx17/transform_inclusive_scan.hpp +++ b/ThirdParty/include/boost/algorithm/cxx17/transform_inclusive_scan.hpp @@ -22,6 +22,21 @@ namespace boost { namespace algorithm { +/// \fn transform_inclusive_scan ( InputIterator first, InputIterator last, OutputIterator result, BinaryOperation bOp, UnaryOperation uOp, T init ) +/// \brief Transforms elements from the input range with uOp and then combines +/// those transformed elements with bOp such that the n-1th element and the nth +/// element are combined. Inclusivity means that the nth element is included in +/// the nth combination. +/// \return The updated output iterator +/// +/// \param first The start of the input sequence +/// \param last The end of the input sequence +/// \param result The output iterator to write the results into +/// \param bOp The operation for combining transformed input elements +/// \param uOp The operation for transforming input elements +/// \param init The initial value +/// +/// \note This function is part of the C++17 standard library template OutputIterator transform_inclusive_scan(InputIterator first, InputIterator last, @@ -37,6 +52,20 @@ OutputIterator transform_inclusive_scan(InputIterator first, InputIterator last, return result; } +/// \fn transform_inclusive_scan ( InputIterator first, InputIterator last, OutputIterator result, BinaryOperation bOp, UnaryOperation uOp, T init ) +/// \brief Transforms elements from the input range with uOp and then combines +/// those transformed elements with bOp such that the n-1th element and the nth +/// element are combined. Inclusivity means that the nth element is included in +/// the nth combination. The first value will be used as the init. +/// \return The updated output iterator +/// +/// \param first The start of the input sequence +/// \param last The end of the input sequence +/// \param result The output iterator to write the results into +/// \param bOp The operation for combining transformed input elements +/// \param uOp The operation for transforming input elements +/// +/// \note This function is part of the C++17 standard library template OutputIterator transform_inclusive_scan(InputIterator first, InputIterator last, diff --git a/ThirdParty/include/boost/algorithm/hex.hpp b/ThirdParty/include/boost/algorithm/hex.hpp index 446a5b12a..3cba2f958 100644 --- a/ThirdParty/include/boost/algorithm/hex.hpp +++ b/ThirdParty/include/boost/algorithm/hex.hpp @@ -48,9 +48,9 @@ namespace boost { namespace algorithm { \brief Thrown when the input sequence unexpectedly ends */ -struct hex_decode_error : virtual boost::exception, virtual std::exception {}; -struct not_enough_input : virtual hex_decode_error {}; -struct non_hex_input : virtual hex_decode_error {}; +struct BOOST_SYMBOL_VISIBLE hex_decode_error : virtual boost::exception, virtual std::exception {}; +struct BOOST_SYMBOL_VISIBLE not_enough_input : virtual hex_decode_error {}; +struct BOOST_SYMBOL_VISIBLE non_hex_input : virtual hex_decode_error {}; typedef boost::error_info bad_char; namespace detail { diff --git a/ThirdParty/include/boost/algorithm/is_clamped.hpp b/ThirdParty/include/boost/algorithm/is_clamped.hpp new file mode 100644 index 000000000..72287d302 --- /dev/null +++ b/ThirdParty/include/boost/algorithm/is_clamped.hpp @@ -0,0 +1,72 @@ +/* + Copyright (c) Ivan Matek, Marshall Clow 2021. + + 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) + +*/ + +/// \file is_clamped.hpp +/// \brief IsClamped algorithm +/// \authors Ivan Matek, Marshall Clow +/// + +#ifndef BOOST_ALGORITHM_IS_CLAMPED_HPP +#define BOOST_ALGORITHM_IS_CLAMPED_HPP + +#include // for std::less +#include + +#include // for boost::type_identity + +namespace boost { namespace algorithm { + +/// \fn is_clamped ( T const& val, +/// typename boost::type_identity::type const & lo, +/// typename boost::type_identity::type const & hi, Pred p ) +/// \returns true if value "val" is in the range [ lo, hi ] +/// using the comparison predicate p. +/// If p ( val, lo ) return false. +/// If p ( hi, val ) return false. +/// Otherwise, returns true. +/// +/// \param val The value to be checked +/// \param lo The lower bound of the range +/// \param hi The upper bound of the range +/// \param p A predicate to use to compare the values. +/// p ( a, b ) returns a boolean. +/// + template + BOOST_CXX14_CONSTEXPR bool is_clamped( + T const& val, typename boost::type_identity::type const& lo, + typename boost::type_identity::type const& hi, Pred p) { + // assert ( !p ( hi, lo )); // Can't assert p ( lo, hi ) b/c they + // might be equal + return p(val, lo) ? false : p(hi, val) ? false : true; + } + +/// \fn is_clamped ( T const& val, +/// typename boost::type_identity::type const & lo, +/// typename boost::type_identity::type const & hi) +/// \returns true if value "val" is in the range [ lo, hi ] +/// using operator < for comparison. +/// If the value is less than lo, return false. +/// If the value is greater than hi, return false. +/// Otherwise, returns true. +/// +/// \param val The value to be checked +/// \param lo The lower bound of the range +/// \param hi The upper bound of the range +/// + + template + BOOST_CXX14_CONSTEXPR bool is_clamped ( const T& val, + typename boost::type_identity::type const & lo, + typename boost::type_identity::type const & hi ) + { + return boost::algorithm::is_clamped ( val, lo, hi, std::less()); + } + +}} + +#endif // BOOST_ALGORITHM_CLAMP_HPP diff --git a/ThirdParty/include/boost/algorithm/string/detail/case_conv.hpp b/ThirdParty/include/boost/algorithm/string/detail/case_conv.hpp index 3ba317f41..188602a1d 100644 --- a/ThirdParty/include/boost/algorithm/string/detail/case_conv.hpp +++ b/ThirdParty/include/boost/algorithm/string/detail/case_conv.hpp @@ -15,6 +15,9 @@ #include #include +#include +#include +#include #include namespace boost { diff --git a/ThirdParty/include/boost/algorithm/string/detail/classification.hpp b/ThirdParty/include/boost/algorithm/string/detail/classification.hpp index febf8b7b5..30a37c698 100644 --- a/ThirdParty/include/boost/algorithm/string/detail/classification.hpp +++ b/ThirdParty/include/boost/algorithm/string/detail/classification.hpp @@ -13,10 +13,12 @@ #include #include +#include #include #include #include +#include #include #include diff --git a/ThirdParty/include/boost/algorithm/string/detail/find_format_all.hpp b/ThirdParty/include/boost/algorithm/string/detail/find_format_all.hpp index 52930c83a..311fa26ff 100644 --- a/ThirdParty/include/boost/algorithm/string/detail/find_format_all.hpp +++ b/ThirdParty/include/boost/algorithm/string/detail/find_format_all.hpp @@ -18,6 +18,8 @@ #include #include +#include + namespace boost { namespace algorithm { namespace detail { diff --git a/ThirdParty/include/boost/algorithm/string/detail/find_iterator.hpp b/ThirdParty/include/boost/algorithm/string/detail/find_iterator.hpp index 4f90a98fc..c99078525 100644 --- a/ThirdParty/include/boost/algorithm/string/detail/find_iterator.hpp +++ b/ThirdParty/include/boost/algorithm/string/detail/find_iterator.hpp @@ -40,10 +40,18 @@ namespace boost { // Protected construction/destruction // Default constructor - find_iterator_base() {} + BOOST_DEFAULTED_FUNCTION(find_iterator_base(), {}) + // Copy construction - find_iterator_base( const find_iterator_base& Other ) : + BOOST_DEFAULTED_FUNCTION(find_iterator_base( const find_iterator_base& Other ), : m_Finder(Other.m_Finder) {} + ) + + // Assignment + BOOST_DEFAULTED_FUNCTION(find_iterator_base& operator=( const find_iterator_base& Other ), { + m_Finder = Other.m_Finder; + return *this; + }) // Constructor template @@ -51,7 +59,7 @@ namespace boost { m_Finder(Finder) {} // Destructor - ~find_iterator_base() {} + BOOST_DEFAULTED_FUNCTION(~find_iterator_base(), {}) // Find operation match_type do_find( diff --git a/ThirdParty/include/boost/algorithm/string/find_iterator.hpp b/ThirdParty/include/boost/algorithm/string/find_iterator.hpp index 5a52d92e4..47c20e673 100644 --- a/ThirdParty/include/boost/algorithm/string/find_iterator.hpp +++ b/ThirdParty/include/boost/algorithm/string/find_iterator.hpp @@ -74,7 +74,7 @@ namespace boost { \post eof()==true */ - find_iterator() {} + BOOST_DEFAULTED_FUNCTION(find_iterator(), {}) //! Copy constructor /*! @@ -85,6 +85,18 @@ namespace boost { m_Match(Other.m_Match), m_End(Other.m_End) {} + //! Copy assignment + /*! + Assigns a copy of the find_iterator + */ + BOOST_DEFAULTED_FUNCTION(find_iterator& operator=( const find_iterator& Other ), { + if (this == &Other) return *this; + this->base_type::operator=(Other); + m_Match = Other.m_Match; + m_End = Other.m_End; + return *this; + }) + //! Constructor /*! Construct new find_iterator for a given finder @@ -248,6 +260,20 @@ namespace boost { m_bEof(Other.m_bEof) {} + //! Assignment operator + /*! + Assigns a copy of the split_iterator + */ + BOOST_DEFAULTED_FUNCTION(split_iterator& operator=( const split_iterator& Other ), { + if (this == &Other) return *this; + this->base_type::operator=(Other); + m_Match = Other.m_Match; + m_Next = Other.m_Next; + m_End = Other.m_End; + m_bEof = Other.m_bEof; + return *this; + }) + //! Constructor /*! Construct new split_iterator for a given finder diff --git a/ThirdParty/include/boost/align/align.hpp b/ThirdParty/include/boost/align/align.hpp index ee4371091..92f0c616b 100644 --- a/ThirdParty/include/boost/align/align.hpp +++ b/ThirdParty/include/boost/align/align.hpp @@ -10,7 +10,7 @@ Distributed under the Boost Software License, Version 1.0. #include -#if !defined(BOOST_NO_CXX11_STD_ALIGN) +#if !defined(BOOST_NO_CXX11_STD_ALIGN) && !defined(BOOST_LIBSTDCXX_VERSION) #include #else #include diff --git a/ThirdParty/include/boost/align/detail/align.hpp b/ThirdParty/include/boost/align/detail/align.hpp index 1be7a353d..77b327a22 100644 --- a/ThirdParty/include/boost/align/detail/align.hpp +++ b/ThirdParty/include/boost/align/detail/align.hpp @@ -1,5 +1,5 @@ /* -Copyright 2014-2016 Glen Joseph Fernandes +Copyright 2014-2020 Glen Joseph Fernandes (glenjofe@gmail.com) Distributed under the Boost Software License, Version 1.0. @@ -19,13 +19,15 @@ align(std::size_t alignment, std::size_t size, void*& ptr, std::size_t& space) { BOOST_ASSERT(boost::alignment::detail::is_alignment(alignment)); - char* p = reinterpret_cast(~(alignment - 1) & - (reinterpret_cast(ptr) + alignment - 1)); - std::size_t n = p - static_cast(ptr); - if (size + n <= space) { - ptr = p; - space -= n; - return p; + if (size <= space) { + char* p = reinterpret_cast(~(alignment - 1) & + (reinterpret_cast(ptr) + alignment - 1)); + std::size_t n = p - static_cast(ptr); + if (n <= space - size) { + ptr = p; + space -= n; + return p; + } } return 0; } diff --git a/ThirdParty/include/boost/any.hpp b/ThirdParty/include/boost/any.hpp index 9c2789cba..9d2e92141 100644 --- a/ThirdParty/include/boost/any.hpp +++ b/ThirdParty/include/boost/any.hpp @@ -3,18 +3,20 @@ #ifndef BOOST_ANY_INCLUDED #define BOOST_ANY_INCLUDED -#if defined(_MSC_VER) +#include +#ifdef BOOST_HAS_PRAGMA_ONCE # pragma once #endif // what: variant type boost::any // who: contributed by Kevlin Henney, // with features contributed and bugs found by -// Antony Polukhin, Ed Brey, Mark Rodgers, +// Antony Polukhin, Ed Brey, Mark Rodgers, // Peter Dimov, and James Curran // when: July 2001, April 2013 - 2020 -#include +#include +#include #include #include #include @@ -27,7 +29,6 @@ #include #include #include -#include #include namespace boost @@ -47,6 +48,10 @@ namespace boost BOOST_DEDUCED_TYPENAME remove_cv::type>::type >(value)) { + BOOST_STATIC_ASSERT_MSG( + !anys::detail::is_basic_any::value, + "boost::any shall not be constructed from boost::anys::basic_any" + ); } any(const any & other) @@ -69,6 +74,10 @@ namespace boost , typename boost::disable_if >::type* = 0) // disable if value has type `const ValueType&&` : content(new holder< typename decay::type >(static_cast(value))) { + BOOST_STATIC_ASSERT_MSG( + !anys::detail::is_basic_any::type>::value, + "boost::any shall not be constructed from boost::anys::basic_any" + ); } #endif @@ -92,6 +101,10 @@ namespace boost template any & operator=(const ValueType & rhs) { + BOOST_STATIC_ASSERT_MSG( + !anys::detail::is_basic_any::value, + "boost::anys::basic_any shall not be assigned into boost::any" + ); any(rhs).swap(*this); return *this; } @@ -102,7 +115,7 @@ namespace boost return *this; } -#else +#else any & operator=(const any& rhs) { any(rhs).swap(*this); @@ -121,6 +134,10 @@ namespace boost template any & operator=(ValueType&& rhs) { + BOOST_STATIC_ASSERT_MSG( + !anys::detail::is_basic_any::type>::value, + "boost::anys::basic_any shall not be assigned into boost::any" + ); any(static_cast(rhs)).swap(*this); return *this; } @@ -224,27 +241,12 @@ namespace boost placeholder * content; }; - + inline void swap(any & lhs, any & rhs) BOOST_NOEXCEPT { lhs.swap(rhs); } - class BOOST_SYMBOL_VISIBLE bad_any_cast : -#ifndef BOOST_NO_RTTI - public std::bad_cast -#else - public std::exception -#endif - { - public: - const char * what() const BOOST_NOEXCEPT_OR_NOTHROW BOOST_OVERRIDE - { - return "boost::bad_any_cast: " - "failed conversion using boost::any_cast"; - } - }; - template ValueType * any_cast(any * operand) BOOST_NOEXCEPT { @@ -271,9 +273,9 @@ namespace boost if(!result) boost::throw_exception(bad_any_cast()); - // Attempt to avoid construction of a temporary object in cases when + // Attempt to avoid construction of a temporary object in cases when // `ValueType` is not a reference. Example: - // `static_cast(*result);` + // `static_cast(*result);` // which is equal to `std::string(*result);` typedef BOOST_DEDUCED_TYPENAME boost::conditional< boost::is_reference::value, @@ -305,7 +307,7 @@ namespace boost BOOST_STATIC_ASSERT_MSG( boost::is_rvalue_reference::value /*true if ValueType is rvalue or just a value*/ || boost::is_const< typename boost::remove_reference::type >::value, - "boost::any_cast shall not be used for getting nonconst references to temporary objects" + "boost::any_cast shall not be used for getting nonconst references to temporary objects" ); return any_cast(operand); } @@ -333,7 +335,7 @@ namespace boost } // Copyright Kevlin Henney, 2000, 2001, 2002. All rights reserved. -// Copyright Antony Polukhin, 2013-2020. +// Copyright Antony Polukhin, 2013-2022. // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at diff --git a/ThirdParty/include/boost/any/bad_any_cast.hpp b/ThirdParty/include/boost/any/bad_any_cast.hpp new file mode 100644 index 000000000..bba142da5 --- /dev/null +++ b/ThirdParty/include/boost/any/bad_any_cast.hpp @@ -0,0 +1,43 @@ +// Copyright Antony Polukhin, 2020-2022. +// +// 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) + +// See http://www.boost.org/libs/any for Documentation. + +#ifndef BOOST_ANYS_BAD_ANY_CAST_HPP_INCLUDED +#define BOOST_ANYS_BAD_ANY_CAST_HPP_INCLUDED + +#include +#ifdef BOOST_HAS_PRAGMA_ONCE +# pragma once +#endif + +#ifndef BOOST_NO_RTTI +#include +#endif + +#include + +namespace boost { + +class BOOST_SYMBOL_VISIBLE bad_any_cast : +#ifndef BOOST_NO_RTTI + public std::bad_cast +#else + public std::exception +#endif +{ +public: + const char * what() const BOOST_NOEXCEPT_OR_NOTHROW BOOST_OVERRIDE + { + return "boost::bad_any_cast: " + "failed conversion using boost::any_cast"; + } +}; + +} // namespace boost + + +#endif // #ifndef BOOST_ANYS_BAD_ANY_CAST_HPP_INCLUDED diff --git a/ThirdParty/include/boost/any/basic_any.hpp b/ThirdParty/include/boost/any/basic_any.hpp new file mode 100644 index 000000000..980abed19 --- /dev/null +++ b/ThirdParty/include/boost/any/basic_any.hpp @@ -0,0 +1,480 @@ +// Copyright Ruslan Arutyunyan, 2019-2021. +// Copyright Antony Polukhin, 2021-2022. +// +// 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) + +// Contributed by Ruslan Arutyunyan + +#ifndef BOOST_ANYS_BASIC_ANY_HPP_INCLUDED +#define BOOST_ANYS_BASIC_ANY_HPP_INCLUDED + +#include +#ifdef BOOST_HAS_PRAGMA_ONCE +# pragma once +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { + +namespace anys { + + template + class basic_any + { + BOOST_STATIC_ASSERT_MSG(OptimizeForSize > 0 && OptimizeForAlignment > 0, "Size and Align shall be positive values"); + BOOST_STATIC_ASSERT_MSG(OptimizeForSize >= OptimizeForAlignment, "Size shall non less than Align"); + BOOST_STATIC_ASSERT_MSG((OptimizeForAlignment & (OptimizeForAlignment - 1)) == 0, "Align shall be a power of 2"); + BOOST_STATIC_ASSERT_MSG(OptimizeForSize % OptimizeForAlignment == 0, "Size shall be multiple of alignment"); + private: + enum operation + { + Destroy, + Move, + Copy, + AnyCast, + UnsafeCast, + Typeinfo + }; + + template + static void* small_manager(operation op, basic_any& left, const basic_any* right, const boost::typeindex::type_info* info) + { + switch (op) + { + case Destroy: + BOOST_ASSERT(!left.empty()); + reinterpret_cast(&left.content.small_value)->~ValueType(); + break; + case Move: { + BOOST_ASSERT(left.empty()); + BOOST_ASSERT(right); + BOOST_ASSERT(!right->empty()); + BOOST_ASSERT(right->type() == boost::typeindex::type_id()); + ValueType* value = reinterpret_cast(&const_cast(right)->content.small_value); +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + new (&left.content.small_value) ValueType(std::move(*value)); +#else + new (&left.content.small_value) ValueType(*value); +#endif + left.man = right->man; + reinterpret_cast(&right->content.small_value)->~ValueType(); + const_cast(right)->man = 0; + + }; + break; + + case Copy: + BOOST_ASSERT(left.empty()); + BOOST_ASSERT(right); + BOOST_ASSERT(!right->empty()); + BOOST_ASSERT(right->type() == boost::typeindex::type_id()); + new (&left.content.small_value) ValueType(*reinterpret_cast(&right->content.small_value)); + left.man = right->man; + break; + case AnyCast: + BOOST_ASSERT(info); + BOOST_ASSERT(!left.empty()); + return boost::typeindex::type_id() == *info ? + reinterpret_cast::type *>(&left.content.small_value) : 0; + case UnsafeCast: + BOOST_ASSERT(!left.empty()); + return reinterpret_cast::type *>(&left.content.small_value); + case Typeinfo: + return const_cast(static_cast(&boost::typeindex::type_id().type_info())); + } + + return 0; + } + + template + static void* large_manager(operation op, basic_any& left, const basic_any* right, const boost::typeindex::type_info* info) + { + switch (op) + { + case Destroy: + BOOST_ASSERT(!left.empty()); + delete static_cast(left.content.large_value); + break; + case Move: + BOOST_ASSERT(left.empty()); + BOOST_ASSERT(right); + BOOST_ASSERT(!right->empty()); + BOOST_ASSERT(right->type() == boost::typeindex::type_id()); + left.content.large_value = right->content.large_value; + left.man = right->man; + const_cast(right)->content.large_value = 0; + const_cast(right)->man = 0; + break; + case Copy: + BOOST_ASSERT(left.empty()); + BOOST_ASSERT(right); + BOOST_ASSERT(!right->empty()); + BOOST_ASSERT(right->type() == boost::typeindex::type_id()); + left.content.large_value = new ValueType(*static_cast(right->content.large_value)); + left.man = right->man; + break; + case AnyCast: + BOOST_ASSERT(info); + BOOST_ASSERT(!left.empty()); + return boost::typeindex::type_id() == *info ? + static_cast::type *>(left.content.large_value) : 0; + case UnsafeCast: + BOOST_ASSERT(!left.empty()); + return reinterpret_cast::type *>(left.content.large_value); + case Typeinfo: + return const_cast(static_cast(&boost::typeindex::type_id().type_info())); + } + + return 0; + } + + template + struct is_small_object : boost::integral_constant::value <= OptimizeForAlignment && + boost::is_nothrow_move_constructible::value> + {}; + + template + static void create(basic_any& any, const ValueType& value, boost::true_type) + { + typedef typename boost::decay::type DecayedType; + + any.man = &small_manager; + new (&any.content.small_value) ValueType(value); + } + + template + static void create(basic_any& any, const ValueType& value, boost::false_type) + { + typedef typename boost::decay::type DecayedType; + + any.man = &large_manager; + any.content.large_value = new DecayedType(value); + } + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + template + static void create(basic_any& any, ValueType&& value, boost::true_type) + { + typedef typename boost::decay::type DecayedType; + any.man = &small_manager; + new (&any.content.small_value) DecayedType(static_cast(value)); + } + + template + static void create(basic_any& any, ValueType&& value, boost::false_type) + { + typedef typename boost::decay::type DecayedType; + any.man = &large_manager; + any.content.large_value = new DecayedType(static_cast(value)); + } +#endif + public: // non-type template parameters accessors + static BOOST_CONSTEXPR_OR_CONST std::size_t buffer_size = OptimizeForSize; + static BOOST_CONSTEXPR_OR_CONST std::size_t buffer_align = OptimizeForAlignment; + + public: // structors + + BOOST_CONSTEXPR basic_any() BOOST_NOEXCEPT + : man(0), content() + { + } + + template + basic_any(const ValueType & value) + : man(0), content() + { + BOOST_STATIC_ASSERT_MSG( + !(boost::is_same::value), + "boost::anys::basic_any shall not be constructed from boost::any" + ); + BOOST_STATIC_ASSERT_MSG( + !anys::detail::is_basic_any::value, + "boost::anys::basic_any shall not be constructed from boost::anys::basic_any" + ); + create(*this, value, is_small_object()); + } + + basic_any(const basic_any & other) + : man(0), content() + { + if (other.man) + { + other.man(Copy, *this, &other, 0); + } + } + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + // Move constructor + basic_any(basic_any&& other) BOOST_NOEXCEPT + : man(0), content() + { + if (other.man) + { + other.man(Move, *this, &other, 0); + } + } + + // Perfect forwarding of ValueType + template + basic_any(ValueType&& value + , typename boost::disable_if >::type* = 0 // disable if value has type `basic_any&` + , typename boost::disable_if >::type* = 0) // disable if value has type `const ValueType&&` + : man(0), content() + { + typedef typename boost::decay::type DecayedType; + BOOST_STATIC_ASSERT_MSG( + !(boost::is_same::value), + "boost::anys::basic_any shall not be constructed from boost::any" + ); + BOOST_STATIC_ASSERT_MSG( + !anys::detail::is_basic_any::value, + "boost::anys::basic_any shall not be constructed from boost::anys::basic_any" + ); + create(*this, static_cast(value), is_small_object()); + } +#endif + + ~basic_any() BOOST_NOEXCEPT + { + if (man) + { + man(Destroy, *this, 0, 0); + } + } + + public: // modifiers + + basic_any & swap(basic_any & rhs) BOOST_NOEXCEPT + { + if (this == &rhs) + { + return *this; + } + + if (man && rhs.man) + { + basic_any tmp; + rhs.man(Move, tmp, &rhs, 0); + man(Move, rhs, this, 0); + tmp.man(Move, *this, &tmp, 0); + } + else if (man) + { + man(Move, rhs, this, 0); + } + else if (rhs.man) + { + rhs.man(Move, *this, &rhs, 0); + } + return *this; + } + + +#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES + template + basic_any & operator=(const ValueType & rhs) + { + BOOST_STATIC_ASSERT_MSG( + !(boost::is_same::value), + "boost::any shall not be assigned into boost::anys::basic_any" + ); + BOOST_STATIC_ASSERT_MSG( + !anys::detail::is_basic_any::value, + "boost::anys::basic_any shall not be assigned into boost::anys::basic_any" + ); + basic_any(rhs).swap(*this); + return *this; + } + + basic_any & operator=(basic_any rhs) + { + rhs.swap(*this); + return *this; + } + +#else + basic_any & operator=(const basic_any& rhs) + { + basic_any(rhs).swap(*this); + return *this; + } + + // move assignment + basic_any & operator=(basic_any&& rhs) BOOST_NOEXCEPT + { + rhs.swap(*this); + basic_any().swap(rhs); + return *this; + } + + // Perfect forwarding of ValueType + template + basic_any & operator=(ValueType&& rhs) + { + typedef typename boost::decay::type DecayedType; + BOOST_STATIC_ASSERT_MSG( + !(boost::is_same::value), + "boost::any shall not be assigned into boost::anys::basic_any" + ); + BOOST_STATIC_ASSERT_MSG( + (!anys::detail::is_basic_any::value || boost::is_same::value), + "boost::anys::basic_any shall not be assigned into boost::anys::basic_any" + ); + basic_any(static_cast(rhs)).swap(*this); + return *this; + } +#endif + + public: // queries + + bool empty() const BOOST_NOEXCEPT + { + return !man; + } + + void clear() BOOST_NOEXCEPT + { + basic_any().swap(*this); + } + + const boost::typeindex::type_info& type() const BOOST_NOEXCEPT + { + return man + ? *static_cast(man(Typeinfo, const_cast(*this), 0, 0)) + : boost::typeindex::type_id().type_info(); + } + + private: // representation + + template + friend ValueType * any_cast(basic_any *) BOOST_NOEXCEPT; + + template + friend ValueType * unsafe_any_cast(basic_any *) BOOST_NOEXCEPT; + + typedef void*(*manager)(operation op, basic_any& left, const basic_any* right, const boost::typeindex::type_info* info); + + manager man; + + union content { + void * large_value; + typename boost::aligned_storage::type small_value; + } content; + }; + + template + void swap(basic_any& lhs, basic_any& rhs) BOOST_NOEXCEPT + { + lhs.swap(rhs); + } + + template + ValueType * any_cast(basic_any * operand) BOOST_NOEXCEPT + { + return operand->man ? + static_cast::type *>(operand->man(basic_any::AnyCast, *operand, 0, &boost::typeindex::type_id().type_info())) + : 0; + } + + template + inline const ValueType * any_cast(const basic_any * operand) BOOST_NOEXCEPT + { + return any_cast(const_cast *>(operand)); + } + + template + ValueType any_cast(basic_any & operand) + { + typedef typename remove_reference::type nonref; + + nonref * result = any_cast(boost::addressof(operand)); + if(!result) + boost::throw_exception(bad_any_cast()); + + // Attempt to avoid construction of a temporary object in cases when + // `ValueType` is not a reference. Example: + // `static_cast(*result);` + // which is equal to `std::string(*result);` + typedef typename boost::conditional< + boost::is_reference::value, + ValueType, + typename boost::add_reference::type + >::type ref_type; + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable: 4172) // "returning address of local variable or temporary" but *result is not local! +#endif + return static_cast(*result); +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + } + + template + inline ValueType any_cast(const basic_any & operand) + { + typedef typename remove_reference::type nonref; + return any_cast(const_cast &>(operand)); + } + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + template + inline ValueType any_cast(basic_any&& operand) + { + BOOST_STATIC_ASSERT_MSG( + boost::is_rvalue_reference::value /*true if ValueType is rvalue or just a value*/ + || boost::is_const< typename boost::remove_reference::type >::value, + "boost::any_cast shall not be used for getting nonconst references to temporary objects" + ); + return any_cast(operand); + } +#endif + + + // Note: The "unsafe" versions of any_cast are not part of the + // public interface and may be removed at any time. They are + // required where we know what type is stored in the any and can't + // use typeid() comparison, e.g., when our types may travel across + // different shared libraries. + template + inline ValueType * unsafe_any_cast(basic_any * operand) BOOST_NOEXCEPT + { + return static_cast(operand->man(basic_any::UnsafeCast, *operand, 0, 0)); + } + + template + inline const ValueType * unsafe_any_cast(const basic_any * operand) BOOST_NOEXCEPT + { + return unsafe_any_cast(const_cast *>(operand)); + } + +} // namespace anys + +using boost::anys::any_cast; +using boost::anys::unsafe_any_cast; + +} // namespace boost + +#endif // #ifndef BOOST_ANYS_BASIC_ANY_HPP_INCLUDED diff --git a/ThirdParty/include/boost/any/fwd.hpp b/ThirdParty/include/boost/any/fwd.hpp new file mode 100644 index 000000000..6905b2644 --- /dev/null +++ b/ThirdParty/include/boost/any/fwd.hpp @@ -0,0 +1,40 @@ +// Copyright Antony Polukhin, 2021-2022. +// +// 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) + +// Contributed by Ruslan Arutyunyan +#ifndef BOOST_ANY_ANYS_FWD_HPP +#define BOOST_ANY_ANYS_FWD_HPP + +#include +#ifdef BOOST_HAS_PRAGMA_ONCE +# pragma once +#endif + + #include + +namespace boost { + +class any; + +namespace anys { + +template::value> +class basic_any; + +namespace detail { + template + struct is_basic_any: public false_type {}; + + + template + struct is_basic_any > : public true_type {}; +} // namespace detail + +} // namespace anys + +} // namespace boost + +#endif // #ifndef BOOST_ANY_ANYS_FWD_HPP diff --git a/ThirdParty/include/boost/any/unique_any.hpp b/ThirdParty/include/boost/any/unique_any.hpp new file mode 100644 index 000000000..a56dd6c8c --- /dev/null +++ b/ThirdParty/include/boost/any/unique_any.hpp @@ -0,0 +1,283 @@ +// Copyright Antony Polukhin, 2020-2022. +// +// 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) + +// See http://www.boost.org/libs/any for Documentation. + +#ifndef BOOST_ANYS_UNIQUE_ANY_HPP_INCLUDED +#define BOOST_ANYS_UNIQUE_ANY_HPP_INCLUDED + +#include +#ifdef BOOST_HAS_PRAGMA_ONCE +# pragma once +#endif + +#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES +#error Header requires C++11 compatible compiler with move semantics +#endif + +#ifdef BOOST_NO_CXX11_DEFAULTED_FUNCTIONS +#error Header requires C++11 compatible compiler with defaulted functions +#endif + +#ifdef BOOST_NO_CXX11_SMART_PTR +#error Header requires C++11 compatible standard library with std::unique_ptr +#endif +#include + +#ifdef BOOST_NO_CXX11_HDR_INITIALIZER_LIST +#include +#endif + +#include + +#include + +#include +#include + +namespace boost { namespace anys { + +template +struct in_place_type_t +{ +}; + +#if !defined(BOOST_NO_CXX14_VARIABLE_TEMPLATES) +template +constexpr in_place_type_t in_place_type{}; +#endif + +class unique_any { +public: + + BOOST_CONSTEXPR unique_any() BOOST_NOEXCEPT = default; + + unique_any(unique_any&& other) BOOST_NOEXCEPT = default; + + // Perfect forwarding of T + template + unique_any(T&& value + , typename boost::disable_if >::type* = 0 // disable if value has type `unique_any&` + , typename boost::disable_if >::type* = 0) // disable if value has type `const T&&` + : content(new holder< typename boost::decay::type >(std::forward(value))) + { + } + + template + explicit unique_any(in_place_type_t, Args&&... args) + : content(new holder::type>(std::forward(args)...)) + { + } + +#ifdef BOOST_NO_CXX11_HDR_INITIALIZER_LIST + template + explicit unique_any(in_place_type_t, std::initializer_list il, Args&&... args) + : content(new holder::type>(il, std::forward(args)...)) + { + } +#endif + + ~unique_any() BOOST_NOEXCEPT = default; + + unique_any & operator=(unique_any&& rhs) BOOST_NOEXCEPT = default; + + template + unique_any & operator=(T&& rhs) + { + unique_any(std::forward(rhs)).swap(*this); + return *this; + } + + template + typename boost::decay::type& emplace(Args&&... args) { + content = std::unique_ptr( + new holder::type>(std::forward(args)...) + ); + } + +#ifdef BOOST_NO_CXX11_HDR_INITIALIZER_LIST + template + typename boost::decay::type& emplace(initializer_list il, Args&&... args) { + content = std::unique_ptr( + new holder::type>(il, std::forward(args)...) + ); + } +#endif + + void reset() BOOST_NOEXCEPT + { + content.reset(); + } + + unique_any& swap(unique_any& rhs) BOOST_NOEXCEPT + { + content.swap(rhs.content); + return *this; + } + + + bool has_value() const BOOST_NOEXCEPT + { + return !content; + } + + const boost::typeindex::type_info& type() const BOOST_NOEXCEPT + { + return content ? content->type() : boost::typeindex::type_id().type_info(); + } + +private: // types + class BOOST_SYMBOL_VISIBLE placeholder + { + virtual ~placeholder() + { + } + + virtual const boost::typeindex::type_info& type() const BOOST_NOEXCEPT = 0; + + }; + + template + class holder BOOST_FINAL: public placeholder + { + public: // structors + + template + holder(Args&&... args) + : held(std::forward(args)...) + { + } + +#ifdef BOOST_NO_CXX11_HDR_INITIALIZER_LIST + template + holder(std::initializer_list il, Args&&... args) + : held(il, std::forward(args)...) + { + } +#endif + + const boost::typeindex::type_info& type() const BOOST_NOEXCEPT BOOST_OVERRIDE + { + return boost::typeindex::type_id().type_info(); + } + + public: // representation + + T held; + }; + + +private: // representation + + template + friend T * any_cast(unique_any *) BOOST_NOEXCEPT; + + template + friend T * unsafe_any_cast(unique_any *) BOOST_NOEXCEPT; + + std::unique_ptr content; +}; + +inline void swap(unique_any & lhs, unique_any & rhs) BOOST_NOEXCEPT +{ + lhs.swap(rhs); +} + +template +T * any_cast(unique_any * operand) BOOST_NOEXCEPT +{ + return operand && operand->type() == boost::typeindex::type_id() + ? boost::addressof( + static_cast::type>&>(*operand->content).held + ) + : 0; +} + +template +inline const T * any_cast(const unique_any * operand) BOOST_NOEXCEPT +{ + return any_cast(const_cast(operand)); +} + +template +T any_cast(unique_any & operand) +{ + typedef BOOST_DEDUCED_TYPENAME remove_reference::type nonref; + + + nonref * result = any_cast(boost::addressof(operand)); + if(!result) + boost::throw_exception(bad_any_cast()); + + // Attempt to avoid construction of a temporary object in cases when + // `T` is not a reference. Example: + // `static_cast(*result);` + // which is equal to `std::string(*result);` + typedef BOOST_DEDUCED_TYPENAME boost::conditional< + boost::is_reference::value, + T, + BOOST_DEDUCED_TYPENAME boost::add_reference::type + >::type ref_type; + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable: 4172) // "returning address of local variable or temporary" but *result is not local! +#endif + return static_cast(*result); +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif +} + +template +inline T any_cast(const unique_any & operand) +{ + typedef BOOST_DEDUCED_TYPENAME remove_reference::type nonref; + return any_cast(const_cast(operand)); +} + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES +template +inline T any_cast(unique_any&& operand) +{ + BOOST_STATIC_ASSERT_MSG( + boost::is_rvalue_reference::value /*true if T is rvalue or just a value*/ + || boost::is_const< typename boost::remove_reference::type >::value, + "boost::any_cast shall not be used for getting nonconst references to temporary objects" + ); + return any_cast(operand); +} +#endif + + +// Note: The "unsafe" versions of any_cast are not part of the +// public interface and may be removed at any time. They are +// required where we know what type is stored in the any and can't +// use typeid() comparison, e.g., when our types may travel across +// different shared libraries. +template +inline T * unsafe_any_cast(unique_any * operand) BOOST_NOEXCEPT +{ + return boost::addressof( + static_cast&>(*operand->content)->held + ); +} + +template +inline const T * unsafe_any_cast(const unique_any * operand) BOOST_NOEXCEPT +{ + return unsafe_any_cast(const_cast(operand)); +} + +} // namespace anys + +using boost::anys::any_cast; +using boost::anys::unsafe_any_cast; + +} // namespace boost + + +#endif // BOOST_ANYS_UNIQUE_ANY_HPP_INCLUDED diff --git a/ThirdParty/include/boost/archive/detail/check.hpp b/ThirdParty/include/boost/archive/detail/check.hpp index 15a2c31e9..5bf0a48bb 100644 --- a/ThirdParty/include/boost/archive/detail/check.hpp +++ b/ThirdParty/include/boost/archive/detail/check.hpp @@ -4,12 +4,14 @@ // MS compatible compilers support #pragma once #if defined(_MSC_VER) # pragma once -#pragma inline_depth(511) +#if !defined(__clang__) +#pragma inline_depth(255) #pragma inline_recursion(on) #endif +#endif #if defined(__MWERKS__) -#pragma inline_depth(511) +#pragma inline_depth(255) #endif /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 diff --git a/ThirdParty/include/boost/archive/detail/iserializer.hpp b/ThirdParty/include/boost/archive/detail/iserializer.hpp index 4b89edfce..b1a9d438b 100644 --- a/ThirdParty/include/boost/archive/detail/iserializer.hpp +++ b/ThirdParty/include/boost/archive/detail/iserializer.hpp @@ -2,14 +2,16 @@ #define BOOST_ARCHIVE_DETAIL_ISERIALIZER_HPP // MS compatible compilers support #pragma once -#if defined(_MSC_VER) +#if defined(BOOST_MSVC) # pragma once -#pragma inline_depth(511) +#if !defined(__clang__) +#pragma inline_depth(255) #pragma inline_recursion(on) #endif +#endif #if defined(__MWERKS__) -#pragma inline_depth(511) +#pragma inline_depth(255) #endif /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 diff --git a/ThirdParty/include/boost/archive/detail/oserializer.hpp b/ThirdParty/include/boost/archive/detail/oserializer.hpp index daf815f9e..f6a77edfc 100644 --- a/ThirdParty/include/boost/archive/detail/oserializer.hpp +++ b/ThirdParty/include/boost/archive/detail/oserializer.hpp @@ -4,12 +4,14 @@ // MS compatible compilers support #pragma once #if defined(_MSC_VER) # pragma once -#pragma inline_depth(511) +#if !defined(__clang__) +#pragma inline_depth(255) #pragma inline_recursion(on) #endif +#endif #if defined(__MWERKS__) -#pragma inline_depth(511) +#pragma inline_depth(255) #endif /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 diff --git a/ThirdParty/include/boost/archive/impl/basic_text_iprimitive.ipp b/ThirdParty/include/boost/archive/impl/basic_text_iprimitive.ipp index 4e4472806..cad9c3f8f 100644 --- a/ThirdParty/include/boost/archive/impl/basic_text_iprimitive.ipp +++ b/ThirdParty/include/boost/archive/impl/basic_text_iprimitive.ipp @@ -112,8 +112,8 @@ basic_text_iprimitive::basic_text_iprimitive( ) : is(is_), flags_saver(is_), - precision_saver(is_), #ifndef BOOST_NO_STD_LOCALE + precision_saver(is_), codecvt_null_facet(1), archive_locale(is.getloc(), & codecvt_null_facet), locale_saver(is) @@ -125,6 +125,7 @@ basic_text_iprimitive::basic_text_iprimitive( is_ >> std::noboolalpha; } #else + precision_saver(is_) {} #endif diff --git a/ThirdParty/include/boost/archive/impl/basic_text_oprimitive.ipp b/ThirdParty/include/boost/archive/impl/basic_text_oprimitive.ipp index 11f046b84..98a8879ba 100644 --- a/ThirdParty/include/boost/archive/impl/basic_text_oprimitive.ipp +++ b/ThirdParty/include/boost/archive/impl/basic_text_oprimitive.ipp @@ -87,8 +87,8 @@ basic_text_oprimitive::basic_text_oprimitive( ) : os(os_), flags_saver(os_), - precision_saver(os_), #ifndef BOOST_NO_STD_LOCALE + precision_saver(os_), codecvt_null_facet(1), archive_locale(os.getloc(), & codecvt_null_facet), locale_saver(os) @@ -100,6 +100,7 @@ basic_text_oprimitive::basic_text_oprimitive( os_ << std::noboolalpha; } #else + precision_saver(os_) {} #endif diff --git a/ThirdParty/include/boost/asio.hpp b/ThirdParty/include/boost/asio.hpp index 3c9e3853f..282fc4c1f 100644 --- a/ThirdParty/include/boost/asio.hpp +++ b/ThirdParty/include/boost/asio.hpp @@ -2,7 +2,7 @@ // asio.hpp // ~~~~~~~~ // -// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -17,14 +17,21 @@ # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) +#include +#include #include #include +#include +#include #include #include #include #include +#include #include +#include #include +#include #include #include #include @@ -32,11 +39,16 @@ #include #include #include +#include #include #include #include +#include +#include +#include #include #include +#include #include #include #include @@ -44,13 +56,18 @@ #include #include #include +#include +#include +#include #include #include #include #include +#include #include #include #include +#include #include #include #include @@ -85,6 +102,7 @@ #include #include #include +#include #include #include #include @@ -123,6 +141,7 @@ #include #include #include +#include #include #include #include @@ -140,11 +159,16 @@ #include #include #include +#include #include +#include #include #include #include +#include +#include #include +#include #include #include #include @@ -154,6 +178,7 @@ #include #include #include +#include #include #include #include @@ -175,6 +200,7 @@ #include #include #include +#include #include #include diff --git a/ThirdParty/include/boost/asio/any_io_executor.hpp b/ThirdParty/include/boost/asio/any_io_executor.hpp index 1be8fb6cc..6dc8731fd 100644 --- a/ThirdParty/include/boost/asio/any_io_executor.hpp +++ b/ThirdParty/include/boost/asio/any_io_executor.hpp @@ -2,7 +2,7 @@ // any_io_executor.hpp // ~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -49,19 +49,245 @@ typedef executor any_io_executor; * execution::prefer_only * > @endcode */ +class any_io_executor : #if defined(GENERATING_DOCUMENTATION) -typedef execution::any_executor<...> any_io_executor; + public execution::any_executor<...> #else // defined(GENERATING_DOCUMENTATION) -typedef execution::any_executor< - execution::context_as_t, - execution::blocking_t::never_t, - execution::prefer_only, - execution::prefer_only, - execution::prefer_only, - execution::prefer_only, - execution::prefer_only - > any_io_executor; + public execution::any_executor< + execution::context_as_t, + execution::blocking_t::never_t, + execution::prefer_only, + execution::prefer_only, + execution::prefer_only, + execution::prefer_only, + execution::prefer_only + > #endif // defined(GENERATING_DOCUMENTATION) +{ +public: +#if !defined(GENERATING_DOCUMENTATION) + typedef execution::any_executor< + execution::context_as_t, + execution::blocking_t::never_t, + execution::prefer_only, + execution::prefer_only, + execution::prefer_only, + execution::prefer_only, + execution::prefer_only + > base_type; + + typedef void supportable_properties_type( + execution::context_as_t, + execution::blocking_t::never_t, + execution::prefer_only, + execution::prefer_only, + execution::prefer_only, + execution::prefer_only, + execution::prefer_only + ); +#endif // !defined(GENERATING_DOCUMENTATION) + + /// Default constructor. + BOOST_ASIO_DECL any_io_executor() BOOST_ASIO_NOEXCEPT; + + /// Construct in an empty state. Equivalent effects to default constructor. + BOOST_ASIO_DECL any_io_executor(nullptr_t) BOOST_ASIO_NOEXCEPT; + + /// Copy constructor. + BOOST_ASIO_DECL any_io_executor(const any_io_executor& e) BOOST_ASIO_NOEXCEPT; + +#if defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + /// Move constructor. + BOOST_ASIO_DECL any_io_executor(any_io_executor&& e) BOOST_ASIO_NOEXCEPT; +#endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + + /// Construct to point to the same target as another any_executor. +#if defined(GENERATING_DOCUMENTATION) + template + any_io_executor(execution::any_executor e); +#else // defined(GENERATING_DOCUMENTATION) + template + any_io_executor(OtherAnyExecutor e, + typename constraint< + conditional< + !is_same::value + && is_base_of::value, + typename execution::detail::supportable_properties< + 0, supportable_properties_type>::template + is_valid_target, + false_type + >::type::value + >::type = 0) + : base_type(BOOST_ASIO_MOVE_CAST(OtherAnyExecutor)(e)) + { + } +#endif // defined(GENERATING_DOCUMENTATION) + + /// Construct a polymorphic wrapper for the specified executor. +#if defined(GENERATING_DOCUMENTATION) + template + any_io_executor(Executor e); +#else // defined(GENERATING_DOCUMENTATION) + template + any_io_executor(Executor e, + typename constraint< + conditional< + !is_same::value + && !is_base_of::value, + execution::detail::is_valid_target_executor< + Executor, supportable_properties_type>, + false_type + >::type::value + >::type = 0) + : base_type(BOOST_ASIO_MOVE_CAST(Executor)(e)) + { + } +#endif // defined(GENERATING_DOCUMENTATION) + + /// Assignment operator. + BOOST_ASIO_DECL any_io_executor& operator=( + const any_io_executor& e) BOOST_ASIO_NOEXCEPT; + +#if defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + /// Move assignment operator. + BOOST_ASIO_DECL any_io_executor& operator=( + any_io_executor&& e) BOOST_ASIO_NOEXCEPT; +#endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + + /// Assignment operator that sets the polymorphic wrapper to the empty state. + BOOST_ASIO_DECL any_io_executor& operator=(nullptr_t); + + /// Destructor. + BOOST_ASIO_DECL ~any_io_executor(); + + /// Swap targets with another polymorphic wrapper. + BOOST_ASIO_DECL void swap(any_io_executor& other) BOOST_ASIO_NOEXCEPT; + + /// Obtain a polymorphic wrapper with the specified property. + /** + * Do not call this function directly. It is intended for use with the + * boost::asio::require and boost::asio::prefer customisation points. + * + * For example: + * @code any_io_executor ex = ...; + * auto ex2 = boost::asio::require(ex, execution::blocking.possibly); @endcode + */ + template + any_io_executor require(const Property& p, + typename constraint< + traits::require_member::is_valid + >::type = 0) const + { + return static_cast(*this).require(p); + } + + /// Obtain a polymorphic wrapper with the specified property. + /** + * Do not call this function directly. It is intended for use with the + * boost::asio::prefer customisation point. + * + * For example: + * @code any_io_executor ex = ...; + * auto ex2 = boost::asio::prefer(ex, execution::blocking.possibly); @endcode + */ + template + any_io_executor prefer(const Property& p, + typename constraint< + traits::prefer_member::is_valid + >::type = 0) const + { + return static_cast(*this).prefer(p); + } +}; + +#if !defined(GENERATING_DOCUMENTATION) + +template <> +BOOST_ASIO_DECL any_io_executor any_io_executor::require( + const execution::blocking_t::never_t&, int) const; + +template <> +BOOST_ASIO_DECL any_io_executor any_io_executor::prefer( + const execution::blocking_t::possibly_t&, int) const; + +template <> +BOOST_ASIO_DECL any_io_executor any_io_executor::prefer( + const execution::outstanding_work_t::tracked_t&, int) const; + +template <> +BOOST_ASIO_DECL any_io_executor any_io_executor::prefer( + const execution::outstanding_work_t::untracked_t&, int) const; + +template <> +BOOST_ASIO_DECL any_io_executor any_io_executor::prefer( + const execution::relationship_t::fork_t&, int) const; + +template <> +BOOST_ASIO_DECL any_io_executor any_io_executor::prefer( + const execution::relationship_t::continuation_t&, int) const; + +namespace traits { + +#if !defined(BOOST_ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT) + +template <> +struct equality_comparable +{ + static const bool is_valid = true; + static const bool is_noexcept = true; +}; + +#endif // !defined(BOOST_ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT) + +#if !defined(BOOST_ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT) + +template +struct execute_member +{ + static const bool is_valid = true; + static const bool is_noexcept = false; + typedef void result_type; +}; + +#endif // !defined(BOOST_ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT) + +#if !defined(BOOST_ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) + +template +struct query_member : + query_member +{ +}; + +#endif // !defined(BOOST_ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT) + +#if !defined(BOOST_ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT) + +template +struct require_member : + require_member +{ + typedef any_io_executor result_type; +}; + +#endif // !defined(BOOST_ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT) + +#if !defined(BOOST_ASIO_HAS_DEDUCED_PREFER_MEMBER_TRAIT) + +template +struct prefer_member : + prefer_member +{ + typedef any_io_executor result_type; +}; + +#endif // !defined(BOOST_ASIO_HAS_DEDUCED_PREFER_MEMBER_TRAIT) + +} // namespace traits + +#endif // !defined(GENERATING_DOCUMENTATION) #endif // defined(BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT) @@ -70,4 +296,10 @@ typedef execution::any_executor< #include +#if defined(BOOST_ASIO_HEADER_ONLY) \ + && !defined(BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT) +# include +#endif // defined(BOOST_ASIO_HEADER_ONLY) + // && !defined(BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT) + #endif // BOOST_ASIO_ANY_IO_EXECUTOR_HPP diff --git a/ThirdParty/include/boost/asio/append.hpp b/ThirdParty/include/boost/asio/append.hpp new file mode 100644 index 000000000..0963236f6 --- /dev/null +++ b/ThirdParty/include/boost/asio/append.hpp @@ -0,0 +1,80 @@ +// +// append.hpp +// ~~~~~~~~~~ +// +// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef BOOST_ASIO_APPEND_HPP +#define BOOST_ASIO_APPEND_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include + +#if (defined(BOOST_ASIO_HAS_STD_TUPLE) \ + && defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)) \ + || defined(GENERATING_DOCUMENTATION) + +#include +#include + +#include + +namespace boost { +namespace asio { + +/// Completion token type used to specify that the completion handler +/// arguments should be passed additional values after the results of the +/// operation. +template +class append_t +{ +public: + /// Constructor. + template + BOOST_ASIO_CONSTEXPR explicit append_t( + BOOST_ASIO_MOVE_ARG(T) completion_token, + BOOST_ASIO_MOVE_ARG(V)... values) + : token_(BOOST_ASIO_MOVE_CAST(T)(completion_token)), + values_(BOOST_ASIO_MOVE_CAST(V)(values)...) + { + } + +//private: + CompletionToken token_; + std::tuple values_; +}; + +/// Completion token type used to specify that the completion handler +/// arguments should be passed additional values after the results of the +/// operation. +template +BOOST_ASIO_NODISCARD inline BOOST_ASIO_CONSTEXPR append_t< + typename decay::type, typename decay::type...> +append(BOOST_ASIO_MOVE_ARG(CompletionToken) completion_token, + BOOST_ASIO_MOVE_ARG(Values)... values) +{ + return append_t< + typename decay::type, typename decay::type...>( + BOOST_ASIO_MOVE_CAST(CompletionToken)(completion_token), + BOOST_ASIO_MOVE_CAST(Values)(values)...); +} + +} // namespace asio +} // namespace boost + +#include + +#include + +#endif // (defined(BOOST_ASIO_HAS_STD_TUPLE) + // && defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)) + // || defined(GENERATING_DOCUMENTATION) + +#endif // BOOST_ASIO_APPEND_HPP diff --git a/ThirdParty/include/boost/asio/as_tuple.hpp b/ThirdParty/include/boost/asio/as_tuple.hpp new file mode 100644 index 000000000..613fe1add --- /dev/null +++ b/ThirdParty/include/boost/asio/as_tuple.hpp @@ -0,0 +1,141 @@ +// +// as_tuple.hpp +// ~~~~~~~~~~~~ +// +// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef BOOST_ASIO_AS_TUPLE_HPP +#define BOOST_ASIO_AS_TUPLE_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include + +#if (defined(BOOST_ASIO_HAS_STD_TUPLE) \ + && defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)) \ + || defined(GENERATING_DOCUMENTATION) + +#include + +#include + +namespace boost { +namespace asio { + +/// A @ref completion_token adapter used to specify that the completion handler +/// arguments should be combined into a single tuple argument. +/** + * The as_tuple_t class is used to indicate that any arguments to the + * completion handler should be combined and passed as a single tuple argument. + * The arguments are first moved into a @c std::tuple and that tuple is then + * passed to the completion handler. + */ +template +class as_tuple_t +{ +public: + /// Tag type used to prevent the "default" constructor from being used for + /// conversions. + struct default_constructor_tag {}; + + /// Default constructor. + /** + * This constructor is only valid if the underlying completion token is + * default constructible and move constructible. The underlying completion + * token is itself defaulted as an argument to allow it to capture a source + * location. + */ + BOOST_ASIO_CONSTEXPR as_tuple_t( + default_constructor_tag = default_constructor_tag(), + CompletionToken token = CompletionToken()) + : token_(BOOST_ASIO_MOVE_CAST(CompletionToken)(token)) + { + } + + /// Constructor. + template + BOOST_ASIO_CONSTEXPR explicit as_tuple_t( + BOOST_ASIO_MOVE_ARG(T) completion_token) + : token_(BOOST_ASIO_MOVE_CAST(T)(completion_token)) + { + } + + /// Adapts an executor to add the @c as_tuple_t completion token as the + /// default. + template + struct executor_with_default : InnerExecutor + { + /// Specify @c as_tuple_t as the default completion token type. + typedef as_tuple_t default_completion_token_type; + + /// Construct the adapted executor from the inner executor type. + template + executor_with_default(const InnerExecutor1& ex, + typename constraint< + conditional< + !is_same::value, + is_convertible, + false_type + >::type::value + >::type = 0) BOOST_ASIO_NOEXCEPT + : InnerExecutor(ex) + { + } + }; + + /// Type alias to adapt an I/O object to use @c as_tuple_t as its + /// default completion token type. +#if defined(BOOST_ASIO_HAS_ALIAS_TEMPLATES) \ + || defined(GENERATING_DOCUMENTATION) + template + using as_default_on_t = typename T::template rebind_executor< + executor_with_default >::other; +#endif // defined(BOOST_ASIO_HAS_ALIAS_TEMPLATES) + // || defined(GENERATING_DOCUMENTATION) + + /// Function helper to adapt an I/O object to use @c as_tuple_t as its + /// default completion token type. + template + static typename decay::type::template rebind_executor< + executor_with_default::type::executor_type> + >::other + as_default_on(BOOST_ASIO_MOVE_ARG(T) object) + { + return typename decay::type::template rebind_executor< + executor_with_default::type::executor_type> + >::other(BOOST_ASIO_MOVE_CAST(T)(object)); + } + +//private: + CompletionToken token_; +}; + +/// Adapt a @ref completion_token to specify that the completion handler +/// arguments should be combined into a single tuple argument. +template +BOOST_ASIO_NODISCARD inline +BOOST_ASIO_CONSTEXPR as_tuple_t::type> +as_tuple(BOOST_ASIO_MOVE_ARG(CompletionToken) completion_token) +{ + return as_tuple_t::type>( + BOOST_ASIO_MOVE_CAST(CompletionToken)(completion_token)); +} + +} // namespace asio +} // namespace boost + +#include + +#include + +#endif // (defined(BOOST_ASIO_HAS_STD_TUPLE) + // && defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)) + // || defined(GENERATING_DOCUMENTATION) + +#endif // BOOST_ASIO_AS_TUPLE_HPP diff --git a/ThirdParty/include/boost/asio/associated_allocator.hpp b/ThirdParty/include/boost/asio/associated_allocator.hpp index 0735bb161..01c020269 100644 --- a/ThirdParty/include/boost/asio/associated_allocator.hpp +++ b/ThirdParty/include/boost/asio/associated_allocator.hpp @@ -2,7 +2,7 @@ // associated_allocator.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -17,15 +17,33 @@ #include #include +#include +#include #include #include namespace boost { namespace asio { + +template +struct associated_allocator; + namespace detail { -template +template +struct has_allocator_type : false_type +{ +}; + +template +struct has_allocator_type::type> + : true_type +{ +}; + +template struct associated_allocator_impl { typedef E type; @@ -48,6 +66,17 @@ struct associated_allocator_impl +struct associated_allocator_impl::value + >::type, + typename void_type< + typename associator::type + >::type> : associator +{ +}; + } // namespace detail /// Traits type used to obtain the allocator associated with an object. @@ -94,7 +123,7 @@ struct associated_allocator * @returns associated_allocator::get(t) */ template -inline typename associated_allocator::type +BOOST_ASIO_NODISCARD inline typename associated_allocator::type get_associated_allocator(const T& t) BOOST_ASIO_NOEXCEPT { return associated_allocator::get(t); @@ -105,7 +134,7 @@ get_associated_allocator(const T& t) BOOST_ASIO_NOEXCEPT * @returns associated_allocator::get(t, a) */ template -inline typename associated_allocator::type +BOOST_ASIO_NODISCARD inline typename associated_allocator::type get_associated_allocator(const T& t, const Allocator& a) BOOST_ASIO_NOEXCEPT { return associated_allocator::get(t, a); @@ -119,6 +148,29 @@ using associated_allocator_t #endif // defined(BOOST_ASIO_HAS_ALIAS_TEMPLATES) +#if defined(BOOST_ASIO_HAS_STD_REFERENCE_WRAPPER) \ + || defined(GENERATING_DOCUMENTATION) + +/// Specialisation of associated_allocator for @c std::reference_wrapper. +template +struct associated_allocator, Allocator> +{ + /// Forwards @c type to the associator specialisation for the unwrapped type + /// @c T. + typedef typename associated_allocator::type type; + + /// Forwards the request to get the allocator to the associator specialisation + /// for the unwrapped type @c T. + static type get(reference_wrapper t, + const Allocator& a = Allocator()) BOOST_ASIO_NOEXCEPT + { + return associated_allocator::get(t.get(), a); + } +}; + +#endif // defined(BOOST_ASIO_HAS_STD_REFERENCE_WRAPPER) + // || defined(GENERATING_DOCUMENTATION) + } // namespace asio } // namespace boost diff --git a/ThirdParty/include/boost/asio/associated_cancellation_slot.hpp b/ThirdParty/include/boost/asio/associated_cancellation_slot.hpp new file mode 100644 index 000000000..f3f52e733 --- /dev/null +++ b/ThirdParty/include/boost/asio/associated_cancellation_slot.hpp @@ -0,0 +1,180 @@ +// +// associated_cancellation_slot.hpp +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef BOOST_ASIO_ASSOCIATED_CANCELLATION_SLOT_HPP +#define BOOST_ASIO_ASSOCIATED_CANCELLATION_SLOT_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include +#include +#include +#include + +#include + +namespace boost { +namespace asio { + +template +struct associated_cancellation_slot; + +namespace detail { + +template +struct has_cancellation_slot_type : false_type +{ +}; + +template +struct has_cancellation_slot_type::type> + : true_type +{ +}; + +template +struct associated_cancellation_slot_impl +{ + typedef void asio_associated_cancellation_slot_is_unspecialised; + + typedef S type; + + static type get(const T&, const S& s = S()) BOOST_ASIO_NOEXCEPT + { + return s; + } +}; + +template +struct associated_cancellation_slot_impl::type> +{ + typedef typename T::cancellation_slot_type type; + + static type get(const T& t, const S& = S()) BOOST_ASIO_NOEXCEPT + { + return t.get_cancellation_slot(); + } +}; + +template +struct associated_cancellation_slot_impl::value + >::type, + typename void_type< + typename associator::type + >::type> : associator +{ +}; + +} // namespace detail + +/// Traits type used to obtain the cancellation_slot associated with an object. +/** + * A program may specialise this traits type if the @c T template parameter in + * the specialisation is a user-defined type. The template parameter @c + * CancellationSlot shall be a type meeting the CancellationSlot requirements. + * + * Specialisations shall meet the following requirements, where @c t is a const + * reference to an object of type @c T, and @c s is an object of type @c + * CancellationSlot. + * + * @li Provide a nested typedef @c type that identifies a type meeting the + * CancellationSlot requirements. + * + * @li Provide a noexcept static member function named @c get, callable as @c + * get(t) and with return type @c type. + * + * @li Provide a noexcept static member function named @c get, callable as @c + * get(t,s) and with return type @c type. + */ +template +struct associated_cancellation_slot +#if !defined(GENERATING_DOCUMENTATION) + : detail::associated_cancellation_slot_impl +#endif // !defined(GENERATING_DOCUMENTATION) +{ +#if defined(GENERATING_DOCUMENTATION) + /// If @c T has a nested type @c cancellation_slot_type, + /// T::cancellation_slot_type. Otherwise + /// @c CancellationSlot. + typedef see_below type; + + /// If @c T has a nested type @c cancellation_slot_type, returns + /// t.get_cancellation_slot(). Otherwise returns @c s. + static type get(const T& t, + const CancellationSlot& s = CancellationSlot()) BOOST_ASIO_NOEXCEPT; +#endif // defined(GENERATING_DOCUMENTATION) +}; + +/// Helper function to obtain an object's associated cancellation_slot. +/** + * @returns associated_cancellation_slot::get(t) + */ +template +BOOST_ASIO_NODISCARD inline typename associated_cancellation_slot::type +get_associated_cancellation_slot(const T& t) BOOST_ASIO_NOEXCEPT +{ + return associated_cancellation_slot::get(t); +} + +/// Helper function to obtain an object's associated cancellation_slot. +/** + * @returns associated_cancellation_slot::get(t, st) + */ +template +BOOST_ASIO_NODISCARD inline +typename associated_cancellation_slot::type +get_associated_cancellation_slot(const T& t, + const CancellationSlot& st) BOOST_ASIO_NOEXCEPT +{ + return associated_cancellation_slot::get(t, st); +} + +#if defined(BOOST_ASIO_HAS_ALIAS_TEMPLATES) + +template +using associated_cancellation_slot_t = + typename associated_cancellation_slot::type; + +#endif // defined(BOOST_ASIO_HAS_ALIAS_TEMPLATES) + +namespace detail { + +template +struct associated_cancellation_slot_forwarding_base +{ +}; + +template +struct associated_cancellation_slot_forwarding_base::asio_associated_cancellation_slot_is_unspecialised, + void + >::value + >::type> +{ + typedef void asio_associated_cancellation_slot_is_unspecialised; +}; + +} // namespace detail +} // namespace asio +} // namespace boost + +#include + +#endif // BOOST_ASIO_ASSOCIATED_CANCELLATION_SLOT_HPP diff --git a/ThirdParty/include/boost/asio/associated_executor.hpp b/ThirdParty/include/boost/asio/associated_executor.hpp index 555e46f18..02738aac8 100644 --- a/ThirdParty/include/boost/asio/associated_executor.hpp +++ b/ThirdParty/include/boost/asio/associated_executor.hpp @@ -2,7 +2,7 @@ // associated_executor.hpp // ~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -16,6 +16,8 @@ #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) #include +#include +#include #include #include #include @@ -25,9 +27,25 @@ namespace boost { namespace asio { + +template +struct associated_executor; + namespace detail { -template +template +struct has_executor_type : false_type +{ +}; + +template +struct has_executor_type::type> + : true_type +{ +}; + +template struct associated_executor_impl { typedef void asio_associated_executor_is_unspecialised; @@ -52,6 +70,17 @@ struct associated_executor_impl +struct associated_executor_impl::value + >::type, + typename void_type< + typename associator::type + >::type> : associator +{ +}; + } // namespace detail /// Traits type used to obtain the executor associated with an object. @@ -96,7 +125,7 @@ struct associated_executor * @returns associated_executor::get(t) */ template -inline typename associated_executor::type +BOOST_ASIO_NODISCARD inline typename associated_executor::type get_associated_executor(const T& t) BOOST_ASIO_NOEXCEPT { return associated_executor::get(t); @@ -107,11 +136,11 @@ get_associated_executor(const T& t) BOOST_ASIO_NOEXCEPT * @returns associated_executor::get(t, ex) */ template -inline typename associated_executor::type +BOOST_ASIO_NODISCARD inline typename associated_executor::type get_associated_executor(const T& t, const Executor& ex, - typename enable_if< + typename constraint< is_executor::value || execution::is_executor::value - >::type* = 0) BOOST_ASIO_NOEXCEPT + >::type = 0) BOOST_ASIO_NOEXCEPT { return associated_executor::get(t, ex); } @@ -122,11 +151,11 @@ get_associated_executor(const T& t, const Executor& ex, * ExecutionContext::executor_type>::get(t, ctx.get_executor()) */ template -inline typename associated_executor::type get_associated_executor(const T& t, ExecutionContext& ctx, - typename enable_if::value>::type* = 0) BOOST_ASIO_NOEXCEPT + typename constraint::value>::type = 0) BOOST_ASIO_NOEXCEPT { return associated_executor::get(t, ctx.get_executor()); @@ -160,6 +189,33 @@ struct associated_executor_forwarding_base +struct associated_executor, Executor> +#if !defined(GENERATING_DOCUMENTATION) + : detail::associated_executor_forwarding_base +#endif // !defined(GENERATING_DOCUMENTATION) +{ + /// Forwards @c type to the associator specialisation for the unwrapped type + /// @c T. + typedef typename associated_executor::type type; + + /// Forwards the request to get the executor to the associator specialisation + /// for the unwrapped type @c T. + static type get(reference_wrapper t, + const Executor& ex = Executor()) BOOST_ASIO_NOEXCEPT + { + return associated_executor::get(t.get(), ex); + } +}; + +#endif // defined(BOOST_ASIO_HAS_STD_REFERENCE_WRAPPER) + // || defined(GENERATING_DOCUMENTATION) + } // namespace asio } // namespace boost diff --git a/ThirdParty/include/boost/asio/associator.hpp b/ThirdParty/include/boost/asio/associator.hpp new file mode 100644 index 000000000..bc775b010 --- /dev/null +++ b/ThirdParty/include/boost/asio/associator.hpp @@ -0,0 +1,37 @@ +// +// associator.hpp +// ~~~~~~~~~~~~~~ +// +// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef BOOST_ASIO_ASSOCIATOR_HPP +#define BOOST_ASIO_ASSOCIATOR_HPP + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) + +#include + +#include + +namespace boost { +namespace asio { + +/// Used to generically specialise associators for a type. +template