]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /*! |
2 | @file | |
3 | Forward declares `boost::hana::not_`. | |
4 | ||
5 | @copyright Louis Dionne 2013-2016 | |
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_NOT_HPP | |
11 | #define BOOST_HANA_FWD_NOT_HPP | |
12 | ||
13 | #include <boost/hana/config.hpp> | |
14 | #include <boost/hana/core/when.hpp> | |
15 | ||
16 | ||
17 | BOOST_HANA_NAMESPACE_BEGIN | |
18 | //! Negates a `Logical`. | |
19 | //! @ingroup group-Logical | |
20 | //! | |
21 | //! This method returns a `Logical` with the same tag, but whose | |
22 | //! truth-value is negated. Specifically, `not_(x)` returns a false-valued | |
23 | //! `Logical` if `x` is a true-valued `Logical`, and a true-valued one | |
24 | //! otherwise. | |
25 | //! | |
26 | //! | |
27 | //! Example | |
28 | //! ------- | |
29 | //! @include example/not.cpp | |
30 | #ifdef BOOST_HANA_DOXYGEN_INVOKED | |
31 | constexpr auto not_ = [](auto&& x) -> decltype(auto) { | |
32 | return tag-dispatched; | |
33 | }; | |
34 | #else | |
35 | template <typename L, typename = void> | |
36 | struct not_impl : not_impl<L, when<true>> { }; | |
37 | ||
38 | struct not_t { | |
39 | template <typename X> | |
40 | constexpr decltype(auto) operator()(X&& x) const; | |
41 | }; | |
42 | ||
43 | constexpr not_t not_{}; | |
44 | #endif | |
45 | BOOST_HANA_NAMESPACE_END | |
46 | ||
47 | #endif // !BOOST_HANA_FWD_NOT_HPP |