AirlineTicket 1.0.12
Loading...
Searching...
No Matches
modern Namespace Referenceexport

Classes

struct  Price
 价格强类型(整型分) More...
struct  Quantity
 数量强类型(整型单位) More...

Enumerations

enum class  ParseErr : int { empty = 1 , invalid = 2 , overflow = 3 }
 价格字符串解析的可恢复错误码 More...

Functions

std::expected< Price, ParseErr > parse_price_cents (std::string_view s)
 解析 ASCII 数字分字符串;失败返回 ParseErr
std::int64_t sum_cents (std::span< Price const > prices) noexcept
 对价格 span 求和(零拷贝)

Enumeration Type Documentation

◆ ParseErr

enum class modern::ParseErr : int
exportstrong

价格字符串解析的可恢复错误码

Enumerator
empty 
invalid 
overflow 

Function Documentation

◆ parse_price_cents()

std::expected< Price, ParseErr > modern::parse_price_cents ( std::string_view s)
nodiscardexport

解析 ASCII 数字分字符串;失败返回 ParseErr

◆ sum_cents()

std::int64_t modern::sum_cents ( std::span< Price const > prices)
nodiscardexportnoexcept

对价格 span 求和(零拷贝)