https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119409
            Bug ID: 119409
           Summary: <functional> should not include all of <unordered_map>
                    and <vector>
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

Currently the <functional> header does:

#if __cplusplus >= 201703L
# if _GLIBCXX_HOSTED
#  include <unordered_map>
#  include <vector>
#  include <array>
# endif
# include <bits/stl_algobase.h> // std::search
#endif


This means that all feature test macros defined by <vector> are being defined
by <functional>.

It would be better if we include internal headers instead, so that we don't
"leak" feature test macros for containers into <functional>

So something like:

#if __cplusplus >= 201703L
# if _GLIBCXX_HOSTED
#  include <bits/unordered_map.h>
#  include <bits/stl_vector.h>
#  include <bits/vector.tcc>
#  include <array>
# endif
# include <bits/stl_algobase.h> // std::search
#endif

Reply via email to