c++11 - Which headers in the C++ standard library are guaranteed to include another header? -


The C ++ standard library headers can include each other in an unspeakable manner, so the programmer usually has the second heading Should not be dependent on. In some cases, however, a header is guaranteed to include another header, or provide some tasks that are necessary for the addition of other headers. What are those cases?

This answer does not take into account C header - both & lt; Meow.h & gt; and and lt; Cmeow & gt; From the C ++ Library Header with (for all references N465 9):

Initiator_list & gt; Guaranteed by:

  • & lt; Utility & gt; (§23.2.1)
  • & lt; String & gt; (§24.3.1)
  • (§ 26.3.2)
  • & lt ; Deque & gt; (§ 26.3.3)
  • & lt; Forward_list & gt; (§ 26.3.4)
  • & lt; List & gt; (§ 26.3.5)
  • & lt; Vector & gt; (§ 26.3.6)
  • & lt; Map & gt; (§ 26.4.2)
  • & lt; Set & gt; (§ 26.4.3)
  • & lt; Unordered_map> (§ 26.5.2)
  • & lt; Unordered_set & gt; (§ 26.5.3)
  • & lt; Queue & gt; (§ 26.6.2)
  • & lt; Stack & gt; (§ 26.6 .3)
  • & lt; Algorithm & gt; (§28.2)
  • & lt; Random & gt; (§29.6.2)
  • & lt; Valarray & gt; (§29.7.1)
  • & lt; Regex & gt; (§31.4)

< & lt; Ios & gt; , & lt; Streambuf & gt; , & lt; Istream & gt; to add code> & lt; Iostream & gt; & lt; Ostream & gt; (§30.4.1).

(§30.5.1) & lt; Bitset & gt; to & lt; String & gt; and & lt; Iosfwd & gt; (§ 23.9.1) is guaranteed to include. ).

Free function template std :: start , std :: end , c +14 14 c - , r - , and cr - version, and C ++ 17 free function templates std :: size , std:: empty < / Code> and std :: data named , but are available even if any of the following headers are included: & lt; Aar; , & lt; Deque & gt; , & lt; Forward_list & gt; , , & lt; Map & gt; ; , & lt; Regex & gt; , , , & lt; Unordered_map> , & lt; Unordered_set & gt; , and & lt; Vector & gt; (§27.7, §27.8).

When & lt; String_view & gt; is included, * start and * end function, and two general swap (T & amp; amp; T & amp; / Code> and swap (t (and a) [n], defined in the t (and b)> std :: swap overload [n]) ) is guaranteed to be available. Size / Empty / Data , however, are not. (§24.4.1).


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -