-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCpp_notes.txt
39 lines (31 loc) · 1.32 KB
/
Cpp_notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
////// callback functions
Functions used as arguments to another function are sometimes called callback functions.
///
typedef bool (*validateFcn)(int, int);
<=>
using validateFcn = bool(*)(int, int); // type alias In C++11
/// std::function in C++11
#include <functional>
bool validate(int x, int y, std::function<bool(int, int)> fcn);
// If there are no parameters, the parentheses can be left empty
/////
Visual Leak Detector An open-source memory leak detection system for Visual C++.
/// faster build https://devblogs.microsoft.com/cppblog/recommendations-to-speed-c-builds-in-visual-studio/
Specific recommendations include:
DO USE PCH for projects
DO include commonly used system, runtime and third party headers in PCH
DO include rarely changing project specific headers in PCH
DO NOT include headers that change frequently
DO audit PCH regularly to keep it up to date with product churn
DO USE /MP
DO Remove /Gm in favor of /MP
DO resolve conflict with #import and use /MP
DO USE linker switch /incremental
DO USE linker switch /debug:fastlink
DO consider using a third party build accelerator
/// tools
Cppcheck
StopOnFirstBuildError https://marketplace.visualstudio.com/items?itemName=EinarEgilsson.StopOnFirstBuildError
ReSharper C++ https://marketplace.visualstudio.com/items?itemName=JetBrains.ReSharperC
VSColorOutput
VcpkgSrv