c++ - Need some clarification on #pragma once -


I have searched for some explanation as to whether #prramhas really does once and there is no definitive answer for some questions. I can still get it.

Once the #pragma insurance is that the header file is included in it, it is said only once that the handlers included in the header file are not included yet? Also, if it is called only once, then what does it mean? Is the CPP file that requires a special title, will not be able to access it? If a header file is marked with #pragma once and is included in the CPP, can that header file be used elsewhere?

These are explanations that I can not find. Sorry, if there is a document that clarifies it somewhere, but I can not really find anything specific.

#pragma once protected one file in only one translation unit Does not count sub-hierarchy of being included in it. (However, if the second inclusion of the file is prevented, then there is not a chance to include twice as much in it.)

You can re-add it to another .cpp Can re-join. .

The file is usually identified by its end number.

Note that #pragma is one time strict strictly nonstandard, and still the traditional #Indf header guard.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -