| 1 | /*! |
| 2 | @file |
| 3 | Forward declares `boost::hana::none`. |
| 4 | |
| 5 | Copyright Louis Dionne 2013-2022 |
| 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) |
| 8 | */ |
| 9 | |
| 10 | #ifndef BOOST_HANA_FWD_NONE_HPP |
| 11 | #define BOOST_HANA_FWD_NONE_HPP |
| 12 | |
| 13 | #include <boost/hana/config.hpp> |
| 14 | #include <boost/hana/core/when.hpp> |
| 15 | |
| 16 | |
| 17 | namespace boost { namespace hana { |
| 18 | //! Returns whether all of the keys of the structure are false-valued. |
| 19 | //! @ingroup group-Searchable |
| 20 | //! |
| 21 | //! The keys of the structure must be `Logical`s. If the structure is not |
| 22 | //! finite, a true-valued key must appear at a finite "index" in order |
| 23 | //! for this method to finish. |
| 24 | //! |
| 25 | //! |
| 26 | //! Example |
| 27 | //! ------- |
| 28 | //! @include example/none.cpp |
| 29 | #ifdef BOOST_HANA_DOXYGEN_INVOKED |
| 30 | constexpr auto none = [](auto&& xs) -> decltype(auto) { |
| 31 | return tag-dispatched; |
| 32 | }; |
| 33 | #else |
| 34 | template <typename S, typename = void> |
| 35 | struct none_impl : none_impl<S, when<true>> { }; |
| 36 | |
| 37 | struct none_t { |
| 38 | template <typename Xs> |
| 39 | constexpr auto operator()(Xs&& xs) const; |
| 40 | }; |
| 41 | |
| 42 | BOOST_HANA_INLINE_VARIABLE constexpr none_t none{}; |
| 43 | #endif |
| 44 | }} // end namespace boost::hana |
| 45 | |
| 46 | #endif // !BOOST_HANA_FWD_NONE_HPP |
| 47 | |