[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / libc / src / __support / CPP / algorithm.h
blobfef3c18dc50bc87044849c735cc1173ec339b9d7
1 //===-- A self contained equivalent of <algorithm> --------------*- C++ -*-===//
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 // This file is minimalist on purpose but can receive a few more function if
9 // they prove useful.
10 //===----------------------------------------------------------------------===//
12 #ifndef LLVM_LIBC_SRC___SUPPORT_CPP_ALGORITHM_H
13 #define LLVM_LIBC_SRC___SUPPORT_CPP_ALGORITHM_H
15 #include "src/__support/macros/attributes.h" // LIBC_INLINE
17 namespace LIBC_NAMESPACE {
18 namespace cpp {
20 template <class T> LIBC_INLINE constexpr const T &max(const T &a, const T &b) {
21 return (a < b) ? b : a;
24 template <class T> LIBC_INLINE constexpr const T &min(const T &a, const T &b) {
25 return (a < b) ? a : b;
28 } // namespace cpp
29 } // namespace LIBC_NAMESPACE
31 #endif // LLVM_LIBC_SRC___SUPPORT_CPP_ALGORITHM_H