Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects, and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Developer articles
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
YandereChan2
binary_tree
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
binary_tree
/
Yc.binary_tree.cppm
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
49 lines (43 loc) · 1.88 KB
main
Breadcrumbs
binary_tree
/
Yc.binary_tree.cppm
Copy path
Top
File metadata and controls
Code
Blame
49 lines (43 loc) · 1.88 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// ===========================================================================
// Yc.binary_tree.cppm
//
// 具名模块接口:导出 binary_tree.h 的全部声明。
//
// 用法(与 intrusive 模块一致,不要在同一程序里混用 include 与 import):
// * #include "binary_tree.h"
// * import "binary_tree.h"; (标题单元)
// * import Yc.binary_tree; (本文件)
//
// 依赖的处理:
// * intrusive_binary_tree.h 由 import Yc.intrusive_binary_tree; 提供;
// * union_data.h 只在模块内部使用(data_t 是节点存储的实现细节),直接放在
// 本接口单元的全局模块片段里文本包含,既不导出、也不单独成模块。
// 两个树模块各自包含同一份 union_data.h,得到的是全局模块里同一个 data_t。
// 这里先定义 YC_BINARY_TREE_MODULE,让 binary_tree.h 跳过它自己的两个
// #include,避免 intrusive 的声明在多个模块里各定义一份。
//
// 构建(MSVC):
// cl /std:c++latest /EHsc /utf-8 /c /interface /TpYc.binary_tree.cppm
// /ifcSearchDir . /ifcOutput Yc.binary_tree.ifc
// 其中 /ifcSearchDir 用于找到 import 引入的 Yc.intrusive_binary_tree 的 .ifc。
// ===========================================================================
module;
// 标准库头文件放在全局模块片段,理由同 Yc.intrusive_binary_tree.cppm。
// union_data.h 放在这里:它的声明属于全局模块,不会被 export 出去。
#include <cstddef>
#include <functional>
#include <new>
#include <memory>
#include <type_traits>
#include <utility>
#include "union_data.h"
export module Yc.binary_tree;
import Yc.intrusive_binary_tree;
// 理由同 Yc.intrusive_binary_tree.cppm:把 placement new 的声明导出给导入方。
export using ::operator new;
export using ::operator delete;
#define YC_BINARY_TREE_MODULE 1
export
{
#include "binary_tree.h"
}
You can’t perform that action at this time.