Code compiles with g++ 3.3 but not g++ 4.4
Axel Freyn
axel-freyn@gmx.de
Sat Oct 17 16:18:00 GMT 2009
Hi Dave,
>
> Is there a "correct" way to name these files? I had never seen this ".inc"
> idea before. If I change to #include the ".cpp" file, should it be a ".txx"
> file? That's the extension I've seen for template files... is it a "real"
> one?
Just look at the C++-standard-library of gcc - that's exactly the way it
is written: the include-files contain the complete template definitions
of e.g. std::map, ... .
I don't know of a general "correct" way:
- looking at the man-page of g++, I would propose something of
.hh, .H, .hp, .hxx, .hpp, .HPP, .h++, .tcc
- in the standard - library, ".tcc" is used for the template
definitions, if they are in a separate file. If not, everything is in
a ".h" file
- the blitz-library uses .cc and .h
- the boost-library includes the definitions and the declarations both
in a single ".hpp"-file
So: just do it as you like:-)
Axel
More information about the Gcc-help
mailing list