CMakeTutorialStep1 2.3.12
Loading...
Searching...
No Matches
ModernParadigm.cxx File Reference

ModernParadigm.hxx 的实现:分字符串解析与 span 求和。 More...

#include "ModernParadigm.hxx"
#include <cctype>
#include <limits>

Namespaces

namespace  tutorial

Functions

std::expected< Price, ParseErr > tutorial::parse_price_cents (std::string_view s)
 逐字符解析十进制整数分;空串、非数字或溢出返回对应 ParseErr
std::int64_t tutorial::sum_cents (std::span< Price const > prices) noexcept
 累加各 Price::cents; noexcept 便于 fuzz/bench 热路径

Detailed Description

ModernParadigm.hxx 的实现:分字符串解析与 span 求和。