Console Library 8.0.0
A header-only library that makes C++ simple
Loading...
Searching...
No Matches
container.h
Go to the documentation of this file.
1
9
10/*
11Copyright (c) 2026 MrXie1109
12
13Permission is hereby granted, free of charge, to any person obtaining a copy
14of this software and associated documentation files (the "Software"), to deal
15in the Software without restriction, including without limitation the rights
16to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17copies of the Software, and to permit persons to whom the Software is
18furnished to do so, subject to the following conditions:
19
20The above copyright notice and this permission notice shall be included in all
21copies or substantial portions of the Software.
22
23THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29SOFTWARE.
30*/
31
32#pragma once
33#include "./container/adapter.h"
34#include "./container/box.h"
35#include "./container/cow.h"
36#include "./container/maybe.h"
38#include "./container/result.h"
39#include "./container/union.h"
40#include "./container/view.h"
41
42namespace console {}
提供带有值返回 pop 操作的容器适配器包装类。
提供可存储任意类型的异构容器(Box)和类型擦除包装器(Item)。
提供 Cow 类实现写时复制操作。
提供类似 std::optional 的可选值容器 Maybe,支持空状态(nothing)。
提供编译期维度固定的多维数组容器 MultiArray,支持任意维度和元素级算术/逻辑/位运算。
本库所有组件所在的顶层命名空间。
提供类似 Rust 的 Result 类型,用于表示成功(Ok)或失败(Err)的结果。
提供类型安全的可判别联合体 (Tagged Union)。
提供容器的非拥有视图(View),支持区间切片和便捷的工厂函数。