Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:52:53

0001 /*!
0002 @file
0003 Forward declares `boost::hana::empty`.
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_EMPTY_HPP
0011 #define BOOST_HANA_FWD_EMPTY_HPP
0012 
0013 #include <boost/hana/config.hpp>
0014 #include <boost/hana/core/when.hpp>
0015 
0016 
0017 namespace boost { namespace hana {
0018     //! Identity of the monadic combination `concat`.
0019     //! @ingroup group-MonadPlus
0020     //!
0021     //! Signature
0022     //! ---------
0023     //! Given a MonadPlus `M`, the signature is
0024     //! @f$ \mathtt{empty}_M : \emptyset \to M(T) @f$.
0025     //!
0026     //! @tparam M
0027     //! The tag of the monadic structure to return. This must be
0028     //! a model of the MonadPlus concept.
0029     //!
0030     //!
0031     //! Example
0032     //! -------
0033     //! @include example/empty.cpp
0034 #ifdef BOOST_HANA_DOXYGEN_INVOKED
0035     template <typename M>
0036     constexpr auto empty = []() {
0037         return tag-dispatched;
0038     };
0039 #else
0040     template <typename M, typename = void>
0041     struct empty_impl : empty_impl<M, when<true>> { };
0042 
0043     template <typename M>
0044     struct empty_t {
0045         constexpr auto operator()() const;
0046     };
0047 
0048     template <typename M>
0049     BOOST_HANA_INLINE_VARIABLE constexpr empty_t<M> empty{};
0050 #endif
0051 }} // end namespace boost::hana
0052 
0053 #endif // !BOOST_HANA_FWD_EMPTY_HPP