From: John G. <jo...@jo...> - 2005-05-20 02:34:40
|
Anh Vo wrote: > That means I do not have do the following every time to make sure > only once copy is used. > #ifndef BLA_BLA_BLA > #define BLA_BLA_BLA > > // ... > > #endif This is the standard method used by C and C++ programmers. It is portable across compilers and is fully documented by the standard. While #pragma is part of the standard, that is all that is in there: the #pragma itself. Any options are, by definition, proprietary. Some options may be the same or similar between compilers, or across different versions of the same compiler, but there is no guarantee. > If the above was true, I am more than pleased to get rid of the > #pragma once and the ifdef macro for all. The only way to get rid of both would be to stick everything in one big source code file. One compilation unit, no headers. Otherwise, you always have the potential of multiple inclusion. Or you can just live with the #ifdef include guards, which is your safest bet. -- John Gaughan http://www.johngaughan.net/ jo...@jo... |