Quoting from Microsoft documentation, There is no advantage to use of both the #include guard idiom and #pragma once in the same file.
Answers to previous r
Technically #pragma once
is not standard C++, whereas header guards are. They will not conflict with each other if you have both.
The reason boost likely has both, as alluded to by the #if defined(_MSC_VER)
is that if you're not using MSVC then you need something to act as your header guard, so they fall back to the other method.
Since boost strives to be cross-platform they are trying to ensure their code works on compilers that don't support #pragma once
, though all of the big modern compilers I can think of do support it, as enumerated on wikipedia.