Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-15 09:53:04

0001 /*!
0002 @file
0003 Forward declares `boost::hana::min`.
0004 
0005 Copyright Louis Dionne 2013-2022
0006 Distributed under the Boost Software License, Version 1.0.
0007 (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
0008  */
0009 
0010 #ifndef BOOST_HANA_FWD_MIN_HPP
0011 #define BOOST_HANA_FWD_MIN_HPP
0012 
0013 #include <boost/hana/config.hpp>
0014 #include <boost/hana/core/when.hpp>
0015 
0016 
0017 namespace boost { namespace hana {
0018     //! Returns the smallest of its arguments according to the `less` ordering.
0019     //! @ingroup group-Orderable
0020     //!
0021     //!
0022     //! @todo
0023     //! We can't specify the signature right now, because the tag of the
0024     //! returned object depends on whether `x < y` or not. If we wanted to be
0025     //! mathematically correct, we should probably ask that `if_(cond, x, y)`
0026     //! returns a common data type of `x` and `y`, and then the behavior
0027     //! of `min` would follow naturally. However, I'm unsure whether this
0028     //! is desirable because that's a big requirement.
0029     //!
0030     //!
0031     //! Example
0032     //! -------
0033     //! @include example/min.cpp
0034 #ifdef BOOST_HANA_DOXYGEN_INVOKED
0035     constexpr auto min = [](auto&& x, auto&& y) -> decltype(auto) {
0036         return tag-dispatched;
0037     };
0038 #else
0039     template <typename T, typename U, typename = void>
0040     struct min_impl : min_impl<T, U, when<true>> { };
0041 
0042     struct min_t {
0043         template <typename X, typename Y>
0044         constexpr decltype(auto) operator()(X&& x, Y&& y) const;
0045     };
0046 
0047     BOOST_HANA_INLINE_VARIABLE constexpr min_t min{};
0048 #endif
0049 }} // end namespace boost::hana
0050 
0051 #endif // !BOOST_HANA_FWD_MIN_HPP