CPP
Configuring VSCode
IntelliSense Configurations
- Go to the desired directory
- View > Command Palette (Ctrl+Shift+P) > C++ Edit configuration UI
- Compiler path = g++ (for C++)
- C++ standard = 20
- Ctrl+S (To save)
Build task
- Open and select a cpp file
- Terminal > Configure Default Build Task
- In Task.json
- in "args" section add "-Wall", "-Wall", "-std=c++20",
Interesting Sources
Interesting opencv doc: Here
The Basics
References and pointers
If you want obvious "no-copy" semantics:
Use pointers (T*) when you want it explicit: “This function takes an address.”
Use references (T&) only when you want to guarantee it can’t be null and can’t change which object it refers to.
For large objects, you can use const T& to avoid copies while still signaling "read-only."