Header-only
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 (the -I switch in gcc/g++), and then #include the header files into the application source.
The disadvantages include:
- brittleness – most changes to the library will require recompilation of all compilation units using that library
- longer compilation times – the compilation unit must see the implementation of all components in the included files, rather than just their interfaces
- code-bloat (this may be disputed) – the necessary use of inline statements in non-class functions can lead to code bloat by over-inlining.
Nonetheless, the header-only form is popular because it avoids the (often much more serious) problem of packaging.
List of (mostly) header-only libraries
- Some of the Boost C++ Libraries
- STLSoft C++ Libraries
- VOLE
- flecxx
- STL
References
- ↑ Wilson, Matthew (2004). Imperfect C++. Addison-Wesley. ISBN 0-321-22877-4.
External links
If you like SEOmastering Site, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...