FTXUI 6.1.9 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#ifndef FTXUI_SCREEN_UTIL_HPP
5#define FTXUI_SCREEN_UTIL_HPP
6
7 namespace ftxui::util {
8
9// Similar to std::clamp, but allow hi to be lower than lo.
10 template <class T>
11 constexpr const T& clamp(const T& v, const T& lo, const T& hi) {
12 return v < lo ? lo : hi < v ? hi : v;
13}
14
15} // namespace ftxui::util
16
17#endif /* end of include guard: FTXUI_SCREEN_UTIL_HPP */
ftxui::util
Definition util.hpp:7
ftxui::util::clamp
constexpr const T & clamp(const T &v, const T &lo, const T &hi)
Definition util.hpp:11