This repository contains my C++ snippets code on C++ concepts/ idioms, optimized C++, modern C++ and advance C++. I have included snippets and samples code for using third party libs for parsing CSV, YAML and JASON files. Example of code benchmarking with Google Benchmark is available. There is also a tutorial on using CMake for building and exporting your project.
There is docker file for this project where contains all dependencies and you build the image with :
docker build -t cpp_tutorials .
ig_notes: it is done. Now i have a image named cpp_tutorials.
Create a container where you mount the checkout code into your container:
docker run --name <continer-name> -v <checked-out-path-on-host>:<path-in-the-container> -it <docker-image-name>
for instance:
docker run --name cpp_container -v /home/behnam/workspace/cpp_tutorials:/cpp_tutorials -it cpp_tutorials
ig_notes: i will apply it like below:
docker run --name cpp_container -v C:\Users\ilhan.goren\IG_OnePiece\_IG_DOCKER\cpp_tutorials:/cpp_tutorials -it cpp_tutorials
ig_notes:The 3. step is for the container you have. In next time i will call just the 3. command.
If you have already created a container from the docker image, you can start it with:
docker start -i cpp_container
After getting run the container we go to the vscode and attach the container over docker extention. Like i do now. I am changing the readme inside container over vscode. Lets see the commit from my PC powershell.
git diff says:
+> After getting run the container we go to the vscode and attach the container over docker extention. Like i do now. I am changing the readme inside container over vscode. Lets see the commit from my PC powershell.
You can remove unnecessary images and containers by:
docker image prune -a
docker container prune
- You need to run:
docker run --name cpp_container -v /home/behnam/workspace/cpp_tutorials:/cpp_tutorials --env="DISPLAY" --env="QT_X11_NO_MITSHM=1" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" -it cpp_tutorials
- On the host run the following (every time you run your container):
export containerId=$(docker ps -l -q)
xhost +local: docker inspect --format='{{ .Config.Hostname }}' $containerId
read more here
- Align
- Allocator
- Algorithms library
- Assert
- Atomic operations and Types
- Attribute [[ attribute-list ]]
- Basic IO Operation, Streams, Reading/Writing Files, Formatting Output, cin, scanf, gets, getline, printf
- Bitset, Bit field, Bitwise Operations
- Callbacks
- Callable Objects, std::function, std::bind, Lambda
- Clock, Date, Time
- Conditional Compilation
- Containers
- Const, Constexpr and Mutable
- Data Types, Numerical Limits, Precision
- Data Types Conversions, Casting
- Decay
- Dynamic Memory Allocation in C
- Debugging Core Dumps
- Enum
- Error Handling
- Exception Handling, noexcept
- Extern Variables, Extern Functions
- File System
- Forking
- Forwarding Reference
- Functions, Extern Function, Function Objects, Function Pointer, Inline Functions
- Hash
- Heap and Stack, Memory Layout of C Programs
- Invoke
- Iterator, for_each loop, range-for loop, Loop optimization
- Lambda
- Literals
- Loading Classes Dynamically From Plugins
- Macro
- Memory Error Detection With Memory Address Sanitizer and Valgrind
- Nested Namespaces, Unnamed/Anonymous Namespaces
- Optional
- Parameter Pack Expansion ...
- Register Keyword
- Regex
- Pseudo-random Number Generation, Distributions
- Raw Pointers, Smart (Shared, Unique, Weak) Pointers, Reference, addressof, reference_wrapper, std::ref
- Return, Abort, Exit
- Scope Resolution Operator
- Scope and Life Cycle of Objects Returned by Functions
- Setting argc, argv
- Simple Command Argument Parser
- Signals
- System Call
- String C/C++, string_view, string literal, string conversion, ASCII, Unicode
- Structs
- Switch Case
- Template, Expression templates
- Ternary (One Line If)
- Temporary Objects
- Track memory allocations(overriding new operator)
- Trivial, standard-layout, Passive/ Plain old data structure (PDS)/ (POD), and literal types
- Type Traits
- Typedef, Type alias (using keyword))
- type_dispatch, integral_constant, true/false type
- Unions
- Variadic Templates Function
- Volatile Keyword
- C++ Classes
- Abstract Class Vs Interface
- Cast Base Class to Derived/ Derived to Base
- Class Forward Declaration
- Class Constructor Initializationlist
- Class Constructor Aggregate/ Copy/ Default/ Direct/ Value/ Uniform/ Zero Initialization, Initializer List
- Copy/ Move Constructor, rvalue, lvalue, move semantic
- Cyclic (Circular) Dependency
- Default(=default), Deleted (=delete) Constructors
- Diamond Problem Virtual Inheritance
- Explicit Constructor, Converting Constructor
- Friend Functions
- Header Guard
- Inheritance, Inheritance Prevention (final)
- Multiple Inheritance Polymorphism
- Operator Overloading
- Object Slicing
- Passing Arguments To Parent Constructor
- Private Public Protected Inheritance
- Protected Friend Class Function
- Shadowing
- Static Member Function, Static Initialization Order Fiasco
- Special Member Functions
- Virtual Function Abstract Class
- Virtual Destructor, Virtual Constructor
- Multithreading and Process
- Process, Inter Process Communication (IPC), Process Tree, Process Control Block (PCB
- Creating (Thread Callable Objects), Terminating Threads
- Over Subscription
- Differentiating Between Threads
- Sleeping Threads
- Joining/ Detaching Threads, Joinable Detachable
- Threads Yield
- Thread Synchronization
- Racing Condition
- Mutex
- Semaphor
- Thread Safe
- Dead Lock
- Lock Guard
- Scoped Lock
- Unique Lock
- Condition Variable
- Future, Promise and async
- Packaged Task
- Thread design pattern
- Argument-dependent lookup
- Buffer overflow
- Copy and Swap
- Static Casting, Dynamic Casting
- Run-Time Type Information(RTTI)
- Curiously Recurring Template Pattern (CRTP)
- Copy Elision, Return value optimization (RVO,NRVO)
- Double Dispatch
- Most vexing parse
- Metaprogramming
- Pointer to implementation (PIMPL)
- Return Type Resolver
- Resource Acquisition Is Initialization (RAII)
- Substitution failure is not an error (SFINAE)
- Stack overflow
- Stack Unwinding
- Type Erasure
- Template Specialization, Tag Dispatch
- Virtual Method Table(VTABLE), Virtual Table Pointer(VPTR)
- Virtual address space
- Tricky Questions
- Type Erasure
- Undefined behavior, Unspecified and Implementation-Defined