3 Forward declares `boost::hana::is_empty`.
5 @copyright Louis Dionne 2013-2017
6 Distributed under the Boost Software License, Version 1.0.
7 (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
10 #ifndef BOOST_HANA_FWD_IS_EMPTY_HPP
11 #define BOOST_HANA_FWD_IS_EMPTY_HPP
13 #include <boost/hana/config.hpp>
14 #include <boost/hana/core/when.hpp>
17 BOOST_HANA_NAMESPACE_BEGIN
18 //! Returns whether the iterable is empty.
19 //! @ingroup group-Iterable
21 //! Given an `Iterable` `xs`, `is_empty` returns whether `xs` contains
22 //! no more elements. In other words, it returns whether trying to
23 //! extract the tail of `xs` would be an error. In the current version
24 //! of the library, `is_empty` must return an `IntegralConstant` holding
25 //! a value convertible to `bool`. This is because only compile-time
26 //! `Iterable`s are supported right now.
31 //! @include example/is_empty.cpp
32 #ifdef BOOST_HANA_DOXYGEN_INVOKED
33 constexpr auto is_empty = [](auto const& xs) {
34 return tag-dispatched;
37 template <typename It, typename = void>
38 struct is_empty_impl : is_empty_impl<It, when<true>> { };
41 template <typename Xs>
42 constexpr auto operator()(Xs const& xs) const;
45 constexpr is_empty_t is_empty{};
47 BOOST_HANA_NAMESPACE_END
49 #endif // !BOOST_HANA_FWD_IS_EMPTY_HPP