less_equal.hpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*!
  2. @file
  3. Forward declares `boost::hana::less_equal`.
  4. @copyright Louis Dionne 2013-2017
  5. Distributed under the Boost Software License, Version 1.0.
  6. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
  7. */
  8. #ifndef BOOST_HANA_FWD_LESS_EQUAL_HPP
  9. #define BOOST_HANA_FWD_LESS_EQUAL_HPP
  10. #include <boost/hana/config.hpp>
  11. #include <boost/hana/core/when.hpp>
  12. #include <boost/hana/detail/nested_than_fwd.hpp>
  13. BOOST_HANA_NAMESPACE_BEGIN
  14. //! Returns a `Logical` representing whether `x` is less than or
  15. //! equal to `y`.
  16. //! @ingroup group-Orderable
  17. //!
  18. //!
  19. //! Signature
  20. //! ---------
  21. //! Given a Logical `Bool` and two Orderables `A` and `B` with a common
  22. //! embedding, the signature is
  23. //! @f$ \mathrm{less\_equal} : A \times B \to Bool @f$.
  24. //!
  25. //! @param x, y
  26. //! Two objects to compare.
  27. //!
  28. //!
  29. //! Example
  30. //! -------
  31. //! @include example/less_equal.cpp
  32. #ifdef BOOST_HANA_DOXYGEN_INVOKED
  33. constexpr auto less_equal = [](auto&& x, auto&& y) {
  34. return tag-dispatched;
  35. };
  36. #else
  37. template <typename T, typename U, typename = void>
  38. struct less_equal_impl : less_equal_impl<T, U, when<true>> { };
  39. struct less_equal_t : detail::nested_than<less_equal_t> {
  40. template <typename X, typename Y>
  41. constexpr auto operator()(X&& x, Y&& y) const;
  42. };
  43. constexpr less_equal_t less_equal{};
  44. #endif
  45. BOOST_HANA_NAMESPACE_END
  46. #endif // !BOOST_HANA_FWD_LESS_EQUAL_HPP