In C ++ Boost libraries, why there is a ".ipp" extension for some header files

In C ++ Boost libraries, why does the .ipp extension exist in some header files?

They seem to be header files included in the .hpp file with the same name.

Is this agreement shared outside of Boost?

What is the rationale for having a special file type?

+41
c ++ boost
Feb 12 '09 at 21:49
source share
2 answers

Explanation from one of the template gurus:

If you want to separate template sources into an interface and (there are many good reasons for this, including controlling the instance), you cannot very well use the same name (foo.hpp) twice, and foo.cpp is not suitable for one. foo.ipp clearly defines the file as an implementation file intended to be included in foo.hpp.

+46
Feb 12 '09 at 21:55
source share

I believe that "ipp" means "implementation file". that is, they actually contain code (for built-in functions and templates), and not just a declaration (which are in the -.H or .HPP header files)

+14
Feb 12 '09 at 21:51
source share



All Articles