Bring back C++17 minimal requirement. (#475)

This commit is contained in:
Arthur Sonzogni
2022-09-03 12:12:59 +02:00
committed by ArthurSonzogni
parent 1d76a2321c
commit c8ec151154
10 changed files with 42 additions and 33 deletions

View File

@@ -1,5 +1,4 @@
#include <cmath> // IWYU pragma: keep
#include <compare> // for operator<=, operator>=, partial_ordering
#include <ratio> // for ratio
#include <utility> // for move

View File

@@ -26,8 +26,7 @@ class RadioboxBase : public ComponentBase {
RadioboxBase(ConstStringListRef entries,
int* selected,
Ref<RadioboxOption> option)
: entries_(entries), selected_(selected), option_(std::move(option)) {
}
: entries_(entries), selected_(selected), option_(std::move(option)) {}
private:
Element Render() override {

View File

@@ -1,7 +1,6 @@
#include <algorithm> // for min
#include <algorithm> // for copy, max, min
#include <array> // for array
#include <chrono> // for operator-, milliseconds, duration, operator<=>, time_point, common_type<>::type
#include <compare> // for operator>=, strong_ordering
#include <chrono> // for operator-, milliseconds, duration, operator>=, time_point, common_type<>::type
#include <csignal> // for signal, raise, SIGTSTP, SIGABRT, SIGFPE, SIGILL, SIGINT, SIGSEGV, SIGTERM, SIGWINCH
#include <cstdio> // for fileno, size_t, stdin
#include <ftxui/component/task.hpp> // for Task, Closure, AnimationTask

View File

@@ -266,12 +266,12 @@ Component Slider(ConstStringRef label,
ConstRef<int> min,
ConstRef<int> max,
ConstRef<int> increment) {
auto slider = Make<SliderBase<int>>(SliderOption<int>({
.value = value,
.min = min,
.max = max,
.increment = increment,
}));
SliderOption<int> option;
option.value = value;
option.min = min;
option.max = max;
option.increment = increment;
auto slider = Make<SliderBase<int>>(option);
return Make<SliderWithLabel>(label, slider);
}
@@ -280,12 +280,12 @@ Component Slider(ConstStringRef label,
ConstRef<float> min,
ConstRef<float> max,
ConstRef<float> increment) {
auto slider = Make<SliderBase<float>>(SliderOption<float>({
.value = value,
.min = min,
.max = max,
.increment = increment,
}));
SliderOption<float> option;
option.value = value;
option.min = min;
option.max = max;
option.increment = increment;
auto slider = Make<SliderBase<float>>(option);
return Make<SliderWithLabel>(label, slider);
}
Component Slider(ConstStringRef label,
@@ -293,12 +293,12 @@ Component Slider(ConstStringRef label,
ConstRef<long> min,
ConstRef<long> max,
ConstRef<long> increment) {
auto slider = Make<SliderBase<long>>(SliderOption<long>({
.value = value,
.min = min,
.max = max,
.increment = increment,
}));
SliderOption<long> option;
option.value = value;
option.min = min;
option.max = max;
option.increment = increment;
auto slider = Make<SliderBase<long>>(option);
return Make<SliderWithLabel>(label, slider);
}

View File

@@ -145,7 +145,7 @@ Color Color::RGB(uint8_t red, uint8_t green, uint8_t blue) {
// static
Color Color::HSV(uint8_t h, uint8_t s, uint8_t v) {
if (s == 0) {
return {0,0,0};
return {0, 0, 0};
}
uint8_t region = h / 43; // NOLINT