Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:38:03

0001 /*!
0002 @file
0003 Defines `boost::hana::is_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_IS_EMPTY_HPP
0011 #define BOOST_HANA_IS_EMPTY_HPP
0012 
0013 #include <boost/hana/fwd/is_empty.hpp>
0014 
0015 #include <boost/hana/concept/iterable.hpp>
0016 #include <boost/hana/config.hpp>
0017 #include <boost/hana/core/dispatch.hpp>
0018 
0019 
0020 namespace boost { namespace hana {
0021     //! @cond
0022     template <typename Xs>
0023     constexpr auto is_empty_t::operator()(Xs const& xs) const {
0024         using It = typename hana::tag_of<Xs>::type;
0025         using IsEmpty = BOOST_HANA_DISPATCH_IF(is_empty_impl<It>,
0026             hana::Iterable<It>::value
0027         );
0028 
0029     #ifndef BOOST_HANA_CONFIG_DISABLE_CONCEPT_CHECKS
0030         static_assert(hana::Iterable<It>::value,
0031         "hana::is_empty(xs) requires 'xs' to be an Iterable");
0032     #endif
0033 
0034         return IsEmpty::apply(xs);
0035     }
0036     //! @endcond
0037 
0038     template <typename It, bool condition>
0039     struct is_empty_impl<It, when<condition>> : default_ {
0040         template <typename ...Args>
0041         static constexpr auto apply(Args&& ...) = delete;
0042     };
0043 }} // end namespace boost::hana
0044 
0045 #endif // !BOOST_HANA_IS_EMPTY_HPP