https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99958

            Bug ID: 99958
           Summary: The <algorithm> seems to contain the entire <vector>
                    and <string> in C++20 mode
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hewillk at gmail dot com
  Target Milestone: ---

I found that include <algorithm> will automatically include the entire <vector>
in C++17 mode, and both the <vector> and <string> will be automatically
included in C++20 mode:

https://godbolt.org/z/G5hrsaPKs

#include <algorithm>

int main() {
  std::string s{"hell"};
  s.push_back('o');
  std::vector<int> v{1, 2};
  v.push_back(3);
}

Reply via email to