As can be seen from https://stackoverflow.com/a/26614984/481267 the following headers are guaranteed by the standard to #include <initializer_list>
:
- Everything in [containers]
<utility>
<string>
<algorithm>
<random>
<valarray>
<regex>
Most of these headers declare at least one function that takes a std::initializer_list<E>
argument, so it makes sense. However,
<array>
,<stack>
, and<queue>
have no such functions, although perhaps it makes sense to treat all containers uniformly here.<utility>
has no such functions.<iterator>
does have functions with aninitializer_list
argument (rbegin
,rend
) but it's not specified to include<initializer_list>
.
What is the rationale behind these exceptions?