Thanks for all the support about << Stories About C ++ >>, right now you could open this link(https://light-city.club/sc/) to read this article.
Any star, retweet or pr will be weclomed.
Notice: The website is not available now.
- Chinese version:C++ 那些事
- English version:Stories About C Plus Plus
This repository meets the need of people who wants to really know about C++, and may help you in the interview. Besides, it also provides other details,such as in-depth source code analysis and multi-threaded concurrency. It is a comprehensive C ++ repository from entry to advanced improvement
- Stories About const
- Stories About static
- Stories about this
- Stories About inline
- Stories About sizeof
- Stories About pointer of function
- Stories About pure virtual function and abstract
- Stories About vptr_vtable
- Stories About virtual
- Stories About volatile
- Stories About assert
- Stories About bit
- Stories About extern
- Stories About struct
- Stories About struct and class
- Stories About union
- Stories About polymorphism
- Stories About explicit
- Stories About friend
- Stories About using
- Stories About ::
- Stories About enum
- Stories About decltype
- Stories About pointer_refer
- Stories About macro
- day1
Basic Grammar About C ++
- day2
Recursive、Structor、Enumerate、Static Variable
- day3
Function
- day4
Thorough About Function
- day5
Inheritance and Polymorphism
- day6
Vitrual Function、Abstruct
- day7
Operator overloading
- day8
Template And STL
- day9
Exception
- day10
File And Stream
├── Square brackets overload .cpp ├── Clock++operator overloading.cpp ├── Mandatory conversion of operator overloading.cpp └── Clock with overloaded parenthesis.cpp
├── Dictionary insertion and search.cpp
├── Inheritance And Package.cpp
├── Read And Write files.cpp ├── Operator Overloading About Input and Output.cpp ├── Input And Output Overloading.cpp ├── Input Format.cpp
C++2.0 is an Abbreviation, meaning「modern C++」,including C++11/14/17/20.
-
Spaces in Template Expressions
vector<list<int> > //ok in each C++ version vector<list<int>> // before c++ 11 error error: ‘>>’ should be ‘> >’ within a nested template argument list,version beyond c++ 11 could compile successfully
-
for(decl:col) { statement }
-
If you define a ctor by yourself, compiler won't compile the default ctor. If you add =default, you could recatch and use default ctor.
-
Alias(化名)Template(template typedef)
-
Container-Struct And Classify
- (1) Serial containers include:
array
(C++2.0 Newly Introduced),vector
,deque
,list
,forward_list
(C++2.0 Newly Introduced) - (2) Associated containers include:
set/multiset
,map/multimap
- (3) Unordered container(C++2.0 Newly Introduced,replace
hash_xxx
tounordered_xxx
) include:unordered_map/unordered_multimap,unordered_set/unordered_multiset
- (1) Serial containers include:
-
Learning Material:https://www.bilibili.com/video/av51863195?from=search&seid=3610634846288253061
To Be Continued ...
STL Source Code Analysis:gcc 4.9.1
- array
- deque
- queue and stack
- list
- vector
- typename
- traits
- iterator
- Talking about STL design and EBO optimization
- rb_tree
- set and multiset
- map and multimap
- hashtable
- myhashtable
- unordered_map
Learning materials: https://chenxiaowei.gitbook.io/cpp_concurrency_in_action/
From:
https://www.youtube.com/watch?v=eZ8yKZo-PGw&list=PLk6CEY9XxSIAeK-EAh3hB4fgNvYkYmghp&index=4
- 1.ClassInitializers
- 2.Replace Enumclass with Namespace
- 3.RAII(Resource Acquisition Initialization)
- 4.Copy and Swap
- 5.pImpl(Pointer Implement)
- heap、stack、RAII:How to manage resources for C ++ ?
- Implementing smart pointers for C ++
- What exactly does r value and move solve?
- Container 1
- Container 2
- Exception
- Literal、Static Assertion And Member Function Specifier
- Return Object?c
- Getting started with generic programming and templates
- A whole Compiler Compute World
- SFINAE:What is it if it is not replace error?
- constexpr:A Normal World
- Function object and Lambda:functionLambda
- Memory Model and Atomic:Understangding the complexity of concurrency
Modified the code, Click here for the code
Input:
map<int, int> mp{
{1, 1},
{2, 4},
{3, 9}};
cout << mp << endl;
Output:
{ 1 => 1, 2 => 4, 3 => 9 }
-
Running Circumstance
Ubuntu 18.04
-
IDE
CLion gcc/g++
贡献人 | 地址 |
---|---|
光城 | https://github.com/Light-City |
ChungZH | https://github.com/ChungZH |
xliu79 | https://github.com/xliu79 |
个人公众号: