Initial Course
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#include <expected>
|
||||
#include <string>
|
||||
|
||||
namespace cpp23 {
|
||||
|
||||
enum class ParseError { EmptyInput, InvalidNumber };
|
||||
|
||||
[[nodiscard]] auto parse_int(const std::string& text) -> std::expected<int, ParseError>;
|
||||
[[nodiscard]] auto safe_sqrt(int value) -> std::expected<double, std::string>;
|
||||
[[nodiscard]] auto chain_parse_and_double(const std::string& text) -> std::expected<int, ParseError>;
|
||||
|
||||
} // namespace cpp23
|
||||
Reference in New Issue
Block a user