Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:44:26

0001 //
0002 // Copyright (c) 2022 Klemens Morgenstern (klemens.morgenstern@gmx.net)
0003 //
0004 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0005 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 //
0007 
0008 #ifndef BOOST_COBALT_GATHER_HPP
0009 #define BOOST_COBALT_GATHER_HPP
0010 
0011 #include <boost/cobalt/concepts.hpp>
0012 #include <boost/cobalt/detail/gather.hpp>
0013 
0014 namespace boost::cobalt
0015 {
0016 
0017 
0018 template<awaitable ... Promise>
0019 auto gather(Promise && ... p)
0020 {
0021   return detail::gather_variadic_impl<Promise ...>(
0022       static_cast<Promise&&>(p)...);
0023 }
0024 
0025 
0026 template<typename PromiseRange>
0027   requires awaitable<std::decay_t<decltype(*std::declval<PromiseRange>().begin())>>
0028 auto gather(PromiseRange && p)
0029 {
0030   return detail::gather_ranged_impl<PromiseRange>{static_cast<PromiseRange&&>(p)};
0031 }
0032 
0033 
0034 
0035 }
0036 
0037 
0038 #endif //BOOST_COBALT_GATHER_HPP