Skip to content

Commit

Permalink
Merge pull request #1443 from dtolnay/rangesheader
Browse files Browse the repository at this point in the history
Move ranges header to cxx.h
  • Loading branch information
dtolnay authored Feb 19, 2025
2 parents 0243229 + be38b9d commit 8d3ed92
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gen/src/include.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ pub(super) fn write(out: &mut OutFile) {
if vector && !cxx_header {
writeln!(out, "#include <vector>");
}
if ranges {
if ranges && !cxx_header {
writeln!(out, "#if __cplusplus >= 202002L");
writeln!(out, "#include <ranges>");
writeln!(out, "#endif");
Expand Down
3 changes: 3 additions & 0 deletions include/cxx.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
#include <iosfwd>
#include <iterator>
#include <new>
#if __cplusplus >= 202002L
#include <ranges>
#endif
#include <stdexcept>
#include <string>
#include <type_traits>
Expand Down

0 comments on commit 8d3ed92

Please sign in to comment.