mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-05-07 18:41:12 +08:00

Add missing include guard. This fix https://github.com/cpp-best-practices/cmake_template/issues/64 Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
20 lines
541 B
C++
20 lines
541 B
C++
// Copyright 2022 Arthur Sonzogni. All rights reserved.
|
|
// Use of this source code is governed by the MIT license that can be found in
|
|
// the LICENSE file.
|
|
#ifndef FTXUI_SCREEN_UTIL_HPP
|
|
#define FTXUI_SCREEN_UTIL_HPP
|
|
|
|
namespace ftxui {
|
|
namespace util {
|
|
|
|
// Similar to std::clamp, but allow hi to be lower than lo.
|
|
template <class T>
|
|
constexpr const T& clamp(const T& v, const T& lo, const T& hi) {
|
|
return v < lo ? lo : hi < v ? hi : v;
|
|
}
|
|
|
|
} // namespace util
|
|
} // namespace ftxui
|
|
|
|
#endif /* end of include guard: FTXUI_SCREEN_UTIL_HPP */
|