Header-only (original) (raw)
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. 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.
Property | Value |
---|---|
dbo:abstract | 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. 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. 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 * machine-code bloat (arguably) – 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. 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. (en) |
dbo:wikiPageID | 18859896 (xsd:integer) |
dbo:wikiPageLength | 1952 (xsd:nonNegativeInteger) |
dbo:wikiPageRevisionID | 1115873861 (xsd:integer) |
dbo:wikiPageWikiLink | dbr:Inline_function dbr:Library_(computing) dbr:Compiler dbr:Function_(computer_science) dbc:C_(programming_language)_headers dbr:C++ dbr:C_(programming_language) dbr:C_preprocessor dbc:C_(programming_language)_libraries dbr:Compilation_unit dbr:Header_file dbr:Template_(C++) dbc:C++ dbr:Code_bloat dbr:Macro_(computer_science) dbr:Class_(computer_science) |
dbp:wikiPageUsesTemplate | dbt:Mono dbt:More_citations_needed dbt:Reflist |
dct:subject | dbc:C_(programming_language)_headers dbc:C_(programming_language)_libraries dbc:C++ |
rdf:type | yago:WikicatCLibraries yago:Area102735688 yago:Artifact100021939 yago:Library103660909 yago:Object100002684 yago:PhysicalEntity100001930 yago:YagoGeoEntity yago:YagoPermanentlyLocatedEntity yago:Room104105893 yago:Structure104341686 yago:Whole100003553 |
rdfs:comment | 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. 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. (en) |
rdfs:label | Header-only (en) |
owl:sameAs | freebase:Header-only yago-res:Header-only wikidata:Header-only https://global.dbpedia.org/id/4kWhw |
prov:wasDerivedFrom | wikipedia-en:Header-only?oldid=1115873861&ns=0 |
foaf:isPrimaryTopicOf | wikipedia-en:Header-only |
is dbo:wikiPageWikiLink of | dbr:Include_directive dbr:GNU_Lesser_General_Public_License dbr:Template_(C++) |
is foaf:primaryTopic of | wikipedia-en:Header-only |