Subject: Re: [boost] numeric_cast
From: Stephan T. Lavavej (stl_at_[hidden])
Date: 2011-06-23 17:43:02
> It looks fine to me (except maybe for the #pragma once... is that
> properly supported on all supported compilers?)
> Ah, right. We use that at my work (all MSVC). So I'm acclimated. I'll
> remove those.
Actually, the best thing to do is this:
#endif // _MSC_VER
#endif // MYPROJECT_MYDIRECTORY_FOOBAR_HPP
This way, all compilers get the portable idempotency guard. Because it's on the outside, GCC (and possibly other compilers) will magically recognize it and avoid opening the header file twice. And the #pragma once for MSVC also instructs it to avoid opening the header file twice, which can improve build perf and can't hurt.
Stephan T. Lavavej
Visual C++ Libraries Developer