Copyright (C) 1994-98 by Addison-Wesley Longman, Inc.
This code is provided for its instructional value. It has been tested with care, but it is not guaranteed for any particular purpose. The publisher and authors do not offer any warranties or representations, nor do they accept any liabilities with respect to this code.
The code has been tested with Microsoft Visual C++ 5.0 ONLY. It is designed to be portable, but given the realities of "portable code," it probably doesn't work with all C++ compilers. In particular, Murphy's Law says it won't work with YOUR compiler!
If you try it on some other C++ compiler and it doesn't work, please add another #if/#endif to "cpp-faqs.hpp" and send the revised "cpp-faqs.hpp" to us -- we'll be happy to post the update to the web site. But please don't simply say, "It doesn't work on the XYZZY compiler," since we probably don't have the XYZZY compiler.
Click here to download the code.
Marshall, Greg, and Mike