Loading AI tools
From Wikipedia, the free encyclopedia
In the context of the C or C++ programming languages, a library is called header-only if the full definitions of all macros, functions and classes comprising the library are visible to the compiler in a header file form.[1] Header-only libraries do not need to be separately compiled, packaged and installed in order to be used. All that is required is to point the compiler at the location of the headers, and then #include the header files into the application source. Another advantage is that the compiler's optimizer can do a much better job when all the library's source code is available.
This article needs additional citations for verification. (January 2019) |
The disadvantages include:
Nonetheless, the header-only form is popular because it avoids the (often much more serious) problem of packaging.
For C++ templates, including the definitions in header is the only way to compile, since the compiler needs to know the full definition of the templates in order to instantiate.
Seamless Wikipedia browsing. On steroids.
Every time you click a link to Wikipedia, Wiktionary or Wikiquote in your browser's search results, it will show the modern Wikiwand interface.
Wikiwand extension is a five stars, simple, with minimum permission required to keep your browsing private, safe and transparent.