プロジェクト内のすべてのソースファイルで使用されるプリコンパイル済みヘッダーstdafx.hがあります。したがって、stdafx.hのすべてのヘッダーは、プロジェクトのすべてのコードファイルで使用できます。
私が確信していないのは、プリコンパイル済みヘッダーにすでに含まれているものを再含めるかどうかです。皆さんはどう思いますか?
例えば
stdafx.h
#pragma once
#include <memory>
my_class.h
#pragma once
#include <memory> // Re-include or not that's the question. Best practice?
struct my_class
{
};
typedef std::shared_ptr<my_class> my_class_ptr;
main.cpp
#include "stdafx.h"
#include "my_class.h"
int main()
{
}