Warning: This file is not a C or C++ file. It does not have highlighting.
| 1 | //===----------------------------------------------------------------------===// |
|---|---|
| 2 | // |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | #ifndef _LIBCPP___CXX03___ALGORITHM_MIN_H |
| 10 | #define _LIBCPP___CXX03___ALGORITHM_MIN_H |
| 11 | |
| 12 | #include <__cxx03/__algorithm/comp.h> |
| 13 | #include <__cxx03/__algorithm/comp_ref_type.h> |
| 14 | #include <__cxx03/__algorithm/min_element.h> |
| 15 | #include <__cxx03/__config> |
| 16 | |
| 17 | #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) |
| 18 | # pragma GCC system_header |
| 19 | #endif |
| 20 | |
| 21 | _LIBCPP_PUSH_MACROS |
| 22 | #include <__cxx03/__undef_macros> |
| 23 | |
| 24 | _LIBCPP_BEGIN_NAMESPACE_STD |
| 25 | |
| 26 | template <class _Tp, class _Compare> |
| 27 | _LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI const _Tp& |
| 28 | min(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b, _Compare __comp) { |
| 29 | return __comp(__b, __a) ? __b : __a; |
| 30 | } |
| 31 | |
| 32 | template <class _Tp> |
| 33 | _LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI const _Tp& |
| 34 | min(_LIBCPP_LIFETIMEBOUND const _Tp& __a, _LIBCPP_LIFETIMEBOUND const _Tp& __b) { |
| 35 | return std::min(__a, __b, __less<>()); |
| 36 | } |
| 37 | |
| 38 | _LIBCPP_END_NAMESPACE_STD |
| 39 | |
| 40 | _LIBCPP_POP_MACROS |
| 41 | |
| 42 | #endif // _LIBCPP___CXX03___ALGORITHM_MIN_H |
| 43 |
Warning: This file is not a C or C++ file. It does not have highlighting.
