https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108760
--- Comment #3 from Daniel Krügler <daniel.kruegler at googlemail dot com> --- (In reply to Michael Levine from comment #2) > (In reply to Daniel Krügler from comment #1) > > (In reply to 康桓瑋 from comment #0) > > > It seems wrong that libstdc++ needs to include <algorithm> for > > > ranges::iota. > > > > I agree, this looks like a defect, both std::iota and std::ranges:iota are > > specified to be part of header <numerics> > > Should it not require including <algorithm> even though it seems to be a use > of a constrained algorithm through C++20 that is in the namespace > std::ranges? https://en.cppreference.com/w/cpp/algorithm Following https://cplusplus.github.io/LWG/lwg-defects.html#1178 we have according to [res.on.headers] p1 "A C++ header shall provide the declarations and definitions that appear in its synopsis." and I'm interpreting this that an implementation needs to make it work without requiring the user to include <algorithm>. But we have https://cplusplus.github.io/LWG/issue3679 which raises a similar question for a different issue. If the libstdc++ maintainers think that the current wording does require a conforming program to include <algorithm>, I think that an LWG issue would be required.