mirror of
https://github.com/Vita3K/ext-boost.git
synced 2024-11-26 23:10:28 +00:00
update boost to 1.72.0 (#2)
- update extracting boost subset instruction - add extracting script for Linux
This commit is contained in:
parent
1c2451cd81
commit
fa7fbdc17e
17
.gitignore
vendored
17
.gitignore
vendored
@ -1,6 +1,19 @@
|
||||
b2
|
||||
# b2.exe
|
||||
b2.exe
|
||||
bin.v2
|
||||
bjam
|
||||
# bjam.exe
|
||||
bjam.exe
|
||||
bootstrap.log
|
||||
boost
|
||||
dist
|
||||
project-config.jam*
|
||||
stage
|
||||
stage_x64
|
||||
user-config.jam
|
||||
.settings
|
||||
.project
|
||||
.pydevproject
|
||||
|
||||
*.exe
|
||||
*.pdb
|
||||
*.obj
|
2
Jamroot
2
Jamroot
@ -144,7 +144,7 @@ import option ;
|
||||
import tools/boost\_install/boost-install ;
|
||||
|
||||
path-constant BOOST_ROOT : . ;
|
||||
constant BOOST_VERSION : 1.71.0 ;
|
||||
constant BOOST_VERSION : 1.72.0 ;
|
||||
constant BOOST_JAMROOT_MODULE : $(__name__) ;
|
||||
|
||||
boostcpp.set-version $(BOOST_VERSION) ;
|
||||
|
29
README.md
29
README.md
@ -1,24 +1,17 @@
|
||||
Boost libraries - trimmed down for Vita3K
|
||||
========================================
|
||||
# Boost libraries - trimmed down for Vita3K
|
||||
|
||||
This is a subset of Boost v1.67.0 generated using the bcp tool. To get a list of boost modules guaranteed to exist, check the build script.
|
||||
This is a subset of Boost v1.72.0 generated using the bcp tool. To get a list of boost modules guaranteed to exist, check the build script.
|
||||
Adapted from [citra-emu/ext-boost](https://github.com/citra-emu/ext-boost).
|
||||
|
||||
Updating this repo (on Windows)
|
||||
===============================
|
||||
## Updating this repo
|
||||
|
||||
To update the Boost version (or to add a new library) follow these steps:
|
||||
|
||||
- Download Boost and extract the package, then launch Powershell and `cd` to the `boost_1_xx_0` directory.
|
||||
- Build the `bcp` tool:
|
||||
```
|
||||
.\boostrap.bat
|
||||
.\b2 tools\bcp
|
||||
```
|
||||
|
||||
- Store the boost directory in a variable for later use: `$boost_dir = $pwd`.
|
||||
- `cd` to this repo's directory (`...\externals\boost\`)
|
||||
- Remove the existing boost from the repo: `rm -r boost` (This is only necessary if doing a Boost version upgrade, in case they removed any files in the new version.)
|
||||
- Run `.\build.cmd $boost_dir` to build a new trimmed down distro.
|
||||
- Copy the `tools/build/` directory from the untouched `boost_1_xx_0` zip to `./tools/build`. Alternatively we could include it with `bcp`'s files, but it would also include a bunch of build files (since we've built Boost build tools) that unecessarily increase the size.
|
||||
- Add/remove all files in git and commit.
|
||||
- Download [`boost`](https://boost.org) and extract the package.
|
||||
- Copy `update.sh` or `update.cmd` in this repo to extracted directory of `boost`.
|
||||
- `cd` to extracted `boost` directory and run `update` script. The trimed down version of `boost` will be in the `subsets-boost` directory.
|
||||
- Copy `update.sh`, `update.bat`, `.gitignore`, and `README.md` in this repo to another directory.
|
||||
- Remove all the files in this directory (except the `.git` directory).
|
||||
- Copy all files in `subsets-boost` to this repo directory.
|
||||
- Copy `update.sh`, `update.bat`, `.gitignore`, and `README.md` back to this repo directory.
|
||||
- Commit all changes.
|
@ -12,6 +12,7 @@
|
||||
#ifndef BOOST_ALGORITHM_ALL_OF_HPP
|
||||
#define BOOST_ALGORITHM_ALL_OF_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/range/begin.hpp>
|
||||
#include <boost/range/end.hpp>
|
||||
|
||||
|
@ -24,6 +24,66 @@
|
||||
namespace boost {
|
||||
namespace asio {
|
||||
|
||||
#if defined(BOOST_ASIO_HAS_CONCEPTS) \
|
||||
&& defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES) \
|
||||
&& defined(BOOST_ASIO_HAS_DECLTYPE)
|
||||
|
||||
namespace detail {
|
||||
|
||||
template <typename T>
|
||||
struct is_completion_signature : false_type
|
||||
{
|
||||
};
|
||||
|
||||
template <typename R, typename... Args>
|
||||
struct is_completion_signature<R(Args...)> : true_type
|
||||
{
|
||||
};
|
||||
|
||||
template <typename T, typename... Args>
|
||||
BOOST_ASIO_CONCEPT callable_with = requires(T t, Args&&... args)
|
||||
{
|
||||
t(static_cast<Args&&>(args)...);
|
||||
};
|
||||
|
||||
template <typename T, typename Signature>
|
||||
struct is_completion_handler_for : false_type
|
||||
{
|
||||
};
|
||||
|
||||
template <typename T, typename R, typename... Args>
|
||||
struct is_completion_handler_for<T, R(Args...)>
|
||||
: integral_constant<bool, (callable_with<T, Args...>)>
|
||||
{
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template <typename T>
|
||||
BOOST_ASIO_CONCEPT completion_signature =
|
||||
detail::is_completion_signature<T>::value;
|
||||
|
||||
#define BOOST_ASIO_COMPLETION_SIGNATURE \
|
||||
::boost::asio::completion_signature
|
||||
|
||||
template <typename T, completion_signature Signature>
|
||||
BOOST_ASIO_CONCEPT completion_handler_for =
|
||||
detail::is_completion_handler_for<T, Signature>::value;
|
||||
|
||||
#define BOOST_ASIO_COMPLETION_HANDLER_FOR(s) \
|
||||
::boost::asio::completion_handler_for<s>
|
||||
|
||||
#else // defined(BOOST_ASIO_HAS_CONCEPTS)
|
||||
// && defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
|
||||
// && defined(BOOST_ASIO_HAS_DECLTYPE)
|
||||
|
||||
#define BOOST_ASIO_COMPLETION_SIGNATURE typename
|
||||
#define BOOST_ASIO_COMPLETION_HANDLER_FOR(s) typename
|
||||
|
||||
#endif // defined(BOOST_ASIO_HAS_CONCEPTS)
|
||||
// && defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
|
||||
// && defined(BOOST_ASIO_HAS_DECLTYPE)
|
||||
|
||||
/// An interface for customising the behaviour of an initiating function.
|
||||
/**
|
||||
* The async_result traits class is used for determining:
|
||||
@ -42,7 +102,7 @@ namespace asio {
|
||||
* The primary template assumes that the CompletionToken is the completion
|
||||
* handler.
|
||||
*/
|
||||
template <typename CompletionToken, typename Signature>
|
||||
template <typename CompletionToken, BOOST_ASIO_COMPLETION_SIGNATURE Signature>
|
||||
class async_result
|
||||
{
|
||||
public:
|
||||
@ -68,12 +128,21 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
#if defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES) \
|
||||
|| defined(GENERATING_DOCUMENTATION)
|
||||
#if defined(GENERATING_DOCUMENTATION)
|
||||
|
||||
/// Initiate the asynchronous operation that will produce the result, and
|
||||
/// obtain the value to be returned from the initiating function.
|
||||
template <typename Initiation, typename RawCompletionToken, typename... Args>
|
||||
static return_type initiate(
|
||||
BOOST_ASIO_MOVE_ARG(Initiation) initiation,
|
||||
BOOST_ASIO_MOVE_ARG(RawCompletionToken) token,
|
||||
BOOST_ASIO_MOVE_ARG(Args)... args);
|
||||
|
||||
#elif defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
|
||||
|
||||
template <typename Initiation,
|
||||
BOOST_ASIO_COMPLETION_HANDLER_FOR(Signature) RawCompletionToken,
|
||||
typename... Args>
|
||||
static return_type initiate(
|
||||
BOOST_ASIO_MOVE_ARG(Initiation) initiation,
|
||||
BOOST_ASIO_MOVE_ARG(RawCompletionToken) token,
|
||||
@ -85,9 +154,9 @@ public:
|
||||
}
|
||||
|
||||
#else // defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
|
||||
// || defined(GENERATING_DOCUMENTATION)
|
||||
|
||||
template <typename Initiation, typename RawCompletionToken>
|
||||
template <typename Initiation,
|
||||
BOOST_ASIO_COMPLETION_HANDLER_FOR(Signature) RawCompletionToken>
|
||||
static return_type initiate(
|
||||
BOOST_ASIO_MOVE_ARG(Initiation) initiation,
|
||||
BOOST_ASIO_MOVE_ARG(RawCompletionToken) token)
|
||||
@ -97,7 +166,8 @@ public:
|
||||
}
|
||||
|
||||
#define BOOST_ASIO_PRIVATE_INITIATE_DEF(n) \
|
||||
template <typename Initiation, typename RawCompletionToken, \
|
||||
template <typename Initiation, \
|
||||
BOOST_ASIO_COMPLETION_HANDLER_FOR(Signature) RawCompletionToken, \
|
||||
BOOST_ASIO_VARIADIC_TPARAMS(n)> \
|
||||
static return_type initiate( \
|
||||
BOOST_ASIO_MOVE_ARG(Initiation) initiation, \
|
||||
@ -113,17 +183,26 @@ public:
|
||||
#undef BOOST_ASIO_PRIVATE_INITIATE_DEF
|
||||
|
||||
#endif // defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
|
||||
// || defined(GENERATING_DOCUMENTATION)
|
||||
|
||||
private:
|
||||
async_result(const async_result&) BOOST_ASIO_DELETED;
|
||||
async_result& operator=(const async_result&) BOOST_ASIO_DELETED;
|
||||
};
|
||||
|
||||
#if !defined(GENERATING_DOCUMENTATION)
|
||||
|
||||
template <BOOST_ASIO_COMPLETION_SIGNATURE Signature>
|
||||
class async_result<void, Signature>
|
||||
{
|
||||
// Empty.
|
||||
};
|
||||
|
||||
#endif // !defined(GENERATING_DOCUMENTATION)
|
||||
|
||||
/// Helper template to deduce the handler type from a CompletionToken, capture
|
||||
/// a local copy of the handler, and then create an async_result for the
|
||||
/// handler.
|
||||
template <typename CompletionToken, typename Signature>
|
||||
template <typename CompletionToken, BOOST_ASIO_COMPLETION_SIGNATURE Signature>
|
||||
struct async_completion
|
||||
{
|
||||
/// The real handler type to be used for the asynchronous operation.
|
||||
@ -233,22 +312,50 @@ struct async_result_has_initiate_memfn
|
||||
typename ::boost::asio::decay<ct>::type, sig>::completion_handler_type
|
||||
#endif
|
||||
|
||||
#if defined(GENERATION_DOCUMENTATION)
|
||||
# define BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ct, sig) \
|
||||
auto
|
||||
#elif defined(BOOST_ASIO_HAS_RETURN_TYPE_DEDUCTION)
|
||||
# define BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ct, sig) \
|
||||
auto
|
||||
#else
|
||||
# define BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ct, sig) \
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(ct, sig)
|
||||
#endif
|
||||
|
||||
#if defined(GENERATION_DOCUMENTATION)
|
||||
# define BOOST_ASIO_INITFN_DEDUCED_RESULT_TYPE(ct, sig, expr) \
|
||||
void_or_deduced
|
||||
#elif defined(BOOST_ASIO_HAS_DECLTYPE)
|
||||
# define BOOST_ASIO_INITFN_DEDUCED_RESULT_TYPE(ct, sig, expr) \
|
||||
decltype expr
|
||||
#else
|
||||
# define BOOST_ASIO_INITFN_DEDUCED_RESULT_TYPE(ct, sig, expr) \
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(ct, sig)
|
||||
#endif
|
||||
|
||||
#if defined(GENERATING_DOCUMENTATION)
|
||||
|
||||
template <typename CompletionToken, typename Signature,
|
||||
template <typename CompletionToken,
|
||||
completion_signature Signature,
|
||||
typename Initiation, typename... Args>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, Signature)
|
||||
async_initiate(BOOST_ASIO_MOVE_ARG(Initiation) initiation,
|
||||
void_or_deduced async_initiate(
|
||||
BOOST_ASIO_MOVE_ARG(Initiation) initiation,
|
||||
BOOST_ASIO_NONDEDUCED_MOVE_ARG(CompletionToken),
|
||||
BOOST_ASIO_MOVE_ARG(Args)... args);
|
||||
|
||||
#elif defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
|
||||
|
||||
template <typename CompletionToken, typename Signature,
|
||||
template <typename CompletionToken,
|
||||
BOOST_ASIO_COMPLETION_SIGNATURE Signature,
|
||||
typename Initiation, typename... Args>
|
||||
inline typename enable_if<
|
||||
detail::async_result_has_initiate_memfn<CompletionToken, Signature>::value,
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, Signature)>::type
|
||||
BOOST_ASIO_INITFN_DEDUCED_RESULT_TYPE(CompletionToken, Signature,
|
||||
(async_result<typename decay<CompletionToken>::type,
|
||||
Signature>::initiate(declval<BOOST_ASIO_MOVE_ARG(Initiation)>(),
|
||||
declval<BOOST_ASIO_MOVE_ARG(CompletionToken)>(),
|
||||
declval<BOOST_ASIO_MOVE_ARG(Args)>()...)))>::type
|
||||
async_initiate(BOOST_ASIO_MOVE_ARG(Initiation) initiation,
|
||||
BOOST_ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token,
|
||||
BOOST_ASIO_MOVE_ARG(Args)... args)
|
||||
@ -259,7 +366,8 @@ async_initiate(BOOST_ASIO_MOVE_ARG(Initiation) initiation,
|
||||
BOOST_ASIO_MOVE_CAST(Args)(args)...);
|
||||
}
|
||||
|
||||
template <typename CompletionToken, typename Signature,
|
||||
template <typename CompletionToken,
|
||||
BOOST_ASIO_COMPLETION_SIGNATURE Signature,
|
||||
typename Initiation, typename... Args>
|
||||
inline typename enable_if<
|
||||
!detail::async_result_has_initiate_memfn<CompletionToken, Signature>::value,
|
||||
@ -280,10 +388,15 @@ async_initiate(BOOST_ASIO_MOVE_ARG(Initiation) initiation,
|
||||
|
||||
#else // defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
|
||||
|
||||
template <typename CompletionToken, typename Signature, typename Initiation>
|
||||
template <typename CompletionToken,
|
||||
BOOST_ASIO_COMPLETION_SIGNATURE Signature,
|
||||
typename Initiation>
|
||||
inline typename enable_if<
|
||||
detail::async_result_has_initiate_memfn<CompletionToken, Signature>::value,
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, Signature)>::type
|
||||
BOOST_ASIO_INITFN_DEDUCED_RESULT_TYPE(CompletionToken, Signature,
|
||||
(async_result<typename decay<CompletionToken>::type,
|
||||
Signature>::initiate(declval<BOOST_ASIO_MOVE_ARG(Initiation)>(),
|
||||
declval<BOOST_ASIO_MOVE_ARG(CompletionToken)>())))>::type
|
||||
async_initiate(BOOST_ASIO_MOVE_ARG(Initiation) initiation,
|
||||
BOOST_ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token)
|
||||
{
|
||||
@ -292,7 +405,9 @@ async_initiate(BOOST_ASIO_MOVE_ARG(Initiation) initiation,
|
||||
BOOST_ASIO_MOVE_CAST(CompletionToken)(token));
|
||||
}
|
||||
|
||||
template <typename CompletionToken, typename Signature, typename Initiation>
|
||||
template <typename CompletionToken,
|
||||
BOOST_ASIO_COMPLETION_SIGNATURE Signature,
|
||||
typename Initiation>
|
||||
inline typename enable_if<
|
||||
!detail::async_result_has_initiate_memfn<CompletionToken, Signature>::value,
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, Signature)>::type
|
||||
@ -309,12 +424,17 @@ async_initiate(BOOST_ASIO_MOVE_ARG(Initiation) initiation,
|
||||
}
|
||||
|
||||
#define BOOST_ASIO_PRIVATE_INITIATE_DEF(n) \
|
||||
template <typename CompletionToken, typename Signature, \
|
||||
template <typename CompletionToken, \
|
||||
BOOST_ASIO_COMPLETION_SIGNATURE Signature, \
|
||||
typename Initiation, BOOST_ASIO_VARIADIC_TPARAMS(n)> \
|
||||
inline typename enable_if< \
|
||||
detail::async_result_has_initiate_memfn< \
|
||||
CompletionToken, Signature>::value, \
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, Signature)>::type \
|
||||
BOOST_ASIO_INITFN_DEDUCED_RESULT_TYPE(CompletionToken, Signature, \
|
||||
(async_result<typename decay<CompletionToken>::type, \
|
||||
Signature>::initiate(declval<BOOST_ASIO_MOVE_ARG(Initiation)>(), \
|
||||
declval<BOOST_ASIO_MOVE_ARG(CompletionToken)>(), \
|
||||
BOOST_ASIO_VARIADIC_MOVE_DECLVAL(n))))>::type \
|
||||
async_initiate(BOOST_ASIO_MOVE_ARG(Initiation) initiation, \
|
||||
BOOST_ASIO_NONDEDUCED_MOVE_ARG(CompletionToken) token, \
|
||||
BOOST_ASIO_VARIADIC_MOVE_PARAMS(n)) \
|
||||
@ -325,7 +445,8 @@ async_initiate(BOOST_ASIO_MOVE_ARG(Initiation) initiation,
|
||||
BOOST_ASIO_VARIADIC_MOVE_ARGS(n)); \
|
||||
} \
|
||||
\
|
||||
template <typename CompletionToken, typename Signature, \
|
||||
template <typename CompletionToken, \
|
||||
BOOST_ASIO_COMPLETION_SIGNATURE Signature, \
|
||||
typename Initiation, BOOST_ASIO_VARIADIC_TPARAMS(n)> \
|
||||
inline typename enable_if< \
|
||||
!detail::async_result_has_initiate_memfn< \
|
||||
@ -350,6 +471,114 @@ async_initiate(BOOST_ASIO_MOVE_ARG(Initiation) initiation,
|
||||
|
||||
#endif // defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
|
||||
|
||||
#if defined(BOOST_ASIO_HAS_CONCEPTS) \
|
||||
&& defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES) \
|
||||
&& defined(BOOST_ASIO_HAS_DECLTYPE)
|
||||
|
||||
namespace detail {
|
||||
|
||||
template <typename Signature>
|
||||
struct initiation_archetype
|
||||
{
|
||||
template <completion_handler_for<Signature> CompletionHandler>
|
||||
void operator()(CompletionHandler&&) const
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template <typename T, completion_signature Signature>
|
||||
BOOST_ASIO_CONCEPT completion_token_for = requires(T&& t)
|
||||
{
|
||||
async_initiate<T, Signature>(detail::initiation_archetype<Signature>{}, t);
|
||||
};
|
||||
|
||||
#define BOOST_ASIO_COMPLETION_TOKEN_FOR(s) \
|
||||
::boost::asio::completion_token_for<s>
|
||||
|
||||
#else // defined(BOOST_ASIO_HAS_CONCEPTS)
|
||||
// && defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
|
||||
// && defined(BOOST_ASIO_HAS_DECLTYPE)
|
||||
|
||||
#define BOOST_ASIO_COMPLETION_TOKEN_FOR(s) typename
|
||||
|
||||
#endif // defined(BOOST_ASIO_HAS_CONCEPTS)
|
||||
// && defined(BOOST_ASIO_HAS_VARIADIC_TEMPLATES)
|
||||
// && defined(BOOST_ASIO_HAS_DECLTYPE)
|
||||
|
||||
namespace detail {
|
||||
|
||||
template <typename>
|
||||
struct default_completion_token_check
|
||||
{
|
||||
typedef void type;
|
||||
};
|
||||
|
||||
template <typename T, typename = void>
|
||||
struct default_completion_token_impl
|
||||
{
|
||||
typedef void type;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct default_completion_token_impl<T,
|
||||
typename default_completion_token_check<
|
||||
typename T::default_completion_token_type>::type>
|
||||
{
|
||||
typedef typename T::default_completion_token_type type;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
#if defined(GENERATING_DOCUMENTATION)
|
||||
|
||||
/// Traits type used to determine the default completion token type associated
|
||||
/// with a type (such as an executor).
|
||||
/**
|
||||
* A program may specialise this traits type if the @c T template parameter in
|
||||
* the specialisation is a user-defined type.
|
||||
*
|
||||
* Specialisations of this trait may provide a nested typedef @c type, which is
|
||||
* a default-constructible completion token type.
|
||||
*/
|
||||
template <typename T>
|
||||
struct default_completion_token
|
||||
{
|
||||
/// If @c T has a nested type @c default_completion_token_type,
|
||||
/// <tt>T::default_completion_token_type</tt>. Otherwise the typedef @c type
|
||||
/// is not defined.
|
||||
typedef see_below type;
|
||||
};
|
||||
#else
|
||||
template <typename T>
|
||||
struct default_completion_token
|
||||
: detail::default_completion_token_impl<T>
|
||||
{
|
||||
};
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_ASIO_HAS_ALIAS_TEMPLATES)
|
||||
|
||||
template <typename T>
|
||||
using default_completion_token_t = typename default_completion_token<T>::type;
|
||||
|
||||
#endif // defined(BOOST_ASIO_HAS_ALIAS_TEMPLATES)
|
||||
|
||||
#if defined(BOOST_ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS)
|
||||
|
||||
#define BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(e) \
|
||||
= typename ::boost::asio::default_completion_token<e>::type
|
||||
#define BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(e) \
|
||||
= typename ::boost::asio::default_completion_token<e>::type()
|
||||
|
||||
#else // defined(BOOST_ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS)
|
||||
|
||||
#define BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(e)
|
||||
#define BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(e)
|
||||
|
||||
#endif // defined(BOOST_ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS)
|
||||
|
||||
} // namespace asio
|
||||
} // namespace boost
|
||||
|
||||
|
@ -249,7 +249,7 @@ public:
|
||||
* constructed using the @c basic_datagram_socket(const executor_type&)
|
||||
* constructor.
|
||||
*/
|
||||
basic_datagram_socket(basic_datagram_socket&& other)
|
||||
basic_datagram_socket(basic_datagram_socket&& other) BOOST_ASIO_NOEXCEPT
|
||||
: basic_socket<Protocol, Executor>(std::move(other))
|
||||
{
|
||||
}
|
||||
@ -448,15 +448,19 @@ public:
|
||||
* buffers in one go, and how to use it with arrays, boost::array or
|
||||
* std::vector.
|
||||
*/
|
||||
template <typename ConstBufferSequence, typename WriteHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
|
||||
template <typename ConstBufferSequence,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) WriteHandler
|
||||
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_send(const ConstBufferSequence& buffers,
|
||||
BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
|
||||
BOOST_ASIO_MOVE_ARG(WriteHandler) handler
|
||||
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
|
||||
{
|
||||
return async_initiate<WriteHandler,
|
||||
void (boost::system::error_code, std::size_t)>(
|
||||
initiate_async_send(), handler, this,
|
||||
initiate_async_send(this), handler,
|
||||
buffers, socket_base::message_flags(0));
|
||||
}
|
||||
|
||||
@ -488,16 +492,20 @@ public:
|
||||
* Use the async_send_to function to send data on an unconnected datagram
|
||||
* socket.
|
||||
*/
|
||||
template <typename ConstBufferSequence, typename WriteHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
|
||||
template <typename ConstBufferSequence,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) WriteHandler
|
||||
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_send(const ConstBufferSequence& buffers,
|
||||
socket_base::message_flags flags,
|
||||
BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
|
||||
BOOST_ASIO_MOVE_ARG(WriteHandler) handler
|
||||
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
|
||||
{
|
||||
return async_initiate<WriteHandler,
|
||||
void (boost::system::error_code, std::size_t)>(
|
||||
initiate_async_send(), handler, this, buffers, flags);
|
||||
initiate_async_send(this), handler, buffers, flags);
|
||||
}
|
||||
|
||||
/// Send a datagram to the specified endpoint.
|
||||
@ -625,16 +633,20 @@ public:
|
||||
* buffers in one go, and how to use it with arrays, boost::array or
|
||||
* std::vector.
|
||||
*/
|
||||
template <typename ConstBufferSequence, typename WriteHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
|
||||
template <typename ConstBufferSequence,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) WriteHandler
|
||||
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_send_to(const ConstBufferSequence& buffers,
|
||||
const endpoint_type& destination,
|
||||
BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
|
||||
BOOST_ASIO_MOVE_ARG(WriteHandler) handler
|
||||
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
|
||||
{
|
||||
return async_initiate<WriteHandler,
|
||||
void (boost::system::error_code, std::size_t)>(
|
||||
initiate_async_send_to(), handler, this, buffers,
|
||||
initiate_async_send_to(this), handler, buffers,
|
||||
destination, socket_base::message_flags(0));
|
||||
}
|
||||
|
||||
@ -665,16 +677,20 @@ public:
|
||||
* immediate completion, invocation of the handler will be performed in a
|
||||
* manner equivalent to using boost::asio::post().
|
||||
*/
|
||||
template <typename ConstBufferSequence, typename WriteHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler,
|
||||
template <typename ConstBufferSequence,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) WriteHandler
|
||||
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(WriteHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_send_to(const ConstBufferSequence& buffers,
|
||||
const endpoint_type& destination, socket_base::message_flags flags,
|
||||
BOOST_ASIO_MOVE_ARG(WriteHandler) handler)
|
||||
BOOST_ASIO_MOVE_ARG(WriteHandler) handler
|
||||
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
|
||||
{
|
||||
return async_initiate<WriteHandler,
|
||||
void (boost::system::error_code, std::size_t)>(
|
||||
initiate_async_send_to(), handler, this, buffers, destination, flags);
|
||||
initiate_async_send_to(this), handler, buffers, destination, flags);
|
||||
}
|
||||
|
||||
/// Receive some data on a connected socket.
|
||||
@ -802,15 +818,19 @@ public:
|
||||
* multiple buffers in one go, and how to use it with arrays, boost::array or
|
||||
* std::vector.
|
||||
*/
|
||||
template <typename MutableBufferSequence, typename ReadHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
|
||||
template <typename MutableBufferSequence,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) ReadHandler
|
||||
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_receive(const MutableBufferSequence& buffers,
|
||||
BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
|
||||
BOOST_ASIO_MOVE_ARG(ReadHandler) handler
|
||||
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
|
||||
{
|
||||
return async_initiate<ReadHandler,
|
||||
void (boost::system::error_code, std::size_t)>(
|
||||
initiate_async_receive(), handler, this,
|
||||
initiate_async_receive(this), handler,
|
||||
buffers, socket_base::message_flags(0));
|
||||
}
|
||||
|
||||
@ -842,16 +862,20 @@ public:
|
||||
* Use the async_receive_from function to receive data on an unconnected
|
||||
* datagram socket.
|
||||
*/
|
||||
template <typename MutableBufferSequence, typename ReadHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
|
||||
template <typename MutableBufferSequence,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) ReadHandler
|
||||
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_receive(const MutableBufferSequence& buffers,
|
||||
socket_base::message_flags flags,
|
||||
BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
|
||||
BOOST_ASIO_MOVE_ARG(ReadHandler) handler
|
||||
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
|
||||
{
|
||||
return async_initiate<ReadHandler,
|
||||
void (boost::system::error_code, std::size_t)>(
|
||||
initiate_async_receive(), handler, this, buffers, flags);
|
||||
initiate_async_receive(this), handler, buffers, flags);
|
||||
}
|
||||
|
||||
/// Receive a datagram with the endpoint of the sender.
|
||||
@ -979,16 +1003,20 @@ public:
|
||||
* multiple buffers in one go, and how to use it with arrays, boost::array or
|
||||
* std::vector.
|
||||
*/
|
||||
template <typename MutableBufferSequence, typename ReadHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
|
||||
template <typename MutableBufferSequence,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) ReadHandler
|
||||
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_receive_from(const MutableBufferSequence& buffers,
|
||||
endpoint_type& sender_endpoint,
|
||||
BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
|
||||
BOOST_ASIO_MOVE_ARG(ReadHandler) handler
|
||||
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
|
||||
{
|
||||
return async_initiate<ReadHandler,
|
||||
void (boost::system::error_code, std::size_t)>(
|
||||
initiate_async_receive_from(), handler, this, buffers,
|
||||
initiate_async_receive_from(this), handler, buffers,
|
||||
&sender_endpoint, socket_base::message_flags(0));
|
||||
}
|
||||
|
||||
@ -1021,25 +1049,42 @@ public:
|
||||
* immediate completion, invocation of the handler will be performed in a
|
||||
* manner equivalent to using boost::asio::post().
|
||||
*/
|
||||
template <typename MutableBufferSequence, typename ReadHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler,
|
||||
template <typename MutableBufferSequence,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
std::size_t)) ReadHandler
|
||||
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ReadHandler,
|
||||
void (boost::system::error_code, std::size_t))
|
||||
async_receive_from(const MutableBufferSequence& buffers,
|
||||
endpoint_type& sender_endpoint, socket_base::message_flags flags,
|
||||
BOOST_ASIO_MOVE_ARG(ReadHandler) handler)
|
||||
BOOST_ASIO_MOVE_ARG(ReadHandler) handler
|
||||
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
|
||||
{
|
||||
return async_initiate<ReadHandler,
|
||||
void (boost::system::error_code, std::size_t)>(
|
||||
initiate_async_receive_from(), handler,
|
||||
this, buffers, &sender_endpoint, flags);
|
||||
initiate_async_receive_from(this), handler,
|
||||
buffers, &sender_endpoint, flags);
|
||||
}
|
||||
|
||||
private:
|
||||
struct initiate_async_send
|
||||
{
|
||||
class initiate_async_send
|
||||
{
|
||||
public:
|
||||
typedef Executor executor_type;
|
||||
|
||||
explicit initiate_async_send(basic_datagram_socket* self)
|
||||
: self_(self)
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return self_->get_executor();
|
||||
}
|
||||
|
||||
template <typename WriteHandler, typename ConstBufferSequence>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(WriteHandler) handler,
|
||||
basic_datagram_socket* self, const ConstBufferSequence& buffers,
|
||||
const ConstBufferSequence& buffers,
|
||||
socket_base::message_flags flags) const
|
||||
{
|
||||
// If you get an error on the following line it means that your handler
|
||||
@ -1047,18 +1092,33 @@ private:
|
||||
BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
|
||||
|
||||
detail::non_const_lvalue<WriteHandler> handler2(handler);
|
||||
self->impl_.get_service().async_send(
|
||||
self->impl_.get_implementation(), buffers, flags,
|
||||
handler2.value, self->impl_.get_implementation_executor());
|
||||
self_->impl_.get_service().async_send(
|
||||
self_->impl_.get_implementation(), buffers, flags,
|
||||
handler2.value, self_->impl_.get_implementation_executor());
|
||||
}
|
||||
|
||||
private:
|
||||
basic_datagram_socket* self_;
|
||||
};
|
||||
|
||||
struct initiate_async_send_to
|
||||
class initiate_async_send_to
|
||||
{
|
||||
public:
|
||||
typedef Executor executor_type;
|
||||
|
||||
explicit initiate_async_send_to(basic_datagram_socket* self)
|
||||
: self_(self)
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return self_->get_executor();
|
||||
}
|
||||
|
||||
template <typename WriteHandler, typename ConstBufferSequence>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(WriteHandler) handler,
|
||||
basic_datagram_socket* self, const ConstBufferSequence& buffers,
|
||||
const endpoint_type& destination,
|
||||
const ConstBufferSequence& buffers, const endpoint_type& destination,
|
||||
socket_base::message_flags flags) const
|
||||
{
|
||||
// If you get an error on the following line it means that your handler
|
||||
@ -1066,17 +1126,33 @@ private:
|
||||
BOOST_ASIO_WRITE_HANDLER_CHECK(WriteHandler, handler) type_check;
|
||||
|
||||
detail::non_const_lvalue<WriteHandler> handler2(handler);
|
||||
self->impl_.get_service().async_send_to(
|
||||
self->impl_.get_implementation(), buffers, destination, flags,
|
||||
handler2.value, self->impl_.get_implementation_executor());
|
||||
self_->impl_.get_service().async_send_to(
|
||||
self_->impl_.get_implementation(), buffers, destination, flags,
|
||||
handler2.value, self_->impl_.get_implementation_executor());
|
||||
}
|
||||
|
||||
private:
|
||||
basic_datagram_socket* self_;
|
||||
};
|
||||
|
||||
struct initiate_async_receive
|
||||
class initiate_async_receive
|
||||
{
|
||||
public:
|
||||
typedef Executor executor_type;
|
||||
|
||||
explicit initiate_async_receive(basic_datagram_socket* self)
|
||||
: self_(self)
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return self_->get_executor();
|
||||
}
|
||||
|
||||
template <typename ReadHandler, typename MutableBufferSequence>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
|
||||
basic_datagram_socket* self, const MutableBufferSequence& buffers,
|
||||
const MutableBufferSequence& buffers,
|
||||
socket_base::message_flags flags) const
|
||||
{
|
||||
// If you get an error on the following line it means that your handler
|
||||
@ -1084,28 +1160,47 @@ private:
|
||||
BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
|
||||
|
||||
detail::non_const_lvalue<ReadHandler> handler2(handler);
|
||||
self->impl_.get_service().async_receive(
|
||||
self->impl_.get_implementation(), buffers, flags,
|
||||
handler2.value, self->impl_.get_implementation_executor());
|
||||
self_->impl_.get_service().async_receive(
|
||||
self_->impl_.get_implementation(), buffers, flags,
|
||||
handler2.value, self_->impl_.get_implementation_executor());
|
||||
}
|
||||
|
||||
private:
|
||||
basic_datagram_socket* self_;
|
||||
};
|
||||
|
||||
struct initiate_async_receive_from
|
||||
class initiate_async_receive_from
|
||||
{
|
||||
public:
|
||||
typedef Executor executor_type;
|
||||
|
||||
explicit initiate_async_receive_from(basic_datagram_socket* self)
|
||||
: self_(self)
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return self_->get_executor();
|
||||
}
|
||||
|
||||
template <typename ReadHandler, typename MutableBufferSequence>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(ReadHandler) handler,
|
||||
basic_datagram_socket* self, const MutableBufferSequence& buffers,
|
||||
endpoint_type* sender_endpoint, socket_base::message_flags flags) const
|
||||
const MutableBufferSequence& buffers, endpoint_type* sender_endpoint,
|
||||
socket_base::message_flags flags) const
|
||||
{
|
||||
// If you get an error on the following line it means that your handler
|
||||
// does not meet the documented type requirements for a ReadHandler.
|
||||
BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
|
||||
|
||||
detail::non_const_lvalue<ReadHandler> handler2(handler);
|
||||
self->impl_.get_service().async_receive_from(
|
||||
self->impl_.get_implementation(), buffers, *sender_endpoint, flags,
|
||||
handler2.value, self->impl_.get_implementation_executor());
|
||||
self_->impl_.get_service().async_receive_from(
|
||||
self_->impl_.get_implementation(), buffers, *sender_endpoint, flags,
|
||||
handler2.value, self_->impl_.get_implementation_executor());
|
||||
}
|
||||
|
||||
private:
|
||||
basic_datagram_socket* self_;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -295,7 +295,7 @@ public:
|
||||
* @note Following the move, the moved-from object is in the same state as if
|
||||
* constructed using the @c basic_socket(const executor_type&) constructor.
|
||||
*/
|
||||
basic_socket(basic_socket&& other)
|
||||
basic_socket(basic_socket&& other) BOOST_ASIO_NOEXCEPT
|
||||
: impl_(std::move(other.impl_))
|
||||
{
|
||||
}
|
||||
@ -940,11 +940,14 @@ public:
|
||||
* socket.async_connect(endpoint, connect_handler);
|
||||
* @endcode
|
||||
*/
|
||||
template <typename ConnectHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(ConnectHandler,
|
||||
template <
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code))
|
||||
ConnectHandler BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ConnectHandler,
|
||||
void (boost::system::error_code))
|
||||
async_connect(const endpoint_type& peer_endpoint,
|
||||
BOOST_ASIO_MOVE_ARG(ConnectHandler) handler)
|
||||
BOOST_ASIO_MOVE_ARG(ConnectHandler) handler
|
||||
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
|
||||
{
|
||||
boost::system::error_code open_ec;
|
||||
if (!is_open())
|
||||
@ -954,7 +957,7 @@ public:
|
||||
}
|
||||
|
||||
return async_initiate<ConnectHandler, void (boost::system::error_code)>(
|
||||
initiate_async_connect(), handler, this, peer_endpoint, open_ec);
|
||||
initiate_async_connect(this), handler, peer_endpoint, open_ec);
|
||||
}
|
||||
|
||||
/// Set an option on the socket.
|
||||
@ -1770,13 +1773,17 @@ public:
|
||||
* socket.async_wait(boost::asio::ip::tcp::socket::wait_read, wait_handler);
|
||||
* @endcode
|
||||
*/
|
||||
template <typename WaitHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(WaitHandler,
|
||||
template <
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code))
|
||||
WaitHandler BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(WaitHandler,
|
||||
void (boost::system::error_code))
|
||||
async_wait(wait_type w, BOOST_ASIO_MOVE_ARG(WaitHandler) handler)
|
||||
async_wait(wait_type w,
|
||||
BOOST_ASIO_MOVE_ARG(WaitHandler) handler
|
||||
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
|
||||
{
|
||||
return async_initiate<WaitHandler, void (boost::system::error_code)>(
|
||||
initiate_async_wait(), handler, this, w);
|
||||
initiate_async_wait(this), handler, w);
|
||||
}
|
||||
|
||||
protected:
|
||||
@ -1805,11 +1812,24 @@ private:
|
||||
basic_socket(const basic_socket&) BOOST_ASIO_DELETED;
|
||||
basic_socket& operator=(const basic_socket&) BOOST_ASIO_DELETED;
|
||||
|
||||
struct initiate_async_connect
|
||||
class initiate_async_connect
|
||||
{
|
||||
public:
|
||||
typedef Executor executor_type;
|
||||
|
||||
explicit initiate_async_connect(basic_socket* self)
|
||||
: self_(self)
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return self_->get_executor();
|
||||
}
|
||||
|
||||
template <typename ConnectHandler>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(ConnectHandler) handler,
|
||||
basic_socket* self, const endpoint_type& peer_endpoint,
|
||||
const endpoint_type& peer_endpoint,
|
||||
const boost::system::error_code& open_ec) const
|
||||
{
|
||||
// If you get an error on the following line it means that your handler
|
||||
@ -1818,35 +1838,53 @@ private:
|
||||
|
||||
if (open_ec)
|
||||
{
|
||||
boost::asio::post(self->impl_.get_executor(),
|
||||
boost::asio::post(self_->impl_.get_executor(),
|
||||
boost::asio::detail::bind_handler(
|
||||
BOOST_ASIO_MOVE_CAST(ConnectHandler)(handler), open_ec));
|
||||
}
|
||||
else
|
||||
{
|
||||
detail::non_const_lvalue<ConnectHandler> handler2(handler);
|
||||
self->impl_.get_service().async_connect(
|
||||
self->impl_.get_implementation(), peer_endpoint,
|
||||
handler2.value, self->impl_.get_implementation_executor());
|
||||
self_->impl_.get_service().async_connect(
|
||||
self_->impl_.get_implementation(), peer_endpoint,
|
||||
handler2.value, self_->impl_.get_implementation_executor());
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
basic_socket* self_;
|
||||
};
|
||||
|
||||
struct initiate_async_wait
|
||||
class initiate_async_wait
|
||||
{
|
||||
public:
|
||||
typedef Executor executor_type;
|
||||
|
||||
explicit initiate_async_wait(basic_socket* self)
|
||||
: self_(self)
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return self_->get_executor();
|
||||
}
|
||||
|
||||
template <typename WaitHandler>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(WaitHandler) handler,
|
||||
basic_socket* self, wait_type w) const
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(WaitHandler) handler, wait_type w) const
|
||||
{
|
||||
// If you get an error on the following line it means that your handler
|
||||
// does not meet the documented type requirements for a WaitHandler.
|
||||
BOOST_ASIO_WAIT_HANDLER_CHECK(WaitHandler, handler) type_check;
|
||||
|
||||
detail::non_const_lvalue<WaitHandler> handler2(handler);
|
||||
self->impl_.get_service().async_wait(
|
||||
self->impl_.get_implementation(), w, handler2.value,
|
||||
self->impl_.get_implementation_executor());
|
||||
self_->impl_.get_service().async_wait(
|
||||
self_->impl_.get_implementation(), w, handler2.value,
|
||||
self_->impl_.get_implementation_executor());
|
||||
}
|
||||
|
||||
private:
|
||||
basic_socket* self_;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -314,6 +314,42 @@
|
||||
# endif // !defined(BOOST_ASIO_DISABLE_ALIAS_TEMPLATES)
|
||||
#endif // !defined(BOOST_ASIO_HAS_ALIAS_TEMPLATES)
|
||||
|
||||
// Support return type deduction on compilers known to allow it.
|
||||
#if !defined(BOOST_ASIO_HAS_RETURN_TYPE_DEDUCTION)
|
||||
# if !defined(BOOST_ASIO_DISABLE_RETURN_TYPE_DEDUCTION)
|
||||
# if defined(__clang__)
|
||||
# if __has_feature(__cxx_return_type_deduction__)
|
||||
# define BOOST_ASIO_HAS_RETURN_TYPE_DEDUCTION 1
|
||||
# endif // __has_feature(__cxx_alias_templates__)
|
||||
# elif (__cplusplus >= 201402)
|
||||
# define BOOST_ASIO_HAS_RETURN_TYPE_DEDUCTION 1
|
||||
# elif defined(__cpp_return_type_deduction)
|
||||
# if (__cpp_return_type_deduction >= 201304)
|
||||
# define BOOST_ASIO_HAS_RETURN_TYPE_DEDUCTION 1
|
||||
# endif // (__cpp_return_type_deduction >= 201304)
|
||||
# endif // defined(__cpp_return_type_deduction)
|
||||
# endif // !defined(BOOST_ASIO_DISABLE_RETURN_TYPE_DEDUCTION)
|
||||
#endif // !defined(BOOST_ASIO_HAS_RETURN_TYPE_DEDUCTION)
|
||||
|
||||
// Support default function template arguments on compilers known to allow it.
|
||||
#if !defined(BOOST_ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS)
|
||||
# if !defined(BOOST_ASIO_DISABLE_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS)
|
||||
# if (__cplusplus >= 201103)
|
||||
# define BOOST_ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS 1
|
||||
# endif // (__cplusplus >= 201103)
|
||||
# endif // !defined(BOOST_ASIO_DISABLE_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS)
|
||||
#endif // !defined(BOOST_ASIO_HAS_DEFAULT_FUNCTION_TEMPLATE_ARGUMENTS)
|
||||
|
||||
// Support concepts on compilers known to allow them.
|
||||
#if !defined(BOOST_ASIO_HAS_CONCEPTS)
|
||||
# if !defined(BOOST_ASIO_DISABLE_CONCEPTS)
|
||||
# if __cpp_concepts
|
||||
# define BOOST_ASIO_HAS_CONCEPTS 1
|
||||
# define BOOST_ASIO_CONCEPT concept bool
|
||||
# endif // __cpp_concepts
|
||||
# endif // !defined(BOOST_ASIO_DISABLE_CONCEPTS)
|
||||
#endif // !defined(BOOST_ASIO_HAS_CONCEPTS)
|
||||
|
||||
// Standard library support for system errors.
|
||||
# if !defined(BOOST_ASIO_DISABLE_STD_SYSTEM_ERROR)
|
||||
# if defined(__clang__)
|
||||
|
@ -49,6 +49,7 @@ void reactive_socket_service_base::construct(
|
||||
void reactive_socket_service_base::base_move_construct(
|
||||
reactive_socket_service_base::base_implementation_type& impl,
|
||||
reactive_socket_service_base::base_implementation_type& other_impl)
|
||||
BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
impl.socket_ = other_impl.socket_;
|
||||
other_impl.socket_ = invalid_socket;
|
||||
|
@ -73,6 +73,7 @@ void win_iocp_socket_service_base::construct(
|
||||
void win_iocp_socket_service_base::base_move_construct(
|
||||
win_iocp_socket_service_base::base_implementation_type& impl,
|
||||
win_iocp_socket_service_base::base_implementation_type& other_impl)
|
||||
BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
impl.socket_ = other_impl.socket_;
|
||||
other_impl.socket_ = invalid_socket;
|
||||
|
@ -89,7 +89,7 @@ public:
|
||||
|
||||
// Move-construct a new socket implementation.
|
||||
void move_construct(implementation_type& impl,
|
||||
implementation_type& other_impl)
|
||||
implementation_type& other_impl) BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
this->base_move_construct(impl, other_impl);
|
||||
|
||||
|
@ -73,7 +73,7 @@ public:
|
||||
|
||||
// Move-construct a new socket implementation.
|
||||
BOOST_ASIO_DECL void base_move_construct(base_implementation_type& impl,
|
||||
base_implementation_type& other_impl);
|
||||
base_implementation_type& other_impl) BOOST_ASIO_NOEXCEPT;
|
||||
|
||||
// Move-assign from another socket implementation.
|
||||
BOOST_ASIO_DECL void base_move_assign(base_implementation_type& impl,
|
||||
|
@ -32,6 +32,7 @@
|
||||
# include <boost/type_traits/is_same.hpp>
|
||||
# include <boost/type_traits/remove_pointer.hpp>
|
||||
# include <boost/type_traits/remove_reference.hpp>
|
||||
# include <boost/utility/declval.hpp>
|
||||
# include <boost/utility/enable_if.hpp>
|
||||
# include <boost/utility/result_of.hpp>
|
||||
#endif // defined(BOOST_ASIO_HAS_TYPE_TRAITS)
|
||||
@ -43,6 +44,7 @@ namespace asio {
|
||||
using std::add_const;
|
||||
using std::conditional;
|
||||
using std::decay;
|
||||
using std::declval;
|
||||
using std::enable_if;
|
||||
using std::false_type;
|
||||
using std::integral_constant;
|
||||
@ -68,6 +70,7 @@ template <bool Condition, typename Type = void>
|
||||
struct enable_if : boost::enable_if_c<Condition, Type> {};
|
||||
using boost::conditional;
|
||||
using boost::decay;
|
||||
using boost::declval;
|
||||
using boost::false_type;
|
||||
using boost::integral_constant;
|
||||
using boost::is_base_of;
|
||||
|
@ -108,6 +108,24 @@
|
||||
BOOST_ASIO_MOVE_CAST(T3)(x3), BOOST_ASIO_MOVE_CAST(T4)(x4), \
|
||||
BOOST_ASIO_MOVE_CAST(T5)(x5)
|
||||
|
||||
# define BOOST_ASIO_VARIADIC_MOVE_DECLVAL(n) \
|
||||
BOOST_ASIO_VARIADIC_MOVE_DECLVAL_##n
|
||||
|
||||
# define BOOST_ASIO_VARIADIC_MOVE_DECLVAL_1 \
|
||||
declval<BOOST_ASIO_MOVE_ARG(T1)>()
|
||||
# define BOOST_ASIO_VARIADIC_MOVE_DECLVAL_2 \
|
||||
declval<BOOST_ASIO_MOVE_ARG(T1)>(), declval<BOOST_ASIO_MOVE_ARG(T2)>()
|
||||
# define BOOST_ASIO_VARIADIC_MOVE_DECLVAL_3 \
|
||||
declval<BOOST_ASIO_MOVE_ARG(T1)>(), declval<BOOST_ASIO_MOVE_ARG(T2)>(), \
|
||||
declval<BOOST_ASIO_MOVE_ARG(T3)>()
|
||||
# define BOOST_ASIO_VARIADIC_MOVE_DECLVAL_4 \
|
||||
declval<BOOST_ASIO_MOVE_ARG(T1)>(), declval<BOOST_ASIO_MOVE_ARG(T2)>(), \
|
||||
declval<BOOST_ASIO_MOVE_ARG(T3)>(), declval<BOOST_ASIO_MOVE_ARG(T4)>()
|
||||
# define BOOST_ASIO_VARIADIC_MOVE_DECLVAL_5 \
|
||||
declval<BOOST_ASIO_MOVE_ARG(T1)>(), declval<BOOST_ASIO_MOVE_ARG(T2)>(), \
|
||||
declval<BOOST_ASIO_MOVE_ARG(T3)>(), declval<BOOST_ASIO_MOVE_ARG(T4)>(), \
|
||||
declval<BOOST_ASIO_MOVE_ARG(T5)>()
|
||||
|
||||
# define BOOST_ASIO_VARIADIC_DECAY(n) \
|
||||
BOOST_ASIO_VARIADIC_DECAY_##n
|
||||
|
||||
|
@ -100,6 +100,7 @@ public:
|
||||
if (ec == boost::asio::error::connection_aborted
|
||||
&& !o->enable_connection_aborted_)
|
||||
{
|
||||
handler_work<Handler, IoExecutor>::start(o->handler_, o->io_executor_);
|
||||
o->reset();
|
||||
o->socket_service_.restart_accept_op(o->socket_,
|
||||
o->new_socket_, o->protocol_.family(),
|
||||
@ -229,6 +230,7 @@ public:
|
||||
if (ec == boost::asio::error::connection_aborted
|
||||
&& !o->enable_connection_aborted_)
|
||||
{
|
||||
handler_work<Handler, IoExecutor>::start(o->handler_, o->io_executor_);
|
||||
o->reset();
|
||||
o->socket_service_.restart_accept_op(o->socket_,
|
||||
o->new_socket_, o->protocol_.family(),
|
||||
|
@ -145,7 +145,7 @@ public:
|
||||
|
||||
// Move-construct a new socket implementation.
|
||||
void move_construct(implementation_type& impl,
|
||||
implementation_type& other_impl)
|
||||
implementation_type& other_impl) BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
this->base_move_construct(impl, other_impl);
|
||||
|
||||
|
@ -96,7 +96,7 @@ public:
|
||||
|
||||
// Move-construct a new socket implementation.
|
||||
BOOST_ASIO_DECL void base_move_construct(base_implementation_type& impl,
|
||||
base_implementation_type& other_impl);
|
||||
base_implementation_type& other_impl) BOOST_ASIO_NOEXCEPT;
|
||||
|
||||
// Move-assign from another socket implementation.
|
||||
BOOST_ASIO_DECL void base_move_assign(base_implementation_type& impl,
|
||||
|
@ -172,7 +172,7 @@ struct io_context::initiate_dispatch
|
||||
};
|
||||
|
||||
template <typename LegacyCompletionHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(LegacyCompletionHandler, void ())
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(LegacyCompletionHandler, void ())
|
||||
io_context::dispatch(BOOST_ASIO_MOVE_ARG(LegacyCompletionHandler) handler)
|
||||
{
|
||||
return async_initiate<LegacyCompletionHandler, void ()>(
|
||||
@ -211,7 +211,7 @@ struct io_context::initiate_post
|
||||
};
|
||||
|
||||
template <typename LegacyCompletionHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(LegacyCompletionHandler, void ())
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(LegacyCompletionHandler, void ())
|
||||
io_context::post(BOOST_ASIO_MOVE_ARG(LegacyCompletionHandler) handler)
|
||||
{
|
||||
return async_initiate<LegacyCompletionHandler, void ()>(
|
||||
|
@ -26,8 +26,9 @@ namespace boost {
|
||||
namespace asio {
|
||||
namespace detail {
|
||||
|
||||
struct initiate_post
|
||||
class initiate_post
|
||||
{
|
||||
public:
|
||||
template <typename CompletionHandler>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(CompletionHandler) handler) const
|
||||
{
|
||||
@ -41,42 +42,63 @@ struct initiate_post
|
||||
|
||||
ex.post(BOOST_ASIO_MOVE_CAST(CompletionHandler)(handler), alloc);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename CompletionHandler, typename Executor>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(CompletionHandler) handler,
|
||||
BOOST_ASIO_MOVE_ARG(Executor) ex) const
|
||||
template <typename Executor>
|
||||
class initiate_post_with_executor
|
||||
{
|
||||
public:
|
||||
typedef Executor executor_type;
|
||||
|
||||
explicit initiate_post_with_executor(const Executor& ex)
|
||||
: ex_(ex)
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return ex_;
|
||||
}
|
||||
|
||||
template <typename CompletionHandler>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(CompletionHandler) handler) const
|
||||
{
|
||||
typedef typename decay<CompletionHandler>::type DecayedHandler;
|
||||
|
||||
typename associated_allocator<DecayedHandler>::type alloc(
|
||||
(get_associated_allocator)(handler));
|
||||
|
||||
ex.post(detail::work_dispatcher<DecayedHandler>(
|
||||
ex_.post(detail::work_dispatcher<DecayedHandler>(
|
||||
BOOST_ASIO_MOVE_CAST(CompletionHandler)(handler)), alloc);
|
||||
}
|
||||
|
||||
private:
|
||||
Executor ex_;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template <typename CompletionToken>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) post(
|
||||
template <BOOST_ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) post(
|
||||
BOOST_ASIO_MOVE_ARG(CompletionToken) token)
|
||||
{
|
||||
return async_initiate<CompletionToken, void()>(
|
||||
detail::initiate_post(), token);
|
||||
}
|
||||
|
||||
template <typename Executor, typename CompletionToken>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) post(
|
||||
template <typename Executor,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) post(
|
||||
const Executor& ex, BOOST_ASIO_MOVE_ARG(CompletionToken) token,
|
||||
typename enable_if<is_executor<Executor>::value>::type*)
|
||||
{
|
||||
return async_initiate<CompletionToken, void()>(
|
||||
detail::initiate_post(), token, ex);
|
||||
detail::initiate_post_with_executor<Executor>(ex), token);
|
||||
}
|
||||
|
||||
template <typename ExecutionContext, typename CompletionToken>
|
||||
inline BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) post(
|
||||
template <typename ExecutionContext,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
|
||||
inline BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) post(
|
||||
ExecutionContext& ctx, BOOST_ASIO_MOVE_ARG(CompletionToken) token,
|
||||
typename enable_if<is_convertible<
|
||||
ExecutionContext&, execution_context&>::value>::type*)
|
||||
|
@ -533,7 +533,7 @@ public:
|
||||
* throws an exception.
|
||||
*/
|
||||
template <typename LegacyCompletionHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(LegacyCompletionHandler, void ())
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(LegacyCompletionHandler, void ())
|
||||
dispatch(BOOST_ASIO_MOVE_ARG(LegacyCompletionHandler) handler);
|
||||
|
||||
/// (Deprecated: Use boost::asio::post().) Request the io_context to invoke
|
||||
@ -560,7 +560,7 @@ public:
|
||||
* throws an exception.
|
||||
*/
|
||||
template <typename LegacyCompletionHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(LegacyCompletionHandler, void ())
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(LegacyCompletionHandler, void ())
|
||||
post(BOOST_ASIO_MOVE_ARG(LegacyCompletionHandler) handler);
|
||||
|
||||
/// (Deprecated: Use boost::asio::bind_executor().) Create a new handler that
|
||||
|
@ -183,7 +183,7 @@ public:
|
||||
* @code void handler(); @endcode
|
||||
*/
|
||||
template <typename LegacyCompletionHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(LegacyCompletionHandler, void ())
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(LegacyCompletionHandler, void ())
|
||||
dispatch(BOOST_ASIO_MOVE_ARG(LegacyCompletionHandler) handler)
|
||||
{
|
||||
return async_initiate<LegacyCompletionHandler, void ()>(
|
||||
@ -230,7 +230,7 @@ public:
|
||||
* @code void handler(); @endcode
|
||||
*/
|
||||
template <typename LegacyCompletionHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(LegacyCompletionHandler, void ())
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(LegacyCompletionHandler, void ())
|
||||
post(BOOST_ASIO_MOVE_ARG(LegacyCompletionHandler) handler)
|
||||
{
|
||||
return async_initiate<LegacyCompletionHandler, void ()>(
|
||||
|
@ -72,6 +72,14 @@ public:
|
||||
/// The type of the executor associated with the object.
|
||||
typedef Executor executor_type;
|
||||
|
||||
/// Rebinds the resolver type to another executor.
|
||||
template <typename Executor1>
|
||||
struct rebind_executor
|
||||
{
|
||||
/// The resolver type when rebound to the specified executor.
|
||||
typedef basic_resolver<InternetProtocol, Executor1> other;
|
||||
};
|
||||
|
||||
/// The protocol type.
|
||||
typedef InternetProtocol protocol_type;
|
||||
|
||||
@ -613,15 +621,19 @@ public:
|
||||
* A successful resolve operation is guaranteed to pass a non-empty range to
|
||||
* the handler.
|
||||
*/
|
||||
template <typename ResolveHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(ResolveHandler,
|
||||
template <
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
results_type)) ResolveHandler
|
||||
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ResolveHandler,
|
||||
void (boost::system::error_code, results_type))
|
||||
async_resolve(const query& q,
|
||||
BOOST_ASIO_MOVE_ARG(ResolveHandler) handler)
|
||||
BOOST_ASIO_MOVE_ARG(ResolveHandler) handler
|
||||
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
|
||||
{
|
||||
return boost::asio::async_initiate<ResolveHandler,
|
||||
void (boost::system::error_code, results_type)>(
|
||||
initiate_async_resolve(), handler, this, q);
|
||||
initiate_async_resolve(this), handler, q);
|
||||
}
|
||||
#endif // !defined(BOOST_ASIO_NO_DEPRECATED)
|
||||
|
||||
@ -667,12 +679,16 @@ public:
|
||||
* <tt>c:\\windows\\system32\\drivers\\etc\\services</tt>. Operating systems
|
||||
* may use additional locations when resolving service names.
|
||||
*/
|
||||
template <typename ResolveHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(ResolveHandler,
|
||||
template <
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
results_type)) ResolveHandler
|
||||
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ResolveHandler,
|
||||
void (boost::system::error_code, results_type))
|
||||
async_resolve(BOOST_ASIO_STRING_VIEW_PARAM host,
|
||||
BOOST_ASIO_STRING_VIEW_PARAM service,
|
||||
BOOST_ASIO_MOVE_ARG(ResolveHandler) handler)
|
||||
BOOST_ASIO_MOVE_ARG(ResolveHandler) handler
|
||||
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
|
||||
{
|
||||
return async_resolve(host, service, resolver_base::flags(),
|
||||
BOOST_ASIO_MOVE_CAST(ResolveHandler)(handler));
|
||||
@ -725,20 +741,24 @@ public:
|
||||
* <tt>c:\\windows\\system32\\drivers\\etc\\services</tt>. Operating systems
|
||||
* may use additional locations when resolving service names.
|
||||
*/
|
||||
template <typename ResolveHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(ResolveHandler,
|
||||
template <
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
results_type)) ResolveHandler
|
||||
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ResolveHandler,
|
||||
void (boost::system::error_code, results_type))
|
||||
async_resolve(BOOST_ASIO_STRING_VIEW_PARAM host,
|
||||
BOOST_ASIO_STRING_VIEW_PARAM service,
|
||||
resolver_base::flags resolve_flags,
|
||||
BOOST_ASIO_MOVE_ARG(ResolveHandler) handler)
|
||||
BOOST_ASIO_MOVE_ARG(ResolveHandler) handler
|
||||
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
|
||||
{
|
||||
basic_resolver_query<protocol_type> q(static_cast<std::string>(host),
|
||||
static_cast<std::string>(service), resolve_flags);
|
||||
|
||||
return boost::asio::async_initiate<ResolveHandler,
|
||||
void (boost::system::error_code, results_type)>(
|
||||
initiate_async_resolve(), handler, this, q);
|
||||
initiate_async_resolve(this), handler, q);
|
||||
}
|
||||
|
||||
/// Asynchronously perform forward resolution of a query to a list of entries.
|
||||
@ -786,12 +806,16 @@ public:
|
||||
* <tt>c:\\windows\\system32\\drivers\\etc\\services</tt>. Operating systems
|
||||
* may use additional locations when resolving service names.
|
||||
*/
|
||||
template <typename ResolveHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(ResolveHandler,
|
||||
template <
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
results_type)) ResolveHandler
|
||||
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ResolveHandler,
|
||||
void (boost::system::error_code, results_type))
|
||||
async_resolve(const protocol_type& protocol,
|
||||
BOOST_ASIO_STRING_VIEW_PARAM host, BOOST_ASIO_STRING_VIEW_PARAM service,
|
||||
BOOST_ASIO_MOVE_ARG(ResolveHandler) handler)
|
||||
BOOST_ASIO_MOVE_ARG(ResolveHandler) handler
|
||||
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
|
||||
{
|
||||
return async_resolve(protocol, host, service, resolver_base::flags(),
|
||||
BOOST_ASIO_MOVE_CAST(ResolveHandler)(handler));
|
||||
@ -847,13 +871,17 @@ public:
|
||||
* <tt>c:\\windows\\system32\\drivers\\etc\\services</tt>. Operating systems
|
||||
* may use additional locations when resolving service names.
|
||||
*/
|
||||
template <typename ResolveHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(ResolveHandler,
|
||||
template <
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
results_type)) ResolveHandler
|
||||
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ResolveHandler,
|
||||
void (boost::system::error_code, results_type))
|
||||
async_resolve(const protocol_type& protocol,
|
||||
BOOST_ASIO_STRING_VIEW_PARAM host, BOOST_ASIO_STRING_VIEW_PARAM service,
|
||||
resolver_base::flags resolve_flags,
|
||||
BOOST_ASIO_MOVE_ARG(ResolveHandler) handler)
|
||||
BOOST_ASIO_MOVE_ARG(ResolveHandler) handler
|
||||
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
|
||||
{
|
||||
basic_resolver_query<protocol_type> q(
|
||||
protocol, static_cast<std::string>(host),
|
||||
@ -861,7 +889,7 @@ public:
|
||||
|
||||
return boost::asio::async_initiate<ResolveHandler,
|
||||
void (boost::system::error_code, results_type)>(
|
||||
initiate_async_resolve(), handler, this, q);
|
||||
initiate_async_resolve(this), handler, q);
|
||||
}
|
||||
|
||||
/// Perform reverse resolution of an endpoint to a list of entries.
|
||||
@ -930,15 +958,19 @@ public:
|
||||
* A successful resolve operation is guaranteed to pass a non-empty range to
|
||||
* the handler.
|
||||
*/
|
||||
template <typename ResolveHandler>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(ResolveHandler,
|
||||
template <
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code,
|
||||
results_type)) ResolveHandler
|
||||
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type)>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(ResolveHandler,
|
||||
void (boost::system::error_code, results_type))
|
||||
async_resolve(const endpoint_type& e,
|
||||
BOOST_ASIO_MOVE_ARG(ResolveHandler) handler)
|
||||
BOOST_ASIO_MOVE_ARG(ResolveHandler) handler
|
||||
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type))
|
||||
{
|
||||
return boost::asio::async_initiate<ResolveHandler,
|
||||
void (boost::system::error_code, results_type)>(
|
||||
initiate_async_resolve(), handler, this, e);
|
||||
initiate_async_resolve(this), handler, e);
|
||||
}
|
||||
|
||||
private:
|
||||
@ -946,11 +978,24 @@ private:
|
||||
basic_resolver(const basic_resolver&) BOOST_ASIO_DELETED;
|
||||
basic_resolver& operator=(const basic_resolver&) BOOST_ASIO_DELETED;
|
||||
|
||||
struct initiate_async_resolve
|
||||
class initiate_async_resolve
|
||||
{
|
||||
public:
|
||||
typedef Executor executor_type;
|
||||
|
||||
explicit initiate_async_resolve(basic_resolver* self)
|
||||
: self_(self)
|
||||
{
|
||||
}
|
||||
|
||||
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return self_->get_executor();
|
||||
}
|
||||
|
||||
template <typename ResolveHandler, typename Query>
|
||||
void operator()(BOOST_ASIO_MOVE_ARG(ResolveHandler) handler,
|
||||
basic_resolver* self, const Query& q) const
|
||||
const Query& q) const
|
||||
{
|
||||
// If you get an error on the following line it means that your handler
|
||||
// does not meet the documented type requirements for a ResolveHandler.
|
||||
@ -958,10 +1003,13 @@ private:
|
||||
ResolveHandler, handler, results_type) type_check;
|
||||
|
||||
boost::asio::detail::non_const_lvalue<ResolveHandler> handler2(handler);
|
||||
self->impl_.get_service().async_resolve(
|
||||
self->impl_.get_implementation(), q, handler2.value,
|
||||
self->impl_.get_implementation_executor());
|
||||
self_->impl_.get_service().async_resolve(
|
||||
self_->impl_.get_implementation(), q, handler2.value,
|
||||
self_->impl_.get_implementation_executor());
|
||||
}
|
||||
|
||||
private:
|
||||
basic_resolver* self_;
|
||||
};
|
||||
|
||||
# if defined(BOOST_ASIO_WINDOWS_RUNTIME)
|
||||
|
@ -47,31 +47,31 @@ public:
|
||||
typedef basic_endpoint<udp> endpoint;
|
||||
|
||||
/// Construct to represent the IPv4 UDP protocol.
|
||||
static udp v4()
|
||||
static udp v4() BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return udp(BOOST_ASIO_OS_DEF(AF_INET));
|
||||
}
|
||||
|
||||
/// Construct to represent the IPv6 UDP protocol.
|
||||
static udp v6()
|
||||
static udp v6() BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return udp(BOOST_ASIO_OS_DEF(AF_INET6));
|
||||
}
|
||||
|
||||
/// Obtain an identifier for the type of the protocol.
|
||||
int type() const
|
||||
int type() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return BOOST_ASIO_OS_DEF(SOCK_DGRAM);
|
||||
}
|
||||
|
||||
/// Obtain an identifier for the protocol.
|
||||
int protocol() const
|
||||
int protocol() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return BOOST_ASIO_OS_DEF(IPPROTO_UDP);
|
||||
}
|
||||
|
||||
/// Obtain an identifier for the protocol family.
|
||||
int family() const
|
||||
int family() const BOOST_ASIO_NOEXCEPT
|
||||
{
|
||||
return family_;
|
||||
}
|
||||
@ -96,7 +96,7 @@ public:
|
||||
|
||||
private:
|
||||
// Construct with a specific family.
|
||||
explicit udp(int protocol_family)
|
||||
explicit udp(int protocol_family) BOOST_ASIO_NOEXCEPT
|
||||
: family_(protocol_family)
|
||||
{
|
||||
}
|
||||
|
@ -53,8 +53,8 @@ namespace asio {
|
||||
*
|
||||
* @li Returns <tt>result.get()</tt>.
|
||||
*/
|
||||
template <typename CompletionToken>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) post(
|
||||
template <BOOST_ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) post(
|
||||
BOOST_ASIO_MOVE_ARG(CompletionToken) token);
|
||||
|
||||
/// Submits a completion token or function object for execution.
|
||||
@ -90,18 +90,28 @@ BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) post(
|
||||
*
|
||||
* @li Returns <tt>result.get()</tt>.
|
||||
*/
|
||||
template <typename Executor, typename CompletionToken>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) post(
|
||||
const Executor& ex, BOOST_ASIO_MOVE_ARG(CompletionToken) token,
|
||||
template <typename Executor,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken
|
||||
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(Executor)>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) post(
|
||||
const Executor& ex,
|
||||
BOOST_ASIO_MOVE_ARG(CompletionToken) token
|
||||
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(Executor),
|
||||
typename enable_if<is_executor<Executor>::value>::type* = 0);
|
||||
|
||||
/// Submits a completion token or function object for execution.
|
||||
/**
|
||||
* @returns <tt>post(ctx.get_executor(), forward<CompletionToken>(token))</tt>.
|
||||
*/
|
||||
template <typename ExecutionContext, typename CompletionToken>
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken, void()) post(
|
||||
ExecutionContext& ctx, BOOST_ASIO_MOVE_ARG(CompletionToken) token,
|
||||
template <typename ExecutionContext,
|
||||
BOOST_ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken
|
||||
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
|
||||
typename ExecutionContext::executor_type)>
|
||||
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void()) post(
|
||||
ExecutionContext& ctx,
|
||||
BOOST_ASIO_MOVE_ARG(CompletionToken) token
|
||||
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(
|
||||
typename ExecutionContext::executor_type),
|
||||
typename enable_if<is_convertible<
|
||||
ExecutionContext&, execution_context&>::value>::type* = 0);
|
||||
|
||||
|
@ -26,8 +26,12 @@
|
||||
#define BOOST_ATOMIC_DETAIL_X86_HAS_CMPXCHG8B 1
|
||||
#endif
|
||||
|
||||
#if _MSC_VER >= 1500 && defined(_M_AMD64) && !defined(BOOST_ATOMIC_NO_CMPXCHG16B)
|
||||
#if !defined(BOOST_ATOMIC_NO_CMPXCHG16B)
|
||||
#if defined(__clang__) && (defined(_M_AMD64) || defined(__x86_64__)) && defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16)
|
||||
#define BOOST_ATOMIC_DETAIL_X86_HAS_CMPXCHG16B 1
|
||||
#elif _MSC_VER >= 1500 && defined(_M_AMD64)
|
||||
#define BOOST_ATOMIC_DETAIL_X86_HAS_CMPXCHG16B 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) && (defined(_M_AMD64) || (defined(_M_IX86) && defined(_M_IX86_FP) && _M_IX86_FP >= 2))
|
||||
|
@ -5,7 +5,7 @@
|
||||
*
|
||||
* Copyright (c) 2009 Helge Bahmann
|
||||
* Copyright (c) 2012 Tim Blechmann
|
||||
* Copyright (c) 2014 Andrey Semashev
|
||||
* Copyright (c) 2014, 2019 Andrey Semashev
|
||||
*/
|
||||
/*!
|
||||
* \file atomic/detail/ops_msvc_common.hpp
|
||||
@ -25,6 +25,8 @@
|
||||
// Define compiler barriers
|
||||
#if defined(__INTEL_COMPILER)
|
||||
#define BOOST_ATOMIC_DETAIL_COMPILER_BARRIER() __memory_barrier()
|
||||
#elif defined(__clang__)
|
||||
#define BOOST_ATOMIC_DETAIL_COMPILER_BARRIER() __atomic_signal_fence(__ATOMIC_SEQ_CST)
|
||||
#elif defined(_MSC_VER) && !defined(_WIN32_WCE)
|
||||
extern "C" void _ReadWriteBarrier(void);
|
||||
#pragma intrinsic(_ReadWriteBarrier)
|
||||
|
@ -15,7 +15,8 @@
|
||||
#define BOOST_ATOMIC_DETAIL_TYPE_TRAITS_IS_FLOATING_POINT_HPP_INCLUDED_
|
||||
|
||||
#include <boost/atomic/detail/config.hpp>
|
||||
#if !defined(BOOST_ATOMIC_DETAIL_NO_CXX11_BASIC_HDR_TYPE_TRAITS)
|
||||
// Some versions of libstdc++ don't consider __float128 a floating point type. Use Boost.TypeTraits because of that.
|
||||
#if !defined(BOOST_ATOMIC_DETAIL_NO_CXX11_BASIC_HDR_TYPE_TRAITS) && !defined(BOOST_HAS_FLOAT128)
|
||||
#include <type_traits>
|
||||
#else
|
||||
#include <boost/type_traits/is_floating_point.hpp>
|
||||
@ -29,7 +30,7 @@ namespace boost {
|
||||
namespace atomics {
|
||||
namespace detail {
|
||||
|
||||
#if !defined(BOOST_ATOMIC_DETAIL_NO_CXX11_BASIC_HDR_TYPE_TRAITS)
|
||||
#if !defined(BOOST_ATOMIC_DETAIL_NO_CXX11_BASIC_HDR_TYPE_TRAITS) && !defined(BOOST_HAS_FLOAT128)
|
||||
using std::is_floating_point;
|
||||
#else
|
||||
using boost::is_floating_point;
|
||||
|
@ -111,8 +111,8 @@
|
||||
// TR1 features:
|
||||
//
|
||||
#if (_MSC_VER >= 1700) && defined(_HAS_CXX17) && (_HAS_CXX17 > 0)
|
||||
// # define BOOST_HAS_TR1_HASH // don't know if this is true yet.
|
||||
// # define BOOST_HAS_TR1_TYPE_TRAITS // don't know if this is true yet.
|
||||
// # define BOOST_HAS_TR1_HASH // don't know if this is true yet.
|
||||
// # define BOOST_HAS_TR1_TYPE_TRAITS // don't know if this is true yet.
|
||||
# define BOOST_HAS_TR1_UNORDERED_MAP
|
||||
# define BOOST_HAS_TR1_UNORDERED_SET
|
||||
#endif
|
||||
|
@ -943,6 +943,14 @@ namespace std{ using ::type_info; }
|
||||
// ------------------ End of deprecated macros for 1.51 ---------------------------
|
||||
|
||||
|
||||
//
|
||||
// Helper macro for marking types and methods final
|
||||
//
|
||||
#if !defined(BOOST_NO_CXX11_FINAL)
|
||||
# define BOOST_FINAL final
|
||||
#else
|
||||
# define BOOST_FINAL
|
||||
#endif
|
||||
|
||||
//
|
||||
// Helper macros BOOST_NOEXCEPT, BOOST_NOEXCEPT_IF, BOOST_NOEXCEPT_EXPR
|
||||
@ -986,6 +994,15 @@ namespace std{ using ::type_info; }
|
||||
#define BOOST_CXX14_CONSTEXPR constexpr
|
||||
#endif
|
||||
|
||||
//
|
||||
// C++17 inline variables
|
||||
//
|
||||
#if !defined(BOOST_NO_CXX17_INLINE_VARIABLES)
|
||||
#define BOOST_INLINE_VARIABLE inline
|
||||
#else
|
||||
#define BOOST_INLINE_VARIABLE
|
||||
#endif
|
||||
|
||||
//
|
||||
// Unused variable/typedef workarounds:
|
||||
//
|
||||
@ -996,7 +1013,8 @@ namespace std{ using ::type_info; }
|
||||
// [[nodiscard]]:
|
||||
//
|
||||
#ifdef __has_cpp_attribute
|
||||
#if __has_cpp_attribute(nodiscard)
|
||||
// clang-6 accepts [[nodiscard]] with -std=c++14, but warns about it -pedantic
|
||||
#if __has_cpp_attribute(nodiscard) && !(defined(__clang__) && (__cplusplus < 201703L))
|
||||
# define BOOST_ATTRIBUTE_NODISCARD [[nodiscard]]
|
||||
#endif
|
||||
#if __has_cpp_attribute(no_unique_address) && !(defined(__GNUC__) && (__cplusplus < 201100))
|
||||
@ -1041,7 +1059,8 @@ namespace std{ using ::type_info; }
|
||||
#endif
|
||||
|
||||
// This is a catch all case for obsolete compilers / std libs:
|
||||
#if !defined(__has_include)
|
||||
#if !defined(_YVALS) && !defined(_CPPLIB_VER) // msvc std lib already configured
|
||||
#if (!defined(__has_include) || (__cplusplus < 201700))
|
||||
# define BOOST_NO_CXX17_HDR_OPTIONAL
|
||||
# define BOOST_NO_CXX17_HDR_STRING_VIEW
|
||||
# define BOOST_NO_CXX17_HDR_VARIANT
|
||||
@ -1056,6 +1075,7 @@ namespace std{ using ::type_info; }
|
||||
# define BOOST_NO_CXX17_HDR_VARIANT
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// Finish off with checks for macros that are depricated / no longer supported,
|
||||
|
@ -318,7 +318,7 @@ namespace std {
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" void bzero (void *, size_t); // FD_ZERO uses bzero() but doesn't include strings.h
|
||||
extern "C" void bzero (void *, size_t); // FD_ZERO uses bzero() but doesn't include strings.h
|
||||
|
||||
// Put the selfmade functions into the std-namespace, just in case
|
||||
namespace std {
|
||||
|
@ -97,7 +97,7 @@
|
||||
#endif
|
||||
#include <typeinfo>
|
||||
#if ( (!_HAS_EXCEPTIONS && !defined(__ghs__)) || (defined(__ghs__) && !_HAS_NAMESPACE) ) && !defined(__TI_COMPILER_VERSION__) && !defined(__VISUALDSPVERSION__) \
|
||||
&& !defined(__VXWORKS__)
|
||||
&& !defined(__VXWORKS__)
|
||||
# define BOOST_NO_STD_TYPEINFO
|
||||
#endif
|
||||
|
||||
@ -136,6 +136,7 @@
|
||||
# define BOOST_NO_CXX11_HDR_RATIO
|
||||
# define BOOST_NO_CXX11_HDR_THREAD
|
||||
# define BOOST_NO_CXX11_ATOMIC_SMART_PTR
|
||||
# define BOOST_NO_CXX11_HDR_EXCEPTION
|
||||
#endif
|
||||
|
||||
// C++0x headers implemented in 610 (as shipped by Microsoft)
|
||||
|
@ -39,6 +39,7 @@
|
||||
# define BOOST_NO_CXX11_HDR_CHRONO
|
||||
# define BOOST_NO_CXX11_HDR_CODECVT
|
||||
# define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
|
||||
# define BOOST_NO_CXX11_HDR_EXCEPTION
|
||||
# define BOOST_NO_CXX11_HDR_FORWARD_LIST
|
||||
# define BOOST_NO_CXX11_HDR_FUTURE
|
||||
# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
|
||||
|
@ -41,6 +41,7 @@
|
||||
|
||||
# define BOOST_NO_CXX11_HDR_CODECVT
|
||||
# define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
|
||||
# define BOOST_NO_CXX11_HDR_EXCEPTION
|
||||
# define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
|
||||
# define BOOST_NO_CXX11_HDR_MUTEX
|
||||
# define BOOST_NO_CXX11_HDR_RANDOM
|
||||
|
@ -125,7 +125,13 @@
|
||||
//
|
||||
#ifdef __clang__
|
||||
|
||||
#if __has_include(<experimental/memory_resource>)
|
||||
#if __has_include(<memory_resource>)
|
||||
# define BOOST_LIBSTDCXX_VERSION 90100
|
||||
#elif __has_include(<charconv>)
|
||||
# define BOOST_LIBSTDCXX_VERSION 80100
|
||||
#elif __has_include(<variant>)
|
||||
# define BOOST_LIBSTDCXX_VERSION 70100
|
||||
#elif __has_include(<experimental/memory_resource>)
|
||||
# define BOOST_LIBSTDCXX_VERSION 60100
|
||||
#elif __has_include(<experimental/any>)
|
||||
# define BOOST_LIBSTDCXX_VERSION 50100
|
||||
@ -231,6 +237,7 @@ extern "C" char *gets (char *__s);
|
||||
# define BOOST_NO_CXX11_HDR_RATIO
|
||||
# define BOOST_NO_CXX11_HDR_SYSTEM_ERROR
|
||||
# define BOOST_NO_CXX11_SMART_PTR
|
||||
# define BOOST_NO_CXX11_HDR_EXCEPTION
|
||||
#else
|
||||
# define BOOST_HAS_TR1_COMPLEX_INVERSE_TRIG
|
||||
# define BOOST_HAS_TR1_COMPLEX_OVERLOADS
|
||||
|
@ -51,6 +51,7 @@
|
||||
# define BOOST_NO_CXX11_HDR_ATOMIC
|
||||
# define BOOST_NO_CXX11_STD_ALIGN
|
||||
# define BOOST_NO_CXX11_ADDRESSOF
|
||||
# define BOOST_NO_CXX11_HDR_EXCEPTION
|
||||
|
||||
#if defined(__has_include)
|
||||
#if !__has_include(<shared_mutex>)
|
||||
|
@ -75,6 +75,7 @@
|
||||
# define BOOST_NO_CXX11_HDR_ATOMIC
|
||||
# define BOOST_NO_CXX11_STD_ALIGN
|
||||
# define BOOST_NO_CXX11_ADDRESSOF
|
||||
# define BOOST_NO_CXX11_HDR_EXCEPTION
|
||||
|
||||
#if defined(__has_include)
|
||||
#if !__has_include(<shared_mutex>)
|
||||
|
@ -187,6 +187,7 @@
|
||||
# define BOOST_NO_CXX11_HDR_ATOMIC
|
||||
# define BOOST_NO_CXX11_STD_ALIGN
|
||||
# define BOOST_NO_CXX11_ADDRESSOF
|
||||
# define BOOST_NO_CXX11_HDR_EXCEPTION
|
||||
|
||||
#if defined(__has_include)
|
||||
#if !__has_include(<shared_mutex>)
|
||||
|
@ -145,6 +145,7 @@
|
||||
# define BOOST_NO_CXX11_HDR_ATOMIC
|
||||
# define BOOST_NO_CXX11_STD_ALIGN
|
||||
# define BOOST_NO_CXX11_ADDRESSOF
|
||||
# define BOOST_NO_CXX11_HDR_EXCEPTION
|
||||
|
||||
#if defined(__has_include)
|
||||
#if !__has_include(<shared_mutex>)
|
||||
|
@ -235,6 +235,7 @@ namespace boost { using std::min; using std::max; }
|
||||
# define BOOST_NO_CXX11_HDR_ATOMIC
|
||||
# define BOOST_NO_CXX11_STD_ALIGN
|
||||
# define BOOST_NO_CXX11_ADDRESSOF
|
||||
# define BOOST_NO_CXX11_HDR_EXCEPTION
|
||||
|
||||
#if defined(__has_include)
|
||||
#if !__has_include(<shared_mutex>)
|
||||
|
@ -51,6 +51,7 @@
|
||||
# define BOOST_NO_CXX11_HDR_ATOMIC
|
||||
# define BOOST_NO_CXX11_STD_ALIGN
|
||||
# define BOOST_NO_CXX11_ADDRESSOF
|
||||
# define BOOST_NO_CXX11_HDR_EXCEPTION
|
||||
|
||||
#if defined(__has_include)
|
||||
#if !__has_include(<shared_mutex>)
|
||||
|
@ -50,6 +50,7 @@
|
||||
#define BOOST_NO_CXX11_HDR_CHRONO
|
||||
#define BOOST_NO_CXX11_HDR_ATOMIC
|
||||
#define BOOST_NO_CXX11_HDR_ARRAY
|
||||
#define BOOST_NO_CXX11_HDR_EXCEPTION
|
||||
#define BOOST_NO_CXX11_STD_ALIGN
|
||||
|
||||
#define BOOST_NO_CXX14_STD_EXCHANGE
|
||||
|
@ -1,8 +1,8 @@
|
||||
// boost/config/user.hpp ---------------------------------------------------//
|
||||
|
||||
// (C) Copyright John Maddock 2001.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// Do not check in modified versions of this file,
|
||||
|
@ -993,7 +993,7 @@ class map
|
||||
//!
|
||||
//! <b>Returns</b>: A node_type owning the element if found, otherwise an empty node_type.
|
||||
//!
|
||||
//! <b>Complexity</b>: log(a.size()).
|
||||
//! <b>Complexity</b>: log(size()).
|
||||
node_type extract(const key_type& k)
|
||||
{
|
||||
typename base_t::node_type base_nh(this->base_t::extract(k));
|
||||
@ -1026,7 +1026,7 @@ class map
|
||||
//!
|
||||
//! <b>Throws</b>: Nothing unless the comparison object throws.
|
||||
//!
|
||||
//! <b>Complexity</b>: N log(a.size() + N) (N has the value source.size())
|
||||
//! <b>Complexity</b>: N log(size() + N) (N has the value source.size())
|
||||
template<class C2>
|
||||
BOOST_CONTAINER_FORCEINLINE void merge(map<Key, T, C2, Allocator, Options>& source)
|
||||
{
|
||||
@ -1064,7 +1064,7 @@ class map
|
||||
BOOST_NOEXCEPT_IF( allocator_traits_type::is_always_equal::value
|
||||
&& boost::container::dtl::is_nothrow_swappable<Compare>::value )
|
||||
|
||||
//! <b>Effects</b>: erase(a.begin(),a.end()).
|
||||
//! <b>Effects</b>: erase(begin(),end()).
|
||||
//!
|
||||
//! <b>Postcondition</b>: size() == 0.
|
||||
//!
|
||||
@ -1152,13 +1152,13 @@ class map
|
||||
bool contains(const K& x) const;
|
||||
|
||||
//! <b>Returns</b>: An iterator pointing to the first element with key not less
|
||||
//! than k, or a.end() if such an element is not found.
|
||||
//! than x, or end() if such an element is not found.
|
||||
//!
|
||||
//! <b>Complexity</b>: Logarithmic
|
||||
iterator lower_bound(const key_type& x);
|
||||
|
||||
//! <b>Returns</b>: A const iterator pointing to the first element with key not
|
||||
//! less than k, or a.end() if such an element is not found.
|
||||
//! less than x, or end() if such an element is not found.
|
||||
//!
|
||||
//! <b>Complexity</b>: Logarithmic
|
||||
const_iterator lower_bound(const key_type& x) const;
|
||||
@ -1167,7 +1167,7 @@ class map
|
||||
//! key_compare::is_transparent exists.
|
||||
//!
|
||||
//! <b>Returns</b>: An iterator pointing to the first element with key not less
|
||||
//! than k, or a.end() if such an element is not found.
|
||||
//! than x, or end() if such an element is not found.
|
||||
//!
|
||||
//! <b>Complexity</b>: Logarithmic
|
||||
template<typename K>
|
||||
@ -1177,20 +1177,20 @@ class map
|
||||
//! key_compare::is_transparent exists.
|
||||
//!
|
||||
//! <b>Returns</b>: A const iterator pointing to the first element with key not
|
||||
//! less than k, or a.end() if such an element is not found.
|
||||
//! less than x, or end() if such an element is not found.
|
||||
//!
|
||||
//! <b>Complexity</b>: Logarithmic
|
||||
template<typename K>
|
||||
const_iterator lower_bound(const K& x) const;
|
||||
|
||||
//! <b>Returns</b>: An iterator pointing to the first element with key not less
|
||||
//! <b>Returns</b>: An iterator pointing to the first element with key greater
|
||||
//! than x, or end() if such an element is not found.
|
||||
//!
|
||||
//! <b>Complexity</b>: Logarithmic
|
||||
iterator upper_bound(const key_type& x);
|
||||
|
||||
//! <b>Returns</b>: A const iterator pointing to the first element with key not
|
||||
//! less than x, or end() if such an element is not found.
|
||||
//! <b>Returns</b>: A const iterator pointing to the first element with key
|
||||
//! greater than x, or end() if such an element is not found.
|
||||
//!
|
||||
//! <b>Complexity</b>: Logarithmic
|
||||
const_iterator upper_bound(const key_type& x) const;
|
||||
@ -1198,7 +1198,7 @@ class map
|
||||
//! <b>Requires</b>: This overload is available only if
|
||||
//! key_compare::is_transparent exists.
|
||||
//!
|
||||
//! <b>Returns</b>: An iterator pointing to the first element with key not less
|
||||
//! <b>Returns</b>: An iterator pointing to the first element with key greater
|
||||
//! than x, or end() if such an element is not found.
|
||||
//!
|
||||
//! <b>Complexity</b>: Logarithmic
|
||||
@ -1208,8 +1208,8 @@ class map
|
||||
//! <b>Requires</b>: This overload is available only if
|
||||
//! key_compare::is_transparent exists.
|
||||
//!
|
||||
//! <b>Returns</b>: A const iterator pointing to the first element with key not
|
||||
//! less than x, or end() if such an element is not found.
|
||||
//! <b>Returns</b>: A const iterator pointing to the first element with key
|
||||
//! greater than x, or end() if such an element is not found.
|
||||
//!
|
||||
//! <b>Complexity</b>: Logarithmic
|
||||
template<typename K>
|
||||
@ -1981,7 +1981,7 @@ class multimap
|
||||
//!
|
||||
//! <b>Throws</b>: Nothing unless the comparison object throws.
|
||||
//!
|
||||
//! <b>Complexity</b>: N log(a.size() + N) (N has the value source.size())
|
||||
//! <b>Complexity</b>: N log(size() + N) (N has the value source.size())
|
||||
template<class C2>
|
||||
BOOST_CONTAINER_FORCEINLINE void merge(multimap<Key, T, C2, Allocator, Options>& source)
|
||||
{
|
||||
@ -2087,13 +2087,13 @@ class multimap
|
||||
bool contains(const K& x) const;
|
||||
|
||||
//! <b>Returns</b>: An iterator pointing to the first element with key not less
|
||||
//! than k, or a.end() if such an element is not found.
|
||||
//! than x, or end() if such an element is not found.
|
||||
//!
|
||||
//! <b>Complexity</b>: Logarithmic
|
||||
iterator lower_bound(const key_type& x);
|
||||
|
||||
//! <b>Returns</b>: A const iterator pointing to the first element with key not
|
||||
//! less than k, or a.end() if such an element is not found.
|
||||
//! less than x, or end() if such an element is not found.
|
||||
//!
|
||||
//! <b>Complexity</b>: Logarithmic
|
||||
const_iterator lower_bound(const key_type& x) const;
|
||||
@ -2102,7 +2102,7 @@ class multimap
|
||||
//! key_compare::is_transparent exists.
|
||||
//!
|
||||
//! <b>Returns</b>: An iterator pointing to the first element with key not less
|
||||
//! than k, or a.end() if such an element is not found.
|
||||
//! than x, or end() if such an element is not found.
|
||||
//!
|
||||
//! <b>Complexity</b>: Logarithmic
|
||||
template<typename K>
|
||||
@ -2112,20 +2112,20 @@ class multimap
|
||||
//! key_compare::is_transparent exists.
|
||||
//!
|
||||
//! <b>Returns</b>: A const iterator pointing to the first element with key not
|
||||
//! less than k, or a.end() if such an element is not found.
|
||||
//! less than x, or end() if such an element is not found.
|
||||
//!
|
||||
//! <b>Complexity</b>: Logarithmic
|
||||
template<typename K>
|
||||
const_iterator lower_bound(const K& x) const;
|
||||
|
||||
//! <b>Returns</b>: An iterator pointing to the first element with key not less
|
||||
//! <b>Returns</b>: An iterator pointing to the first element with key greater
|
||||
//! than x, or end() if such an element is not found.
|
||||
//!
|
||||
//! <b>Complexity</b>: Logarithmic
|
||||
iterator upper_bound(const key_type& x);
|
||||
|
||||
//! <b>Returns</b>: A const iterator pointing to the first element with key not
|
||||
//! less than x, or end() if such an element is not found.
|
||||
//! <b>Returns</b>: A const iterator pointing to the first element with key
|
||||
//! greater than x, or end() if such an element is not found.
|
||||
//!
|
||||
//! <b>Complexity</b>: Logarithmic
|
||||
const_iterator upper_bound(const key_type& x) const;
|
||||
@ -2133,7 +2133,7 @@ class multimap
|
||||
//! <b>Requires</b>: This overload is available only if
|
||||
//! key_compare::is_transparent exists.
|
||||
//!
|
||||
//! <b>Returns</b>: An iterator pointing to the first element with key not less
|
||||
//! <b>Returns</b>: An iterator pointing to the first element with key greater
|
||||
//! than x, or end() if such an element is not found.
|
||||
//!
|
||||
//! <b>Complexity</b>: Logarithmic
|
||||
@ -2143,8 +2143,8 @@ class multimap
|
||||
//! <b>Requires</b>: This overload is available only if
|
||||
//! key_compare::is_transparent exists.
|
||||
//!
|
||||
//! <b>Returns</b>: A const iterator pointing to the first element with key not
|
||||
//! less than x, or end() if such an element is not found.
|
||||
//! <b>Returns</b>: A const iterator pointing to the first element with key
|
||||
//! greater than x, or end() if such an element is not found.
|
||||
//!
|
||||
//! <b>Complexity</b>: Logarithmic
|
||||
template<typename K>
|
||||
|
@ -712,7 +712,7 @@ class basic_string
|
||||
: base_t(a)
|
||||
{
|
||||
this->priv_terminate_string();
|
||||
if(a == this->alloc()){
|
||||
if(s.alloc() == this->alloc()){
|
||||
this->swap_data(s);
|
||||
}
|
||||
else{
|
||||
|
@ -19,7 +19,7 @@ Distributed under the Boost Software License, Version 1.0.
|
||||
namespace boost {
|
||||
|
||||
#if defined(BOOST_NO_EXCEPTIONS)
|
||||
void throw_exception(const std::exception&);
|
||||
BOOST_NORETURN void throw_exception(const std::exception&);
|
||||
#endif
|
||||
|
||||
namespace default_ {
|
||||
|
@ -110,14 +110,14 @@ inline void throw_failed_impl(char const * excep, char const * file, int line, c
|
||||
// In the comparisons below, it is possible that T and U are signed and unsigned integer types, which generates warnings in some compilers.
|
||||
// A cleaner fix would require common_type trait or some meta-programming, which would introduce a dependency on Boost.TypeTraits. To avoid
|
||||
// the dependency we just disable the warnings.
|
||||
#if defined(_MSC_VER)
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable: 4389)
|
||||
#elif defined(__clang__) && defined(__has_warning)
|
||||
#if defined(__clang__) && defined(__has_warning)
|
||||
# if __has_warning("-Wsign-compare")
|
||||
# pragma clang diagnostic push
|
||||
# pragma clang diagnostic ignored "-Wsign-compare"
|
||||
# endif
|
||||
#elif defined(_MSC_VER)
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable: 4389)
|
||||
#elif defined(__GNUC__) && !(defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC)) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 406
|
||||
# pragma GCC diagnostic push
|
||||
# pragma GCC diagnostic ignored "-Wsign-compare"
|
||||
@ -361,12 +361,12 @@ void test_all_with_impl(FormattedOutputFunction& output,
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
# pragma warning(pop)
|
||||
#elif defined(__clang__) && defined(__has_warning)
|
||||
#if defined(__clang__) && defined(__has_warning)
|
||||
# if __has_warning("-Wsign-compare")
|
||||
# pragma clang diagnostic pop
|
||||
# endif
|
||||
#elif defined(_MSC_VER)
|
||||
# pragma warning(pop)
|
||||
#elif defined(__GNUC__) && !(defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC)) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 406
|
||||
# pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
57
boost/core/nvp.hpp
Normal file
57
boost/core/nvp.hpp
Normal file
@ -0,0 +1,57 @@
|
||||
/*
|
||||
Copyright 2019 Glen Joseph Fernandes
|
||||
(glenjofe@gmail.com)
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#ifndef BOOST_CORE_NVP_HPP
|
||||
#define BOOST_CORE_NVP_HPP
|
||||
|
||||
#include <boost/core/addressof.hpp>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace serialization {
|
||||
|
||||
template<class T>
|
||||
class nvp {
|
||||
public:
|
||||
nvp(const char* n, T& v) BOOST_NOEXCEPT
|
||||
: n_(n)
|
||||
, v_(boost::addressof(v)) { }
|
||||
|
||||
const char* name() const BOOST_NOEXCEPT {
|
||||
return n_;
|
||||
}
|
||||
|
||||
T& value() const BOOST_NOEXCEPT {
|
||||
return *v_;
|
||||
}
|
||||
|
||||
const T& const_value() const BOOST_NOEXCEPT {
|
||||
return *v_;
|
||||
}
|
||||
|
||||
private:
|
||||
const char* n_;
|
||||
T* v_;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
inline const nvp<T>
|
||||
make_nvp(const char* n, T& v) BOOST_NOEXCEPT
|
||||
{
|
||||
return nvp<T>(n, v);
|
||||
}
|
||||
|
||||
} /* serialization */
|
||||
|
||||
using serialization::nvp;
|
||||
using serialization::make_nvp;
|
||||
|
||||
} /* boost */
|
||||
|
||||
#define BOOST_NVP(v) boost::make_nvp(BOOST_STRINGIZE(v), v)
|
||||
|
||||
#endif
|
@ -52,9 +52,9 @@
|
||||
// so we disable use of stdint.h when GLIBC does not define __GLIBC_HAVE_LONG_LONG.
|
||||
// See https://svn.boost.org/trac/boost/ticket/3548 and http://sources.redhat.com/bugzilla/show_bug.cgi?id=10990
|
||||
//
|
||||
#if defined(BOOST_HAS_STDINT_H) \
|
||||
&& (!defined(__GLIBC__) \
|
||||
|| defined(__GLIBC_HAVE_LONG_LONG) \
|
||||
#if defined(BOOST_HAS_STDINT_H) \
|
||||
&& (!defined(__GLIBC__) \
|
||||
|| defined(__GLIBC_HAVE_LONG_LONG) \
|
||||
|| (defined(__GLIBC__) && ((__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 17)))))
|
||||
|
||||
// The following #include is an implementation artifact; not part of interface.
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include <stdexcept>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/type_traits/conditional.hpp>
|
||||
#include <boost/type_traits/is_base_of.hpp>
|
||||
|
||||
namespace boost {
|
||||
@ -95,8 +95,8 @@ namespace CV {
|
||||
}
|
||||
};
|
||||
|
||||
typedef typename mpl::if_<
|
||||
is_base_of< std::exception, exception_type >,
|
||||
typedef typename conditional<
|
||||
is_base_of< std::exception, exception_type >::value,
|
||||
exception_type,
|
||||
exception_wrapper
|
||||
>::type actual_exception_type;
|
||||
|
@ -164,7 +164,7 @@ namespace date_time {
|
||||
}
|
||||
time_type operator+=(const time_duration_type& td)
|
||||
{
|
||||
time_ = (time_system::get_time_rep(date(), time_of_day() + td));
|
||||
time_ = time_system::add_time_duration(time_,td);
|
||||
return time_type(time_);
|
||||
}
|
||||
//! subtract time durations
|
||||
@ -174,7 +174,7 @@ namespace date_time {
|
||||
}
|
||||
time_type operator-=(const time_duration_type& td)
|
||||
{
|
||||
time_ = (time_system::get_time_rep(date(), time_of_day() - td));
|
||||
time_ = time_system::subtract_time_duration(time_, td);
|
||||
return time_type(time_);
|
||||
}
|
||||
|
||||
|
@ -144,10 +144,26 @@ namespace date_time {
|
||||
{
|
||||
return duration_type(ticks_ * (-1));
|
||||
}
|
||||
duration_type abs() const
|
||||
{
|
||||
if ( is_negative() )
|
||||
{
|
||||
return invert_sign();
|
||||
}
|
||||
return duration_type(ticks_);
|
||||
}
|
||||
bool is_negative() const
|
||||
{
|
||||
return ticks_ < 0;
|
||||
}
|
||||
bool is_zero() const
|
||||
{
|
||||
return ticks_ == 0;
|
||||
}
|
||||
bool is_positive() const
|
||||
{
|
||||
return ticks_ > 0;
|
||||
}
|
||||
bool operator<(const time_duration& rhs) const
|
||||
{
|
||||
return ticks_ < rhs.ticks_;
|
||||
|
@ -21,6 +21,7 @@ namespace boost { namespace exception_detail { using boost::shared_ptr; } }
|
||||
#endif
|
||||
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||
#pragma warning(push,1)
|
||||
#pragma warning(disable: 4265)
|
||||
#endif
|
||||
|
||||
namespace
|
||||
|
@ -14,7 +14,10 @@
|
||||
|
||||
# include <boost/filesystem/config.hpp>
|
||||
# include <boost/filesystem/path.hpp>
|
||||
# include <boost/filesystem/exception.hpp>
|
||||
# include <boost/filesystem/directory.hpp>
|
||||
# include <boost/filesystem/operations.hpp>
|
||||
# include <boost/filesystem/file_status.hpp>
|
||||
# include <boost/filesystem/convenience.hpp>
|
||||
# include <boost/filesystem/string_file.hpp>
|
||||
|
||||
|
620
boost/filesystem/directory.hpp
Normal file
620
boost/filesystem/directory.hpp
Normal file
@ -0,0 +1,620 @@
|
||||
// boost/filesystem/directory.hpp ---------------------------------------------------//
|
||||
|
||||
// Copyright Beman Dawes 2002-2009
|
||||
// Copyright Jan Langer 2002
|
||||
// Copyright Dietmar Kuehl 2001
|
||||
// Copyright Vladimir Prus 2002
|
||||
// Copyright Andrey Semashev 2019
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
// Library home page: http://www.boost.org/libs/filesystem
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
#ifndef BOOST_FILESYSTEM3_DIRECTORY_HPP
|
||||
#define BOOST_FILESYSTEM3_DIRECTORY_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
# if defined( BOOST_NO_STD_WSTRING )
|
||||
# error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
|
||||
# endif
|
||||
|
||||
#include <boost/filesystem/config.hpp>
|
||||
#include <boost/filesystem/path.hpp>
|
||||
#include <boost/filesystem/file_status.hpp>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility> // std::move
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/core/scoped_enum.hpp>
|
||||
#include <boost/detail/bitmask.hpp>
|
||||
#include <boost/system/error_code.hpp>
|
||||
#include <boost/smart_ptr/intrusive_ptr.hpp>
|
||||
#include <boost/smart_ptr/intrusive_ref_counter.hpp>
|
||||
#include <boost/iterator/iterator_facade.hpp>
|
||||
#include <boost/iterator/iterator_categories.hpp>
|
||||
|
||||
#include <boost/config/abi_prefix.hpp> // must be the last #include
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
namespace boost {
|
||||
namespace filesystem {
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
// //
|
||||
// directory_entry //
|
||||
// //
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
// GCC has a problem with a member function named path within a namespace or
|
||||
// sub-namespace that also has a class named path. The workaround is to always
|
||||
// fully qualify the name path when it refers to the class name.
|
||||
|
||||
class directory_entry
|
||||
{
|
||||
public:
|
||||
typedef boost::filesystem::path::value_type value_type; // enables class path ctor taking directory_entry
|
||||
|
||||
directory_entry() BOOST_NOEXCEPT {}
|
||||
explicit directory_entry(const boost::filesystem::path& p) :
|
||||
m_path(p), m_status(file_status()), m_symlink_status(file_status())
|
||||
{
|
||||
}
|
||||
directory_entry(const boost::filesystem::path& p,
|
||||
file_status st, file_status symlink_st = file_status()) :
|
||||
m_path(p), m_status(st), m_symlink_status(symlink_st)
|
||||
{
|
||||
}
|
||||
|
||||
directory_entry(const directory_entry& rhs) :
|
||||
m_path(rhs.m_path), m_status(rhs.m_status), m_symlink_status(rhs.m_symlink_status)
|
||||
{
|
||||
}
|
||||
|
||||
directory_entry& operator=(const directory_entry& rhs)
|
||||
{
|
||||
m_path = rhs.m_path;
|
||||
m_status = rhs.m_status;
|
||||
m_symlink_status = rhs.m_symlink_status;
|
||||
return *this;
|
||||
}
|
||||
|
||||
// As of October 2015 the interaction between noexcept and =default is so troublesome
|
||||
// for VC++, GCC, and probably other compilers, that =default is not used with noexcept
|
||||
// functions. GCC is not even consistent for the same release on different platforms.
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
directory_entry(directory_entry&& rhs) BOOST_NOEXCEPT :
|
||||
m_path(std::move(rhs.m_path)), m_status(std::move(rhs.m_status)), m_symlink_status(std::move(rhs.m_symlink_status))
|
||||
{
|
||||
}
|
||||
directory_entry& operator=(directory_entry&& rhs) BOOST_NOEXCEPT
|
||||
{
|
||||
m_path = std::move(rhs.m_path);
|
||||
m_status = std::move(rhs.m_status);
|
||||
m_symlink_status = std::move(rhs.m_symlink_status);
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
|
||||
void assign(const boost::filesystem::path& p,
|
||||
file_status st = file_status(), file_status symlink_st = file_status())
|
||||
{
|
||||
m_path = p;
|
||||
m_status = st;
|
||||
m_symlink_status = symlink_st;
|
||||
}
|
||||
|
||||
void replace_filename(const boost::filesystem::path& p,
|
||||
file_status st = file_status(), file_status symlink_st = file_status())
|
||||
{
|
||||
m_path.remove_filename();
|
||||
m_path /= p;
|
||||
m_status = st;
|
||||
m_symlink_status = symlink_st;
|
||||
}
|
||||
|
||||
# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
|
||||
void replace_leaf(const boost::filesystem::path& p, file_status st, file_status symlink_st)
|
||||
{
|
||||
replace_filename(p, st, symlink_st);
|
||||
}
|
||||
# endif
|
||||
|
||||
const boost::filesystem::path& path() const BOOST_NOEXCEPT { return m_path; }
|
||||
operator const boost::filesystem::path&() const BOOST_NOEXCEPT { return m_path; }
|
||||
file_status status() const { return get_status(); }
|
||||
file_status status(system::error_code& ec) const BOOST_NOEXCEPT { return get_status(&ec); }
|
||||
file_status symlink_status() const { return get_symlink_status(); }
|
||||
file_status symlink_status(system::error_code& ec) const BOOST_NOEXCEPT { return get_symlink_status(&ec); }
|
||||
|
||||
bool operator==(const directory_entry& rhs) const BOOST_NOEXCEPT { return m_path == rhs.m_path; }
|
||||
bool operator!=(const directory_entry& rhs) const BOOST_NOEXCEPT { return m_path != rhs.m_path; }
|
||||
bool operator< (const directory_entry& rhs) const BOOST_NOEXCEPT { return m_path < rhs.m_path; }
|
||||
bool operator<=(const directory_entry& rhs) const BOOST_NOEXCEPT { return m_path <= rhs.m_path; }
|
||||
bool operator> (const directory_entry& rhs) const BOOST_NOEXCEPT { return m_path > rhs.m_path; }
|
||||
bool operator>=(const directory_entry& rhs) const BOOST_NOEXCEPT { return m_path >= rhs.m_path; }
|
||||
|
||||
private:
|
||||
BOOST_FILESYSTEM_DECL file_status get_status(system::error_code* ec=0) const;
|
||||
BOOST_FILESYSTEM_DECL file_status get_symlink_status(system::error_code* ec=0) const;
|
||||
|
||||
private:
|
||||
boost::filesystem::path m_path;
|
||||
mutable file_status m_status; // stat()-like
|
||||
mutable file_status m_symlink_status; // lstat()-like
|
||||
}; // directory_entry
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
// //
|
||||
// directory_entry overloads //
|
||||
// //
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
// Without these functions, calling (for example) 'is_directory' with a 'directory_entry' results in:
|
||||
// - a conversion to 'path' using 'operator const boost::filesystem::path&()',
|
||||
// - then a call to 'is_directory(const path& p)' which recomputes the status with 'detail::status(p)'.
|
||||
//
|
||||
// These functions avoid a costly recomputation of the status if one calls 'is_directory(e)' instead of 'is_directory(e.status)'
|
||||
|
||||
inline file_status status (const directory_entry& e) BOOST_NOEXCEPT { return e.status(); }
|
||||
inline bool type_present (const directory_entry& e) BOOST_NOEXCEPT { return filesystem::type_present(e.status()); }
|
||||
inline bool status_known (const directory_entry& e) BOOST_NOEXCEPT { return filesystem::status_known(e.status()); }
|
||||
inline bool exists (const directory_entry& e) BOOST_NOEXCEPT { return filesystem::exists(e.status()); }
|
||||
inline bool is_regular_file(const directory_entry& e) BOOST_NOEXCEPT { return filesystem::is_regular_file(e.status()); }
|
||||
inline bool is_directory (const directory_entry& e) BOOST_NOEXCEPT { return filesystem::is_directory(e.status()); }
|
||||
inline bool is_symlink (const directory_entry& e) BOOST_NOEXCEPT { return filesystem::is_symlink(e.status()); }
|
||||
inline bool is_other (const directory_entry& e) BOOST_NOEXCEPT { return filesystem::is_other(e.status()); }
|
||||
#ifndef BOOST_FILESYSTEM_NO_DEPRECATED
|
||||
inline bool is_regular (const directory_entry& e) BOOST_NOEXCEPT { return filesystem::is_regular(e.status()); }
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
// //
|
||||
// directory_iterator helpers //
|
||||
// //
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(directory_options, unsigned int)
|
||||
{
|
||||
none = 0u,
|
||||
skip_permission_denied = 1u, // if a directory cannot be opened because of insufficient permissions, pretend that the directory is empty
|
||||
follow_directory_symlink = 1u << 1, // recursive_directory_iterator: follow directory symlinks
|
||||
skip_dangling_symlinks = 1u << 2, // non-standard extension for recursive_directory_iterator: don't follow dangling directory symlinks,
|
||||
pop_on_error = 1u << 3, // non-standard extension for recursive_directory_iterator: instead of producing an end iterator on errors,
|
||||
// repeatedly invoke pop() until it succeeds or the iterator becomes equal to end iterator
|
||||
_detail_no_push = 1u << 4 // internal use only
|
||||
}
|
||||
BOOST_SCOPED_ENUM_DECLARE_END(directory_options)
|
||||
|
||||
BOOST_BITMASK(BOOST_SCOPED_ENUM_NATIVE(directory_options))
|
||||
|
||||
class directory_iterator;
|
||||
|
||||
namespace detail {
|
||||
|
||||
BOOST_FILESYSTEM_DECL
|
||||
system::error_code dir_itr_close(// never throws()
|
||||
void*& handle
|
||||
#if defined(BOOST_POSIX_API)
|
||||
, void*& buffer
|
||||
#endif
|
||||
) BOOST_NOEXCEPT;
|
||||
|
||||
struct dir_itr_imp :
|
||||
public boost::intrusive_ref_counter< dir_itr_imp >
|
||||
{
|
||||
directory_entry dir_entry;
|
||||
void* handle;
|
||||
|
||||
#if defined(BOOST_POSIX_API)
|
||||
void* buffer; // see dir_itr_increment implementation
|
||||
#endif
|
||||
|
||||
dir_itr_imp() BOOST_NOEXCEPT :
|
||||
handle(0)
|
||||
#if defined(BOOST_POSIX_API)
|
||||
, buffer(0)
|
||||
#endif
|
||||
{
|
||||
}
|
||||
|
||||
~dir_itr_imp() BOOST_NOEXCEPT
|
||||
{
|
||||
dir_itr_close(handle
|
||||
#if defined(BOOST_POSIX_API)
|
||||
, buffer
|
||||
#endif
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
// see path::iterator: comment below
|
||||
BOOST_FILESYSTEM_DECL void directory_iterator_construct(directory_iterator& it, const path& p, unsigned int opts, system::error_code* ec);
|
||||
BOOST_FILESYSTEM_DECL void directory_iterator_increment(directory_iterator& it, system::error_code* ec);
|
||||
|
||||
} // namespace detail
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
// //
|
||||
// directory_iterator //
|
||||
// //
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
class directory_iterator :
|
||||
public boost::iterator_facade<
|
||||
directory_iterator,
|
||||
directory_entry,
|
||||
boost::single_pass_traversal_tag
|
||||
>
|
||||
{
|
||||
friend class boost::iterator_core_access;
|
||||
|
||||
friend BOOST_FILESYSTEM_DECL void detail::directory_iterator_construct(directory_iterator& it, const path& p, unsigned int opts, system::error_code* ec);
|
||||
friend BOOST_FILESYSTEM_DECL void detail::directory_iterator_increment(directory_iterator& it, system::error_code* ec);
|
||||
|
||||
public:
|
||||
directory_iterator() BOOST_NOEXCEPT {} // creates the "end" iterator
|
||||
|
||||
// iterator_facade derived classes don't seem to like implementations in
|
||||
// separate translation unit dll's, so forward to detail functions
|
||||
explicit directory_iterator(const path& p, BOOST_SCOPED_ENUM_NATIVE(directory_options) opts = directory_options::none)
|
||||
{
|
||||
detail::directory_iterator_construct(*this, p, static_cast< unsigned int >(opts), 0);
|
||||
}
|
||||
|
||||
directory_iterator(const path& p, system::error_code& ec) BOOST_NOEXCEPT
|
||||
{
|
||||
detail::directory_iterator_construct(*this, p, static_cast< unsigned int >(directory_options::none), &ec);
|
||||
}
|
||||
|
||||
directory_iterator(const path& p, BOOST_SCOPED_ENUM_NATIVE(directory_options) opts, system::error_code& ec) BOOST_NOEXCEPT
|
||||
{
|
||||
detail::directory_iterator_construct(*this, p, static_cast< unsigned int >(opts), &ec);
|
||||
}
|
||||
|
||||
BOOST_DEFAULTED_FUNCTION(directory_iterator(directory_iterator const& that), : m_imp(that.m_imp) {})
|
||||
BOOST_DEFAULTED_FUNCTION(directory_iterator& operator= (directory_iterator const& that), { m_imp = that.m_imp; return *this; })
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
directory_iterator(directory_iterator&& that) BOOST_NOEXCEPT :
|
||||
m_imp(std::move(that.m_imp))
|
||||
{
|
||||
}
|
||||
|
||||
directory_iterator& operator= (directory_iterator&& that) BOOST_NOEXCEPT
|
||||
{
|
||||
m_imp = std::move(that.m_imp);
|
||||
return *this;
|
||||
}
|
||||
#endif // !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
|
||||
directory_iterator& increment(system::error_code& ec) BOOST_NOEXCEPT
|
||||
{
|
||||
detail::directory_iterator_increment(*this, &ec);
|
||||
return *this;
|
||||
}
|
||||
|
||||
private:
|
||||
boost::iterator_facade<
|
||||
directory_iterator,
|
||||
directory_entry,
|
||||
boost::single_pass_traversal_tag
|
||||
>::reference dereference() const
|
||||
{
|
||||
BOOST_ASSERT_MSG(!is_end(), "attempt to dereference end directory iterator");
|
||||
return m_imp->dir_entry;
|
||||
}
|
||||
|
||||
void increment() { detail::directory_iterator_increment(*this, 0); }
|
||||
|
||||
bool equal(const directory_iterator& rhs) const BOOST_NOEXCEPT
|
||||
{
|
||||
return m_imp == rhs.m_imp || (is_end() && rhs.is_end());
|
||||
}
|
||||
|
||||
bool is_end() const BOOST_NOEXCEPT
|
||||
{
|
||||
// Note: The check for handle is needed because the iterator can be copied and the copy
|
||||
// can be incremented to end while the original iterator still refers to the same dir_itr_imp.
|
||||
return !m_imp || !m_imp->handle;
|
||||
}
|
||||
|
||||
private:
|
||||
// intrusive_ptr provides the shallow-copy semantics required for single pass iterators
|
||||
// (i.e. InputIterators). The end iterator is indicated by is_end().
|
||||
boost::intrusive_ptr< detail::dir_itr_imp > m_imp;
|
||||
};
|
||||
|
||||
// enable directory_iterator C++11 range-based for statement use --------------------//
|
||||
|
||||
// begin() and end() are only used by a range-based for statement in the context of
|
||||
// auto - thus the top-level const is stripped - so returning const is harmless and
|
||||
// emphasizes begin() is just a pass through.
|
||||
inline const directory_iterator& begin(const directory_iterator& iter) BOOST_NOEXCEPT { return iter; }
|
||||
inline directory_iterator end(const directory_iterator&) BOOST_NOEXCEPT { return directory_iterator(); }
|
||||
|
||||
// enable C++14 generic accessors for range const iterators
|
||||
inline const directory_iterator& cbegin(const directory_iterator& iter) BOOST_NOEXCEPT { return iter; }
|
||||
inline directory_iterator cend(const directory_iterator&) BOOST_NOEXCEPT { return directory_iterator(); }
|
||||
|
||||
// enable directory_iterator BOOST_FOREACH -----------------------------------------//
|
||||
|
||||
inline directory_iterator& range_begin(directory_iterator& iter) BOOST_NOEXCEPT { return iter; }
|
||||
inline directory_iterator range_begin(const directory_iterator& iter) BOOST_NOEXCEPT { return iter; }
|
||||
inline directory_iterator range_end(directory_iterator&) BOOST_NOEXCEPT { return directory_iterator(); }
|
||||
inline directory_iterator range_end(const directory_iterator&) BOOST_NOEXCEPT { return directory_iterator(); }
|
||||
|
||||
} // namespace filesystem
|
||||
|
||||
// namespace boost template specializations
|
||||
template<typename C, typename Enabler>
|
||||
struct range_mutable_iterator;
|
||||
|
||||
template<>
|
||||
struct range_mutable_iterator<boost::filesystem::directory_iterator, void>
|
||||
{
|
||||
typedef boost::filesystem::directory_iterator type;
|
||||
};
|
||||
|
||||
template<typename C, typename Enabler>
|
||||
struct range_const_iterator;
|
||||
|
||||
template<>
|
||||
struct range_const_iterator<boost::filesystem::directory_iterator, void>
|
||||
{
|
||||
typedef boost::filesystem::directory_iterator type;
|
||||
};
|
||||
|
||||
namespace filesystem {
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
// //
|
||||
// recursive_directory_iterator helpers //
|
||||
// //
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
#if !defined(BOOST_FILESYSTEM_NO_DEPRECATED)
|
||||
// Deprecated enum, use directory_options instead
|
||||
BOOST_SCOPED_ENUM_UT_DECLARE_BEGIN(symlink_option, unsigned int)
|
||||
{
|
||||
none = static_cast< unsigned int >(directory_options::none),
|
||||
no_recurse = none, // don't follow directory symlinks (default behavior)
|
||||
recurse = static_cast< unsigned int >(directory_options::follow_directory_symlink), // follow directory symlinks
|
||||
_detail_no_push = static_cast< unsigned int >(directory_options::_detail_no_push) // internal use only
|
||||
}
|
||||
BOOST_SCOPED_ENUM_DECLARE_END(symlink_option)
|
||||
|
||||
BOOST_BITMASK(BOOST_SCOPED_ENUM_NATIVE(symlink_option))
|
||||
#endif // BOOST_FILESYSTEM_NO_DEPRECATED
|
||||
|
||||
class recursive_directory_iterator;
|
||||
|
||||
namespace detail {
|
||||
|
||||
struct recur_dir_itr_imp :
|
||||
public boost::intrusive_ref_counter< recur_dir_itr_imp >
|
||||
{
|
||||
typedef directory_iterator element_type;
|
||||
std::vector< element_type > m_stack;
|
||||
// directory_options values, declared as unsigned int for ABI compatibility
|
||||
unsigned int m_options;
|
||||
|
||||
explicit recur_dir_itr_imp(unsigned int opts) BOOST_NOEXCEPT : m_options(opts) {}
|
||||
};
|
||||
|
||||
BOOST_FILESYSTEM_DECL void recursive_directory_iterator_construct(recursive_directory_iterator& it, const path& dir_path, unsigned int opts, system::error_code* ec);
|
||||
BOOST_FILESYSTEM_DECL void recursive_directory_iterator_increment(recursive_directory_iterator& it, system::error_code* ec);
|
||||
BOOST_FILESYSTEM_DECL void recursive_directory_iterator_pop(recursive_directory_iterator& it, system::error_code* ec);
|
||||
|
||||
} // namespace detail
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
// //
|
||||
// recursive_directory_iterator //
|
||||
// //
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
class recursive_directory_iterator :
|
||||
public boost::iterator_facade<
|
||||
recursive_directory_iterator,
|
||||
directory_entry,
|
||||
boost::single_pass_traversal_tag
|
||||
>
|
||||
{
|
||||
friend class boost::iterator_core_access;
|
||||
|
||||
friend BOOST_FILESYSTEM_DECL void detail::recursive_directory_iterator_construct(recursive_directory_iterator& it, const path& dir_path, unsigned int opts, system::error_code* ec);
|
||||
friend BOOST_FILESYSTEM_DECL void detail::recursive_directory_iterator_increment(recursive_directory_iterator& it, system::error_code* ec);
|
||||
friend BOOST_FILESYSTEM_DECL void detail::recursive_directory_iterator_pop(recursive_directory_iterator& it, system::error_code* ec);
|
||||
|
||||
public:
|
||||
recursive_directory_iterator() BOOST_NOEXCEPT {} // creates the "end" iterator
|
||||
|
||||
explicit recursive_directory_iterator(const path& dir_path)
|
||||
{
|
||||
detail::recursive_directory_iterator_construct(*this, dir_path, static_cast< unsigned int >(directory_options::none), 0);
|
||||
}
|
||||
|
||||
recursive_directory_iterator(const path& dir_path, system::error_code& ec)
|
||||
{
|
||||
detail::recursive_directory_iterator_construct(*this, dir_path, static_cast< unsigned int >(directory_options::none), &ec);
|
||||
}
|
||||
|
||||
recursive_directory_iterator(const path& dir_path, BOOST_SCOPED_ENUM_NATIVE(directory_options) opts)
|
||||
{
|
||||
detail::recursive_directory_iterator_construct(*this, dir_path, static_cast< unsigned int >(opts), 0);
|
||||
}
|
||||
|
||||
recursive_directory_iterator(const path& dir_path, BOOST_SCOPED_ENUM_NATIVE(directory_options) opts, system::error_code& ec)
|
||||
{
|
||||
detail::recursive_directory_iterator_construct(*this, dir_path, static_cast< unsigned int >(opts), &ec);
|
||||
}
|
||||
|
||||
#if !defined(BOOST_FILESYSTEM_NO_DEPRECATED)
|
||||
// Deprecated constructors
|
||||
recursive_directory_iterator(const path& dir_path, BOOST_SCOPED_ENUM_NATIVE(symlink_option) opts)
|
||||
{
|
||||
detail::recursive_directory_iterator_construct(*this, dir_path, static_cast< unsigned int >(opts), 0);
|
||||
}
|
||||
|
||||
recursive_directory_iterator(const path& dir_path, BOOST_SCOPED_ENUM_NATIVE(symlink_option) opts, system::error_code& ec) BOOST_NOEXCEPT
|
||||
{
|
||||
detail::recursive_directory_iterator_construct(*this, dir_path, static_cast< unsigned int >(opts), &ec);
|
||||
}
|
||||
#endif // BOOST_FILESYSTEM_NO_DEPRECATED
|
||||
|
||||
BOOST_DEFAULTED_FUNCTION(recursive_directory_iterator(recursive_directory_iterator const& that), : m_imp(that.m_imp) {})
|
||||
BOOST_DEFAULTED_FUNCTION(recursive_directory_iterator& operator= (recursive_directory_iterator const& that), { m_imp = that.m_imp; return *this; })
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
recursive_directory_iterator(recursive_directory_iterator&& that) BOOST_NOEXCEPT :
|
||||
m_imp(std::move(that.m_imp))
|
||||
{
|
||||
}
|
||||
|
||||
recursive_directory_iterator& operator= (recursive_directory_iterator&& that) BOOST_NOEXCEPT
|
||||
{
|
||||
m_imp = std::move(that.m_imp);
|
||||
return *this;
|
||||
}
|
||||
#endif // !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
|
||||
recursive_directory_iterator& increment(system::error_code& ec) BOOST_NOEXCEPT
|
||||
{
|
||||
detail::recursive_directory_iterator_increment(*this, &ec);
|
||||
return *this;
|
||||
}
|
||||
|
||||
int depth() const BOOST_NOEXCEPT
|
||||
{
|
||||
BOOST_ASSERT_MSG(!is_end(), "depth() on end recursive_directory_iterator");
|
||||
return static_cast< int >(m_imp->m_stack.size() - 1u);
|
||||
}
|
||||
|
||||
bool recursion_pending() const BOOST_NOEXCEPT
|
||||
{
|
||||
BOOST_ASSERT_MSG(!is_end(), "recursion_pending() on end recursive_directory_iterator");
|
||||
return (m_imp->m_options & static_cast< unsigned int >(directory_options::_detail_no_push)) == 0u;
|
||||
}
|
||||
|
||||
#ifndef BOOST_FILESYSTEM_NO_DEPRECATED
|
||||
int level() const BOOST_NOEXCEPT { return depth(); }
|
||||
bool no_push_pending() const BOOST_NOEXCEPT { return !recursion_pending(); }
|
||||
bool no_push_request() const BOOST_NOEXCEPT { return !recursion_pending(); }
|
||||
#endif
|
||||
|
||||
void pop()
|
||||
{
|
||||
detail::recursive_directory_iterator_pop(*this, 0);
|
||||
}
|
||||
|
||||
void pop(system::error_code& ec) BOOST_NOEXCEPT
|
||||
{
|
||||
detail::recursive_directory_iterator_pop(*this, &ec);
|
||||
}
|
||||
|
||||
void disable_recursion_pending(bool value = true) BOOST_NOEXCEPT
|
||||
{
|
||||
BOOST_ASSERT_MSG(!is_end(), "disable_recursion_pending() on end recursive_directory_iterator");
|
||||
if (value)
|
||||
m_imp->m_options |= static_cast< unsigned int >(directory_options::_detail_no_push);
|
||||
else
|
||||
m_imp->m_options &= ~static_cast< unsigned int >(directory_options::_detail_no_push);
|
||||
}
|
||||
|
||||
#ifndef BOOST_FILESYSTEM_NO_DEPRECATED
|
||||
void no_push(bool value = true) BOOST_NOEXCEPT { disable_recursion_pending(value); }
|
||||
#endif
|
||||
|
||||
file_status status() const
|
||||
{
|
||||
BOOST_ASSERT_MSG(!is_end(), "status() on end recursive_directory_iterator");
|
||||
return m_imp->m_stack.back()->status();
|
||||
}
|
||||
|
||||
file_status symlink_status() const
|
||||
{
|
||||
BOOST_ASSERT_MSG(!is_end(), "symlink_status() on end recursive_directory_iterator");
|
||||
return m_imp->m_stack.back()->symlink_status();
|
||||
}
|
||||
|
||||
private:
|
||||
boost::iterator_facade<
|
||||
recursive_directory_iterator,
|
||||
directory_entry,
|
||||
boost::single_pass_traversal_tag
|
||||
>::reference dereference() const
|
||||
{
|
||||
BOOST_ASSERT_MSG(!is_end(), "dereference of end recursive_directory_iterator");
|
||||
return *m_imp->m_stack.back();
|
||||
}
|
||||
|
||||
void increment() { detail::recursive_directory_iterator_increment(*this, 0); }
|
||||
|
||||
bool equal(const recursive_directory_iterator& rhs) const BOOST_NOEXCEPT
|
||||
{
|
||||
return m_imp == rhs.m_imp || (is_end() && rhs.is_end());
|
||||
}
|
||||
|
||||
bool is_end() const BOOST_NOEXCEPT
|
||||
{
|
||||
// Note: The check for m_stack.empty() is needed because the iterator can be copied and the copy
|
||||
// can be incremented to end while the original iterator still refers to the same recur_dir_itr_imp.
|
||||
return !m_imp || m_imp->m_stack.empty();
|
||||
}
|
||||
|
||||
private:
|
||||
// intrusive_ptr provides the shallow-copy semantics required for single pass iterators
|
||||
// (i.e. InputIterators). The end iterator is indicated by is_end().
|
||||
boost::intrusive_ptr< detail::recur_dir_itr_imp > m_imp;
|
||||
};
|
||||
|
||||
#if !defined(BOOST_FILESYSTEM_NO_DEPRECATED)
|
||||
typedef recursive_directory_iterator wrecursive_directory_iterator;
|
||||
#endif
|
||||
|
||||
// enable recursive directory iterator C++11 range-base for statement use ----------//
|
||||
|
||||
// begin() and end() are only used by a range-based for statement in the context of
|
||||
// auto - thus the top-level const is stripped - so returning const is harmless and
|
||||
// emphasizes begin() is just a pass through.
|
||||
inline const recursive_directory_iterator& begin(const recursive_directory_iterator& iter) BOOST_NOEXCEPT { return iter; }
|
||||
inline recursive_directory_iterator end(const recursive_directory_iterator&) BOOST_NOEXCEPT { return recursive_directory_iterator(); }
|
||||
|
||||
// enable C++14 generic accessors for range const iterators
|
||||
inline const recursive_directory_iterator& cbegin(const recursive_directory_iterator& iter) BOOST_NOEXCEPT { return iter; }
|
||||
inline recursive_directory_iterator cend(const recursive_directory_iterator&) BOOST_NOEXCEPT { return recursive_directory_iterator(); }
|
||||
|
||||
// enable recursive directory iterator BOOST_FOREACH -------------------------------//
|
||||
|
||||
inline recursive_directory_iterator& range_begin(recursive_directory_iterator& iter) BOOST_NOEXCEPT { return iter; }
|
||||
inline recursive_directory_iterator range_begin(const recursive_directory_iterator& iter) BOOST_NOEXCEPT { return iter; }
|
||||
inline recursive_directory_iterator range_end(recursive_directory_iterator&) BOOST_NOEXCEPT { return recursive_directory_iterator(); }
|
||||
inline recursive_directory_iterator range_end(const recursive_directory_iterator&) BOOST_NOEXCEPT { return recursive_directory_iterator(); }
|
||||
|
||||
} // namespace filesystem
|
||||
|
||||
// namespace boost template specializations
|
||||
template<>
|
||||
struct range_mutable_iterator<boost::filesystem::recursive_directory_iterator, void>
|
||||
{
|
||||
typedef boost::filesystem::recursive_directory_iterator type;
|
||||
};
|
||||
template<>
|
||||
struct range_const_iterator<boost::filesystem::recursive_directory_iterator, void>
|
||||
{
|
||||
typedef boost::filesystem::recursive_directory_iterator type;
|
||||
};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
|
||||
#endif // BOOST_FILESYSTEM3_DIRECTORY_HPP
|
@ -1,9 +1,100 @@
|
||||
// boost/filesystem/exception.hpp -----------------------------------------------------//
|
||||
|
||||
// Copyright Beman Dawes 2003
|
||||
// Use, modification, and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
// Copyright Andrey Semashev 2019
|
||||
|
||||
// This header is no longer used. The contents have been moved to path.hpp.
|
||||
// It is provided so that user code #includes do not have to be changed.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
// Library home page: http://www.boost.org/libs/filesystem
|
||||
|
||||
#ifndef BOOST_FILESYSTEM3_EXCEPTION_HPP
|
||||
#define BOOST_FILESYSTEM3_EXCEPTION_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
# if defined( BOOST_NO_STD_WSTRING )
|
||||
# error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
|
||||
# endif
|
||||
|
||||
#include <boost/filesystem/config.hpp>
|
||||
#include <boost/filesystem/path.hpp>
|
||||
|
||||
#include <string>
|
||||
#include <boost/system/error_code.hpp>
|
||||
#include <boost/system/system_error.hpp>
|
||||
#include <boost/smart_ptr/intrusive_ptr.hpp>
|
||||
#include <boost/smart_ptr/intrusive_ref_counter.hpp>
|
||||
|
||||
#include <boost/config/abi_prefix.hpp> // must be the last #include
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
#pragma warning(push)
|
||||
// 'm_A' : class 'A' needs to have dll-interface to be used by clients of class 'B'
|
||||
#pragma warning(disable: 4251)
|
||||
// non dll-interface class 'A' used as base for dll-interface class 'B'
|
||||
#pragma warning(disable: 4275)
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace filesystem {
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
// //
|
||||
// class filesystem_error //
|
||||
// //
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
class BOOST_FILESYSTEM_DECL filesystem_error :
|
||||
public system::system_error
|
||||
{
|
||||
// see http://www.boost.org/more/error_handling.html for design rationale
|
||||
|
||||
public:
|
||||
filesystem_error(const std::string& what_arg, system::error_code ec);
|
||||
filesystem_error(const std::string& what_arg, const path& path1_arg, system::error_code ec);
|
||||
filesystem_error(const std::string& what_arg, const path& path1_arg, const path& path2_arg, system::error_code ec);
|
||||
|
||||
filesystem_error(filesystem_error const& that);
|
||||
filesystem_error& operator= (filesystem_error const& that);
|
||||
|
||||
~filesystem_error() BOOST_NOEXCEPT_OR_NOTHROW;
|
||||
|
||||
const path& path1() const BOOST_NOEXCEPT
|
||||
{
|
||||
return m_imp_ptr.get() ? m_imp_ptr->m_path1 : get_empty_path();
|
||||
}
|
||||
const path& path2() const BOOST_NOEXCEPT
|
||||
{
|
||||
return m_imp_ptr.get() ? m_imp_ptr->m_path2 : get_empty_path();
|
||||
}
|
||||
|
||||
const char* what() const BOOST_NOEXCEPT_OR_NOTHROW;
|
||||
|
||||
private:
|
||||
static const path& get_empty_path() BOOST_NOEXCEPT;
|
||||
|
||||
private:
|
||||
struct impl :
|
||||
public boost::intrusive_ref_counter< impl >
|
||||
{
|
||||
path m_path1; // may be empty()
|
||||
path m_path2; // may be empty()
|
||||
std::string m_what; // not built until needed
|
||||
|
||||
BOOST_DEFAULTED_FUNCTION(impl(), {})
|
||||
explicit impl(path const& path1) : m_path1(path1) {}
|
||||
impl(path const& path1, path const& path2) : m_path1(path1), m_path2(path2) {}
|
||||
};
|
||||
boost::intrusive_ptr< impl > m_imp_ptr;
|
||||
};
|
||||
|
||||
} // namespace filesystem
|
||||
} // namespace boost
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
|
||||
#endif // BOOST_FILESYSTEM3_EXCEPTION_HPP
|
||||
|
237
boost/filesystem/file_status.hpp
Normal file
237
boost/filesystem/file_status.hpp
Normal file
@ -0,0 +1,237 @@
|
||||
// boost/filesystem/file_status.hpp --------------------------------------------------//
|
||||
|
||||
// Copyright Beman Dawes 2002-2009
|
||||
// Copyright Jan Langer 2002
|
||||
// Copyright Dietmar Kuehl 2001
|
||||
// Copyright Vladimir Prus 2002
|
||||
// Copyright Andrey Semashev 2019
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
// Library home page: http://www.boost.org/libs/filesystem
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
#ifndef BOOST_FILESYSTEM3_FILE_STATUS_HPP
|
||||
#define BOOST_FILESYSTEM3_FILE_STATUS_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
# if defined( BOOST_NO_STD_WSTRING )
|
||||
# error Configuration not supported: Boost.Filesystem V3 and later requires std::wstring support
|
||||
# endif
|
||||
|
||||
#include <boost/filesystem/config.hpp>
|
||||
|
||||
#include <boost/detail/bitmask.hpp>
|
||||
|
||||
#include <boost/config/abi_prefix.hpp> // must be the last #include
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
namespace boost {
|
||||
namespace filesystem {
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
// file_type //
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
enum file_type
|
||||
{
|
||||
status_error,
|
||||
# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
|
||||
status_unknown = status_error,
|
||||
# endif
|
||||
file_not_found,
|
||||
regular_file,
|
||||
directory_file,
|
||||
// the following may not apply to some operating systems or file systems
|
||||
symlink_file,
|
||||
block_file,
|
||||
character_file,
|
||||
fifo_file,
|
||||
socket_file,
|
||||
reparse_file, // Windows: FILE_ATTRIBUTE_REPARSE_POINT that is not a symlink
|
||||
type_unknown, // file does exist, but isn't one of the above types or
|
||||
// we don't have strong enough permission to find its type
|
||||
|
||||
_detail_directory_symlink // internal use only; never exposed to users
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
// perms //
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
enum perms
|
||||
{
|
||||
no_perms = 0, // file_not_found is no_perms rather than perms_not_known
|
||||
|
||||
// POSIX equivalent macros given in comments.
|
||||
// Values are from POSIX and are given in octal per the POSIX standard.
|
||||
|
||||
// permission bits
|
||||
|
||||
owner_read = 0400, // S_IRUSR, Read permission, owner
|
||||
owner_write = 0200, // S_IWUSR, Write permission, owner
|
||||
owner_exe = 0100, // S_IXUSR, Execute/search permission, owner
|
||||
owner_all = 0700, // S_IRWXU, Read, write, execute/search by owner
|
||||
|
||||
group_read = 040, // S_IRGRP, Read permission, group
|
||||
group_write = 020, // S_IWGRP, Write permission, group
|
||||
group_exe = 010, // S_IXGRP, Execute/search permission, group
|
||||
group_all = 070, // S_IRWXG, Read, write, execute/search by group
|
||||
|
||||
others_read = 04, // S_IROTH, Read permission, others
|
||||
others_write = 02, // S_IWOTH, Write permission, others
|
||||
others_exe = 01, // S_IXOTH, Execute/search permission, others
|
||||
others_all = 07, // S_IRWXO, Read, write, execute/search by others
|
||||
|
||||
all_all = 0777, // owner_all|group_all|others_all
|
||||
|
||||
// other POSIX bits
|
||||
|
||||
set_uid_on_exe = 04000, // S_ISUID, Set-user-ID on execution
|
||||
set_gid_on_exe = 02000, // S_ISGID, Set-group-ID on execution
|
||||
sticky_bit = 01000, // S_ISVTX,
|
||||
// (POSIX XSI) On directories, restricted deletion flag
|
||||
// (V7) 'sticky bit': save swapped text even after use
|
||||
// (SunOS) On non-directories: don't cache this file
|
||||
// (SVID-v4.2) On directories: restricted deletion flag
|
||||
// Also see http://en.wikipedia.org/wiki/Sticky_bit
|
||||
|
||||
perms_mask = 07777, // all_all|set_uid_on_exe|set_gid_on_exe|sticky_bit
|
||||
|
||||
perms_not_known = 0xFFFF, // present when directory_entry cache not loaded
|
||||
|
||||
// options for permissions() function
|
||||
|
||||
add_perms = 0x1000, // adds the given permission bits to the current bits
|
||||
remove_perms = 0x2000, // removes the given permission bits from the current bits;
|
||||
// choose add_perms or remove_perms, not both; if neither add_perms
|
||||
// nor remove_perms is given, replace the current bits with
|
||||
// the given bits.
|
||||
|
||||
symlink_perms = 0x4000, // on POSIX, don't resolve symlinks; implied on Windows
|
||||
|
||||
// BOOST_BITMASK op~ casts to int32_least_t, producing invalid enum values
|
||||
_detail_extend_perms_32_1 = 0x7fffffff,
|
||||
_detail_extend_perms_32_2 = -0x7fffffff-1
|
||||
};
|
||||
|
||||
BOOST_BITMASK(perms)
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
// file_status //
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
class file_status
|
||||
{
|
||||
public:
|
||||
BOOST_CONSTEXPR file_status() BOOST_NOEXCEPT :
|
||||
m_value(status_error), m_perms(perms_not_known)
|
||||
{
|
||||
}
|
||||
explicit BOOST_CONSTEXPR file_status(file_type v) BOOST_NOEXCEPT :
|
||||
m_value(v), m_perms(perms_not_known)
|
||||
{
|
||||
}
|
||||
BOOST_CONSTEXPR file_status(file_type v, perms prms) BOOST_NOEXCEPT :
|
||||
m_value(v), m_perms(prms)
|
||||
{
|
||||
}
|
||||
|
||||
// As of October 2015 the interaction between noexcept and =default is so troublesome
|
||||
// for VC++, GCC, and probably other compilers, that =default is not used with noexcept
|
||||
// functions. GCC is not even consistent for the same release on different platforms.
|
||||
|
||||
BOOST_CONSTEXPR file_status(const file_status& rhs) BOOST_NOEXCEPT :
|
||||
m_value(rhs.m_value), m_perms(rhs.m_perms)
|
||||
{
|
||||
}
|
||||
BOOST_CXX14_CONSTEXPR file_status& operator=(const file_status& rhs) BOOST_NOEXCEPT
|
||||
{
|
||||
m_value = rhs.m_value;
|
||||
m_perms = rhs.m_perms;
|
||||
return *this;
|
||||
}
|
||||
|
||||
# if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
// Note: std::move is not constexpr in C++11, that's why we're not using it here
|
||||
BOOST_CONSTEXPR file_status(file_status&& rhs) BOOST_NOEXCEPT :
|
||||
m_value(static_cast< file_type&& >(rhs.m_value)), m_perms(static_cast< enum perms&& >(rhs.m_perms))
|
||||
{
|
||||
}
|
||||
BOOST_CXX14_CONSTEXPR file_status& operator=(file_status&& rhs) BOOST_NOEXCEPT
|
||||
{
|
||||
m_value = static_cast< file_type&& >(rhs.m_value);
|
||||
m_perms = static_cast< enum perms&& >(rhs.m_perms);
|
||||
return *this;
|
||||
}
|
||||
# endif
|
||||
|
||||
// observers
|
||||
BOOST_CONSTEXPR file_type type() const BOOST_NOEXCEPT { return m_value; }
|
||||
BOOST_CONSTEXPR perms permissions() const BOOST_NOEXCEPT { return m_perms; }
|
||||
|
||||
// modifiers
|
||||
BOOST_CXX14_CONSTEXPR void type(file_type v) BOOST_NOEXCEPT { m_value = v; }
|
||||
BOOST_CXX14_CONSTEXPR void permissions(perms prms) BOOST_NOEXCEPT { m_perms = prms; }
|
||||
|
||||
BOOST_CONSTEXPR bool operator==(const file_status& rhs) const BOOST_NOEXCEPT
|
||||
{
|
||||
return type() == rhs.type() && permissions() == rhs.permissions();
|
||||
}
|
||||
BOOST_CONSTEXPR bool operator!=(const file_status& rhs) const BOOST_NOEXCEPT
|
||||
{
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
private:
|
||||
file_type m_value;
|
||||
enum perms m_perms;
|
||||
};
|
||||
|
||||
inline BOOST_CONSTEXPR bool type_present(file_status f) BOOST_NOEXCEPT
|
||||
{
|
||||
return f.type() != status_error;
|
||||
}
|
||||
inline BOOST_CONSTEXPR bool permissions_present(file_status f) BOOST_NOEXCEPT
|
||||
{
|
||||
return f.permissions() != perms_not_known;
|
||||
}
|
||||
inline BOOST_CONSTEXPR bool status_known(file_status f) BOOST_NOEXCEPT
|
||||
{
|
||||
return filesystem::type_present(f) && filesystem::permissions_present(f);
|
||||
}
|
||||
inline BOOST_CONSTEXPR bool exists(file_status f) BOOST_NOEXCEPT
|
||||
{
|
||||
return f.type() != status_error && f.type() != file_not_found;
|
||||
}
|
||||
inline BOOST_CONSTEXPR bool is_regular_file(file_status f) BOOST_NOEXCEPT
|
||||
{
|
||||
return f.type() == regular_file;
|
||||
}
|
||||
inline BOOST_CONSTEXPR bool is_directory(file_status f) BOOST_NOEXCEPT
|
||||
{
|
||||
return f.type() == directory_file;
|
||||
}
|
||||
inline BOOST_CONSTEXPR bool is_symlink(file_status f) BOOST_NOEXCEPT
|
||||
{
|
||||
return f.type() == symlink_file;
|
||||
}
|
||||
inline BOOST_CONSTEXPR bool is_other(file_status f) BOOST_NOEXCEPT
|
||||
{
|
||||
return filesystem::exists(f) && !filesystem::is_regular_file(f)
|
||||
&& !filesystem::is_directory(f) && !filesystem::is_symlink(f);
|
||||
}
|
||||
|
||||
# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
|
||||
inline bool is_regular(file_status f) BOOST_NOEXCEPT { return filesystem::is_regular_file(f); }
|
||||
# endif
|
||||
|
||||
} // namespace filesystem
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
|
||||
#endif // BOOST_FILESYSTEM3_FILE_STATUS_HPP
|
File diff suppressed because it is too large
Load Diff
@ -27,6 +27,7 @@
|
||||
#include <boost/system/error_code.hpp>
|
||||
#include <boost/system/system_error.hpp>
|
||||
#include <boost/iterator/iterator_facade.hpp>
|
||||
#include <boost/iterator/iterator_categories.hpp>
|
||||
#include <boost/core/enable_if.hpp>
|
||||
#include <boost/io/detail/quoted_manip.hpp>
|
||||
#include <boost/functional/hash_fwd.hpp>
|
||||
@ -59,6 +60,7 @@ namespace path_detail // intentionally don't use filesystem::detail to not bring
|
||||
static BOOST_CONSTEXPR_OR_CONST value_type dot = Dot;
|
||||
};
|
||||
|
||||
#if defined(BOOST_NO_CXX17_INLINE_VARIABLES)
|
||||
template< typename Char, Char Separator, Char PreferredSeparator, Char Dot >
|
||||
BOOST_CONSTEXPR_OR_CONST typename path_constants< Char, Separator, PreferredSeparator, Dot >::value_type
|
||||
path_constants< Char, Separator, PreferredSeparator, Dot >::separator;
|
||||
@ -68,6 +70,7 @@ namespace path_detail // intentionally don't use filesystem::detail to not bring
|
||||
template< typename Char, Char Separator, Char PreferredSeparator, Char Dot >
|
||||
BOOST_CONSTEXPR_OR_CONST typename path_constants< Char, Separator, PreferredSeparator, Dot >::value_type
|
||||
path_constants< Char, Separator, PreferredSeparator, Dot >::dot;
|
||||
#endif
|
||||
|
||||
} // namespace path_detail
|
||||
|
||||
|
@ -44,6 +44,8 @@
|
||||
#if defined(__INTEL_COMPILER) || defined(_MSC_VER)
|
||||
# if defined(__INTEL_COMPILER)
|
||||
# define BOOST_LOG_COMPILER_BARRIER __memory_barrier()
|
||||
# elif defined(__clang__) // clang-win also defines _MSC_VER
|
||||
# define BOOST_LOG_COMPILER_BARRIER __atomic_signal_fence(__ATOMIC_SEQ_CST)
|
||||
# else
|
||||
extern "C" void _ReadWriteBarrier(void);
|
||||
# if defined(BOOST_MSVC)
|
||||
|
@ -1103,7 +1103,18 @@ namespace boost
|
||||
template <class T>
|
||||
typename boost::math::tools::promote_args<T>::type lambert_wm1_prime(T z);
|
||||
|
||||
// Hypergeometrics:
|
||||
template <class T1, class T2> typename tools::promote_args<T1, T2>::type hypergeometric_1F0(T1 a, T2 z);
|
||||
template <class T1, class T2, class Policy> typename tools::promote_args<T1, T2>::type hypergeometric_1F0(T1 a, T2 z, const Policy&);
|
||||
|
||||
template <class T1, class T2> typename tools::promote_args<T1, T2>::type hypergeometric_0F1(T1 b, T2 z);
|
||||
template <class T1, class T2, class Policy> typename tools::promote_args<T1, T2>::type hypergeometric_0F1(T1 b, T2 z, const Policy&);
|
||||
|
||||
template <class T1, class T2, class T3> typename tools::promote_args<T1, T2, T3>::type hypergeometric_2F0(T1 a1, T2 a2, T3 z);
|
||||
template <class T1, class T2, class T3, class Policy> typename tools::promote_args<T1, T2, T3>::type hypergeometric_2F0(T1 a1, T2 a2, T3 z, const Policy&);
|
||||
|
||||
template <class T1, class T2, class T3> typename tools::promote_args<T1, T2, T3>::type hypergeometric_1F1(T1 a, T2 b, T3 z);
|
||||
template <class T1, class T2, class T3, class Policy> typename tools::promote_args<T1, T2, T3>::type hypergeometric_1F1(T1 a, T2 b, T3 z, const Policy&);
|
||||
|
||||
|
||||
} // namespace math
|
||||
@ -1125,9 +1136,20 @@ namespace boost
|
||||
#define BOOST_MATH_DETAIL_LL_FUNC(Policy)
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) && !defined(BOOST_NO_CXX11_HDR_ARRAY)
|
||||
# define BOOST_MATH_DETAIL_11_FUNC(Policy)\
|
||||
template <class T, class U, class V>\
|
||||
inline typename boost::math::tools::promote_args<T, U>::type hypergeometric_1F1(const T& a, const U& b, const V& z)\
|
||||
{ return boost::math::hypergeometric_1F1(a, b, z, Policy()); }\
|
||||
|
||||
#else
|
||||
# define BOOST_MATH_DETAIL_11_FUNC(Policy)
|
||||
#endif
|
||||
|
||||
#define BOOST_MATH_DECLARE_SPECIAL_FUNCTIONS(Policy)\
|
||||
\
|
||||
BOOST_MATH_DETAIL_LL_FUNC(Policy)\
|
||||
BOOST_MATH_DETAIL_11_FUNC(Policy)\
|
||||
\
|
||||
template <class RT1, class RT2>\
|
||||
inline typename boost::math::tools::promote_args<RT1, RT2>::type \
|
||||
@ -1669,6 +1691,18 @@ template <class OutputIterator, class T>\
|
||||
template <class T> inline typename boost::math::tools::promote_args<T>::type lambert_w0_prime(T z) { return boost::math::lambert_w0(z, Policy()); }\
|
||||
template <class T> inline typename boost::math::tools::promote_args<T>::type lambert_wm1_prime(T z) { return boost::math::lambert_w0(z, Policy()); }\
|
||||
\
|
||||
template <class T, class U>\
|
||||
inline typename boost::math::tools::promote_args<T, U>::type hypergeometric_1F0(const T& a, const U& z)\
|
||||
{ return boost::math::hypergeometric_1F0(a, z, Policy()); }\
|
||||
\
|
||||
template <class T, class U>\
|
||||
inline typename boost::math::tools::promote_args<T, U>::type hypergeometric_0F1(const T& a, const U& z)\
|
||||
{ return boost::math::hypergeometric_0F1(a, z, Policy()); }\
|
||||
\
|
||||
template <class T, class U, class V>\
|
||||
inline typename boost::math::tools::promote_args<T, U>::type hypergeometric_2F0(const T& a1, const U& a2, const V& z)\
|
||||
{ return boost::math::hypergeometric_2F0(a1, a2, z, Policy()); }\
|
||||
\
|
||||
|
||||
|
||||
|
||||
|
@ -11,6 +11,6 @@
|
||||
// Same format as BOOST_VERSION:
|
||||
// major * 100000 + minor * 100 + patch
|
||||
|
||||
#define BOOST_MP11_VERSION 107100
|
||||
#define BOOST_MP11_VERSION 107200
|
||||
|
||||
#endif // #ifndef BOOST_MP11_VERSION_HPP_INCLUDED
|
||||
|
@ -80,7 +80,7 @@
|
||||
# if !defined BOOST_PP_VARIADICS
|
||||
# /* variadic support explicitly disabled for all untested compilers */
|
||||
|
||||
# if defined __GCCXML__ || defined __CUDACC__ || defined __PATHSCALE__ || defined __DMC__ || defined __CODEGEARC__ || defined __BORLANDC__ || defined __MWERKS__ || ( defined __SUNPRO_CC && __SUNPRO_CC < 0x5120 ) || defined __HP_aCC && !defined __EDG__ || defined __MRC__ || defined __SC__ || (defined(__PGI) && !defined(__EDG__))
|
||||
# if defined __GCCXML__ || (defined __CUDACC__ && !(defined(__clang__) && defined(__CUDA__))) || defined __PATHSCALE__ || defined __DMC__ || defined __CODEGEARC__ || defined __BORLANDC__ || defined __MWERKS__ || ( defined __SUNPRO_CC && __SUNPRO_CC < 0x5120 ) || (defined __HP_aCC && !defined __EDG__) || defined __MRC__ || defined __SC__ || (defined(__PGI) && !defined(__EDG__))
|
||||
# define BOOST_PP_VARIADICS 0
|
||||
# elif defined(_MSC_VER) && defined(__clang__)
|
||||
# define BOOST_PP_VARIADICS 1
|
||||
|
@ -31,8 +31,8 @@
|
||||
#if BOOST_PP_VARIADICS_MSVC && _MSC_VER <= 1400
|
||||
|
||||
#define BOOST_PP_DETAIL_IS_EMPTY_PROCESS(param) \
|
||||
BOOST_PP_IS_BEGIN_PARENS \
|
||||
( \
|
||||
BOOST_PP_IS_BEGIN_PARENS \
|
||||
( \
|
||||
BOOST_PP_DETAIL_IS_EMPTY_NON_FUNCTION_C param () \
|
||||
) \
|
||||
/**/
|
||||
@ -40,7 +40,7 @@
|
||||
#else
|
||||
|
||||
#define BOOST_PP_DETAIL_IS_EMPTY_PROCESS(...) \
|
||||
BOOST_PP_IS_BEGIN_PARENS \
|
||||
BOOST_PP_IS_BEGIN_PARENS \
|
||||
( \
|
||||
BOOST_PP_DETAIL_IS_EMPTY_NON_FUNCTION_C __VA_ARGS__ () \
|
||||
) \
|
||||
|
@ -1,6 +1,6 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Edward Diener 2014.
|
||||
# * (C) Copyright Edward Diener 2014,2019.
|
||||
# * 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)
|
||||
@ -37,7 +37,34 @@
|
||||
/**/
|
||||
#define BOOST_PP_IS_EMPTY_ZERO(param) 0
|
||||
# else
|
||||
# if defined(__cplusplus) && __cplusplus > 201703L
|
||||
# include <boost/preprocessor/variadic/has_opt.hpp>
|
||||
#define BOOST_PP_IS_EMPTY(...) \
|
||||
BOOST_PP_DETAIL_IS_EMPTY_IIF \
|
||||
( \
|
||||
BOOST_PP_VARIADIC_HAS_OPT() \
|
||||
) \
|
||||
( \
|
||||
BOOST_PP_IS_EMPTY_OPT, \
|
||||
BOOST_PP_IS_EMPTY_NO_OPT \
|
||||
) \
|
||||
(__VA_ARGS__) \
|
||||
/**/
|
||||
#define BOOST_PP_IS_EMPTY_FUNCTION2(...) \
|
||||
__VA_OPT__(0,) 1 \
|
||||
/**/
|
||||
#define BOOST_PP_IS_EMPTY_FUNCTION(...) \
|
||||
BOOST_PP_IS_EMPTY_FUNCTION2(__VA_ARGS__) \
|
||||
/**/
|
||||
#define BOOST_PP_IS_EMPTY_OPT(...) \
|
||||
BOOST_PP_VARIADIC_HAS_OPT_ELEM0(BOOST_PP_IS_EMPTY_FUNCTION(__VA_ARGS__),) \
|
||||
/**/
|
||||
# else
|
||||
#define BOOST_PP_IS_EMPTY(...) \
|
||||
BOOST_PP_IS_EMPTY_NO_OPT(__VA_ARGS__) \
|
||||
/**/
|
||||
# endif /* defined(__cplusplus) && __cplusplus > 201703L */
|
||||
#define BOOST_PP_IS_EMPTY_NO_OPT(...) \
|
||||
BOOST_PP_DETAIL_IS_EMPTY_IIF \
|
||||
( \
|
||||
BOOST_PP_IS_BEGIN_PARENS \
|
||||
|
@ -52,13 +52,13 @@
|
||||
|
||||
# define BOOST_PP_FOR_257_ERROR() BOOST_PP_ERROR(0x0002)
|
||||
# define BOOST_PP_FOR_257(s, p, o, m) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_FOR_257_PR(s,p), \
|
||||
BOOST_PP_FOR_257_ERROR, \
|
||||
BOOST_PP_EMPTY \
|
||||
) \
|
||||
() \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_FOR_257_PR(s,p), \
|
||||
BOOST_PP_FOR_257_ERROR, \
|
||||
BOOST_PP_EMPTY \
|
||||
) \
|
||||
() \
|
||||
/**/
|
||||
// # define BOOST_PP_FOR_257(s, p, o, m) BOOST_PP_ERROR(0x0002)
|
||||
#
|
||||
|
@ -21,29 +21,29 @@
|
||||
/* An empty seq is one that is just BOOST_PP_SEQ_NIL */
|
||||
#
|
||||
# define BOOST_PP_SEQ_DETAIL_IS_EMPTY(seq) \
|
||||
BOOST_PP_COMPL \
|
||||
( \
|
||||
BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY(seq) \
|
||||
) \
|
||||
BOOST_PP_COMPL \
|
||||
( \
|
||||
BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY(seq) \
|
||||
) \
|
||||
/**/
|
||||
#
|
||||
# define BOOST_PP_SEQ_DETAIL_IS_EMPTY_SIZE(size) \
|
||||
BOOST_PP_COMPL \
|
||||
( \
|
||||
BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY_SIZE(size) \
|
||||
) \
|
||||
BOOST_PP_COMPL \
|
||||
( \
|
||||
BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY_SIZE(size) \
|
||||
) \
|
||||
/**/
|
||||
#
|
||||
# define BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY(seq) \
|
||||
BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY_SIZE(BOOST_PP_SEQ_DETAIL_EMPTY_SIZE(seq)) \
|
||||
BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY_SIZE(BOOST_PP_SEQ_DETAIL_EMPTY_SIZE(seq)) \
|
||||
/**/
|
||||
#
|
||||
# define BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY_SIZE(size) \
|
||||
BOOST_PP_BOOL(size) \
|
||||
BOOST_PP_BOOL(size) \
|
||||
/**/
|
||||
#
|
||||
# define BOOST_PP_SEQ_DETAIL_EMPTY_SIZE(seq) \
|
||||
BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq (nil))) \
|
||||
BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq (nil))) \
|
||||
/**/
|
||||
#
|
||||
# endif
|
||||
|
@ -36,13 +36,13 @@
|
||||
# define BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_EMPTY(macro, data, seq)
|
||||
#
|
||||
# define BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK(macro, data, seq) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY(seq), \
|
||||
BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_EXEC, \
|
||||
BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_EMPTY \
|
||||
) \
|
||||
(macro, data, seq) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY(seq), \
|
||||
BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_EXEC, \
|
||||
BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_EMPTY \
|
||||
) \
|
||||
(macro, data, seq) \
|
||||
/**/
|
||||
#
|
||||
# define BOOST_PP_SEQ_FOR_EACH_P(r, x) BOOST_PP_TUPLE_ELEM(4, 3, x)
|
||||
@ -54,21 +54,21 @@
|
||||
# endif
|
||||
#
|
||||
# define BOOST_PP_SEQ_FOR_EACH_O_I(macro, data, seq, sz) \
|
||||
BOOST_PP_SEQ_FOR_EACH_O_I_DEC(macro, data, seq, BOOST_PP_DEC(sz)) \
|
||||
BOOST_PP_SEQ_FOR_EACH_O_I_DEC(macro, data, seq, BOOST_PP_DEC(sz)) \
|
||||
/**/
|
||||
# define BOOST_PP_SEQ_FOR_EACH_O_I_DEC(macro, data, seq, sz) \
|
||||
( \
|
||||
macro, \
|
||||
data, \
|
||||
BOOST_PP_IF \
|
||||
( \
|
||||
sz, \
|
||||
BOOST_PP_SEQ_FOR_EACH_O_I_TAIL, \
|
||||
BOOST_PP_SEQ_FOR_EACH_O_I_NIL \
|
||||
) \
|
||||
(seq), \
|
||||
sz \
|
||||
) \
|
||||
( \
|
||||
macro, \
|
||||
data, \
|
||||
BOOST_PP_IF \
|
||||
( \
|
||||
sz, \
|
||||
BOOST_PP_SEQ_FOR_EACH_O_I_TAIL, \
|
||||
BOOST_PP_SEQ_FOR_EACH_O_I_NIL \
|
||||
) \
|
||||
(seq), \
|
||||
sz \
|
||||
) \
|
||||
/**/
|
||||
# define BOOST_PP_SEQ_FOR_EACH_O_I_TAIL(seq) BOOST_PP_SEQ_TAIL(seq)
|
||||
# define BOOST_PP_SEQ_FOR_EACH_O_I_NIL(seq) BOOST_PP_NIL
|
||||
@ -95,13 +95,13 @@
|
||||
# define BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_EMPTY_R(r, macro, data, seq)
|
||||
#
|
||||
# define BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_R(r, macro, data, seq) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY(seq), \
|
||||
BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_EXEC_R, \
|
||||
BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_EMPTY_R \
|
||||
) \
|
||||
(r, macro, data, seq) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY(seq), \
|
||||
BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_EXEC_R, \
|
||||
BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_EMPTY_R \
|
||||
) \
|
||||
(r, macro, data, seq) \
|
||||
/**/
|
||||
#
|
||||
# endif
|
||||
|
@ -37,13 +37,13 @@
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_DETAIL_CHECK_EMPTY(macro, data, seq)
|
||||
#
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_DETAIL_CHECK(macro, data, seq) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY(seq), \
|
||||
BOOST_PP_SEQ_FOR_EACH_I_DETAIL_CHECK_EXEC, \
|
||||
BOOST_PP_SEQ_FOR_EACH_I_DETAIL_CHECK_EMPTY \
|
||||
) \
|
||||
(macro, data, seq) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY(seq), \
|
||||
BOOST_PP_SEQ_FOR_EACH_I_DETAIL_CHECK_EXEC, \
|
||||
BOOST_PP_SEQ_FOR_EACH_I_DETAIL_CHECK_EMPTY \
|
||||
) \
|
||||
(macro, data, seq) \
|
||||
/**/
|
||||
#
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_P(r, x) BOOST_PP_TUPLE_ELEM(5, 4, x)
|
||||
@ -55,22 +55,22 @@
|
||||
# endif
|
||||
#
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_O_I(macro, data, seq, i, sz) \
|
||||
BOOST_PP_SEQ_FOR_EACH_I_O_I_DEC(macro, data, seq, i, BOOST_PP_DEC(sz)) \
|
||||
BOOST_PP_SEQ_FOR_EACH_I_O_I_DEC(macro, data, seq, i, BOOST_PP_DEC(sz)) \
|
||||
/**/
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_O_I_DEC(macro, data, seq, i, sz) \
|
||||
( \
|
||||
macro, \
|
||||
data, \
|
||||
BOOST_PP_IF \
|
||||
( \
|
||||
sz, \
|
||||
BOOST_PP_SEQ_FOR_EACH_I_O_I_TAIL, \
|
||||
BOOST_PP_SEQ_FOR_EACH_I_O_I_NIL \
|
||||
) \
|
||||
(seq), \
|
||||
BOOST_PP_INC(i), \
|
||||
sz \
|
||||
) \
|
||||
( \
|
||||
macro, \
|
||||
data, \
|
||||
BOOST_PP_IF \
|
||||
( \
|
||||
sz, \
|
||||
BOOST_PP_SEQ_FOR_EACH_I_O_I_TAIL, \
|
||||
BOOST_PP_SEQ_FOR_EACH_I_O_I_NIL \
|
||||
) \
|
||||
(seq), \
|
||||
BOOST_PP_INC(i), \
|
||||
sz \
|
||||
) \
|
||||
/**/
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_O_I_TAIL(seq) BOOST_PP_SEQ_TAIL(seq)
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_O_I_NIL(seq) BOOST_PP_NIL
|
||||
@ -97,13 +97,13 @@
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_R_DETAIL_CHECK_EMPTY(r, macro, data, seq)
|
||||
#
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_R_DETAIL_CHECK(r, macro, data, seq) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY(seq), \
|
||||
BOOST_PP_SEQ_FOR_EACH_I_R_DETAIL_CHECK_EXEC, \
|
||||
BOOST_PP_SEQ_FOR_EACH_I_R_DETAIL_CHECK_EMPTY \
|
||||
) \
|
||||
(r, macro, data, seq) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY(seq), \
|
||||
BOOST_PP_SEQ_FOR_EACH_I_R_DETAIL_CHECK_EXEC, \
|
||||
BOOST_PP_SEQ_FOR_EACH_I_R_DETAIL_CHECK_EMPTY \
|
||||
) \
|
||||
(r, macro, data, seq) \
|
||||
/**/
|
||||
#
|
||||
# endif
|
||||
|
@ -32,15 +32,15 @@
|
||||
# endif
|
||||
#
|
||||
# define BOOST_PP_SEQ_REST_N_DETAIL_EXEC(n, seq, size) \
|
||||
BOOST_PP_EXPR_IIF \
|
||||
( \
|
||||
BOOST_PP_BITAND \
|
||||
( \
|
||||
BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY_SIZE(size), \
|
||||
BOOST_PP_NOT_EQUAL(n,size) \
|
||||
), \
|
||||
BOOST_PP_TUPLE_ELEM(2, 1, BOOST_PP_SEQ_SPLIT(BOOST_PP_INC(n), BOOST_PP_IDENTITY( (nil) seq )))() \
|
||||
) \
|
||||
BOOST_PP_EXPR_IIF \
|
||||
( \
|
||||
BOOST_PP_BITAND \
|
||||
( \
|
||||
BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY_SIZE(size), \
|
||||
BOOST_PP_NOT_EQUAL(n,size) \
|
||||
), \
|
||||
BOOST_PP_TUPLE_ELEM(2, 1, BOOST_PP_SEQ_SPLIT(BOOST_PP_INC(n), BOOST_PP_IDENTITY( (nil) seq )))() \
|
||||
) \
|
||||
/**/
|
||||
#
|
||||
# endif
|
||||
|
@ -20,9 +20,9 @@
|
||||
# include <boost/preprocessor/control/iif.hpp>
|
||||
# include <boost/preprocessor/facilities/is_1.hpp>
|
||||
# include <boost/preprocessor/tuple/size.hpp>
|
||||
# define BOOST_PP_TUPLE_IS_SINGLE_RETURN(sr,nsr,tuple) \
|
||||
BOOST_PP_IIF(BOOST_PP_IS_1(BOOST_PP_TUPLE_SIZE(tuple)),sr,nsr) \
|
||||
/**/
|
||||
# define BOOST_PP_TUPLE_IS_SINGLE_RETURN(sr,nsr,tuple) \
|
||||
BOOST_PP_IIF(BOOST_PP_IS_1(BOOST_PP_TUPLE_SIZE(tuple)),sr,nsr) \
|
||||
/**/
|
||||
# endif /* BOOST_PP_VARIADICS && BOOST_PP_VARIADICS_MSVC */
|
||||
#
|
||||
# endif /* BOOST_PREPROCESSOR_TUPLE_DETAIL_IS_SINGLE_RETURN_HPP */
|
||||
|
@ -33,12 +33,12 @@
|
||||
else use BOOST_PP_REM. This fixes a VC++ problem with an empty tuple and BOOST_PP_TUPLE_ELEM
|
||||
functionality. See tuple_elem_bug_test.cxx.
|
||||
*/
|
||||
# define BOOST_PP_TUPLE_ELEM_O_2(n, tuple) \
|
||||
BOOST_PP_VARIADIC_ELEM(n, BOOST_PP_EXPAND(BOOST_PP_TUPLE_IS_SINGLE_RETURN(BOOST_PP_REM_CAT,BOOST_PP_REM,tuple) tuple)) \
|
||||
/**/
|
||||
# define BOOST_PP_TUPLE_ELEM_O_2(n, tuple) \
|
||||
BOOST_PP_VARIADIC_ELEM(n, BOOST_PP_EXPAND(BOOST_PP_TUPLE_IS_SINGLE_RETURN(BOOST_PP_REM_CAT,BOOST_PP_REM,tuple) tuple)) \
|
||||
/**/
|
||||
# else
|
||||
# define BOOST_PP_TUPLE_ELEM(...) BOOST_PP_OVERLOAD(BOOST_PP_TUPLE_ELEM_O_, __VA_ARGS__)(__VA_ARGS__)
|
||||
# define BOOST_PP_TUPLE_ELEM_O_2(n, tuple) BOOST_PP_VARIADIC_ELEM(n, BOOST_PP_REM tuple)
|
||||
# define BOOST_PP_TUPLE_ELEM_O_2(n, tuple) BOOST_PP_VARIADIC_ELEM(n, BOOST_PP_REM tuple)
|
||||
# endif
|
||||
# define BOOST_PP_TUPLE_ELEM_O_3(size, n, tuple) BOOST_PP_TUPLE_ELEM_O_2(n, tuple)
|
||||
# else
|
||||
|
@ -22,10 +22,10 @@
|
||||
# /* BOOST_PP_REM */
|
||||
#
|
||||
# if BOOST_PP_VARIADICS
|
||||
# if BOOST_PP_VARIADICS_MSVC
|
||||
/* To be used internally when __VA_ARGS__ could be empty ( or is a single element ) */
|
||||
# define BOOST_PP_REM_CAT(...) BOOST_PP_CAT(__VA_ARGS__,)
|
||||
# endif
|
||||
# if BOOST_PP_VARIADICS_MSVC
|
||||
/* To be used internally when __VA_ARGS__ could be empty ( or is a single element ) */
|
||||
# define BOOST_PP_REM_CAT(...) BOOST_PP_CAT(__VA_ARGS__,)
|
||||
# endif
|
||||
# define BOOST_PP_REM(...) __VA_ARGS__
|
||||
# else
|
||||
# define BOOST_PP_REM(x) x
|
||||
@ -37,10 +37,10 @@
|
||||
VC++8.0 cannot handle the variadic version of BOOST_PP_TUPLE_REM(size)
|
||||
*/
|
||||
# if BOOST_PP_VARIADICS && !(BOOST_PP_VARIADICS_MSVC && _MSC_VER <= 1400)
|
||||
# if BOOST_PP_VARIADICS_MSVC
|
||||
/* To be used internally when the size could be 0 ( or 1 ) */
|
||||
# define BOOST_PP_TUPLE_REM_CAT(size) BOOST_PP_REM_CAT
|
||||
# endif
|
||||
# if BOOST_PP_VARIADICS_MSVC
|
||||
/* To be used internally when the size could be 0 ( or 1 ) */
|
||||
# define BOOST_PP_TUPLE_REM_CAT(size) BOOST_PP_REM_CAT
|
||||
# endif
|
||||
# define BOOST_PP_TUPLE_REM(size) BOOST_PP_REM
|
||||
# else
|
||||
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
|
||||
@ -124,10 +124,10 @@
|
||||
# define BOOST_PP_TUPLE_REM_CTOR(...) BOOST_PP_TUPLE_REM_CTOR_I(BOOST_PP_OVERLOAD(BOOST_PP_TUPLE_REM_CTOR_O_, __VA_ARGS__), (__VA_ARGS__))
|
||||
# define BOOST_PP_TUPLE_REM_CTOR_I(m, args) BOOST_PP_TUPLE_REM_CTOR_II(m, args)
|
||||
# define BOOST_PP_TUPLE_REM_CTOR_II(m, args) BOOST_PP_CAT(m ## args,)
|
||||
# define BOOST_PP_TUPLE_REM_CTOR_O_1(tuple) BOOST_PP_EXPAND(BOOST_PP_TUPLE_IS_SINGLE_RETURN(BOOST_PP_REM_CAT,BOOST_PP_REM,tuple) tuple)
|
||||
# define BOOST_PP_TUPLE_REM_CTOR_O_1(tuple) BOOST_PP_EXPAND(BOOST_PP_TUPLE_IS_SINGLE_RETURN(BOOST_PP_REM_CAT,BOOST_PP_REM,tuple) tuple)
|
||||
# else
|
||||
# define BOOST_PP_TUPLE_REM_CTOR(...) BOOST_PP_OVERLOAD(BOOST_PP_TUPLE_REM_CTOR_O_, __VA_ARGS__)(__VA_ARGS__)
|
||||
# define BOOST_PP_TUPLE_REM_CTOR_O_1(tuple) BOOST_PP_REM tuple
|
||||
# define BOOST_PP_TUPLE_REM_CTOR_O_1(tuple) BOOST_PP_REM tuple
|
||||
# endif
|
||||
# define BOOST_PP_TUPLE_REM_CTOR_O_2(size, tuple) BOOST_PP_TUPLE_REM_CTOR_O_1(tuple)
|
||||
# else
|
||||
|
@ -28,10 +28,10 @@
|
||||
# define BOOST_PP_TUPLE_TO_LIST(...) BOOST_PP_TUPLE_TO_LIST_I(BOOST_PP_OVERLOAD(BOOST_PP_TUPLE_TO_LIST_O_, __VA_ARGS__), (__VA_ARGS__))
|
||||
# define BOOST_PP_TUPLE_TO_LIST_I(m, args) BOOST_PP_TUPLE_TO_LIST_II(m, args)
|
||||
# define BOOST_PP_TUPLE_TO_LIST_II(m, args) BOOST_PP_CAT(m ## args,)
|
||||
# define BOOST_PP_TUPLE_TO_LIST_O_1(tuple) BOOST_PP_CAT(BOOST_PP_TUPLE_TO_LIST_, BOOST_PP_TUPLE_SIZE(tuple)) tuple
|
||||
# define BOOST_PP_TUPLE_TO_LIST_O_1(tuple) BOOST_PP_CAT(BOOST_PP_TUPLE_TO_LIST_, BOOST_PP_TUPLE_SIZE(tuple)) tuple
|
||||
# else
|
||||
# define BOOST_PP_TUPLE_TO_LIST(...) BOOST_PP_OVERLOAD(BOOST_PP_TUPLE_TO_LIST_O_, __VA_ARGS__)(__VA_ARGS__)
|
||||
# define BOOST_PP_TUPLE_TO_LIST_O_1(tuple) BOOST_PP_CAT(BOOST_PP_TUPLE_TO_LIST_, BOOST_PP_VARIADIC_SIZE tuple) tuple
|
||||
# define BOOST_PP_TUPLE_TO_LIST_O_1(tuple) BOOST_PP_CAT(BOOST_PP_TUPLE_TO_LIST_, BOOST_PP_VARIADIC_SIZE tuple) tuple
|
||||
# endif
|
||||
# define BOOST_PP_TUPLE_TO_LIST_O_2(size, tuple) BOOST_PP_TUPLE_TO_LIST_O_1(tuple)
|
||||
# else
|
||||
|
@ -26,10 +26,10 @@
|
||||
# define BOOST_PP_TUPLE_TO_SEQ(...) BOOST_PP_TUPLE_TO_SEQ_I(BOOST_PP_OVERLOAD(BOOST_PP_TUPLE_TO_SEQ_O_, __VA_ARGS__), (__VA_ARGS__))
|
||||
# define BOOST_PP_TUPLE_TO_SEQ_I(m, args) BOOST_PP_TUPLE_TO_SEQ_II(m, args)
|
||||
# define BOOST_PP_TUPLE_TO_SEQ_II(m, args) BOOST_PP_CAT(m ## args,)
|
||||
# define BOOST_PP_TUPLE_TO_SEQ_O_1(tuple) BOOST_PP_CAT(BOOST_PP_TUPLE_TO_SEQ_, BOOST_PP_TUPLE_SIZE(tuple)) tuple
|
||||
# define BOOST_PP_TUPLE_TO_SEQ_O_1(tuple) BOOST_PP_CAT(BOOST_PP_TUPLE_TO_SEQ_, BOOST_PP_TUPLE_SIZE(tuple)) tuple
|
||||
# else
|
||||
# define BOOST_PP_TUPLE_TO_SEQ(...) BOOST_PP_OVERLOAD(BOOST_PP_TUPLE_TO_SEQ_O_, __VA_ARGS__)(__VA_ARGS__)
|
||||
# define BOOST_PP_TUPLE_TO_SEQ_O_1(tuple) BOOST_PP_CAT(BOOST_PP_TUPLE_TO_SEQ_, BOOST_PP_VARIADIC_SIZE tuple) tuple
|
||||
# define BOOST_PP_TUPLE_TO_SEQ_O_1(tuple) BOOST_PP_CAT(BOOST_PP_TUPLE_TO_SEQ_, BOOST_PP_VARIADIC_SIZE tuple) tuple
|
||||
# endif
|
||||
# define BOOST_PP_TUPLE_TO_SEQ_O_2(size, tuple) BOOST_PP_TUPLE_TO_SEQ_O_1(tuple)
|
||||
# else
|
||||
|
39
boost/preprocessor/variadic/detail/has_opt.hpp
Normal file
39
boost/preprocessor/variadic/detail/has_opt.hpp
Normal file
@ -0,0 +1,39 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Edward Diener 2019. *
|
||||
# * 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 for most recent version. */
|
||||
#
|
||||
# ifndef BOOST_PREPROCESSOR_VARIADIC_DETAIL_HAS_OPT_HPP
|
||||
# define BOOST_PREPROCESSOR_VARIADIC_DETAIL_HAS_OPT_HPP
|
||||
#
|
||||
# include <boost/preprocessor/config/config.hpp>
|
||||
#
|
||||
# if BOOST_PP_VARIADICS && defined(__cplusplus) && __cplusplus > 201703L
|
||||
#
|
||||
# if BOOST_PP_VARIADICS_MSVC
|
||||
# include <boost/preprocessor/cat.hpp>
|
||||
# endif
|
||||
#
|
||||
# define BOOST_PP_VARIADIC_HAS_OPT_FUNCTION(...) \
|
||||
__VA_OPT__(,) , 1, 0 \
|
||||
/**/
|
||||
#
|
||||
# if BOOST_PP_VARIADICS_MSVC
|
||||
# define BOOST_PP_VARIADIC_HAS_OPT_ELEM0(e0, ...) BOOST_PP_CAT(BOOST_PP_VARIADIC_HAS_OPT_ELEM_0(e0,__VA_ARGS__),)
|
||||
# define BOOST_PP_VARIADIC_HAS_OPT_ELEM2(e0, ...) BOOST_PP_CAT(BOOST_PP_VARIADIC_HAS_OPT_ELEM_2(e0,__VA_ARGS__),)
|
||||
# else
|
||||
# define BOOST_PP_VARIADIC_HAS_OPT_ELEM0(e0, ...) BOOST_PP_VARIADIC_HAS_OPT_ELEM_0(e0,__VA_ARGS__)
|
||||
# define BOOST_PP_VARIADIC_HAS_OPT_ELEM2(e0, ...) BOOST_PP_VARIADIC_HAS_OPT_ELEM_2(e0,__VA_ARGS__)
|
||||
# endif
|
||||
# define BOOST_PP_VARIADIC_HAS_OPT_ELEM_0(e0, ...) e0
|
||||
# define BOOST_PP_VARIADIC_HAS_OPT_ELEM_2(e0, e1, e2, ...) e2
|
||||
#
|
||||
# endif
|
||||
#
|
||||
# endif
|
28
boost/preprocessor/variadic/has_opt.hpp
Normal file
28
boost/preprocessor/variadic/has_opt.hpp
Normal file
@ -0,0 +1,28 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Edward Diener 2019. *
|
||||
# * 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 for most recent version. */
|
||||
#
|
||||
# ifndef BOOST_PREPROCESSOR_VARIADIC_HAS_OPT_HPP
|
||||
# define BOOST_PREPROCESSOR_VARIADIC_HAS_OPT_HPP
|
||||
#
|
||||
# include <boost/preprocessor/config/config.hpp>
|
||||
#
|
||||
# /* BOOST_PP_VARIADIC_HAS_OPT */
|
||||
#
|
||||
# if BOOST_PP_VARIADICS && defined(__cplusplus) && __cplusplus > 201703L
|
||||
# include <boost/preprocessor/variadic/detail/has_opt.hpp>
|
||||
# define BOOST_PP_VARIADIC_HAS_OPT() \
|
||||
BOOST_PP_VARIADIC_HAS_OPT_ELEM2(BOOST_PP_VARIADIC_HAS_OPT_FUNCTION(?),) \
|
||||
/**/
|
||||
# else
|
||||
# define BOOST_PP_VARIADIC_HAS_OPT() 0
|
||||
# endif
|
||||
#
|
||||
# endif
|
@ -20,7 +20,7 @@
|
||||
#define BOOST_PROGRESS_HPP
|
||||
|
||||
#include <boost/config/header_deprecated.hpp>
|
||||
BOOST_HEADER_DEPRECATED( "the facilities in <boost/timer/timer.hpp>" )
|
||||
BOOST_HEADER_DEPRECATED( "the facilities in <boost/timer/timer.hpp> or <boost/timer/progress_display.hpp>" )
|
||||
|
||||
#include <boost/timer.hpp>
|
||||
#include <boost/noncopyable.hpp>
|
||||
|
@ -92,7 +92,7 @@ namespace boost { namespace proto
|
||||
|
||||
// Work-around for:
|
||||
// https://connect.microsoft.com/VisualStudio/feedback/details/765449/codegen-stack-corruption-using-runtime-checks-when-aggregate-initializing-struct
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1700))
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, < 1800)
|
||||
template<typename T, typename Expr, typename C, typename U>
|
||||
BOOST_FORCEINLINE
|
||||
Expr make_terminal(T &t, Expr *, proto::term<U C::*> *)
|
||||
|
@ -74,6 +74,7 @@ namespace boost { namespace proto
|
||||
///
|
||||
#define BOOST_PROTO_DEFINE_FUN_OP_IMPL_(Z, N, DATA, Const) \
|
||||
BOOST_PP_IF(N, BOOST_PROTO_TEMPLATE_YES_, BOOST_PROTO_TEMPLATE_NO_)(Z, N) \
|
||||
BOOST_PROTO_DISABLE_MSVC_C4180 \
|
||||
BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \
|
||||
typename BOOST_PROTO_RESULT_OF< \
|
||||
proto_generator( \
|
||||
@ -104,6 +105,7 @@ namespace boost { namespace proto
|
||||
///
|
||||
#define BOOST_PROTO_DEFINE_FUN_OP_VARIADIC_IMPL_(Const) \
|
||||
template<typename... A> \
|
||||
BOOST_PROTO_DISABLE_MSVC_C4180 \
|
||||
BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \
|
||||
typename BOOST_PROTO_RESULT_OF< \
|
||||
proto_generator( \
|
||||
@ -258,6 +260,7 @@ namespace boost { namespace proto
|
||||
///
|
||||
#define BOOST_PROTO_EXTENDS_ASSIGN_IMPL_(ThisConst, ThatConst) \
|
||||
template<typename A> \
|
||||
BOOST_PROTO_DISABLE_MSVC_C4180 \
|
||||
BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \
|
||||
typename BOOST_PROTO_RESULT_OF< \
|
||||
proto_generator( \
|
||||
@ -325,6 +328,7 @@ namespace boost { namespace proto
|
||||
///
|
||||
#define BOOST_PROTO_EXTENDS_SUBSCRIPT_IMPL_(ThisConst, ThatConst) \
|
||||
template<typename A> \
|
||||
BOOST_PROTO_DISABLE_MSVC_C4180 \
|
||||
BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \
|
||||
typename BOOST_PROTO_RESULT_OF< \
|
||||
proto_generator( \
|
||||
|
@ -230,7 +230,7 @@ namespace boost { namespace proto
|
||||
|
||||
// Work-around for:
|
||||
// https://connect.microsoft.com/VisualStudio/feedback/details/765449/codegen-stack-corruption-using-runtime-checks-when-aggregate-initializing-struct
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1700))
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, < 1800)
|
||||
template<typename Class, typename Member>
|
||||
BOOST_FORCEINLINE
|
||||
Extends<expr<tag::terminal, proto::term<Member Class::*> > > operator ()(expr<tag::terminal, proto::term<Member Class::*> > const &e) const
|
||||
|
@ -124,9 +124,11 @@
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
# define BOOST_PROTO_DISABLE_MSVC_C4180 __pragma(warning(disable : 4180)) // qualifier applied to function type has no meaning; ignored
|
||||
# define BOOST_PROTO_DISABLE_MSVC_C4522 __pragma(warning(disable : 4522)) // 'class' : multiple assignment operators specified
|
||||
# define BOOST_PROTO_DISABLE_MSVC_C4714 __pragma(warning(disable : 4714)) // function 'xxx' marked as __forceinline not inlined
|
||||
#else
|
||||
# define BOOST_PROTO_DISABLE_MSVC_C4180
|
||||
# define BOOST_PROTO_DISABLE_MSVC_C4522
|
||||
# define BOOST_PROTO_DISABLE_MSVC_C4714
|
||||
#endif
|
||||
|
@ -20,7 +20,7 @@
|
||||
#define BOOST_REGEX_V4_BASIC_REGEX_HPP
|
||||
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/functional/hash.hpp>
|
||||
#include <boost/container_hash/hash.hpp>
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(push)
|
||||
|
@ -67,7 +67,7 @@ struct saved_matched_paren : public saved_state
|
||||
{
|
||||
int index;
|
||||
sub_match<BidiIterator> sub;
|
||||
saved_matched_paren(int i, const sub_match<BidiIterator>& s) : saved_state(1), index(i), sub(s){};
|
||||
saved_matched_paren(int i, const sub_match<BidiIterator>& s) : saved_state(1), index(i), sub(s){}
|
||||
};
|
||||
|
||||
template <class BidiIterator>
|
||||
@ -75,7 +75,7 @@ struct saved_position : public saved_state
|
||||
{
|
||||
const re_syntax_base* pstate;
|
||||
BidiIterator position;
|
||||
saved_position(const re_syntax_base* ps, BidiIterator pos, int i) : saved_state(i), pstate(ps), position(pos){};
|
||||
saved_position(const re_syntax_base* ps, BidiIterator pos, int i) : saved_state(i), pstate(ps), position(pos){}
|
||||
};
|
||||
|
||||
template <class BidiIterator>
|
||||
@ -83,7 +83,7 @@ struct saved_assertion : public saved_position<BidiIterator>
|
||||
{
|
||||
bool positive;
|
||||
saved_assertion(bool p, const re_syntax_base* ps, BidiIterator pos)
|
||||
: saved_position<BidiIterator>(ps, pos, saved_type_assertion), positive(p){};
|
||||
: saved_position<BidiIterator>(ps, pos, saved_type_assertion), positive(p){}
|
||||
};
|
||||
|
||||
template <class BidiIterator>
|
||||
|
@ -22,7 +22,7 @@ private:
|
||||
typedef std::size_t base_type;
|
||||
base_type t;
|
||||
public:
|
||||
collection_size_type(): t(0) {};
|
||||
collection_size_type(): t(0) {}
|
||||
explicit collection_size_type(const std::size_t & t_) :
|
||||
t(t_)
|
||||
{}
|
||||
|
@ -16,78 +16,54 @@
|
||||
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <utility>
|
||||
#include <boost/core/nvp.hpp>
|
||||
#include <boost/preprocessor/stringize.hpp>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#define BOOST_SERIALIZATION_NVP(name) \
|
||||
boost::serialization::make_nvp(BOOST_PP_STRINGIZE(name), name)
|
||||
/**/
|
||||
|
||||
#define BOOST_SERIALIZATION_BASE_OBJECT_NVP(name) \
|
||||
boost::serialization::make_nvp( \
|
||||
BOOST_PP_STRINGIZE(name), \
|
||||
boost::serialization::base_object<name >(*this) \
|
||||
)
|
||||
/**/
|
||||
|
||||
#include <boost/serialization/level.hpp>
|
||||
#include <boost/serialization/tracking.hpp>
|
||||
#include <boost/serialization/split_member.hpp>
|
||||
#include <boost/serialization/base_object.hpp>
|
||||
#include <boost/serialization/traits.hpp>
|
||||
#include <boost/serialization/split_free.hpp>
|
||||
#include <boost/serialization/wrapper.hpp>
|
||||
|
||||
#include <boost/core/addressof.hpp>
|
||||
#include <boost/serialization/base_object.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace serialization {
|
||||
|
||||
template<class T>
|
||||
struct nvp :
|
||||
public std::pair<const char *, T *>,
|
||||
public wrapper_traits<const nvp< T > >
|
||||
{
|
||||
//private:
|
||||
nvp(const nvp & rhs) :
|
||||
std::pair<const char *, T *>(rhs.first, rhs.second)
|
||||
{}
|
||||
public:
|
||||
explicit nvp(const char * name_, T & t) :
|
||||
// note: added _ to suppress useless gcc warning
|
||||
std::pair<const char *, T *>(name_, boost::addressof(t))
|
||||
{}
|
||||
|
||||
const char * name() const {
|
||||
return this->first;
|
||||
}
|
||||
T & value() const {
|
||||
return *(this->second);
|
||||
}
|
||||
|
||||
const T & const_value() const {
|
||||
return *(this->second);
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
void save(
|
||||
Archive & ar,
|
||||
const unsigned int /* file_version */
|
||||
) const {
|
||||
ar.operator<<(const_value());
|
||||
}
|
||||
template<class Archive>
|
||||
void load(
|
||||
Archive & ar,
|
||||
const unsigned int /* file_version */
|
||||
){
|
||||
ar.operator>>(value());
|
||||
}
|
||||
BOOST_SERIALIZATION_SPLIT_MEMBER()
|
||||
};
|
||||
|
||||
template<class T>
|
||||
inline
|
||||
const nvp< T > make_nvp(const char * name, T & t){
|
||||
return nvp< T >(name, t);
|
||||
template<class Archive, class T>
|
||||
void save(
|
||||
Archive & ar,
|
||||
const nvp<T> & t,
|
||||
const unsigned int /* file_version */
|
||||
){
|
||||
ar << t.const_value();
|
||||
}
|
||||
template<class Archive, class T>
|
||||
void load(
|
||||
Archive & ar,
|
||||
nvp<T> & t ,
|
||||
const unsigned int /* file_version */
|
||||
){
|
||||
ar >> t.value();
|
||||
}
|
||||
|
||||
// to maintain efficiency and portability, we want to assign
|
||||
// specific serialization traits to all instances of this wrappers.
|
||||
// we can't strait forward method below as it depends upon
|
||||
// Partial Template Specialization and doing so would mean that wrappers
|
||||
// wouldn't be treated the same on different platforms. This would
|
||||
// break archive portability. Leave this here as reminder not to use it !!!
|
||||
template<class Archive, class T>
|
||||
inline void serialize(
|
||||
Archive & ar,
|
||||
nvp<T> & t,
|
||||
const unsigned int file_version
|
||||
){
|
||||
split_free(ar, t, file_version);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
struct implementation_level<nvp< T > >
|
||||
@ -96,6 +72,13 @@ struct implementation_level<nvp< T > >
|
||||
typedef mpl::int_<object_serializable> type;
|
||||
BOOST_STATIC_CONSTANT(int, value = implementation_level::type::value);
|
||||
};
|
||||
template <class T>
|
||||
struct implementation_level<const nvp< T > >
|
||||
{
|
||||
typedef mpl::integral_c_tag tag;
|
||||
typedef mpl::int_<object_serializable> type;
|
||||
BOOST_STATIC_CONSTANT(int, value = implementation_level::type::value);
|
||||
};
|
||||
|
||||
// nvp objects are generally created on the stack and are never tracked
|
||||
template<class T>
|
||||
@ -105,21 +88,46 @@ struct tracking_level<nvp< T > >
|
||||
typedef mpl::int_<track_never> type;
|
||||
BOOST_STATIC_CONSTANT(int, value = tracking_level::type::value);
|
||||
};
|
||||
template<class T>
|
||||
struct tracking_level<const nvp< T > >
|
||||
{
|
||||
typedef mpl::integral_c_tag tag;
|
||||
typedef mpl::int_<track_never> type;
|
||||
BOOST_STATIC_CONSTANT(int, value = tracking_level::type::value);
|
||||
};
|
||||
|
||||
// these traits aren't used by nvp so they don't need to be defined
|
||||
#if 0
|
||||
template<class T>
|
||||
struct version<const nvp< T > > {
|
||||
typedef mpl::integral_c_tag tag;
|
||||
typedef mpl::int_<0> type;
|
||||
BOOST_STATIC_CONSTANT(int, value = 0);
|
||||
};
|
||||
struct version<const nvp< T > > {
|
||||
typedef mpl::integral_c_tag tag;
|
||||
typedef mpl::int_<0> type;
|
||||
BOOST_STATIC_CONSTANT(int, value = 0);
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct extended_type_info_impl<const nvp< T > > {
|
||||
typedef extended_type_info_impl< T > type;
|
||||
};
|
||||
#endif
|
||||
|
||||
template<class T>
|
||||
struct is_wrapper<const nvp<T> > {
|
||||
typedef boost::mpl::true_ type;
|
||||
};
|
||||
template<class T>
|
||||
struct is_wrapper<nvp<T> > {
|
||||
typedef boost::mpl::true_ type;
|
||||
};
|
||||
|
||||
|
||||
} // seralization
|
||||
} // boost
|
||||
|
||||
#include <boost/preprocessor/stringize.hpp>
|
||||
|
||||
#define BOOST_SERIALIZATION_NVP(name) \
|
||||
boost::serialization::make_nvp(BOOST_PP_STRINGIZE(name), name)
|
||||
/**/
|
||||
|
||||
#define BOOST_SERIALIZATION_BASE_OBJECT_NVP(name) \
|
||||
boost::serialization::make_nvp( \
|
||||
BOOST_PP_STRINGIZE(name), \
|
||||
boost::serialization::base_object<name >(*this) \
|
||||
)
|
||||
/**/
|
||||
|
||||
#endif // BOOST_SERIALIZATION_NVP_HPP
|
||||
|
@ -26,8 +26,8 @@
|
||||
#elif defined (BOOST_SPIRIT_ASSERT_EXCEPTION)
|
||||
#define BOOST_SPIRIT_ASSERT_AUX(f, l, x) BOOST_SPIRIT_ASSERT_AUX2(f, l, x)
|
||||
#define BOOST_SPIRIT_ASSERT_AUX2(f, l, x) \
|
||||
do{ if (!(x)) boost::throw_exception( \
|
||||
BOOST_SPIRIT_ASSERT_EXCEPTION(f "(" #l "): " #x)); } while(0)
|
||||
( (x) ? (void)0 : boost::throw_exception( \
|
||||
BOOST_SPIRIT_ASSERT_EXCEPTION(f "(" #l "): " #x)) )
|
||||
#define BOOST_SPIRIT_ASSERT(x) BOOST_SPIRIT_ASSERT_AUX(__FILE__, __LINE__, x)
|
||||
#else
|
||||
#include <boost/assert.hpp>
|
||||
|
@ -298,9 +298,8 @@ namespace boost { namespace spirit { namespace traits
|
||||
{
|
||||
static bool call(T n)
|
||||
{
|
||||
if (!std::numeric_limits<T>::has_infinity)
|
||||
return false;
|
||||
return (n == std::numeric_limits<T>::infinity()) ? true : false;
|
||||
return std::numeric_limits<T>::has_infinity
|
||||
&& n == std::numeric_limits<T>::infinity();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -101,11 +101,18 @@ namespace boost { namespace spirit { namespace qi
|
||||
bool r = extract_uint<Attribute, 10, 1, -1, true, true>::call(first, last, attr_);
|
||||
if (r)
|
||||
{
|
||||
#if defined(_MSC_VER) && _MSC_VER < 1900
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable: 4127) // conditional expression is constant
|
||||
#endif
|
||||
// Optimization note: don't compute frac_digits if T is
|
||||
// an unused_type. This should be optimized away by the compiler.
|
||||
if (!is_same<T, unused_type>::value)
|
||||
frac_digits =
|
||||
static_cast<int>(std::distance(savef, first));
|
||||
#if defined(_MSC_VER) && _MSC_VER < 1900
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
// ignore extra (non-significant digits)
|
||||
extract_uint<unused_type, 10, 1, -1>::call(first, last, unused);
|
||||
}
|
||||
|
@ -754,39 +754,14 @@ namespace boost { namespace spirit { namespace char_class
|
||||
namespace boost { namespace spirit { namespace traits
|
||||
{
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// This meta-function evaluates to mpl::true_ if the function
|
||||
// char_encoding::ischar() needs to be called to ensure correct matching.
|
||||
// This happens mainly if the character type returned from the underlying
|
||||
// iterator is larger than the character type of the used character
|
||||
// encoding. Additionally, this meta-function provides a customization
|
||||
// point for the lexer library to enforce this behavior while parsing
|
||||
// a token stream.
|
||||
template <typename Char, typename BaseChar>
|
||||
struct mustcheck_ischar
|
||||
: mpl::bool_<(sizeof(Char) > sizeof(BaseChar)) ? true : false> {};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// The following template calls char_encoding::ischar, if necessary
|
||||
template <typename CharParam, typename CharEncoding
|
||||
, bool MustCheck = mustcheck_ischar<
|
||||
CharParam, typename CharEncoding::char_type>::value>
|
||||
struct ischar
|
||||
{
|
||||
static bool call(CharParam)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename CharParam, typename CharEncoding>
|
||||
struct ischar<CharParam, CharEncoding, true>
|
||||
struct ischar
|
||||
{
|
||||
static bool call(CharParam const& ch)
|
||||
{
|
||||
return CharEncoding::ischar(int(ch));
|
||||
return CharEncoding::ischar(int(ch));
|
||||
}
|
||||
};
|
||||
|
||||
}}}
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
|
@ -183,6 +183,7 @@ namespace boost { namespace spirit { namespace char_encoding
|
||||
struct ascii
|
||||
{
|
||||
typedef char char_type;
|
||||
typedef unsigned char classify_type;
|
||||
|
||||
static bool
|
||||
isascii_(int ch)
|
||||
@ -196,10 +197,22 @@ namespace boost { namespace spirit { namespace char_encoding
|
||||
return isascii_(ch);
|
||||
}
|
||||
|
||||
// *** Note on assertions: The precondition is that the calls to
|
||||
// these functions do not violate the required range of ch (type int)
|
||||
// which is that strict_ischar(ch) should be true. It is the
|
||||
// responsibility of the caller to make sure this precondition is not
|
||||
// violated.
|
||||
|
||||
static bool
|
||||
strict_ischar(int ch)
|
||||
{
|
||||
return ch >= 0 && ch <= 127;
|
||||
}
|
||||
|
||||
static bool
|
||||
isalnum(int ch)
|
||||
{
|
||||
BOOST_ASSERT(0 == (ch & ~UCHAR_MAX));
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return (ascii_char_types[ch] & BOOST_CC_ALPHA)
|
||||
|| (ascii_char_types[ch] & BOOST_CC_DIGIT);
|
||||
}
|
||||
@ -207,74 +220,77 @@ namespace boost { namespace spirit { namespace char_encoding
|
||||
static bool
|
||||
isalpha(int ch)
|
||||
{
|
||||
BOOST_ASSERT(0 == (ch & ~UCHAR_MAX));
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return (ascii_char_types[ch] & BOOST_CC_ALPHA) ? true : false;
|
||||
}
|
||||
|
||||
static bool
|
||||
isdigit(int ch)
|
||||
{
|
||||
BOOST_ASSERT(0 == (ch & ~UCHAR_MAX));
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return (ascii_char_types[ch] & BOOST_CC_DIGIT) ? true : false;
|
||||
}
|
||||
|
||||
static bool
|
||||
isxdigit(int ch)
|
||||
{
|
||||
BOOST_ASSERT(0 == (ch & ~UCHAR_MAX));
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return (ascii_char_types[ch] & BOOST_CC_XDIGIT) ? true : false;
|
||||
}
|
||||
|
||||
static bool
|
||||
iscntrl(int ch)
|
||||
{
|
||||
BOOST_ASSERT(0 == (ch & ~UCHAR_MAX));
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return (ascii_char_types[ch] & BOOST_CC_CTRL) ? true : false;
|
||||
}
|
||||
|
||||
static bool
|
||||
isgraph(int ch)
|
||||
{
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return ('\x21' <= ch && ch <= '\x7e');
|
||||
}
|
||||
|
||||
static bool
|
||||
islower(int ch)
|
||||
{
|
||||
BOOST_ASSERT(0 == (ch & ~UCHAR_MAX));
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return (ascii_char_types[ch] & BOOST_CC_LOWER) ? true : false;
|
||||
}
|
||||
|
||||
static bool
|
||||
isprint(int ch)
|
||||
{
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return ('\x20' <= ch && ch <= '\x7e');
|
||||
}
|
||||
|
||||
static bool
|
||||
ispunct(int ch)
|
||||
{
|
||||
BOOST_ASSERT(0 == (ch & ~UCHAR_MAX));
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return (ascii_char_types[ch] & BOOST_CC_PUNCT) ? true : false;
|
||||
}
|
||||
|
||||
static bool
|
||||
isspace(int ch)
|
||||
{
|
||||
BOOST_ASSERT(0 == (ch & ~UCHAR_MAX));
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return (ascii_char_types[ch] & BOOST_CC_SPACE) ? true : false;
|
||||
}
|
||||
|
||||
static bool
|
||||
isblank BOOST_PREVENT_MACRO_SUBSTITUTION (int ch)
|
||||
{
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return ('\x09' == ch || '\x20' == ch);
|
||||
}
|
||||
|
||||
static bool
|
||||
isupper(int ch)
|
||||
{
|
||||
BOOST_ASSERT(0 == (ch & ~UCHAR_MAX));
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return (ascii_char_types[ch] & BOOST_CC_UPPER) ? true : false;
|
||||
}
|
||||
|
||||
@ -285,18 +301,21 @@ namespace boost { namespace spirit { namespace char_encoding
|
||||
static int
|
||||
tolower(int ch)
|
||||
{
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return isupper(ch) ? (ch - 'A' + 'a') : ch;
|
||||
}
|
||||
|
||||
static int
|
||||
toupper(int ch)
|
||||
{
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return islower(ch) ? (ch - 'a' + 'A') : ch;
|
||||
}
|
||||
|
||||
static ::boost::uint32_t
|
||||
toucs4(int ch)
|
||||
{
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return ch;
|
||||
}
|
||||
};
|
||||
|
@ -203,101 +203,101 @@ namespace boost { namespace spirit { namespace char_encoding
|
||||
/* -- 158 9e */ BOOST_CC_CTRL,
|
||||
/* -- 159 9f */ BOOST_CC_CTRL,
|
||||
/* 160 a0 */ BOOST_CC_SPACE,
|
||||
/* ¡ 161 a1 */ BOOST_CC_PUNCT,
|
||||
/* ¢ 162 a2 */ BOOST_CC_PUNCT,
|
||||
/* £ 163 a3 */ BOOST_CC_PUNCT,
|
||||
/* ¤ 164 a4 */ BOOST_CC_PUNCT,
|
||||
/* ¥ 165 a5 */ BOOST_CC_PUNCT,
|
||||
/* ¦ 166 a6 */ BOOST_CC_PUNCT,
|
||||
/* § 167 a7 */ BOOST_CC_PUNCT,
|
||||
/* ¨ 168 a8 */ BOOST_CC_PUNCT,
|
||||
/* © 169 a9 */ BOOST_CC_PUNCT,
|
||||
/* ª 170 aa */ BOOST_CC_PUNCT,
|
||||
/* « 171 ab */ BOOST_CC_PUNCT,
|
||||
/* ¬ 172 ac */ BOOST_CC_PUNCT,
|
||||
/* 173 ad */ BOOST_CC_PUNCT,
|
||||
/* ® 174 ae */ BOOST_CC_PUNCT,
|
||||
/* ¯ 175 af */ BOOST_CC_PUNCT,
|
||||
/* ° 176 b0 */ BOOST_CC_PUNCT,
|
||||
/* ± 177 b1 */ BOOST_CC_PUNCT,
|
||||
/* ² 178 b2 */ BOOST_CC_DIGIT|BOOST_CC_PUNCT,
|
||||
/* ³ 179 b3 */ BOOST_CC_DIGIT|BOOST_CC_PUNCT,
|
||||
/* ´ 180 b4 */ BOOST_CC_PUNCT,
|
||||
/* µ 181 b5 */ BOOST_CC_PUNCT,
|
||||
/* ¶ 182 b6 */ BOOST_CC_PUNCT,
|
||||
/* · 183 b7 */ BOOST_CC_PUNCT,
|
||||
/* ¸ 184 b8 */ BOOST_CC_PUNCT,
|
||||
/* ¹ 185 b9 */ BOOST_CC_DIGIT|BOOST_CC_PUNCT,
|
||||
/* º 186 ba */ BOOST_CC_PUNCT,
|
||||
/* » 187 bb */ BOOST_CC_PUNCT,
|
||||
/* ¼ 188 bc */ BOOST_CC_PUNCT,
|
||||
/* ½ 189 bd */ BOOST_CC_PUNCT,
|
||||
/* ¾ 190 be */ BOOST_CC_PUNCT,
|
||||
/* ¿ 191 bf */ BOOST_CC_PUNCT,
|
||||
/* À 192 c0 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* Á 193 c1 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* Â 194 c2 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* Ã 195 c3 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* Ä 196 c4 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* Å 197 c5 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* Æ 198 c6 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* Ç 199 c7 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* È 200 c8 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* É 201 c9 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* Ê 202 ca */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* Ë 203 cb */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* Ì 204 cc */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* Í 205 cd */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* Î 206 ce */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* Ï 207 cf */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* Ð 208 d0 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* Ñ 209 d1 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* Ò 210 d2 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* Ó 211 d3 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* Ô 212 d4 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* Õ 213 d5 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* Ö 214 d6 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* × 215 d7 */ BOOST_CC_PUNCT,
|
||||
/* Ø 216 d8 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* Ù 217 d9 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* Ú 218 da */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* Û 219 db */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* Ü 220 dc */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* Ý 221 dd */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* Þ 222 de */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* ß 223 df */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* à 224 e0 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* á 225 e1 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* â 226 e2 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* ã 227 e3 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* ä 228 e4 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* å 229 e5 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* æ 230 e6 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* ç 231 e7 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* è 232 e8 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* é 233 e9 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* ê 234 ea */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* ë 235 eb */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* ì 236 ec */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* í 237 ed */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* î 238 ee */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* ï 239 ef */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* ð 240 f0 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* ñ 241 f1 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* ò 242 f2 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* ó 243 f3 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* ô 244 f4 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* õ 245 f5 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* ö 246 f6 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* ÷ 247 f7 */ BOOST_CC_PUNCT,
|
||||
/* ø 248 f8 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* ù 249 f9 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* ú 250 fa */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* û 251 fb */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* ü 252 fc */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* ý 253 fd */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* þ 254 fe */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* ÿ 255 ff */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* <EFBFBD> 161 a1 */ BOOST_CC_PUNCT,
|
||||
/* <EFBFBD> 162 a2 */ BOOST_CC_PUNCT,
|
||||
/* <EFBFBD> 163 a3 */ BOOST_CC_PUNCT,
|
||||
/* <EFBFBD> 164 a4 */ BOOST_CC_PUNCT,
|
||||
/* <EFBFBD> 165 a5 */ BOOST_CC_PUNCT,
|
||||
/* <EFBFBD> 166 a6 */ BOOST_CC_PUNCT,
|
||||
/* <EFBFBD> 167 a7 */ BOOST_CC_PUNCT,
|
||||
/* <EFBFBD> 168 a8 */ BOOST_CC_PUNCT,
|
||||
/* <EFBFBD> 169 a9 */ BOOST_CC_PUNCT,
|
||||
/* <EFBFBD> 170 aa */ BOOST_CC_PUNCT,
|
||||
/* <EFBFBD> 171 ab */ BOOST_CC_PUNCT,
|
||||
/* <EFBFBD> 172 ac */ BOOST_CC_PUNCT,
|
||||
/* <EFBFBD> 173 ad */ BOOST_CC_PUNCT,
|
||||
/* <EFBFBD> 174 ae */ BOOST_CC_PUNCT,
|
||||
/* <EFBFBD> 175 af */ BOOST_CC_PUNCT,
|
||||
/* <EFBFBD> 176 b0 */ BOOST_CC_PUNCT,
|
||||
/* <EFBFBD> 177 b1 */ BOOST_CC_PUNCT,
|
||||
/* <EFBFBD> 178 b2 */ BOOST_CC_DIGIT|BOOST_CC_PUNCT,
|
||||
/* <EFBFBD> 179 b3 */ BOOST_CC_DIGIT|BOOST_CC_PUNCT,
|
||||
/* <EFBFBD> 180 b4 */ BOOST_CC_PUNCT,
|
||||
/* <EFBFBD> 181 b5 */ BOOST_CC_PUNCT,
|
||||
/* <EFBFBD> 182 b6 */ BOOST_CC_PUNCT,
|
||||
/* <EFBFBD> 183 b7 */ BOOST_CC_PUNCT,
|
||||
/* <EFBFBD> 184 b8 */ BOOST_CC_PUNCT,
|
||||
/* <EFBFBD> 185 b9 */ BOOST_CC_DIGIT|BOOST_CC_PUNCT,
|
||||
/* <EFBFBD> 186 ba */ BOOST_CC_PUNCT,
|
||||
/* <EFBFBD> 187 bb */ BOOST_CC_PUNCT,
|
||||
/* <EFBFBD> 188 bc */ BOOST_CC_PUNCT,
|
||||
/* <EFBFBD> 189 bd */ BOOST_CC_PUNCT,
|
||||
/* <EFBFBD> 190 be */ BOOST_CC_PUNCT,
|
||||
/* <EFBFBD> 191 bf */ BOOST_CC_PUNCT,
|
||||
/* <EFBFBD> 192 c0 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* <EFBFBD> 193 c1 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* <EFBFBD> 194 c2 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* <EFBFBD> 195 c3 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* <EFBFBD> 196 c4 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* <EFBFBD> 197 c5 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* <EFBFBD> 198 c6 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* <EFBFBD> 199 c7 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* <EFBFBD> 200 c8 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* <EFBFBD> 201 c9 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* <EFBFBD> 202 ca */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* <EFBFBD> 203 cb */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* <EFBFBD> 204 cc */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* <EFBFBD> 205 cd */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* <EFBFBD> 206 ce */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* <EFBFBD> 207 cf */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* <EFBFBD> 208 d0 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* <EFBFBD> 209 d1 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* <EFBFBD> 210 d2 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* <EFBFBD> 211 d3 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* <EFBFBD> 212 d4 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* <EFBFBD> 213 d5 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* <EFBFBD> 214 d6 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* <EFBFBD> 215 d7 */ BOOST_CC_PUNCT,
|
||||
/* <EFBFBD> 216 d8 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* <EFBFBD> 217 d9 */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* <EFBFBD> 218 da */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* <EFBFBD> 219 db */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* <EFBFBD> 220 dc */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* <EFBFBD> 221 dd */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* <EFBFBD> 222 de */ BOOST_CC_ALPHA|BOOST_CC_UPPER,
|
||||
/* <EFBFBD> 223 df */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* <EFBFBD> 224 e0 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* <EFBFBD> 225 e1 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* <EFBFBD> 226 e2 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* <EFBFBD> 227 e3 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* <EFBFBD> 228 e4 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* <EFBFBD> 229 e5 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* <EFBFBD> 230 e6 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* <EFBFBD> 231 e7 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* <EFBFBD> 232 e8 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* <EFBFBD> 233 e9 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* <EFBFBD> 234 ea */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* <EFBFBD> 235 eb */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* <EFBFBD> 236 ec */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* <EFBFBD> 237 ed */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* <EFBFBD> 238 ee */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* <EFBFBD> 239 ef */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* <EFBFBD> 240 f0 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* <EFBFBD> 241 f1 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* <EFBFBD> 242 f2 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* <EFBFBD> 243 f3 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* <EFBFBD> 244 f4 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* <EFBFBD> 245 f5 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* <EFBFBD> 246 f6 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* <EFBFBD> 247 f7 */ BOOST_CC_PUNCT,
|
||||
/* <EFBFBD> 248 f8 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* <EFBFBD> 249 f9 */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* <EFBFBD> 250 fa */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* <EFBFBD> 251 fb */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* <EFBFBD> 252 fc */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* <EFBFBD> 253 fd */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* <EFBFBD> 254 fe */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
/* <EFBFBD> 255 ff */ BOOST_CC_ALPHA|BOOST_CC_LOWER,
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
@ -466,101 +466,101 @@ namespace boost { namespace spirit { namespace char_encoding
|
||||
/* -- 158 9e */ '\0',
|
||||
/* -- 159 9f */ '\0',
|
||||
/* 160 a0 */ '\0',
|
||||
/* ¡ 161 a1 */ '\0',
|
||||
/* ¢ 162 a2 */ '\0',
|
||||
/* £ 163 a3 */ '\0',
|
||||
/* ¤ 164 a4 */ '\0',
|
||||
/* ¥ 165 a5 */ '\0',
|
||||
/* ¦ 166 a6 */ '\0',
|
||||
/* § 167 a7 */ '\0',
|
||||
/* ¨ 168 a8 */ '\0',
|
||||
/* © 169 a9 */ '\0',
|
||||
/* ª 170 aa */ '\0',
|
||||
/* « 171 ab */ '\0',
|
||||
/* ¬ 172 ac */ '\0',
|
||||
/* 173 ad */ '\0',
|
||||
/* ® 174 ae */ '\0',
|
||||
/* ¯ 175 af */ '\0',
|
||||
/* ° 176 b0 */ '\0',
|
||||
/* ± 177 b1 */ '\0',
|
||||
/* ² 178 b2 */ '\0',
|
||||
/* ³ 179 b3 */ '\0',
|
||||
/* ´ 180 b4 */ '\0',
|
||||
/* µ 181 b5 */ '\0',
|
||||
/* ¶ 182 b6 */ '\0',
|
||||
/* · 183 b7 */ '\0',
|
||||
/* ¸ 184 b8 */ '\0',
|
||||
/* ¹ 185 b9 */ '\0',
|
||||
/* º 186 ba */ '\0',
|
||||
/* » 187 bb */ '\0',
|
||||
/* ¼ 188 bc */ '\0',
|
||||
/* ½ 189 bd */ '\0',
|
||||
/* ¾ 190 be */ '\0',
|
||||
/* ¿ 191 bf */ '\0',
|
||||
/* à 192 c0 */ 0xe0,
|
||||
/* á 193 c1 */ 0xe1,
|
||||
/* â 194 c2 */ 0xe2,
|
||||
/* ã 195 c3 */ 0xe3,
|
||||
/* ä 196 c4 */ 0xe4,
|
||||
/* å 197 c5 */ 0xe5,
|
||||
/* æ 198 c6 */ 0xe6,
|
||||
/* ç 199 c7 */ 0xe7,
|
||||
/* è 200 c8 */ 0xe8,
|
||||
/* é 201 c9 */ 0xe9,
|
||||
/* ê 202 ca */ 0xea,
|
||||
/* ë 203 cb */ 0xeb,
|
||||
/* ì 204 cc */ 0xec,
|
||||
/* í 205 cd */ 0xed,
|
||||
/* î 206 ce */ 0xee,
|
||||
/* ï 207 cf */ 0xef,
|
||||
/* ð 208 d0 */ 0xf0,
|
||||
/* ñ 209 d1 */ 0xf1,
|
||||
/* ò 210 d2 */ 0xf2,
|
||||
/* ó 211 d3 */ 0xf3,
|
||||
/* ô 212 d4 */ 0xf4,
|
||||
/* õ 213 d5 */ 0xf5,
|
||||
/* ö 214 d6 */ 0xf6,
|
||||
/* × 215 d7 */ '\0',
|
||||
/* ø 216 d8 */ 0xf8,
|
||||
/* ù 217 d9 */ 0xf9,
|
||||
/* ú 218 da */ 0xfa,
|
||||
/* û 219 db */ 0xfb,
|
||||
/* ü 220 dc */ 0xfc,
|
||||
/* ý 221 dd */ 0xfd,
|
||||
/* þ 222 de */ 0xfe,
|
||||
/* ß 223 df */ '\0',
|
||||
/* À 224 e0 */ 0xc0,
|
||||
/* Á 225 e1 */ 0xc1,
|
||||
/* Â 226 e2 */ 0xc2,
|
||||
/* Ã 227 e3 */ 0xc3,
|
||||
/* Ä 228 e4 */ 0xc4,
|
||||
/* Å 229 e5 */ 0xc5,
|
||||
/* Æ 230 e6 */ 0xc6,
|
||||
/* Ç 231 e7 */ 0xc7,
|
||||
/* È 232 e8 */ 0xc8,
|
||||
/* É 233 e9 */ 0xc9,
|
||||
/* Ê 234 ea */ 0xca,
|
||||
/* Ë 235 eb */ 0xcb,
|
||||
/* Ì 236 ec */ 0xcc,
|
||||
/* Í 237 ed */ 0xcd,
|
||||
/* Î 238 ee */ 0xce,
|
||||
/* Ï 239 ef */ 0xcf,
|
||||
/* Ð 240 f0 */ 0xd0,
|
||||
/* Ñ 241 f1 */ 0xd1,
|
||||
/* Ò 242 f2 */ 0xd2,
|
||||
/* Ó 243 f3 */ 0xd3,
|
||||
/* Ô 244 f4 */ 0xd4,
|
||||
/* Õ 245 f5 */ 0xd5,
|
||||
/* Ö 246 f6 */ 0xd6,
|
||||
/* ÷ 247 f7 */ '\0',
|
||||
/* Ø 248 f8 */ 0xd8,
|
||||
/* Ù 249 f9 */ 0xd9,
|
||||
/* Ú 250 fa */ 0xda,
|
||||
/* Û 251 fb */ 0xdb,
|
||||
/* Ü 252 fc */ 0xdc,
|
||||
/* Ý 253 fd */ 0xdd,
|
||||
/* Þ 254 fe */ 0xde,
|
||||
/* ÿ 255 ff */ '\0',
|
||||
/* <EFBFBD> 161 a1 */ '\0',
|
||||
/* <EFBFBD> 162 a2 */ '\0',
|
||||
/* <EFBFBD> 163 a3 */ '\0',
|
||||
/* <EFBFBD> 164 a4 */ '\0',
|
||||
/* <EFBFBD> 165 a5 */ '\0',
|
||||
/* <EFBFBD> 166 a6 */ '\0',
|
||||
/* <EFBFBD> 167 a7 */ '\0',
|
||||
/* <EFBFBD> 168 a8 */ '\0',
|
||||
/* <EFBFBD> 169 a9 */ '\0',
|
||||
/* <EFBFBD> 170 aa */ '\0',
|
||||
/* <EFBFBD> 171 ab */ '\0',
|
||||
/* <EFBFBD> 172 ac */ '\0',
|
||||
/* <EFBFBD> 173 ad */ '\0',
|
||||
/* <EFBFBD> 174 ae */ '\0',
|
||||
/* <EFBFBD> 175 af */ '\0',
|
||||
/* <EFBFBD> 176 b0 */ '\0',
|
||||
/* <EFBFBD> 177 b1 */ '\0',
|
||||
/* <EFBFBD> 178 b2 */ '\0',
|
||||
/* <EFBFBD> 179 b3 */ '\0',
|
||||
/* <EFBFBD> 180 b4 */ '\0',
|
||||
/* <EFBFBD> 181 b5 */ '\0',
|
||||
/* <EFBFBD> 182 b6 */ '\0',
|
||||
/* <EFBFBD> 183 b7 */ '\0',
|
||||
/* <EFBFBD> 184 b8 */ '\0',
|
||||
/* <EFBFBD> 185 b9 */ '\0',
|
||||
/* <EFBFBD> 186 ba */ '\0',
|
||||
/* <EFBFBD> 187 bb */ '\0',
|
||||
/* <EFBFBD> 188 bc */ '\0',
|
||||
/* <EFBFBD> 189 bd */ '\0',
|
||||
/* <EFBFBD> 190 be */ '\0',
|
||||
/* <EFBFBD> 191 bf */ '\0',
|
||||
/* <EFBFBD> 192 c0 */ 0xe0,
|
||||
/* <EFBFBD> 193 c1 */ 0xe1,
|
||||
/* <EFBFBD> 194 c2 */ 0xe2,
|
||||
/* <EFBFBD> 195 c3 */ 0xe3,
|
||||
/* <EFBFBD> 196 c4 */ 0xe4,
|
||||
/* <EFBFBD> 197 c5 */ 0xe5,
|
||||
/* <EFBFBD> 198 c6 */ 0xe6,
|
||||
/* <EFBFBD> 199 c7 */ 0xe7,
|
||||
/* <EFBFBD> 200 c8 */ 0xe8,
|
||||
/* <EFBFBD> 201 c9 */ 0xe9,
|
||||
/* <EFBFBD> 202 ca */ 0xea,
|
||||
/* <EFBFBD> 203 cb */ 0xeb,
|
||||
/* <EFBFBD> 204 cc */ 0xec,
|
||||
/* <EFBFBD> 205 cd */ 0xed,
|
||||
/* <EFBFBD> 206 ce */ 0xee,
|
||||
/* <EFBFBD> 207 cf */ 0xef,
|
||||
/* <EFBFBD> 208 d0 */ 0xf0,
|
||||
/* <EFBFBD> 209 d1 */ 0xf1,
|
||||
/* <EFBFBD> 210 d2 */ 0xf2,
|
||||
/* <EFBFBD> 211 d3 */ 0xf3,
|
||||
/* <EFBFBD> 212 d4 */ 0xf4,
|
||||
/* <EFBFBD> 213 d5 */ 0xf5,
|
||||
/* <EFBFBD> 214 d6 */ 0xf6,
|
||||
/* <EFBFBD> 215 d7 */ '\0',
|
||||
/* <EFBFBD> 216 d8 */ 0xf8,
|
||||
/* <EFBFBD> 217 d9 */ 0xf9,
|
||||
/* <EFBFBD> 218 da */ 0xfa,
|
||||
/* <EFBFBD> 219 db */ 0xfb,
|
||||
/* <EFBFBD> 220 dc */ 0xfc,
|
||||
/* <EFBFBD> 221 dd */ 0xfd,
|
||||
/* <EFBFBD> 222 de */ 0xfe,
|
||||
/* <EFBFBD> 223 df */ '\0',
|
||||
/* <EFBFBD> 224 e0 */ 0xc0,
|
||||
/* <EFBFBD> 225 e1 */ 0xc1,
|
||||
/* <EFBFBD> 226 e2 */ 0xc2,
|
||||
/* <EFBFBD> 227 e3 */ 0xc3,
|
||||
/* <EFBFBD> 228 e4 */ 0xc4,
|
||||
/* <EFBFBD> 229 e5 */ 0xc5,
|
||||
/* <EFBFBD> 230 e6 */ 0xc6,
|
||||
/* <EFBFBD> 231 e7 */ 0xc7,
|
||||
/* <EFBFBD> 232 e8 */ 0xc8,
|
||||
/* <EFBFBD> 233 e9 */ 0xc9,
|
||||
/* <EFBFBD> 234 ea */ 0xca,
|
||||
/* <EFBFBD> 235 eb */ 0xcb,
|
||||
/* <EFBFBD> 236 ec */ 0xcc,
|
||||
/* <EFBFBD> 237 ed */ 0xcd,
|
||||
/* <EFBFBD> 238 ee */ 0xce,
|
||||
/* <EFBFBD> 239 ef */ 0xcf,
|
||||
/* <EFBFBD> 240 f0 */ 0xd0,
|
||||
/* <EFBFBD> 241 f1 */ 0xd1,
|
||||
/* <EFBFBD> 242 f2 */ 0xd2,
|
||||
/* <EFBFBD> 243 f3 */ 0xd3,
|
||||
/* <EFBFBD> 244 f4 */ 0xd4,
|
||||
/* <EFBFBD> 245 f5 */ 0xd5,
|
||||
/* <EFBFBD> 246 f6 */ 0xd6,
|
||||
/* <EFBFBD> 247 f7 */ '\0',
|
||||
/* <EFBFBD> 248 f8 */ 0xd8,
|
||||
/* <EFBFBD> 249 f9 */ 0xd9,
|
||||
/* <EFBFBD> 250 fa */ 0xda,
|
||||
/* <EFBFBD> 251 fb */ 0xdb,
|
||||
/* <EFBFBD> 252 fc */ 0xdc,
|
||||
/* <EFBFBD> 253 fd */ 0xdd,
|
||||
/* <EFBFBD> 254 fe */ 0xde,
|
||||
/* <EFBFBD> 255 ff */ '\0',
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
@ -569,6 +569,7 @@ namespace boost { namespace spirit { namespace char_encoding
|
||||
struct iso8859_1
|
||||
{
|
||||
typedef unsigned char char_type;
|
||||
typedef unsigned char classify_type;
|
||||
|
||||
static bool
|
||||
isascii_(int ch)
|
||||
@ -581,13 +582,25 @@ namespace boost { namespace spirit { namespace char_encoding
|
||||
{
|
||||
// iso8859.1 uses all 8 bits
|
||||
// we have to watch out for sign extensions
|
||||
return (0 == (ch & ~0xff) || ~0 == (ch | 0xff)) ? true : false;
|
||||
return (0 == (ch & ~0xff) || ~0 == (ch | 0xff)) != 0;
|
||||
}
|
||||
|
||||
// *** Note on assertions: The precondition is that the calls to
|
||||
// these functions do not violate the required range of ch (type int)
|
||||
// which is that strict_ischar(ch) should be true. It is the
|
||||
// responsibility of the caller to make sure this precondition is not
|
||||
// violated.
|
||||
|
||||
static bool
|
||||
strict_ischar(int ch)
|
||||
{
|
||||
return ch >= 0 && ch <= 255;
|
||||
}
|
||||
|
||||
static bool
|
||||
isalnum(int ch)
|
||||
{
|
||||
BOOST_ASSERT(0 == (ch & ~UCHAR_MAX));
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return (iso8859_1_char_types[ch] & BOOST_CC_ALPHA)
|
||||
|| (iso8859_1_char_types[ch] & BOOST_CC_DIGIT);
|
||||
}
|
||||
@ -595,29 +608,29 @@ namespace boost { namespace spirit { namespace char_encoding
|
||||
static bool
|
||||
isalpha(int ch)
|
||||
{
|
||||
BOOST_ASSERT(0 == (ch & ~UCHAR_MAX));
|
||||
return (iso8859_1_char_types[ch] & BOOST_CC_ALPHA) ? true : false;
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return (iso8859_1_char_types[ch] & BOOST_CC_ALPHA) != 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
isdigit(int ch)
|
||||
{
|
||||
BOOST_ASSERT(0 == (ch & ~UCHAR_MAX));
|
||||
return (iso8859_1_char_types[ch] & BOOST_CC_DIGIT) ? true : false;
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return (iso8859_1_char_types[ch] & BOOST_CC_DIGIT) != 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
isxdigit(int ch)
|
||||
{
|
||||
BOOST_ASSERT(0 == (ch & ~UCHAR_MAX));
|
||||
return (iso8859_1_char_types[ch] & BOOST_CC_XDIGIT) ? true : false;
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return (iso8859_1_char_types[ch] & BOOST_CC_XDIGIT) != 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
iscntrl(int ch)
|
||||
{
|
||||
BOOST_ASSERT(0 == (ch & ~UCHAR_MAX));
|
||||
return (iso8859_1_char_types[ch] & BOOST_CC_CTRL) ? true : false;
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return (iso8859_1_char_types[ch] & BOOST_CC_CTRL) != 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
@ -629,8 +642,8 @@ namespace boost { namespace spirit { namespace char_encoding
|
||||
static bool
|
||||
islower(int ch)
|
||||
{
|
||||
BOOST_ASSERT(0 == (ch & ~UCHAR_MAX));
|
||||
return (iso8859_1_char_types[ch] & BOOST_CC_LOWER) ? true : false;
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return (iso8859_1_char_types[ch] & BOOST_CC_LOWER) != 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
@ -642,28 +655,29 @@ namespace boost { namespace spirit { namespace char_encoding
|
||||
static bool
|
||||
ispunct(int ch)
|
||||
{
|
||||
BOOST_ASSERT(0 == (ch & ~UCHAR_MAX));
|
||||
return (iso8859_1_char_types[ch] & BOOST_CC_PUNCT) ? true : false;
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return (iso8859_1_char_types[ch] & BOOST_CC_PUNCT) != 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
isspace(int ch)
|
||||
{
|
||||
BOOST_ASSERT(0 == (ch & ~UCHAR_MAX));
|
||||
return (iso8859_1_char_types[ch] & BOOST_CC_SPACE) ? true : false;
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return (iso8859_1_char_types[ch] & BOOST_CC_SPACE) != 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
isblank BOOST_PREVENT_MACRO_SUBSTITUTION (int ch)
|
||||
{
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return ('\x09' == ch || '\x20' == ch || '\xa0' == ch);
|
||||
}
|
||||
|
||||
static bool
|
||||
isupper(int ch)
|
||||
{
|
||||
BOOST_ASSERT(0 == (ch & ~UCHAR_MAX));
|
||||
return (iso8859_1_char_types[ch] & BOOST_CC_UPPER) ? true : false;
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return (iso8859_1_char_types[ch] & BOOST_CC_UPPER) != 0;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
@ -673,6 +687,7 @@ namespace boost { namespace spirit { namespace char_encoding
|
||||
static int
|
||||
tolower(int ch)
|
||||
{
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return isupper(ch) && '\0' != iso8859_1_char_conversion[ch] ?
|
||||
iso8859_1_char_conversion[ch] : ch;
|
||||
}
|
||||
@ -680,6 +695,7 @@ namespace boost { namespace spirit { namespace char_encoding
|
||||
static int
|
||||
toupper(int ch)
|
||||
{
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return islower(ch) && '\0' != iso8859_1_char_conversion[ch] ?
|
||||
iso8859_1_char_conversion[ch] : ch;
|
||||
}
|
||||
@ -689,6 +705,7 @@ namespace boost { namespace spirit { namespace char_encoding
|
||||
{
|
||||
// The first 256 characters in Unicode and the UCS are
|
||||
// identical to those in ISO/IEC-8859-1.
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return ch;
|
||||
}
|
||||
};
|
||||
|
@ -13,6 +13,7 @@
|
||||
#endif
|
||||
|
||||
#include <cctype>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
|
||||
namespace boost { namespace spirit { namespace char_encoding
|
||||
@ -23,6 +24,7 @@ namespace boost { namespace spirit { namespace char_encoding
|
||||
struct standard
|
||||
{
|
||||
typedef char char_type;
|
||||
typedef unsigned char classify_type;
|
||||
|
||||
static bool
|
||||
isascii_(int ch)
|
||||
@ -35,79 +37,104 @@ namespace boost { namespace spirit { namespace char_encoding
|
||||
{
|
||||
// uses all 8 bits
|
||||
// we have to watch out for sign extensions
|
||||
return (0 == (ch & ~0xff) || ~0 == (ch | 0xff)) ? true : false;
|
||||
return (0 == (ch & ~0xff) || ~0 == (ch | 0xff)) != 0;
|
||||
}
|
||||
|
||||
// *** Note on assertions: The precondition is that the calls to
|
||||
// these functions do not violate the required range of ch (int)
|
||||
// which is that strict_ischar(ch) should be true. It is the
|
||||
// responsibility of the caller to make sure this precondition is not
|
||||
// violated.
|
||||
|
||||
static bool
|
||||
strict_ischar(int ch)
|
||||
{
|
||||
// ch should be representable as an unsigned char
|
||||
return ch >= 0 && ch <= UCHAR_MAX;
|
||||
}
|
||||
|
||||
static bool
|
||||
isalnum(int ch)
|
||||
{
|
||||
return std::isalnum(ch) ? true : false;
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return std::isalnum(ch) != 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
isalpha(int ch)
|
||||
{
|
||||
return std::isalpha(ch) ? true : false;
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return std::isalpha(ch) != 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
isdigit(int ch)
|
||||
{
|
||||
return std::isdigit(ch) ? true : false;
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return std::isdigit(ch) != 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
isxdigit(int ch)
|
||||
{
|
||||
return std::isxdigit(ch) ? true : false;
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return std::isxdigit(ch) != 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
iscntrl(int ch)
|
||||
{
|
||||
return std::iscntrl(ch) ? true : false;
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return std::iscntrl(ch) != 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
isgraph(int ch)
|
||||
{
|
||||
return std::isgraph(ch) ? true : false;
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return std::isgraph(ch) != 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
islower(int ch)
|
||||
{
|
||||
return std::islower(ch) ? true : false;
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return std::islower(ch) != 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
isprint(int ch)
|
||||
{
|
||||
return std::isprint(ch) ? true : false;
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return std::isprint(ch) != 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
ispunct(int ch)
|
||||
{
|
||||
return std::ispunct(ch) ? true : false;
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return std::ispunct(ch) != 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
isspace(int ch)
|
||||
{
|
||||
return std::isspace(ch) ? true : false;
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return std::isspace(ch) != 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
isblank BOOST_PREVENT_MACRO_SUBSTITUTION (int ch)
|
||||
{
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return (ch == ' ' || ch == '\t');
|
||||
}
|
||||
|
||||
static bool
|
||||
isupper(int ch)
|
||||
{
|
||||
return std::isupper(ch) ? true : false;
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return std::isupper(ch) != 0;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@ -117,22 +144,24 @@ namespace boost { namespace spirit { namespace char_encoding
|
||||
static int
|
||||
tolower(int ch)
|
||||
{
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return std::tolower(ch);
|
||||
}
|
||||
|
||||
static int
|
||||
toupper(int ch)
|
||||
{
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return std::toupper(ch);
|
||||
}
|
||||
|
||||
static ::boost::uint32_t
|
||||
toucs4(int ch)
|
||||
{
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return ch;
|
||||
}
|
||||
};
|
||||
}}}
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include <cwctype>
|
||||
#include <string>
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/cstdint.hpp>
|
||||
#include <boost/spirit/home/support/assert_msg.hpp>
|
||||
|
||||
@ -42,6 +43,7 @@ namespace boost { namespace spirit { namespace char_encoding
|
||||
struct standard_wide
|
||||
{
|
||||
typedef wchar_t char_type;
|
||||
typedef wchar_t classify_type;
|
||||
|
||||
template <typename Char>
|
||||
static typename std::char_traits<Char>::int_type
|
||||
@ -60,97 +62,121 @@ namespace boost { namespace spirit { namespace char_encoding
|
||||
static bool
|
||||
ischar(int ch)
|
||||
{
|
||||
// we have to watch out for sign extensions (casting is there to
|
||||
// we have to watch out for sign extensions (casting is there to
|
||||
// silence certain compilers complaining about signed/unsigned
|
||||
// mismatch)
|
||||
return (
|
||||
std::size_t(0) ==
|
||||
std::size_t(ch & ~traits::wchar_t_size<sizeof(wchar_t)>::mask) ||
|
||||
std::size_t(~0) ==
|
||||
std::size_t(0) ==
|
||||
std::size_t(ch & ~traits::wchar_t_size<sizeof(wchar_t)>::mask) ||
|
||||
std::size_t(~0) ==
|
||||
std::size_t(ch | traits::wchar_t_size<sizeof(wchar_t)>::mask)
|
||||
) ? true : false; // any wchar_t, but no other bits set
|
||||
) != 0; // any wchar_t, but no other bits set
|
||||
}
|
||||
|
||||
// *** Note on assertions: The precondition is that the calls to
|
||||
// these functions do not violate the required range of ch (type int)
|
||||
// which is that strict_ischar(ch) should be true. It is the
|
||||
// responsibility of the caller to make sure this precondition is not
|
||||
// violated.
|
||||
|
||||
static bool
|
||||
strict_ischar(int ch)
|
||||
{
|
||||
// ch should be representable as a wchar_t
|
||||
return ch >= WCHAR_MIN && ch <= WCHAR_MAX;
|
||||
}
|
||||
|
||||
static bool
|
||||
isalnum(wchar_t ch)
|
||||
{
|
||||
using namespace std;
|
||||
return iswalnum(to_int_type(ch)) ? true : false;
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return iswalnum(to_int_type(ch)) != 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
isalpha(wchar_t ch)
|
||||
{
|
||||
using namespace std;
|
||||
return iswalpha(to_int_type(ch)) ? true : false;
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return iswalpha(to_int_type(ch)) != 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
iscntrl(wchar_t ch)
|
||||
{
|
||||
using namespace std;
|
||||
return iswcntrl(to_int_type(ch)) ? true : false;
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return iswcntrl(to_int_type(ch)) != 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
isdigit(wchar_t ch)
|
||||
{
|
||||
using namespace std;
|
||||
return iswdigit(to_int_type(ch)) ? true : false;
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return iswdigit(to_int_type(ch)) != 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
isgraph(wchar_t ch)
|
||||
{
|
||||
using namespace std;
|
||||
return iswgraph(to_int_type(ch)) ? true : false;
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return iswgraph(to_int_type(ch)) != 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
islower(wchar_t ch)
|
||||
{
|
||||
using namespace std;
|
||||
return iswlower(to_int_type(ch)) ? true : false;
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return iswlower(to_int_type(ch)) != 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
isprint(wchar_t ch)
|
||||
{
|
||||
using namespace std;
|
||||
return iswprint(to_int_type(ch)) ? true : false;
|
||||
return iswprint(to_int_type(ch)) != 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
ispunct(wchar_t ch)
|
||||
{
|
||||
using namespace std;
|
||||
return iswpunct(to_int_type(ch)) ? true : false;
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return iswpunct(to_int_type(ch)) != 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
isspace(wchar_t ch)
|
||||
{
|
||||
using namespace std;
|
||||
return iswspace(to_int_type(ch)) ? true : false;
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return iswspace(to_int_type(ch)) != 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
isupper(wchar_t ch)
|
||||
{
|
||||
using namespace std;
|
||||
return iswupper(to_int_type(ch)) ? true : false;
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return iswupper(to_int_type(ch)) != 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
isxdigit(wchar_t ch)
|
||||
{
|
||||
using namespace std;
|
||||
return iswxdigit(to_int_type(ch)) ? true : false;
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return iswxdigit(to_int_type(ch)) != 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
isblank BOOST_PREVENT_MACRO_SUBSTITUTION (wchar_t ch)
|
||||
{
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return (ch == L' ' || ch == L'\t');
|
||||
}
|
||||
|
||||
@ -162,6 +188,7 @@ namespace boost { namespace spirit { namespace char_encoding
|
||||
tolower(wchar_t ch)
|
||||
{
|
||||
using namespace std;
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return isupper(ch) ?
|
||||
to_char_type<wchar_t>(towlower(to_int_type(ch))) : ch;
|
||||
}
|
||||
@ -170,6 +197,7 @@ namespace boost { namespace spirit { namespace char_encoding
|
||||
toupper(wchar_t ch)
|
||||
{
|
||||
using namespace std;
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return islower(ch) ?
|
||||
to_char_type<wchar_t>(towupper(to_int_type(ch))) : ch;
|
||||
}
|
||||
@ -177,10 +205,10 @@ namespace boost { namespace spirit { namespace char_encoding
|
||||
static ::boost::uint32_t
|
||||
toucs4(int ch)
|
||||
{
|
||||
BOOST_ASSERT(strict_ischar(ch));
|
||||
return ch;
|
||||
}
|
||||
};
|
||||
}}}
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -23,6 +23,7 @@ namespace boost { namespace spirit { namespace char_encoding
|
||||
struct unicode
|
||||
{
|
||||
typedef ::boost::uint32_t char_type;
|
||||
typedef ::boost::uint32_t classify_type;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// Posix stuff
|
||||
|
@ -335,8 +335,11 @@ template<class T> struct BOOST_SYMBOL_VISIBLE cat_holder
|
||||
static constexpr generic_error_category generic_category_instance{};
|
||||
};
|
||||
|
||||
// Before C++17 it was mandatory to redeclare all static constexpr
|
||||
#if defined(BOOST_NO_CXX17_INLINE_VARIABLES)
|
||||
template<class T> constexpr system_error_category cat_holder<T>::system_category_instance;
|
||||
template<class T> constexpr generic_error_category cat_holder<T>::generic_category_instance;
|
||||
#endif
|
||||
|
||||
} // namespace detail
|
||||
|
||||
|
@ -141,4 +141,14 @@ class type_info;
|
||||
|
||||
#endif /* ifndef BOOST_PP_VARIADICS */
|
||||
|
||||
//____________________________________________________________________________//
|
||||
// string_view support
|
||||
//____________________________________________________________________________//
|
||||
// note the code should always be compatible with compiled version of boost.test
|
||||
// using a pre-c++17 compiler
|
||||
|
||||
#ifndef BOOST_NO_CXX17_HDR_STRING_VIEW
|
||||
#define BOOST_TEST_STRING_VIEW
|
||||
#endif
|
||||
|
||||
#endif // BOOST_TEST_CONFIG_HPP_071894GER
|
||||
|
@ -1,18 +0,0 @@
|
||||
// (C) Copyright Gennadiy Rozental 2001.
|
||||
// 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/test for the library home page.
|
||||
//
|
||||
//! @file
|
||||
//! @brief Deprecated header
|
||||
//! @deprecated Use boost/test/tools/floating_point_comparison.hpp instead
|
||||
// ***************************************************************************
|
||||
|
||||
#include <boost/config/header_deprecated.hpp>
|
||||
BOOST_HEADER_DEPRECATED( "This header is deprecated. Please use <boost/test/tools/floating_point_comparison.hpp> instead." )
|
||||
|
||||
|
||||
// Boost.Test
|
||||
#include <boost/test/tools/floating_point_comparison.hpp>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user