mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-12-05 01:11:46 +08:00
feb24b9498
Run ftxui_example_homescreen on Windows, then select compiler tab, crash on origin code. Co-authored-by: chenpeizhe <peizhe.chen@horizon.ai>
16 lines
423 B
C++
16 lines
423 B
C++
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
|
|
|
|
// 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.
|