FTXUI
3.0.0
C++ functional terminal UI.
Loading...
Searching...
No Matches
util.hpp
Go to the documentation of this file.
1
namespace
ftxui
{
2
namespace
util {
3
4
// Similar to std::clamp, but allow hi to be lower than lo.
5
template
<
class
T>
6
constexpr
const
T&
clamp
(
const
T& v,
const
T& lo,
const
T& hi) {
7
return
v < lo ? lo : hi < v ? hi : v;
8
}
9
10
}
// namespace util
11
}
// namespace ftxui
12
13
// Copyright 2022 Arthur Sonzogni. All rights reserved.
14
// Use of this source code is governed by the MIT license that can be found in
15
// the LICENSE file.
ftxui::util::clamp
constexpr const T & clamp(const T &v, const T &lo, const T &hi)
Definition
util.hpp:6
ftxui
Definition
animation.hpp:9