百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
F

from-scratch

> 编程语言
开源

C++标准库特性,从零开始

195 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

C++标准库特性,从零开始

This repository contains "from scratch" implementations of many C++17 standard library features. It's intended for use with my upcoming workshop on "The Standard Library From Scratch".

This code is not intended for use in production!

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT.

(That is, I won't stop you from using it, but it's liable to be inefficient, incomplete, incorrect, non-portable, and so on. Use the actual standard library instead; it's what it's there for.)

The good stuff

If you're looking for the code snippets, you should skip straight to the bits/ subdirectory.

git log is your friend

The git history of this repo is just as much a part of the "product" as the code at the current top-of-tree. I'll try to keep the commits topical, and if I find out that something in the history is wrong, I'll go fix it. This means that this repo will be force-pushed a lot.

If you're browsing the code, all you need to know is that git log and git blame will be very useful to you.

Writing test cases

In general, you should be able to compile a test program with

g++ -std=c++14 -I ${THIS_REPO}/include/ test.cc

The "from scratch" library should behave pretty much the same as the standard library; just do a global search-and-replace on your #includes and your stds.

#include 

int main() {
    scratch::vector v{3, 1, 4, 1, 5, 9};
    scratch::sort(v.begin(), v.end());
    assert((v == scratch::vector{1, 1, 3, 4, 5, 9}));
}

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C++

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言