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

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

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

Go to the source code of this file.

Classes

struct  console::nothing_t
 空状态标记对象,用于显式构造空的 Maybe。 More...
class  console::Maybe< T >
 可选值容器,可包含一个值或为空。 More...

Namespaces

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

Variables

static constexpr nothing_t console::nothing

Detailed Description

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

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

Author
MrXie1109
Date
2026