less.hpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*!
  2. @file
  3. Forward declares `boost::hana::less`.
  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_HPP
  9. #define BOOST_HANA_FWD_LESS_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 `y`.
  15. //! @ingroup group-Orderable
  16. //!
  17. //!
  18. //! Signature
  19. //! ---------
  20. //! Given a Logical `Bool` and two Orderables `A` and `B` with a common
  21. //! embedding, the signature is
  22. //! @f$ \mathrm{less} : A \times B \to Bool @f$.
  23. //!
  24. //! @param x, y
  25. //! Two objects to compare.
  26. //!
  27. //!
  28. //! Example
  29. //! -------
  30. //! @include example/less.cpp
  31. #ifdef BOOST_HANA_DOXYGEN_INVOKED
  32. constexpr auto less = [](auto&& x, auto&& y) {
  33. return tag-dispatched;
  34. };
  35. #else
  36. template <typename T, typename U, typename = void>
  37. struct less_impl : less_impl<T, U, when<true>> { };
  38. struct less_t : detail::nested_than<less_t> {
  39. template <typename X, typename Y>
  40. constexpr auto operator()(X&& x, Y&& y) const;
  41. };
  42. constexpr less_t less{};
  43. #endif
  44. BOOST_HANA_NAMESPACE_END
  45. #endif // !BOOST_HANA_FWD_LESS_HPP