38 lines
752 B
C++
38 lines
752 B
C++
#pragma once
|
|||
|
|
|
||
|
|
#include <algorithm>
|
||
|
|
#include <cctype>
|
||
|
|
#include <concepts>
|
||
|
|
#include <string>
|
||
|
|
#include <vector>
|
||
|
|
|
||
|
|
namespace cpp20 {
|
||
|
|
|
||
|
|
template <std::integral T>
|
||
|
|
[[nodiscard]] auto double_value(T value) -> T {
|
||
|
|
(void)value;
|
||
|
|
return T{};
|
||
|
|
}
|
||
|
|
|
||
|
|
template <std::floating_point T>
|
||
|
|
[[nodiscard]] auto clamp01(T value) -> T {
|
||
|
|
(void)value;
|
||
|
|
return T{};
|
||
|
|
}
|
||
|
|
|
||
|
|
template <typename T>
|
||
|
|
concept StringLike = requires(T value) {
|
||
|
|
{ value.size() } -> std::convertible_to<std::size_t>;
|
||
|
|
{ value.data() } -> std::convertible_to<const char*>;
|
||
|
|
};
|
||
|
|
|
||
|
|
template <StringLike T>
|
||
|
|
[[nodiscard]] auto uppercase_copy(const T& text) -> std::string {
|
||
|
|
(void)text;
|
||
|
|
return {};
|
||
|
|
}
|
||
|
|
|
||
|
|
[[nodiscard]] auto sum_integral(const std::vector<int>& data) -> int;
|
||
|
|
|
||
|
|
} // namespace cpp20
|