@@ -36,6 +36,7 @@ pub(crate) struct Includes<'a> {
36
36
pub ranges : bool ,
37
37
pub stdexcept : bool ,
38
38
pub string : bool ,
39
+ pub string_view : bool ,
39
40
pub type_traits : bool ,
40
41
pub utility : bool ,
41
42
pub vector : bool ,
@@ -98,6 +99,7 @@ pub(super) fn write(out: &mut OutFile) {
98
99
ranges,
99
100
stdexcept,
100
101
string,
102
+ string_view,
101
103
type_traits,
102
104
utility,
103
105
vector,
@@ -157,11 +159,6 @@ pub(super) fn write(out: &mut OutFile) {
157
159
if vector && !cxx_header {
158
160
writeln ! ( out, "#include <vector>" ) ;
159
161
}
160
- if ranges && !cxx_header {
161
- writeln ! ( out, "#if __cplusplus >= 202002L" ) ;
162
- writeln ! ( out, "#include <ranges>" ) ;
163
- writeln ! ( out, "#endif" ) ;
164
- }
165
162
if basetsd && !cxx_header {
166
163
writeln ! ( out, "#if defined(_WIN32)" ) ;
167
164
writeln ! ( out, "#include <basetsd.h>" ) ;
@@ -179,6 +176,16 @@ pub(super) fn write(out: &mut OutFile) {
179
176
if ( basetsd || sys_types) && !cxx_header {
180
177
writeln ! ( out, "#endif" ) ;
181
178
}
179
+ if string_view && !cxx_header {
180
+ writeln ! ( out, "#if __cplusplus >= 201703L" ) ;
181
+ writeln ! ( out, "#include <string_view>" ) ;
182
+ writeln ! ( out, "#endif" ) ;
183
+ }
184
+ if ranges && !cxx_header {
185
+ writeln ! ( out, "#if __cplusplus >= 202002L" ) ;
186
+ writeln ! ( out, "#include <ranges>" ) ;
187
+ writeln ! ( out, "#endif" ) ;
188
+ }
182
189
}
183
190
184
191
impl < ' i , ' a > Extend < & ' i Include > for Includes < ' a > {
0 commit comments