|
From: | Michael D Godfrey |
Subject: | Re: compiling development sources |
Date: | Wed, 10 Feb 2010 14:03:04 -0800 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.7) Gecko/20100120 Fedora/3.0.1-1.fc12 Thunderbird/3.0.1 |
On 02/10/2010 01:38 PM, John W. Eaton wrote:
I don't know how many of these actually need to be included in .h files. For example, should a .h file include everything necessary for it to be included and work in a .cc file, or should we expect that a user of a .h file will have to include other headers first so that it will work? I think that common practice is to only include "local" things in a .h file, and to assume that C or C++ stuff that is in their standard .h files gets included by referencing the standard headers. Generally, it is not a good idea to define objects which are defined in C or C++ headers. Best to treat any problems that this causes as, at best, special cases. But, I also know that getting this to work and be portable is not easy. Also, there have been cases of multiple defines of objects within the standard /include files, so what you get depends on the order of your includes. I think that this (at least in Linux distributions) has been cleaned up, but I would not bet on it. Michael |
[Prev in Thread] | Current Thread | [Next in Thread] |