quote:Original post by damienj
The .hpp extension is used by Boost instead of .h for header files... it might not be a good idea to give it another meaning if you''re expecting people to catch on. (I wouldn''t be surprised if Boost will be pushing the C++ committee to change from no extension to .hpp... which would of course confuse more people during the transition stage just like .h to extensionless did.
.hpp (and .hxx) are old and well-known extensions for C++ (only) header files. Boost will not be pushing for the conversion of STL header filess into *.hpp files as it serves absolutely no purpose.
civguy:
First off, I dislike the Java scheme of requiring member function definitions within the class declaration. I like being able to separate declaration and definition
when I want to (for example, distributing a statically compiled library and just the header). The core issue to solving the .h and .cpp file redundancy (you don''t need one for
every class, as you probably know; you can have multiple definitions and declarations in a variety of files that overlap in terms of functionality) is eliminating the need for
forward declarations (a type/object must be declared before it can be used) at global scope. If you can write a preprocessor that does a multipass to extract all declarative data, then fills out definitions and generates a single source file that can be fed to the compiler, you have a winner.
Extra (brownie) points: Make the preprocessor emit warnings when it encounters obvious pre-standard C++ behavior. Have the warning suggest standard alternatives (useful as a teaching tool). Also have it flag certain "risky" behavior (the assignment of string literals to mutable char pointers, for example).
Aw, hell. I''ll write it myself.