Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>.h vs .hpp is the 90% equivalence of</p> <pre><code>#include &lt;cmath&gt; vs #include &lt;math.h&gt; </code></pre> <p>Some people prefer to use <code>.hpp</code> when they are doing exclusive C++ programming. You will see <code>.hpp</code> in libraries like <code>Boost</code>. </p> <p>However, the other 10% is really important. For example, taking from <code>Boost</code> library doc, they explain the reason of using <code>.hpp</code> over <code>.h</code>:</p> <blockquote> <p>Most Boost libraries are header-only: they consist entirely of header files containing templates and inline functions, and require no separately-compiled library binaries or special treatment when linking.</p> </blockquote> <p>If you fall in that case, you should use <code>.hpp</code>, but this can cost longer compilation time. Otherwise, you might want to keep <code>.h</code> style. That's just my personal taste. It isn't <code>C-oriented</code> at all, in my honest opinion. </p> <p>Further reading:</p> <p><a href="https://stackoverflow.com/questions/1724036/splitting-templated-c-classes-into-hpp-cpp-files-is-it-possible">Splitting templated C++ classes into .hpp/.cpp files--is it possible?</a></p> <p><a href="https://stackoverflow.com/questions/3841238/condensing-declaration-and-implementation-into-an-hpp-file">Condensing Declaration and Implementation into an HPP file</a></p> <p><a href="https://stackoverflow.com/questions/3526299/c-templates-declare-in-h-define-in-hpp">C++ templates declare in .h, define in .hpp</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload