]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/hana/include/boost/hana/none.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / hana / include / boost / hana / none.hpp
CommitLineData
7c673cae
FG
1/*!
2@file
3Defines `boost::hana::none`.
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_NONE_HPP
11#define BOOST_HANA_NONE_HPP
12
13#include <boost/hana/fwd/none.hpp>
14
15#include <boost/hana/concept/searchable.hpp>
16#include <boost/hana/config.hpp>
17#include <boost/hana/core/dispatch.hpp>
18#include <boost/hana/functional/id.hpp>
19#include <boost/hana/none_of.hpp>
20
21
22BOOST_HANA_NAMESPACE_BEGIN
23 //! @cond
24 template <typename Xs>
25 constexpr auto none_t::operator()(Xs&& xs) const {
26 using S = typename hana::tag_of<Xs>::type;
27 using None = BOOST_HANA_DISPATCH_IF(none_impl<S>,
28 hana::Searchable<S>::value
29 );
30
31 #ifndef BOOST_HANA_CONFIG_DISABLE_CONCEPT_CHECKS
32 static_assert(hana::Searchable<S>::value,
33 "hana::none(xs) requires 'xs' to be a Searchable");
34 #endif
35
36 return None::apply(static_cast<Xs&&>(xs));
37 }
38 //! @endcond
39
40 template <typename S, bool condition>
41 struct none_impl<S, when<condition>> : default_ {
42 template <typename Xs>
43 static constexpr auto apply(Xs&& xs)
44 { return hana::none_of(static_cast<Xs&&>(xs), hana::id); }
45 };
46BOOST_HANA_NAMESPACE_END
47
48#endif // !BOOST_HANA_NONE_HPP