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