TITLE: including via
versus (Newsgroups: comp.lang.c++.moderated, 11 Jan 99) NARAN: sbnaran@localhost.localdomain (Siemel Naran) >>> My general purpose headers don't have the .h suffix. Eg, >>> #include >>> Anything wrong with this? HARMON: David Harmon >> For your own headers should be >> #include "fvector" THOMAS: Biju Thomas >There is no such requirement, AFAIK. The standard leaves the search >criteria for both the
and "header" styles upto the >implementation. > >As a matter of style, I agree with your point. CLAMAGE: Steve Clamage It's more than a matter of style. If you write #include where stdhdr is the exact spelling of one of the standard headers, with or without a suffix as appropriate, you should get the standard header. If you write "stdhdr" instead of the standard makes no statement about what will happen. Similarly, if you write #include where otherhdr is not the exact spelling of one of the standard headers, the standard makes no promises about what will happen. But implementations commonly provide additional system headers that will be found when you use angle brackets. A valid implementation might be able to find only system headers if you use angle brackets, and never find system headers if you use quotes. Your best chance for a working program is to use angle brackets only for standard headers (or other system headers as documented by the implementation), and to use quotes for all of your own headers. An apparent exception to this guideline is when you want to replace a system header with your own version. Doing so places you completely outside the realm of any promises made by the C++ standard or your C++ vendor. You don't get to complain when your program fails mysteriously. :-)