• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*!
2 @file
3 Forward declares `boost::hana::greater`.
4 
5 @copyright Louis Dionne 2013-2017
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_GREATER_HPP
11 #define BOOST_HANA_FWD_GREATER_HPP
12 
13 #include <boost/hana/config.hpp>
14 #include <boost/hana/core/when.hpp>
15 #include <boost/hana/detail/nested_than_fwd.hpp>
16 
17 
18 BOOST_HANA_NAMESPACE_BEGIN
19     //! Returns a `Logical` representing whether `x` is greater than `y`.
20     //! @ingroup group-Orderable
21     //!
22     //!
23     //! Signature
24     //! ---------
25     //! Given a Logical `Bool` and two Orderables `A` and `B` with a common
26     //! embedding, the signature is
27     //! @f$ \mathrm{greater} : A \times B \to Bool @f$.
28     //!
29     //! @param x, y
30     //! Two objects to compare.
31     //!
32     //!
33     //! Example
34     //! -------
35     //! @include example/greater.cpp
36 #ifdef BOOST_HANA_DOXYGEN_INVOKED
37     constexpr auto greater = [](auto&& x, auto&& y) -> decltype(auto) {
38         return tag-dispatched;
39     };
40 #else
41     template <typename T, typename U, typename = void>
42     struct greater_impl : greater_impl<T, U, when<true>> { };
43 
44     struct greater_t : detail::nested_than<greater_t> {
45         template <typename X, typename Y>
46         constexpr decltype(auto) operator()(X&& x, Y&& y) const;
47     };
48 
49     constexpr greater_t greater{};
50 #endif
51 BOOST_HANA_NAMESPACE_END
52 
53 #endif // !BOOST_HANA_FWD_GREATER_HPP
54