This documentation is automatically generated by online-judge-tools/verification-helper
#include "kpr/template/chmin_chmax.hpp"#pragma once
namespace kpr {
// assign min
[[maybe_unused]] inline constexpr struct {
template<class T, class U = T>
constexpr bool operator ()(T& a, const U& b) const noexcept {
if (a > b) {
a = b;
return true;
}
return false;
}
} chmin;
// assign max
[[maybe_unused]] inline constexpr struct {
template<class T, class U = T>
constexpr bool operator ()(T& a, const U& b) const noexcept {
if (a < b) {
a = b;
return true;
}
return false;
}
} chmax;
} // namespace kpr#line 2 "kpr/template/chmin_chmax.hpp"
namespace kpr {
// assign min
[[maybe_unused]] inline constexpr struct {
template<class T, class U = T>
constexpr bool operator ()(T& a, const U& b) const noexcept {
if (a > b) {
a = b;
return true;
}
return false;
}
} chmin;
// assign max
[[maybe_unused]] inline constexpr struct {
template<class T, class U = T>
constexpr bool operator ()(T& a, const U& b) const noexcept {
if (a < b) {
a = b;
return true;
}
return false;
}
} chmax;
} // namespace kpr