After rethinking, I found that using #pragma once will prevent us from doing the #include compilation optimization if needed

I mean this optimization:
#ifndef X_H
#include "X.h"
#endif

Let's stick to #def, I agree with you