Skip to content

Commit

Permalink
support bazel complie this project and format code.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangxing authored and Light-City committed Mar 30, 2023
1 parent 1f86192 commit 7529ae3
Show file tree
Hide file tree
Showing 636 changed files with 10,068 additions and 9,430 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
com.sh
bazel-CPlusPlusThings
bazel-bin
bazel-out
bazel-testlogs
bazel-cplusplus_bazel
.vscode
112 changes: 112 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{
"files.associations": {
"iostream": "cpp",
"ostream": "cpp",
"__availability": "cpp",
"__config": "cpp",
"__string": "cpp",
"deque": "cpp",
"filesystem": "cpp",
"functional": "cpp",
"iterator": "cpp",
"ratio": "cpp",
"__bit_reference": "cpp",
"__bits": "cpp",
"__debug": "cpp",
"__errc": "cpp",
"__functional_base": "cpp",
"__hash_table": "cpp",
"__locale": "cpp",
"__mutex_base": "cpp",
"__node_handle": "cpp",
"__nullptr": "cpp",
"__split_buffer": "cpp",
"__threading_support": "cpp",
"__tree": "cpp",
"__tuple": "cpp",
"algorithm": "cpp",
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"bitset": "cpp",
"cctype": "cpp",
"chrono": "cpp",
"cinttypes": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"complex": "cpp",
"condition_variable": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"exception": "cpp",
"fstream": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"ios": "cpp",
"iosfwd": "cpp",
"istream": "cpp",
"limits": "cpp",
"list": "cpp",
"locale": "cpp",
"map": "cpp",
"memory": "cpp",
"mutex": "cpp",
"new": "cpp",
"numeric": "cpp",
"optional": "cpp",
"queue": "cpp",
"regex": "cpp",
"set": "cpp",
"sstream": "cpp",
"stack": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"string": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"typeinfo": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"utility": "cpp",
"vector": "cpp",
"any": "cpp",
"barrier": "cpp",
"*.tcc": "cpp",
"cfenv": "cpp",
"charconv": "cpp",
"codecvt": "cpp",
"compare": "cpp",
"concepts": "cpp",
"coroutine": "cpp",
"csetjmp": "cpp",
"csignal": "cpp",
"cuchar": "cpp",
"forward_list": "cpp",
"memory_resource": "cpp",
"random": "cpp",
"source_location": "cpp",
"future": "cpp",
"latch": "cpp",
"numbers": "cpp",
"ranges": "cpp",
"scoped_allocator": "cpp",
"semaphore": "cpp",
"shared_mutex": "cpp",
"span": "cpp",
"stop_token": "cpp",
"syncstream": "cpp",
"thread": "cpp",
"typeindex": "cpp",
"valarray": "cpp",
"variant": "cpp"
}
}
106 changes: 53 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,15 @@
├── [输入输出重载.cpp](./practical_exercises/key_exercises/输入输出重载.cpp)
├── [输出格式.cpp](./practical_exercises/key_exercises/输出格式.cpp)

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

#### 3.0 概况

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

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

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

- Spaces in Template Expressions

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

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

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

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

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

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

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

```cpp
for(decl:col) {
statement
}
```
- [=default,=delete](./c++2.0/c++11/default_delete.cpp)
- [=default,=delete](./cpp2.0/cpp11/default_delete.cpp)
如果你自行定义了一个 `ctor`, 那么编译器就不会给你一个 `default ctor`
如果强制加上 `=default`, 就可以重新获得并使用 `default ctor`.
- Alias(化名) Template (template typedef)
- [alias.cpp](./c++2.0/c++11/alias.cpp)
- [template_template.cpp](./c++2.0/c++11/template_template.cpp)
- [alias.cpp](./cpp2.0/cpp11/alias.cpp)
- [template_template.cpp](./cpp2.0/cpp11/template_template.cpp)
- [template template parameter](./c++2.0/template_template.cpp)
- [template template parameter](./cpp2.0/template_template.cpp)
- [type alias](./c++2.0/c++11/type_alias.cpp)
- [type alias](./cpp2.0/cpp11/type_alias.cpp)
- [noexcept](./c++2.0/c++11/noexcept.cpp)
- [noexcept](./cpp2.0/cpp11/noexcept.cpp)
- [override](./c++2.0/c++11/override.cpp)
- [override](./cpp2.0/cpp11/override.cpp)
- [final](./c++2.0/c++11/final.cpp)
- [final](./cpp2.0/cpp11/final.cpp)
- [decltype](./c++2.0/c++11/decltype.cpp)
- [decltype](./cpp2.0/cpp11/decltype.cpp)
- [lambda](./c++2.0/c++11/lambda.cpp)
- [lambda](./cpp2.0/cpp11/lambda.cpp)
- [Rvalue reference](./c++2.0/c++11/rvalue.cpp)
- [Rvalue reference](./cpp2.0/cpp11/rvalue.cpp)
- [move aware class](./c++2.0/c++11/move.cpp)
- [move aware class](./cpp2.0/cpp11/move.cpp)
- 容器-结构与分类
- (1) 序列式容器包括:`array`(C++2.0 新引入),`vector`,`deque`,`list`,`forward_list`(C++2.0 新引入)
- (2) 关联式容器包括:`set/multiset`,`map/multimap`
- (3) 无序容器(C++2.0 新引入,更换原先 `hash_xxx` 为 `unordered_xxx`)包括:`unordered_map/unordered_multimap,unordered_set/unordered_multiset`
- [Hash Function](./c++2.0/c++11/hash.cpp)
- [Hash Function](./cpp2.0/cpp11/hash.cpp)
- [tuple](./c++2.0/c++11/tuple.cpp)
- [tuple](./cpp2.0/cpp11/tuple.cpp)
学习资料:https://www.bilibili.com/video/av51863195?from=search&seid=3610634846288253061
Expand Down Expand Up @@ -295,31 +295,31 @@ C++2.0 是一个简称,意为「现代 C++」,包括 C++11/14/17/20。
#### 8.1 [极客时间《现代 C++ 实战 30 讲》](https://time.geekbang.org/channel/home)
- [堆、栈、RAII:C++ 里该如何管理资源?](./learn_class/modern_C++_30/RAII)
- [堆、栈、RAII:C++ 里该如何管理资源?](./learn_class/modern_cpp_30/RAII)
- [堆](./learn_class/modern_++_30/RAII/heap.cpp)
- [栈](./learn_class/modern_C++_30/RAII/stack.cpp)
- [RAII](./learn_class/modern_C++_30/RAII/RAII.cpp)
- [自己动手,实现 C++ 的智能指针](./learn_class/modern_C++_30/smart_ptr)
- [auto_ptr、scope_ptr](./learn_class/modern_C++_30/smart_ptr/auto_scope.cpp)
- [unique_ptr](./learn_class/modern_C++_30/smart_ptr/unique_ptr.cpp)
- [shared_ptr](./learn_class/modern_C++_30/smart_ptr/shared_ptr.cpp)
- [右值和移动究竟解决了什么问题?](./learn_class/modern_C++_30/reference)
- [左值与右值](./learn_class/modern_C++_30/reference/reference.cpp)
- [延长声明周期](./learn_class/modern_C++_30/reference/lifetime.cpp)
- [引用折叠](./learn_class/modern_C++_30/reference/collapses.cpp)
- [完美转发](./learn_class/modern_C++_30/reference/forward.cpp)
- [不要返回本地变量的引用](./learn_class/modern_C++_30/reference/don'treturnReference.cpp)
- [容器 1](./learn_class/modern_C++_30/container1)
- [容器 2](./learn_class/modern_C++_30/container2)
- [异常](./learn_class/modern_C++_30/exception)
- [字面量、静态断言和成员函数说明符](./learn_class/modern_C++_30/literalAssert)
- [是不是应该返回对象?](./learn_class/modern_C++_30/returnObj)
- [编译期多态:泛型编程和模板入门](./learn_class/modern_C++_30/compilerpoly)
- [译期能做些什么?一个完整的计算世界](./learn_class/modern_C++_30/compilercompute)
- [SFINAE:不是错误的替换失败是怎么回事?](./learn_class/modern_C++_30/SFINAE)
- [constexpr:一个常态的世界](./learn_class/modern_C++_30/constexpr)
- [函数对象和 lambda:进入函数式编程](./learn_class/modern_C++_30/functionLambda)
- [内存模型和 atomic:理解并发的复杂性](./learn_class/modern_C++_30/memorymodel_atomic)
- [栈](./learn_class/modern_cpp_30/RAII/stack.cpp)
- [RAII](./learn_class/modern_cpp_30/RAII/RAII.cpp)
- [自己动手,实现 C++ 的智能指针](./learn_class/modern_cpp_30/smart_ptr)
- [auto_ptr、scope_ptr](./learn_class/modern_cpp_30/smart_ptr/auto_scope.cpp)
- [unique_ptr](./learn_class/modern_cpp_30/smart_ptr/unique_ptr.cpp)
- [shared_ptr](./learn_class/modern_cpp_30/smart_ptr/shared_ptr.cpp)
- [右值和移动究竟解决了什么问题?](./learn_class/modern_cpp_30/reference)
- [左值与右值](./learn_class/modern_cpp_30/reference/reference.cpp)
- [延长声明周期](./learn_class/modern_cpp_30/reference/lifetime.cpp)
- [引用折叠](./learn_class/modern_cpp_30/reference/collapses.cpp)
- [完美转发](./learn_class/modern_cpp_30/reference/forward.cpp)
- [不要返回本地变量的引用](./learn_class/modern_cpp_30/reference/don'treturnReference.cpp)
- [容器 1](./learn_class/modern_cpp_30/container1)
- [容器 2](./learn_class/modern_cpp_30/container2)
- [异常](./learn_class/modern_cpp_30/exception)
- [字面量、静态断言和成员函数说明符](./learn_class/modern_cpp_30/literalAssert)
- [是不是应该返回对象?](./learn_class/modern_cpp_30/returnObj)
- [编译期多态:泛型编程和模板入门](./learn_class/modern_cpp_30/compilerpoly)
- [译期能做些什么?一个完整的计算世界](./learn_class/modern_cpp_30/compilercompute)
- [SFINAE:不是错误的替换失败是怎么回事?](./learn_class/modern_cpp_30/SFINAE)
- [constexpr:一个常态的世界](./learn_class/modern_cpp_30/constexpr)
- [函数对象和 lambda:进入函数式编程](./learn_class/modern_cpp_30/functionLambda)
- [内存模型和 atomic:理解并发的复杂性](./learn_class/modern_cpp_30/memorymodel_atomic)
### 9.工具篇
Expand Down Expand Up @@ -376,20 +376,20 @@ map<int, int> mp{
### 12.赞助我
### 12.关注我
如果觉得不错,赞助我吧~
如果觉得不错,关注我吧~
<table>
<tbody>
<tr>
<th align="center" style="height=200 width="200">
<img src="https://light-city.club/sc/assets/images/alipay.jpg" height="200" width="200" ><br>
支付宝
<img src="./img/cpp.jpg" height="200" width="200" ><br>
星球
</th>
<th align="center" style="height=200 width="200">
<img src="https://light-city.club/sc/assets/images/wechat.png" height="200" width="200" ><br>
微信
<img src="./img/wechat.jpg" height="200" width="200" ><br>
微信公众号
</th>
</tr>
</tbody>
Expand Down
48 changes: 24 additions & 24 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,31 +253,31 @@ Learning materials: https://chenxiaowei.gitbook.io/cpp_concurrency_in_action/
#### 6.1 [Chinese Name:极客时间《现代 C++ 实战 30 讲》](https://time.geekbang.org/channel/home)
- [heap、stack、RAII:How to manage resources for C ++ ?](./learn_class/modern_C++_30/RAII)
- [heap、stack、RAII:How to manage resources for C ++ ?](./learn_class/modern_cpp_30/RAII)
- [heap](./modern_++_30/RAII/heap.cpp)
- [stack](./learn_class/modern_C++_30/RAII/stack.cpp)
- [RAII](./learn_class/modern_C++_30/RAII/RAII.cpp)
- [Implementing smart pointers for C ++](./learn_class/modern_C++_30/smart_ptr)
- [auto_ptr、scope_ptr](./learn_class/modern_C++_30/smart_ptr/auto_scope.cpp)
- [unique_ptr](./learn_class/modern_C++_30/smart_ptr/unique_ptr.cpp)
- [shared_ptr](./learn_class/modern_C++_30/smart_ptr/shared_ptr.cpp)
- [What exactly does r value and move solve?](./learn_class/modern_C++_30/reference)
- [L value and R value](./learn_class/modern_C++_30/reference/reference.cpp)
- [Extend the declaration cycle](./learn_class/modern_C++_30/reference/lifetime.cpp)
- [Reference folding](./learn_class/modern_C++_30/reference/collapses.cpp)
- [Perfect forward](./learn_class/modern_C++_30/reference/forward.cpp)
- [Do not return Reference](./learn_class/modern_C++_30/reference/don'treturnReference.cpp)
- [Container 1](./learn_class/modern_C++_30/container1)
- [Container 2](./learn_class/modern_C++_30/container2)
- [Exception](./learn_class/modern_C++_30/exception)
- [Literal、Static Assertion And Member Function Specifier](./learn_class/modern_C++_30/literalAssert)
- [Return Object?](./learn_class/modern_C++_30/returnObj)c
- [Getting started with generic programming and templates](./learn_class/modern_C++_30/compilerpoly)
- [A whole Compiler Compute World](./learn_class/modern_C++_30/compilercompute)
- [SFINAE:What is it if it is not replace error?](./learn_class/modern_C++_30/SFINAE)
- [constexpr:A Normal World](./learn_class/modern_C++_30/constexpr)
- [Function object and Lambda:functionLambda](./learn_class/modern_C++_30/functionLambda)
- [Memory Model and Atomic:Understangding the complexity of concurrency](./learn_class/modern_C++_30/memorymodel_atomic)
- [stack](./learn_class/modern_cpp_30/RAII/stack.cpp)
- [RAII](./learn_class/modern_cpp_30/RAII/RAII.cpp)
- [Implementing smart pointers for C ++](./learn_class/modern_cpp_30/smart_ptr)
- [auto_ptr、scope_ptr](./learn_class/modern_cpp_30/smart_ptr/auto_scope.cpp)
- [unique_ptr](./learn_class/modern_cpp_30/smart_ptr/unique_ptr.cpp)
- [shared_ptr](./learn_class/modern_cpp_30/smart_ptr/shared_ptr.cpp)
- [What exactly does r value and move solve?](./learn_class/modern_cpp_30/reference)
- [L value and R value](./learn_class/modern_cpp_30/reference/reference.cpp)
- [Extend the declaration cycle](./learn_class/modern_cpp_30/reference/lifetime.cpp)
- [Reference folding](./learn_class/modern_cpp_30/reference/collapses.cpp)
- [Perfect forward](./learn_class/modern_cpp_30/reference/forward.cpp)
- [Do not return Reference](./learn_class/modern_cpp_30/reference/don'treturnReference.cpp)
- [Container 1](./learn_class/modern_cpp_30/container1)
- [Container 2](./learn_class/modern_cpp_30/container2)
- [Exception](./learn_class/modern_cpp_30/exception)
- [Literal、Static Assertion And Member Function Specifier](./learn_class/modern_cpp_30/literalAssert)
- [Return Object?](./learn_class/modern_cpp_30/returnObj)c
- [Getting started with generic programming and templates](./learn_class/modern_cpp_30/compilerpoly)
- [A whole Compiler Compute World](./learn_class/modern_cpp_30/compilercompute)
- [SFINAE:What is it if it is not replace error?](./learn_class/modern_cpp_30/SFINAE)
- [constexpr:A Normal World](./learn_class/modern_cpp_30/constexpr)
- [Function object and Lambda:functionLambda](./learn_class/modern_cpp_30/functionLambda)
- [Memory Model and Atomic:Understangding the complexity of concurrency](./learn_class/modern_cpp_30/memorymodel_atomic)
### 7.Tools
Expand Down
Empty file added WORKSPACE
Empty file.
Loading

0 comments on commit 7529ae3

Please sign in to comment.