]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/hana/include/boost/hana/is_empty.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / hana / include / boost / hana / is_empty.hpp
CommitLineData
7c673cae
FG
1/*!
2@file
3Defines `boost::hana::is_empty`.
4
5@copyright Louis Dionne 2013-2016
6Distributed under the Boost Software License, Version 1.0.
7(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
8 */
9
10#ifndef BOOST_HANA_IS_EMPTY_HPP
11#define BOOST_HANA_IS_EMPTY_HPP
12
13#include <boost/hana/fwd/is_empty.hpp>
14
15#include <boost/hana/concept/iterable.hpp>
16#include <boost/hana/config.hpp>
17#include <boost/hana/core/dispatch.hpp>
18
19
20BOOST_HANA_NAMESPACE_BEGIN
21 //! @cond
22 template <typename Xs>
23 constexpr auto is_empty_t::operator()(Xs const& xs) const {
24 using It = typename hana::tag_of<Xs>::type;
25 using IsEmpty = BOOST_HANA_DISPATCH_IF(is_empty_impl<It>,
26 hana::Iterable<It>::value
27 );
28
29 #ifndef BOOST_HANA_CONFIG_DISABLE_CONCEPT_CHECKS
30 static_assert(hana::Iterable<It>::value,
31 "hana::is_empty(xs) requires 'xs' to be an Iterable");
32 #endif
33
34 return IsEmpty::apply(xs);
35 }
36 //! @endcond
37
38 template <typename It, bool condition>
39 struct is_empty_impl<It, when<condition>> : default_ {
40 template <typename ...Args>
41 static constexpr auto apply(Args&& ...) = delete;
42 };
43BOOST_HANA_NAMESPACE_END
44
45#endif // !BOOST_HANA_IS_EMPTY_HPP