I am studying boost libraries, and something strange to me is many libraries use this kind of code:
#ifndef BOOST_SERIALIZATION_ACCESS_HPP
#define BOOST_SERIALIZATION_ACCESS_HPP
// MS compatible compilers support #pragma once
#if defined(_MSC_VER)
# pragma once
#endif
MSDN explicitly states that:
There is no advantage to use of both the #include guard idiom and #pragma once in the same file
I can't understand what might the reason be. include guard does the job anyway so why we bother to write pragma once too?