MinMax.h#
Fully qualified name: carb/MinMax.h
File members: carb/MinMax.h
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: LicenseRef-NvidiaProprietary
//
// NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
// property and proprietary rights in and to this material, related
// documentation and any modifications thereto. Any use, reproduction,
// disclosure or distribution of this material and related documentation
// without an express license agreement from NVIDIA CORPORATION or
// its affiliates is strictly prohibited.
#pragma once
template <class T>
[[nodiscard]] constexpr const T& carb_min(const T& left, const T& right) noexcept(noexcept(left < right))
{
return right < left ? right : left;
}
template <class T>
[[nodiscard]] constexpr const T& carb_max(const T& left, const T& right) noexcept(noexcept(left < right))
{
return left < right ? right : left;
}