Console Library 4.7.0
A header-only library that makes C++ simple
Loading...
Searching...
No Matches
maybe.h File Reference

提供类似 std::optional 的可选值容器 Maybe,支持空状态(nothing)。 More...

#include <utility>
#include <memory>
#include <iostream>
#include "csexc.h"

Go to the source code of this file.

Classes

class  console::Maybe< T >
 可选值容器,可包含一个值或为空。 More...

Namespaces

namespace  console
 本库所有组件所在的顶层命名空间。

Variables

struct { 
console::nothing
 空状态标记对象,用于显式构造空的 Maybe。

Detailed Description

提供类似 std::optional 的可选值容器 Maybe,支持空状态(nothing)。

Maybe<T> 可包含一个 T 类型的值或为空(nothing)。提供安全的访问、值提取、默认值等操作。

Author
MrXie1109
Date
2026