Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-15 09:53:04

0001 /*!
0002 @file
0003 Forward declares `boost::hana::not_equal`.
0004 
0005 Copyright Louis Dionne 2013-2022
0006 Distributed under the Boost Software License, Version 1.0.
0007 (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
0008  */
0009 
0010 #ifndef BOOST_HANA_FWD_NOT_EQUAL_HPP
0011 #define BOOST_HANA_FWD_NOT_EQUAL_HPP
0012 
0013 #include <boost/hana/config.hpp>
0014 #include <boost/hana/core/when.hpp>
0015 #include <boost/hana/detail/nested_to_fwd.hpp>
0016 
0017 
0018 namespace boost { namespace hana {
0019     //! Returns a `Logical` representing whether `x` is not equal to `y`.
0020     //! @ingroup group-Comparable
0021     //!
0022     //! The `not_equal` function can be called in two different ways. First,
0023     //! it can be called like a normal function:
0024     //! @code
0025     //!     not_equal(x, y)
0026     //! @endcode
0027     //!
0028     //! However, it may also be partially applied to an argument by using
0029     //! `not_equal.to`:
0030     //! @code
0031     //!     not_equal.to(x)(y) == not_equal(x, y)
0032     //! @endcode
0033     //!
0034     //! In other words, `not_equal.to(x)` is a function object that is
0035     //! equivalent to `partial(not_equal, x)`. This is provided to enhance
0036     //! the readability of some constructs, especially when using higher
0037     //! order algorithms.
0038     //!
0039     //!
0040     //! Signature
0041     //! ---------
0042     //! Given a Logical `Bool` and two Comparables `A` and `B` that
0043     //! share a common embedding, the signature is
0044     //! @f$ \mathtt{not\_equal} : A \times B \to Bool @f$.
0045     //!
0046     //! @param x, y
0047     //! Two objects to compare for inequality.
0048     //!
0049     //!
0050     //! Example
0051     //! -------
0052     //! @include example/not_equal.cpp
0053 #ifdef BOOST_HANA_DOXYGEN_INVOKED
0054     constexpr auto not_equal = [](auto&& x, auto&& y) {
0055         return tag-dispatched;
0056     };
0057 #else
0058     template <typename T, typename U, typename = void>
0059     struct not_equal_impl : not_equal_impl<T, U, when<true>> { };
0060 
0061     struct not_equal_t : detail::nested_to<not_equal_t> {
0062         template <typename X, typename Y>
0063         constexpr auto operator()(X&& x, Y&& y) const;
0064     };
0065 
0066     BOOST_HANA_INLINE_VARIABLE constexpr not_equal_t not_equal{};
0067 #endif
0068 }} // end namespace boost::hana
0069 
0070 #endif // !BOOST_HANA_FWD_NOT_EQUAL_HPP