Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:04:17

0001 // Copyright (c) 2023 Klemens D. Morgenstern
0002 //
0003 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0004 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0005 #ifndef BOOST_COBALT_COBALT_FOR_HPP
0006 #define BOOST_COBALT_COBALT_FOR_HPP
0007 
0008 #include <boost/preprocessor/cat.hpp>
0009 
0010 #define BOOST_COBALT_FOR_IMPL(Value, Expression, Id) \
0011 for (auto && Id = Expression; Id; )                    \
0012   if (Value = co_await Id; false) {} else
0013 
0014 #define BOOST_COBALT_FOR(Value, Expression) \
0015   BOOST_COBALT_FOR_IMPL(Value, Expression, BOOST_PP_CAT(__boost_cobalt_for_loop_value__, __LINE__))
0016 
0017 #endif //BOOST_COBALT_COBALT_FOR_HPP