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.
4namespace ftxui {
5namespace util {
6
7// Similar to std::clamp, but allow hi to be lower than lo.
8template <class T>
9constexpr 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
constexpr const T & clamp(const T &v, const T &lo, const T &hi)
Definition util.hpp:9
Component Slider(SliderOption< T > options)
A slider in any direction.
Definition slider.cpp:339