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