max.hpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*!
  2. @file
  3. Forward declares `boost::hana::max`.
  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_MAX_HPP
  9. #define BOOST_HANA_FWD_MAX_HPP
  10. #include <boost/hana/config.hpp>
  11. #include <boost/hana/core/when.hpp>
  12. BOOST_HANA_NAMESPACE_BEGIN
  13. //! Returns the greatest of its arguments according to the `less` ordering.
  14. //! @ingroup group-Orderable
  15. //!
  16. //!
  17. //! @todo Can't specify the signature here either. See `min` for details.
  18. //!
  19. //! Example
  20. //! -------
  21. //! @include example/max.cpp
  22. #ifdef BOOST_HANA_DOXYGEN_INVOKED
  23. constexpr auto max = [](auto&& x, auto&& y) -> decltype(auto) {
  24. return tag-dispatched;
  25. };
  26. #else
  27. template <typename T, typename U, typename = void>
  28. struct max_impl : max_impl<T, U, when<true>> { };
  29. struct max_t {
  30. template <typename X, typename Y>
  31. constexpr decltype(auto) operator()(X&& x, Y&& y) const;
  32. };
  33. constexpr max_t max{};
  34. #endif
  35. BOOST_HANA_NAMESPACE_END
  36. #endif // !BOOST_HANA_FWD_MAX_HPP