#include "pch.h"
// for a big project is quite useful.
// give you an opportunity to grad a bunch of header files and convert them into essentially
// a kind of compiled format that the compiler can use instead of having to read those header
// files over and over again. What it does is it takes a whole bunch of header files(a bunch
// of code essentially, for example:<vector>) which you tell it to take in and it compiles it
// once and it stores it in a binary format that is way faster for the compiler to actually
// deal with than just text. Everytime you include that precompiled header file(<vector>)
// it already has everything you need, instead of passing that entire vector file every single
// time, it only needs to look at the precompiled header which is already in a great fast easy
// to use -> binary format.
// need to use it if you care about the compilation times.
// do not put frequently changing files into it.
// it's vitally used for code that isn't yours, for example STL, Windows API.
// on the other hand: it can potentially hide what's actually being used.
pch.h
#pragma once
#include <iostream>
#include <algorithm>
#include <functional>
#include <memory>
#include <thread>
#include <utility>
// Data structures
#include <string>
#include <stack>
#include <deque>
#include <array>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
// Windows API
#include <Windows.h>
pch.cpp
#include "pch.h"
右键pch.cpp -> 属性 -> C/C++ -> 预编译头
右键需要使用的项目或者单个cpp文件 -> 属性 -> C/C++ -> 预编译头
查看【生成计间】对比使用预编译头文件与不使用。