- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
foreach ($files as $n => $f) {
$new_content = $common.$namespace_begin.$f.$namespace_end;
$std_methods = array();
preg_match_all('/std::[a-z_0-9]*/', $new_content, $std_methods);
$std_methods = array_unique($std_methods[0]);
$needed_std_headers = array();
$type_headers = array(
'std::move' => '',
'std::vector' => '',
'std::string' => '',
// [...]
'std::unordered_set' => 'unordered_set');
foreach ($type_headers as $type => $header) {
if (in_array($type, $std_methods)) {
$std_methods = array_diff($std_methods, array($type));
if ($header && !in_array($header, $needed_std_headers)) {
$needed_std_headers[] = $header;
}
}
}
if (!$std_methods) { // know all needed std headers
$new_content = preg_replace_callback(
'/#include <([a-z_]*)>/',
function ($matches) use ($needed_std_headers) {
if (in_array($matches[1], $needed_std_headers)) {
return $matches[0];
}
return '';
},
$new_content
);
}
gost 13.09.2020 13:27 # 0
bootcamp_dropout 13.09.2020 13:35 # 0
bormand 13.09.2020 13:38 # 0
bootcamp_dropout 13.09.2020 13:39 # 0
bormand 13.09.2020 13:39 # 0
guest8 13.09.2020 15:18 # −999
gost 13.09.2020 15:40 # 0
guest8 13.09.2020 15:50 # −999
gost 13.09.2020 15:51 # 0
guest8 13.09.2020 15:55 # −999
gost 13.09.2020 16:19 # +3
guest8 13.09.2020 15:18 # −999
3.14159265 13.09.2020 14:19 # +2
3.14159265 13.09.2020 14:22 # 0
3.14159265 13.09.2020 14:27 # 0
Закрадываются нехорошие подозрения.
3.14159265 13.09.2020 14:35 # 0
Послание очень длинное.
Читать полностью: ==>
https://www.realworldtech.com/forum/?threadid=189711&curpostid=189752
guest8 13.09.2020 15:15 # −999
3_dar 13.09.2020 15:01 # 0
gost 13.09.2020 15:10 # +1
guest8 13.09.2020 15:17 # −999