Home  >  Article  >  Backend Development  >  Which Headers in the C Standard Library Guarantee Specific Functionalities or Inclusions?

Which Headers in the C Standard Library Guarantee Specific Functionalities or Inclusions?

Patricia Arquette
Patricia ArquetteOriginal
2024-11-02 18:56:02405browse

Which Headers in the C   Standard Library Guarantee Specific Functionalities or Inclusions?

Headers in C Standard Library with Guaranteed Inclusions

In the C standard library, headers may include each other in various ways that are not explicitly specified. While programmers should generally avoid relying on header inclusions, there are a few exceptions where specific headers are guaranteed to be included or provide functionality that would otherwise require including an additional header.

Headers Guaranteed to Include Others

  • is included by:

  • includes:

  • includes:

  • includes:

Functions Available through Indirect Header Inclusions

  • Free function templates:

    • std::begin
    • std::end
    • C 14 c-, r-, and cr- versions
    • C 17 std::size, std::empty, std::data

These functions are nominally located in , but they are also available when any of the following headers are included:

- `<array>`
- `<deque>`
- `<forward_list>`
- `<list>`
- `<map>`
- `<regex>`
- `<set>`
- `<string>`
- `<unordered_map>`
- `<unordered_set>`
- `<vector>`
  • When is included:

    • *begin, *end
    • Generic std::swap

The above is the detailed content of Which Headers in the C Standard Library Guarantee Specific Functionalities or Inclusions?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn