Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-15 09:53:05

0001 /*!
0002 @file
0003 Forward declares `boost::hana::then`.
0004 
0005 Copyright Louis Dionne 2013-2022
0006 Distributed under the Boost Software License, Version 1.0.
0007 (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
0008  */
0009 
0010 #ifndef BOOST_HANA_FWD_THEN_HPP
0011 #define BOOST_HANA_FWD_THEN_HPP
0012 
0013 #include <boost/hana/config.hpp>
0014 #include <boost/hana/core/when.hpp>
0015 
0016 
0017 namespace boost { namespace hana {
0018     //! Sequentially compose two monadic actions, discarding any value
0019     //! produced by the first but not its effects.
0020     //! @ingroup group-Monad
0021     //!
0022     //!
0023     //! @param before
0024     //! The first `Monad` in the monadic composition chain. The result of
0025     //! this monad is ignored, but its effects are combined with that of the
0026     //! second monad.
0027     //!
0028     //! @param xs
0029     //! The second `Monad` in the monadic composition chain.
0030     //!
0031     //!
0032     //! Example
0033     //! -------
0034     //! @include example/then.cpp
0035 #ifdef BOOST_HANA_DOXYGEN_INVOKED
0036     constexpr auto then = [](auto&& before, auto&& xs) -> decltype(auto) {
0037         return tag-dispatched;
0038     };
0039 #else
0040     template <typename M, typename = void>
0041     struct then_impl : then_impl<M, when<true>> { };
0042 
0043     struct then_t {
0044         template <typename Before, typename Xs>
0045         constexpr decltype(auto) operator()(Before&& before, Xs&& xs) const;
0046     };
0047 
0048     BOOST_HANA_INLINE_VARIABLE constexpr then_t then{};
0049 #endif
0050 }} // end namespace boost::hana
0051 
0052 #endif // !BOOST_HANA_FWD_THEN_HPP