Initial Course
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user