]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /*! |
2 | @file | |
3 | Forward declares `boost::hana::not_equal`. | |
4 | ||
b32b8144 | 5 | @copyright Louis Dionne 2013-2017 |
7c673cae FG |
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_EQUAL_HPP | |
11 | #define BOOST_HANA_FWD_NOT_EQUAL_HPP | |
12 | ||
13 | #include <boost/hana/config.hpp> | |
14 | #include <boost/hana/core/when.hpp> | |
15 | #include <boost/hana/detail/nested_to_fwd.hpp> | |
16 | ||
17 | ||
1e59de90 | 18 | namespace boost { namespace hana { |
7c673cae FG |
19 | //! Returns a `Logical` representing whether `x` is not equal to `y`. |
20 | //! @ingroup group-Comparable | |
21 | //! | |
22 | //! The `not_equal` function can be called in two different ways. First, | |
23 | //! it can be called like a normal function: | |
24 | //! @code | |
25 | //! not_equal(x, y) | |
26 | //! @endcode | |
27 | //! | |
28 | //! However, it may also be partially applied to an argument by using | |
29 | //! `not_equal.to`: | |
30 | //! @code | |
31 | //! not_equal.to(x)(y) == not_equal(x, y) | |
32 | //! @endcode | |
33 | //! | |
34 | //! In other words, `not_equal.to(x)` is a function object that is | |
35 | //! equivalent to `partial(not_equal, x)`. This is provided to enhance | |
36 | //! the readability of some constructs, especially when using higher | |
37 | //! order algorithms. | |
38 | //! | |
39 | //! | |
40 | //! Signature | |
41 | //! --------- | |
42 | //! Given a Logical `Bool` and two Comparables `A` and `B` that | |
43 | //! share a common embedding, the signature is | |
44 | //! @f$ \mathtt{not\_equal} : A \times B \to Bool @f$. | |
45 | //! | |
46 | //! @param x, y | |
47 | //! Two objects to compare for inequality. | |
48 | //! | |
49 | //! | |
50 | //! Example | |
51 | //! ------- | |
52 | //! @include example/not_equal.cpp | |
53 | #ifdef BOOST_HANA_DOXYGEN_INVOKED | |
54 | constexpr auto not_equal = [](auto&& x, auto&& y) { | |
55 | return tag-dispatched; | |
56 | }; | |
57 | #else | |
58 | template <typename T, typename U, typename = void> | |
59 | struct not_equal_impl : not_equal_impl<T, U, when<true>> { }; | |
60 | ||
61 | struct not_equal_t : detail::nested_to<not_equal_t> { | |
62 | template <typename X, typename Y> | |
63 | constexpr auto operator()(X&& x, Y&& y) const; | |
64 | }; | |
65 | ||
1e59de90 | 66 | BOOST_HANA_INLINE_VARIABLE constexpr not_equal_t not_equal{}; |
7c673cae | 67 | #endif |
1e59de90 | 68 | }} // end namespace boost::hana |
7c673cae FG |
69 | |
70 | #endif // !BOOST_HANA_FWD_NOT_EQUAL_HPP |