I have at a few places, where people have mis-heard/mis-read that that #pragma once has been standardized for C++0x. It's "not".
Even gcc has it labelled as an obsolete feature (for a couple of years now) - Obsolete once-only headers.
Since, it is not standard in the first place, one should avoid using it. The standard include guards "#ifndef" should the choice and with good compiler support, these are as efficient as the promise made by #pragma once. Plus they are guaranteed to be portable.
Showing posts with label include guards. Show all posts
Showing posts with label include guards. Show all posts
Sunday, February 17, 2008
#pragma once standardized?
Posted by
abnegator
at
2/17/2008 11:10:00 AM
2
comments
Labels:
#ifndef,
C++,
gcc,
include guards,
pragma once
Subscribe to:
Posts (Atom)
