Header-only

Header-only

A library, usually in C or C++, 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 / include file formcite book
last = Wilson
first = Matthew
authorlink = Matthew Wilson
year = 2004
title = Imperfect C++
publisher = Addison-Wesley
id = ISBN 0-321-22877-4
] .

The advantage of a header-only library is that it does not need to be separately compiled, packaged and installed in order to be used. All that is usually required is to define a suitable environment variable to where it resides, and then #include the file(s) into the application source.

The disadvantages include:
* brittleness - most changes to the library will require recompilation
* longer compilation times - because the compilation unit must see the implementation of all components in the included file(s), 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.

Header-only Libraries

* Boost C++ Libraries
* STLSoft C++ Libraries
* VOLE
* [http://flecxx.org/ flecxx]

References

External links


Wikimedia Foundation. 2010.

Игры ⚽ Поможем сделать НИР

Look at other dictionaries:

  • Header Error Correction — The Header Error Correction (HEC) is the last field in the Asynchronous Transfer Mode cell consisting of an 8 bit CRC of the cell s header only. It consists of the remainder of the division of the 32 bits of the header by the polynomial… …   Wikipedia

  • Header checksum — refers to the basic protection used in the header of IP packets against data corruption. This checksum is calculated only for the header bytes and is 16 bit long and is a part of the IP packet header. This checksum is calculated by word aligning… …   Wikipedia

  • Header — Head er (h[e^]d [ e]r), n. 1. One who, or that which, heads nails, rivets, etc., esp. a machine for heading. [1913 Webster] 2. One who heads a movement, a party, or a mob; head; chief; leader. [R.] [1913 Webster] 3. (Arch.) (a) A brick or stone… …   The Collaborative International Dictionary of English

  • Header file — In computer programming, particularly in the C and C++ programming languages, a header file or include file is a file, usually in the form of source code, that is automatically included in another source file by the compiler. Typically, header… …   Wikipedia

  • header — /hed euhr/, n. 1. a person or thing that removes or puts a head on something. 2. a reaping machine that cuts off and gathers only the heads of the grain. 3. a chamber to which the ends of a number of tubes are connected so that water or steam may …   Universalium

  • header — /ˈhɛdə / (say heduh) noun 1. someone who or an apparatus which removes or puts a head on something. 2. a form of reaping machine which cuts off and gathers only the head of the grain. 3. a chamber to which the ends of a number of tubes are… …  

  • header — head•er [[t]ˈhɛd ər[/t]] n. 1) a person or thing that removes or puts a head on something 2) a reaping machine that cuts off and gathers only the heads of the grain 3) hyd a chamber where tubes are connected so that water or steam may pass freely …   From formal English to slang

  • List of HTTP header fields — HTTP Persistence · Compression · HTTPS Request methods OPTIONS · GET · HEAD · POST · PUT · DELETE · TRACE · CONNECT Header fields Cookie · ETag · Location · Referer DNT · …   Wikipedia

  • Precompiled header — In computer programming, a pre compiled header is a technique used by some C or C++ compilers to reduce compilation time. OverviewIn the C and C++ programming languages, a header file is a file whose text may be automatically included in another… …   Wikipedia

  • Do not track header — HTTP Persistence · Compression · HTTPS Request methods OPTIONS · GET · HEAD · POST · PUT · DELETE · TRACE · CONNECT Header fields Cookie · ETag · Location · Referer DNT · …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”