Skip to content

Commit 7529ae3

Browse files
zhangxingLight-City
authored andcommitted
support bazel complie this project and format code.
1 parent 1f86192 commit 7529ae3

File tree

636 files changed

+10068
-9430
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

636 files changed

+10068
-9430
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
11
com.sh
2+
bazel-CPlusPlusThings
3+
bazel-bin
4+
bazel-out
5+
bazel-testlogs
6+
bazel-cplusplus_bazel
7+
.vscode

.vscode/settings.json

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
{
2+
"files.associations": {
3+
"iostream": "cpp",
4+
"ostream": "cpp",
5+
"__availability": "cpp",
6+
"__config": "cpp",
7+
"__string": "cpp",
8+
"deque": "cpp",
9+
"filesystem": "cpp",
10+
"functional": "cpp",
11+
"iterator": "cpp",
12+
"ratio": "cpp",
13+
"__bit_reference": "cpp",
14+
"__bits": "cpp",
15+
"__debug": "cpp",
16+
"__errc": "cpp",
17+
"__functional_base": "cpp",
18+
"__hash_table": "cpp",
19+
"__locale": "cpp",
20+
"__mutex_base": "cpp",
21+
"__node_handle": "cpp",
22+
"__nullptr": "cpp",
23+
"__split_buffer": "cpp",
24+
"__threading_support": "cpp",
25+
"__tree": "cpp",
26+
"__tuple": "cpp",
27+
"algorithm": "cpp",
28+
"array": "cpp",
29+
"atomic": "cpp",
30+
"bit": "cpp",
31+
"bitset": "cpp",
32+
"cctype": "cpp",
33+
"chrono": "cpp",
34+
"cinttypes": "cpp",
35+
"clocale": "cpp",
36+
"cmath": "cpp",
37+
"complex": "cpp",
38+
"condition_variable": "cpp",
39+
"cstdarg": "cpp",
40+
"cstddef": "cpp",
41+
"cstdint": "cpp",
42+
"cstdio": "cpp",
43+
"cstdlib": "cpp",
44+
"cstring": "cpp",
45+
"ctime": "cpp",
46+
"cwchar": "cpp",
47+
"cwctype": "cpp",
48+
"exception": "cpp",
49+
"fstream": "cpp",
50+
"initializer_list": "cpp",
51+
"iomanip": "cpp",
52+
"ios": "cpp",
53+
"iosfwd": "cpp",
54+
"istream": "cpp",
55+
"limits": "cpp",
56+
"list": "cpp",
57+
"locale": "cpp",
58+
"map": "cpp",
59+
"memory": "cpp",
60+
"mutex": "cpp",
61+
"new": "cpp",
62+
"numeric": "cpp",
63+
"optional": "cpp",
64+
"queue": "cpp",
65+
"regex": "cpp",
66+
"set": "cpp",
67+
"sstream": "cpp",
68+
"stack": "cpp",
69+
"stdexcept": "cpp",
70+
"streambuf": "cpp",
71+
"string": "cpp",
72+
"string_view": "cpp",
73+
"system_error": "cpp",
74+
"tuple": "cpp",
75+
"type_traits": "cpp",
76+
"typeinfo": "cpp",
77+
"unordered_map": "cpp",
78+
"unordered_set": "cpp",
79+
"utility": "cpp",
80+
"vector": "cpp",
81+
"any": "cpp",
82+
"barrier": "cpp",
83+
"*.tcc": "cpp",
84+
"cfenv": "cpp",
85+
"charconv": "cpp",
86+
"codecvt": "cpp",
87+
"compare": "cpp",
88+
"concepts": "cpp",
89+
"coroutine": "cpp",
90+
"csetjmp": "cpp",
91+
"csignal": "cpp",
92+
"cuchar": "cpp",
93+
"forward_list": "cpp",
94+
"memory_resource": "cpp",
95+
"random": "cpp",
96+
"source_location": "cpp",
97+
"future": "cpp",
98+
"latch": "cpp",
99+
"numbers": "cpp",
100+
"ranges": "cpp",
101+
"scoped_allocator": "cpp",
102+
"semaphore": "cpp",
103+
"shared_mutex": "cpp",
104+
"span": "cpp",
105+
"stop_token": "cpp",
106+
"syncstream": "cpp",
107+
"thread": "cpp",
108+
"typeindex": "cpp",
109+
"valarray": "cpp",
110+
"variant": "cpp"
111+
}
112+
}

README.md

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,15 @@
155155
├── [输入输出重载.cpp](./practical_exercises/key_exercises/输入输出重载.cpp)
156156
├── [输出格式.cpp](./practical_exercises/key_exercises/输出格式.cpp)
157157

158-
### 3.[C++2.0 新特性](./c++2.0)
158+
### 3.[C++2.0 新特性](./cpp2.0)
159159

160160
#### 3.0 概况
161161

162162
C++2.0 是一个简称,意为「现代 C++」,包括 C++11/14/17/20。
163163

164-
#### 3.1 [C++11 新特性](./c++2.0/c++11)
164+
#### 3.1 [C++11 新特性](./cpp2.0/cpp11)
165165

166-
- [Variadic Templates](./c++2.0/c++11/variadic)
166+
- [Variadic Templates](./cpp2.0/cpp11/variadic)
167167

168168
- Spaces in Template Expressions
169169

@@ -172,61 +172,61 @@ C++2.0 是一个简称,意为「现代 C++」,包括 C++11/14/17/20。
172172
vector<list<int>> // before c++ 11 error error: ‘>>’ should be ‘> >’ within a nested template argument list,c++11后可以正常通过
173173
```
174174

175-
- [nullptr and nullptr_t](./c++2.0/c++11/nullptr.cpp)
175+
- [nullptr and nullptr_t](./cpp2.0/cpp11/nullptr.cpp)
176176

177-
- [Automatic Type Deduction with auto](./c++2.0/c++11/auto.cpp)
177+
- [Automatic Type Deduction with auto](./cpp2.0/cpp11/auto.cpp)
178178

179-
- [Uniform Initialization ](./c++2.0/c++11/uniform_initialization.cpp)
179+
- [Uniform Initialization ](./cpp2.0/cpp11/uniform_initialization.cpp)
180180

181-
- [initializer_list](./c++2.0/c++11/initializer.cpp)
181+
- [initializer_list](./cpp2.0/cpp11/initializer.cpp)
182182

183-
- [explicit for ctors taking more than one argument](./c++2.0/c++11/explicit.cpp)
183+
- [explicit for ctors taking more than one argument](./cpp2.0/cpp11/explicit.cpp)
184184

185-
- [range-based for statement](./c++2.0/c++11/auto.cpp)
185+
- [range-based for statement](./cpp2.0/cpp11/auto.cpp)
186186

187187
```cpp
188188
for(decl:col) {
189189
statement
190190
}
191191
```
192192
193-
- [=default,=delete](./c++2.0/c++11/default_delete.cpp)
193+
- [=default,=delete](./cpp2.0/cpp11/default_delete.cpp)
194194
195195
如果你自行定义了一个 `ctor`, 那么编译器就不会给你一个 `default ctor`
196196
如果强制加上 `=default`, 就可以重新获得并使用 `default ctor`.
197197
198198
- Alias(化名) Template (template typedef)
199199
200-
- [alias.cpp](./c++2.0/c++11/alias.cpp)
201-
- [template_template.cpp](./c++2.0/c++11/template_template.cpp)
200+
- [alias.cpp](./cpp2.0/cpp11/alias.cpp)
201+
- [template_template.cpp](./cpp2.0/cpp11/template_template.cpp)
202202
203-
- [template template parameter](./c++2.0/template_template.cpp)
203+
- [template template parameter](./cpp2.0/template_template.cpp)
204204
205-
- [type alias](./c++2.0/c++11/type_alias.cpp)
205+
- [type alias](./cpp2.0/cpp11/type_alias.cpp)
206206
207-
- [noexcept](./c++2.0/c++11/noexcept.cpp)
207+
- [noexcept](./cpp2.0/cpp11/noexcept.cpp)
208208
209-
- [override](./c++2.0/c++11/override.cpp)
209+
- [override](./cpp2.0/cpp11/override.cpp)
210210
211-
- [final](./c++2.0/c++11/final.cpp)
211+
- [final](./cpp2.0/cpp11/final.cpp)
212212
213-
- [decltype](./c++2.0/c++11/decltype.cpp)
213+
- [decltype](./cpp2.0/cpp11/decltype.cpp)
214214
215-
- [lambda](./c++2.0/c++11/lambda.cpp)
215+
- [lambda](./cpp2.0/cpp11/lambda.cpp)
216216
217-
- [Rvalue reference](./c++2.0/c++11/rvalue.cpp)
217+
- [Rvalue reference](./cpp2.0/cpp11/rvalue.cpp)
218218
219-
- [move aware class](./c++2.0/c++11/move.cpp)
219+
- [move aware class](./cpp2.0/cpp11/move.cpp)
220220
221221
- 容器-结构与分类
222222
223223
- (1) 序列式容器包括:`array`(C++2.0 新引入),`vector`,`deque`,`list`,`forward_list`(C++2.0 新引入)
224224
- (2) 关联式容器包括:`set/multiset`,`map/multimap`
225225
- (3) 无序容器(C++2.0 新引入,更换原先 `hash_xxx` 为 `unordered_xxx`)包括:`unordered_map/unordered_multimap,unordered_set/unordered_multiset`
226226
227-
- [Hash Function](./c++2.0/c++11/hash.cpp)
227+
- [Hash Function](./cpp2.0/cpp11/hash.cpp)
228228
229-
- [tuple](./c++2.0/c++11/tuple.cpp)
229+
- [tuple](./cpp2.0/cpp11/tuple.cpp)
230230
231231
学习资料:https://www.bilibili.com/video/av51863195?from=search&seid=3610634846288253061
232232
@@ -295,31 +295,31 @@ C++2.0 是一个简称,意为「现代 C++」,包括 C++11/14/17/20。
295295
296296
#### 8.1 [极客时间《现代 C++ 实战 30 讲》](https://time.geekbang.org/channel/home)
297297
298-
- [堆、栈、RAII:C++ 里该如何管理资源?](./learn_class/modern_C++_30/RAII)
298+
- [堆、栈、RAII:C++ 里该如何管理资源?](./learn_class/modern_cpp_30/RAII)
299299
- [堆](./learn_class/modern_++_30/RAII/heap.cpp)
300-
- [栈](./learn_class/modern_C++_30/RAII/stack.cpp)
301-
- [RAII](./learn_class/modern_C++_30/RAII/RAII.cpp)
302-
- [自己动手,实现 C++ 的智能指针](./learn_class/modern_C++_30/smart_ptr)
303-
- [auto_ptr、scope_ptr](./learn_class/modern_C++_30/smart_ptr/auto_scope.cpp)
304-
- [unique_ptr](./learn_class/modern_C++_30/smart_ptr/unique_ptr.cpp)
305-
- [shared_ptr](./learn_class/modern_C++_30/smart_ptr/shared_ptr.cpp)
306-
- [右值和移动究竟解决了什么问题?](./learn_class/modern_C++_30/reference)
307-
- [左值与右值](./learn_class/modern_C++_30/reference/reference.cpp)
308-
- [延长声明周期](./learn_class/modern_C++_30/reference/lifetime.cpp)
309-
- [引用折叠](./learn_class/modern_C++_30/reference/collapses.cpp)
310-
- [完美转发](./learn_class/modern_C++_30/reference/forward.cpp)
311-
- [不要返回本地变量的引用](./learn_class/modern_C++_30/reference/don'treturnReference.cpp)
312-
- [容器 1](./learn_class/modern_C++_30/container1)
313-
- [容器 2](./learn_class/modern_C++_30/container2)
314-
- [异常](./learn_class/modern_C++_30/exception)
315-
- [字面量、静态断言和成员函数说明符](./learn_class/modern_C++_30/literalAssert)
316-
- [是不是应该返回对象?](./learn_class/modern_C++_30/returnObj)
317-
- [编译期多态:泛型编程和模板入门](./learn_class/modern_C++_30/compilerpoly)
318-
- [译期能做些什么?一个完整的计算世界](./learn_class/modern_C++_30/compilercompute)
319-
- [SFINAE:不是错误的替换失败是怎么回事?](./learn_class/modern_C++_30/SFINAE)
320-
- [constexpr:一个常态的世界](./learn_class/modern_C++_30/constexpr)
321-
- [函数对象和 lambda:进入函数式编程](./learn_class/modern_C++_30/functionLambda)
322-
- [内存模型和 atomic:理解并发的复杂性](./learn_class/modern_C++_30/memorymodel_atomic)
300+
- [栈](./learn_class/modern_cpp_30/RAII/stack.cpp)
301+
- [RAII](./learn_class/modern_cpp_30/RAII/RAII.cpp)
302+
- [自己动手,实现 C++ 的智能指针](./learn_class/modern_cpp_30/smart_ptr)
303+
- [auto_ptr、scope_ptr](./learn_class/modern_cpp_30/smart_ptr/auto_scope.cpp)
304+
- [unique_ptr](./learn_class/modern_cpp_30/smart_ptr/unique_ptr.cpp)
305+
- [shared_ptr](./learn_class/modern_cpp_30/smart_ptr/shared_ptr.cpp)
306+
- [右值和移动究竟解决了什么问题?](./learn_class/modern_cpp_30/reference)
307+
- [左值与右值](./learn_class/modern_cpp_30/reference/reference.cpp)
308+
- [延长声明周期](./learn_class/modern_cpp_30/reference/lifetime.cpp)
309+
- [引用折叠](./learn_class/modern_cpp_30/reference/collapses.cpp)
310+
- [完美转发](./learn_class/modern_cpp_30/reference/forward.cpp)
311+
- [不要返回本地变量的引用](./learn_class/modern_cpp_30/reference/don'treturnReference.cpp)
312+
- [容器 1](./learn_class/modern_cpp_30/container1)
313+
- [容器 2](./learn_class/modern_cpp_30/container2)
314+
- [异常](./learn_class/modern_cpp_30/exception)
315+
- [字面量、静态断言和成员函数说明符](./learn_class/modern_cpp_30/literalAssert)
316+
- [是不是应该返回对象?](./learn_class/modern_cpp_30/returnObj)
317+
- [编译期多态:泛型编程和模板入门](./learn_class/modern_cpp_30/compilerpoly)
318+
- [译期能做些什么?一个完整的计算世界](./learn_class/modern_cpp_30/compilercompute)
319+
- [SFINAE:不是错误的替换失败是怎么回事?](./learn_class/modern_cpp_30/SFINAE)
320+
- [constexpr:一个常态的世界](./learn_class/modern_cpp_30/constexpr)
321+
- [函数对象和 lambda:进入函数式编程](./learn_class/modern_cpp_30/functionLambda)
322+
- [内存模型和 atomic:理解并发的复杂性](./learn_class/modern_cpp_30/memorymodel_atomic)
323323
324324
### 9.工具篇
325325
@@ -376,20 +376,20 @@ map<int, int> mp{
376376
377377
378378
379-
### 12.赞助我
379+
### 12.关注我
380380
381-
如果觉得不错,赞助我吧~
381+
如果觉得不错,关注我吧~
382382
383383
<table>
384384
<tbody>
385385
<tr>
386386
<th align="center" style="height=200 width="200">
387-
<img src="https://light-city.club/sc/assets/images/alipay.jpg" height="200" width="200" ><br>
388-
支付宝
387+
<img src="./img/cpp.jpg" height="200" width="200" ><br>
388+
星球
389389
</th>
390390
<th align="center" style="height=200 width="200">
391-
<img src="https://light-city.club/sc/assets/images/wechat.png" height="200" width="200" ><br>
392-
微信
391+
<img src="./img/wechat.jpg" height="200" width="200" ><br>
392+
微信公众号
393393
</th>
394394
</tr>
395395
</tbody>

README_EN.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -253,31 +253,31 @@ Learning materials: https://chenxiaowei.gitbook.io/cpp_concurrency_in_action/
253253
254254
#### 6.1 [Chinese Name:极客时间《现代 C++ 实战 30 讲》](https://time.geekbang.org/channel/home)
255255
256-
- [heap、stack、RAII:How to manage resources for C ++ ?](./learn_class/modern_C++_30/RAII)
256+
- [heap、stack、RAII:How to manage resources for C ++ ?](./learn_class/modern_cpp_30/RAII)
257257
- [heap](./modern_++_30/RAII/heap.cpp)
258-
- [stack](./learn_class/modern_C++_30/RAII/stack.cpp)
259-
- [RAII](./learn_class/modern_C++_30/RAII/RAII.cpp)
260-
- [Implementing smart pointers for C ++](./learn_class/modern_C++_30/smart_ptr)
261-
- [auto_ptr、scope_ptr](./learn_class/modern_C++_30/smart_ptr/auto_scope.cpp)
262-
- [unique_ptr](./learn_class/modern_C++_30/smart_ptr/unique_ptr.cpp)
263-
- [shared_ptr](./learn_class/modern_C++_30/smart_ptr/shared_ptr.cpp)
264-
- [What exactly does r value and move solve?](./learn_class/modern_C++_30/reference)
265-
- [L value and R value](./learn_class/modern_C++_30/reference/reference.cpp)
266-
- [Extend the declaration cycle](./learn_class/modern_C++_30/reference/lifetime.cpp)
267-
- [Reference folding](./learn_class/modern_C++_30/reference/collapses.cpp)
268-
- [Perfect forward](./learn_class/modern_C++_30/reference/forward.cpp)
269-
- [Do not return Reference](./learn_class/modern_C++_30/reference/don'treturnReference.cpp)
270-
- [Container 1](./learn_class/modern_C++_30/container1)
271-
- [Container 2](./learn_class/modern_C++_30/container2)
272-
- [Exception](./learn_class/modern_C++_30/exception)
273-
- [Literal、Static Assertion And Member Function Specifier](./learn_class/modern_C++_30/literalAssert)
274-
- [Return Object?](./learn_class/modern_C++_30/returnObj)c
275-
- [Getting started with generic programming and templates](./learn_class/modern_C++_30/compilerpoly)
276-
- [A whole Compiler Compute World](./learn_class/modern_C++_30/compilercompute)
277-
- [SFINAE:What is it if it is not replace error?](./learn_class/modern_C++_30/SFINAE)
278-
- [constexpr:A Normal World](./learn_class/modern_C++_30/constexpr)
279-
- [Function object and Lambda:functionLambda](./learn_class/modern_C++_30/functionLambda)
280-
- [Memory Model and Atomic:Understangding the complexity of concurrency](./learn_class/modern_C++_30/memorymodel_atomic)
258+
- [stack](./learn_class/modern_cpp_30/RAII/stack.cpp)
259+
- [RAII](./learn_class/modern_cpp_30/RAII/RAII.cpp)
260+
- [Implementing smart pointers for C ++](./learn_class/modern_cpp_30/smart_ptr)
261+
- [auto_ptr、scope_ptr](./learn_class/modern_cpp_30/smart_ptr/auto_scope.cpp)
262+
- [unique_ptr](./learn_class/modern_cpp_30/smart_ptr/unique_ptr.cpp)
263+
- [shared_ptr](./learn_class/modern_cpp_30/smart_ptr/shared_ptr.cpp)
264+
- [What exactly does r value and move solve?](./learn_class/modern_cpp_30/reference)
265+
- [L value and R value](./learn_class/modern_cpp_30/reference/reference.cpp)
266+
- [Extend the declaration cycle](./learn_class/modern_cpp_30/reference/lifetime.cpp)
267+
- [Reference folding](./learn_class/modern_cpp_30/reference/collapses.cpp)
268+
- [Perfect forward](./learn_class/modern_cpp_30/reference/forward.cpp)
269+
- [Do not return Reference](./learn_class/modern_cpp_30/reference/don'treturnReference.cpp)
270+
- [Container 1](./learn_class/modern_cpp_30/container1)
271+
- [Container 2](./learn_class/modern_cpp_30/container2)
272+
- [Exception](./learn_class/modern_cpp_30/exception)
273+
- [Literal、Static Assertion And Member Function Specifier](./learn_class/modern_cpp_30/literalAssert)
274+
- [Return Object?](./learn_class/modern_cpp_30/returnObj)c
275+
- [Getting started with generic programming and templates](./learn_class/modern_cpp_30/compilerpoly)
276+
- [A whole Compiler Compute World](./learn_class/modern_cpp_30/compilercompute)
277+
- [SFINAE:What is it if it is not replace error?](./learn_class/modern_cpp_30/SFINAE)
278+
- [constexpr:A Normal World](./learn_class/modern_cpp_30/constexpr)
279+
- [Function object and Lambda:functionLambda](./learn_class/modern_cpp_30/functionLambda)
280+
- [Memory Model and Atomic:Understangding the complexity of concurrency](./learn_class/modern_cpp_30/memorymodel_atomic)
281281
282282
### 7.Tools
283283

WORKSPACE

Whitespace-only changes.

0 commit comments

Comments
 (0)