Sha256: 05fc463d72df5d5a053757ddfd42009c53e1ee3d0ac75a7998ec7f6e4d9ab31e

Contents?: true

Size: 1.96 KB

Versions: 3

Compression:

Stored size: 1.96 KB

Contents

//
// experimental/impl/use_promise.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2021-2022 Klemens D. Morgenstern
//                         (klemens dot morgenstern at gmx dot net)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#ifndef BOOST_ASIO_EXPERIMENTAL_IMPL_USE_PROMISE_HPP
#define BOOST_ASIO_EXPERIMENTAL_IMPL_USE_PROMISE_HPP

#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)

#include <boost/asio/detail/config.hpp>
#include <memory>
#include <boost/asio/async_result.hpp>

#include <boost/asio/detail/push_options.hpp>

namespace boost {
namespace asio {
namespace experimental {

template <typename Allocator>
struct use_promise_t;

namespace detail {

template<typename Signature, typename Executor, typename Allocator>
struct promise_handler;

} // namespace detail
} // namespace experimental

#if !defined(GENERATING_DOCUMENTATION)

template <typename Allocator, typename R, typename... Args>
struct async_result<experimental::use_promise_t<Allocator>, R(Args...)>
{
  template <typename Initiation, typename... InitArgs>
  static auto initiate(Initiation initiation,
      experimental::use_promise_t<Allocator> up, InitArgs... args)
    -> experimental::promise<void(typename decay<Args>::type...),
      boost::asio::associated_executor_t<Initiation>, Allocator>
  {
    using handler_type = experimental::detail::promise_handler<
      void(typename decay<Args>::type...),
      boost::asio::associated_executor_t<Initiation>, Allocator>;

    handler_type ht{up.get_allocator(), get_associated_executor(initiation)};
    std::move(initiation)(ht, std::move(args)...);
    return ht.make_promise();
  }
};

#endif // !defined(GENERATING_DOCUMENTATION)

} // namespace asio
} // namespace boost

#include <boost/asio/detail/pop_options.hpp>

#endif // BOOST_ASIO_EXPERIMENTAL_IMPL_USE_PROMISE_HPP

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
passenger-6.0.19 src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/use_promise.hpp
passenger-6.0.18 src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/use_promise.hpp
passenger-6.0.17 src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/use_promise.hpp