Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ulowell!redsox!campbell
From: campbell@redsox.UUCP (Larry Campbell)
Newsgroups: comp.lang.c++
Subject: Re: Including header files minimally.
Message-ID: <562@redsox.UUCP>
Date: 28 Nov 88 00:41:05 GMT
References: <3561@pt.cs.cmu.edu> <7860@nsc.nsc.com> <3614@pt.cs.cmu.edu> <10873@ulysses.homer.nj.att.com> <1073@actnyc.UUCP> <738@quintus.UUCP> <1988Nov25.180309.9323@utzoo.uucp> <8080@nsc.nsc.com>
Reply-To: campbell@redsox.UUCP (Larry Campbell)
Organization: The Boston Software Works, Inc.
Lines: 35

In article <8080@nsc.nsc.com> rfg@nsc.nsc.com.UUCP (Ron Guilmette) writes:
}In article <1988Nov25.180309.9323@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) writes:
}In hindsight though, I now realize that even that was a silly suggestion.
}I now think that putting something like:
}
}	#once
}or
}	#pragma once
}
}into such header files would be more appropriate, more clear, and a more
}portable solution.
 ...
}>The Waterloo "#pragma idempotent" strikes me as the right method;
}>among other things, it means that your code is portable.

How portable can something be that's not even implemented yet???  If you
just wrap your header files like this:

	#ifdef foo_included
	 ...
	#define foo_included
	#endif

it achieves the result you desire, completely portably, today, in both
C++ and C, without requiring changes to preprocessors or funky #pragma
statements (Dr. Coggins' esthetic distaste for this much pragmatism
notwithstanding).

Really, I think this is a SOLVED PROBLEM that's been getting beaten to
death.  Could we move on to more interesting aspects of the import/export
question than how to get it done with the current syntax-oriented paradigm?
-- 
Larry Campbell                          The Boston Software Works, Inc.
campbell@bsw.com                        120 Fulton Street
wjh12!redsox!campbell                   Boston, MA 02146