Skip to content

Commit

Permalink
Update vendor/cget
Browse files Browse the repository at this point in the history
  • Loading branch information
tekezo committed Apr 26, 2024
1 parent bc88686 commit cba2a10
Show file tree
Hide file tree
Showing 643 changed files with 5,389 additions and 4,479 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// asio.hpp
// ~~~~~~~~
//
// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// any_completion_executor.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// any_completion_handler.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Expand Down Expand Up @@ -514,9 +514,15 @@ class any_completion_handler_allocator
/// Allocate space for @c n objects of the allocator's value type.
T* allocate(std::size_t n) const
{
return static_cast<T*>(
fn_table_->allocate(
impl_, sizeof(T) * n, alignof(T)));
if (fn_table_)
{
return static_cast<T*>(
fn_table_->allocate(
impl_, sizeof(T) * n, alignof(T)));
}
std::bad_alloc ex;
asio::detail::throw_exception(ex);
return nullptr;
}

/// Deallocate space for @c n objects of the allocator's value type.
Expand Down Expand Up @@ -724,7 +730,7 @@ class any_completion_handler
/// Get the associated cancellation slot.
cancellation_slot_type get_cancellation_slot() const noexcept
{
return impl_->get_cancellation_slot();
return impl_ ? impl_->get_cancellation_slot() : cancellation_slot_type();
}

/// Function call operator.
Expand Down Expand Up @@ -786,8 +792,10 @@ struct associated_executor<any_completion_handler<Signatures...>, Candidate>
static type get(const any_completion_handler<Signatures...>& handler,
const Candidate& candidate = Candidate()) noexcept
{
return handler.fn_table_->executor(handler.impl_,
any_completion_executor(std::nothrow, candidate));
any_completion_executor any_candidate(std::nothrow, candidate);
return handler.fn_table_
? handler.fn_table_->executor(handler.impl_, any_candidate)
: any_candidate;
}
};

Expand All @@ -800,8 +808,10 @@ struct associated_immediate_executor<
static type get(const any_completion_handler<Signatures...>& handler,
const Candidate& candidate = Candidate()) noexcept
{
return handler.fn_table_->immediate_executor(handler.impl_,
any_io_executor(std::nothrow, candidate));
any_io_executor any_candidate(std::nothrow, candidate);
return handler.fn_table_
? handler.fn_table_->immediate_executor(handler.impl_, any_candidate)
: any_candidate;
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// any_io_executor.hpp
// ~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// append.hpp
// ~~~~~~~~~~
//
// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// as_tuple.hpp
// ~~~~~~~~~~~~
//
// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// associated_allocator.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// associated_cancellation_slot.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// associated_executor.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// associated_immediate_executor.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// associator.hpp
// ~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// async_result.hpp
// ~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Expand Down Expand Up @@ -97,39 +97,39 @@ 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...>)>
: integral_constant<bool, (callable_with<decay_t<T>, Args...>)>
{
};

template <typename T, typename R, typename... Args>
struct is_completion_handler_for<T, R(Args...) &>
: integral_constant<bool, (callable_with<T&, Args...>)>
: integral_constant<bool, (callable_with<decay_t<T>&, Args...>)>
{
};

template <typename T, typename R, typename... Args>
struct is_completion_handler_for<T, R(Args...) &&>
: integral_constant<bool, (callable_with<T&&, Args...>)>
: integral_constant<bool, (callable_with<decay_t<T>&&, Args...>)>
{
};

# if defined(ASIO_HAS_NOEXCEPT_FUNCTION_TYPE)

template <typename T, typename R, typename... Args>
struct is_completion_handler_for<T, R(Args...) noexcept>
: integral_constant<bool, (callable_with<T, Args...>)>
: integral_constant<bool, (callable_with<decay_t<T>, Args...>)>
{
};

template <typename T, typename R, typename... Args>
struct is_completion_handler_for<T, R(Args...) & noexcept>
: integral_constant<bool, (callable_with<T&, Args...>)>
: integral_constant<bool, (callable_with<decay_t<T>&, Args...>)>
{
};

template <typename T, typename R, typename... Args>
struct is_completion_handler_for<T, R(Args...) && noexcept>
: integral_constant<bool, (callable_with<T&&, Args...>)>
: integral_constant<bool, (callable_with<decay_t<T>&&, Args...>)>
{
};

Expand Down Expand Up @@ -176,37 +176,84 @@ ASIO_CONCEPT completion_handler_for =
namespace detail {

template <typename T>
struct is_simple_completion_signature : false_type
struct is_lvalue_completion_signature : false_type
{
};

template <typename R, typename... Args>
struct is_lvalue_completion_signature<R(Args...) &> : true_type
{
};

# if defined(ASIO_HAS_NOEXCEPT_FUNCTION_TYPE)

template <typename R, typename... Args>
struct is_lvalue_completion_signature<R(Args...) & noexcept> : true_type
{
};

# endif // defined(ASIO_HAS_NOEXCEPT_FUNCTION_TYPE)

template <typename... Signatures>
struct are_any_lvalue_completion_signatures : false_type
{
};

template <typename Sig0>
struct are_any_lvalue_completion_signatures<Sig0>
: is_lvalue_completion_signature<Sig0>
{
};

template <typename Sig0, typename... SigN>
struct are_any_lvalue_completion_signatures<Sig0, SigN...>
: integral_constant<bool, (
is_lvalue_completion_signature<Sig0>::value
|| are_any_lvalue_completion_signatures<SigN...>::value)>
{
};

template <typename T>
struct simple_completion_signature;
struct is_rvalue_completion_signature : false_type
{
};

template <typename R, typename... Args>
struct is_simple_completion_signature<R(Args...)> : true_type
struct is_rvalue_completion_signature<R(Args...) &&> : true_type
{
};

# if defined(ASIO_HAS_NOEXCEPT_FUNCTION_TYPE)

template <typename R, typename... Args>
struct is_rvalue_completion_signature<R(Args...) && noexcept> : true_type
{
};

# endif // defined(ASIO_HAS_NOEXCEPT_FUNCTION_TYPE)

template <typename... Signatures>
struct are_simple_completion_signatures : false_type
struct are_any_rvalue_completion_signatures : false_type
{
};

template <typename Sig0>
struct are_simple_completion_signatures<Sig0>
: is_simple_completion_signature<Sig0>
struct are_any_rvalue_completion_signatures<Sig0>
: is_rvalue_completion_signature<Sig0>
{
};

template <typename Sig0, typename... SigN>
struct are_simple_completion_signatures<Sig0, SigN...>
struct are_any_rvalue_completion_signatures<Sig0, SigN...>
: integral_constant<bool, (
is_simple_completion_signature<Sig0>::value
&& are_simple_completion_signatures<SigN...>::value)>
is_rvalue_completion_signature<Sig0>::value
|| are_any_rvalue_completion_signatures<SigN...>::value)>
{
};

template <typename T>
struct simple_completion_signature;

template <typename R, typename... Args>
struct simple_completion_signature<R(Args...)>
{
Expand Down Expand Up @@ -344,15 +391,17 @@ template <typename CompletionToken,
ASIO_COMPLETION_SIGNATURE... Signatures>
class async_result :
public conditional_t<
detail::are_simple_completion_signatures<Signatures...>::value,
detail::are_any_lvalue_completion_signatures<Signatures...>::value
|| !detail::are_any_rvalue_completion_signatures<Signatures...>::value,
detail::completion_handler_async_result<CompletionToken, Signatures...>,
async_result<CompletionToken,
typename detail::simple_completion_signature<Signatures>::type...>
>
{
public:
typedef conditional_t<
detail::are_simple_completion_signatures<Signatures...>::value,
detail::are_any_lvalue_completion_signatures<Signatures...>::value
|| !detail::are_any_rvalue_completion_signatures<Signatures...>::value,
detail::completion_handler_async_result<CompletionToken, Signatures...>,
async_result<CompletionToken,
typename detail::simple_completion_signature<Signatures>::type...>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// awaitable.hpp
// ~~~~~~~~~~~~~
//
// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// basic_datagram_socket.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// basic_deadline_timer.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// basic_file.hpp
// ~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// basic_io_object.hpp
// ~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// basic_random_access_file.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// basic_raw_socket.hpp
// ~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// basic_readable_pipe.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2023 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Expand Down

0 comments on commit cba2a10

Please sign in to comment.