@@ -82,32 +82,46 @@ module CppAutoInclude
82
82
83
83
# header, std namespace, keyword complete (false: no auto remove #include), unioned regex
84
84
HEADER_STD_COMPLETE_REGEX = [
85
- [' cstdio' , false, true , R[F[' s?scanf' , ' puts' , ' s?printf' , ' f?gets' , ' (?:get|put)char' , ' getc' ], C[' FILE' ,' std(?:in|out|err)' ,' EOF' ]] ],
86
- [' cassert' , false, true , R[F[' assert' ]] ],
87
- [' cstring' , false, true , R[F[' mem(?:cpy|set|n?cmp)' , ' str(?:len|n?cmp|n?cpy|error|cat|str|chr)' ]] ],
88
- [' cstdlib' , false, true , R[F[' system' ,' abs' ,' ato[if]' , ' itoa' , ' strto[dflu]+' ,' free' ,' exit' ,' l?abs' ,' s?rand(?:_r|om)?' ,' qsort' ], C[' EXIT_[A-Z]*' , ' NULL' ]] ],
89
- [' cmath' , false, true , R[F[' pow[fl]?' ,' a?(?:sin|cos|tan)[hl]*' , ' atan2[fl]?' , ' exp[m12fl]*' , ' fabs[fl]?' , ' log[210fl]+' , ' nan[fl]?' , ' (?:ceil|floor)[fl]?' , ' l?l?round[fl]?' , ' sqrt[fl]?' ], C[' M_[A-Z24_]*' , ' NAN' , ' INFINITY' , ' HUGE_[A-Z]*' ]] ],
90
- [' strings.h' , false, true , R[F[' b(?:cmp|copy|zero)' , ' strn?casecmp' ]] ],
91
- [' typeinfo' , false, true , R[C[' typeid' ]] ],
92
- [' new' , true , true , R[F[' set_new_handler' ], C[' nothrow' ]] ],
93
- [' limits' , true , true , R[T[' numeric_limits' ]] ],
94
- [' algorithm' , true , true , R[F[' (?:stable_|partial_)?sort(?:_copy)?' , ' unique(?:_copy)?' , ' reverse(?:_copy)?' , ' nth_element' , ' (?:lower|upper)_bound' , ' binary_search' , ' (?:prev|next)_permutation' , ' min' , ' max' , ' count' , ' random_shuffle' , ' swap' ]] ],
95
- [' numeric' , true , true , R[F[' partial_sum' , ' accumulate' , ' adjacent_difference' , ' inner_product' ]] ],
96
- [' iostream' , true , true , R[C[' c(?:err|out|in)' ]] ],
97
- [' sstream' , true , true , R[C[' [io]?stringstream' ]] ],
98
- [' bitset' , true , true , R[T[' bitset' ]] ],
99
- [' complex' , true , true , R[T[' complex' ]] ],
100
- [' deque' , true , true , R[T[' deque' ]] ],
101
- [' queue' , true , true , R[T[' queue' ,' priority_queue' ]] ],
102
- [' list' , true , true , R[T[' list' ]] ],
103
- [' map' , true , true , R[T[' (?:multi)?map' ]] ],
104
- [' set' , true , true , R[T[' (?:multi)?set' ]] ],
105
- [' vector' , true , true , R[T[' vector' ]] ],
106
- [' iomanip' , true , true , R[F[' setprecision' , ' setbase' , ' setw' ], C[' fixed' , ' hex' ]]],
107
- [' fstream' , true , true , R[T[' fstream' ]] ],
108
- [' ctime' , false, true , R[F[' time' , ' clock' ], C[' CLOCKS_PER_SEC' ]]],
109
- [' string' , true , true , R[C[' string' ]] ],
110
- [' utility' , true , true , R[T[' pair' ], F[' make_pair' ]] ],
85
+ [' algorithm' , true , true , R[F[' move(?:_backward)?' , ' find(?:_(?:(?:if(?:_not)?)|end|(?:first_of))?)?' , ' (?:stable_|partial_)?sort(?:_copy)?' , ' unique(?:_copy)?' , ' reverse(?:_copy)?' , ' nth_element' , ' (?:lower|upper)_bound' , ' binary_search' , ' (?:prev|next)_permutation' , ' min' , ' max' , ' count(?:_if)?' , ' random_shuffle' , ' swap' , ' all_of' , ' any_of' , ' none_of' , ' copy(?:_if)?' ]] ],
86
+ [' array' , true , true , R[T[' array' ]] ],
87
+ [' atomic' , true , true , R[T[' atomic_' ]] ],
88
+ [' bitset' , true , true , R[T[' bitset' ]] ],
89
+ [' bitset' , true , true , R[T[' bitset' ]] ],
90
+ [' cassert' , false, true , R[F[' assert' ]] ],
91
+ [' chrono' , true , true , R[C[' chrono::duration' , ' chrono::time_point' ]],],
92
+ [' cmath' , false, true , R[F[' pow[fl]?' ,' a?(?:sin|cos|tan)[hl]*' , ' atan2[fl]?' , ' exp[m12fl]*' , ' fabs[fl]?' , ' log[210fl]+' , ' nan[fl]?' , ' (?:ceil|floor)[fl]?' , ' l?l?round[fl]?' , ' sqrt[fl]?' ], C[' M_[A-Z24_]*' , ' NAN' , ' INFINITY' , ' HUGE_[A-Z]*' ]] ],
93
+ [' complex' , true , true , R[T[' complex' ]] ],
94
+ [' cstdio' , false, true , R[F[' s?scanf' , ' puts' , ' s?printf' , ' f?gets' , ' (?:get|put)char' , ' getc' ], C[' FILE' ,' std(?:in|out|err)' ,' EOF' ]] ],
95
+ [' cstdlib' , false, true , R[F[' system' ,' abs' ,' ato[if]' , ' itoa' , ' strto[dflu]+' ,' free' ,' exit' ,' l?abs' ,' s?rand(?:_r|om)?' ,' qsort' ], C[' EXIT_[A-Z]*' , ' NULL' ]] ],
96
+ [' cstring' , false, true , R[F[' mem(?:cpy|set|n?cmp)' , ' str(?:len|n?cmp|n?cpy|error|cat|str|chr)' ]] ],
97
+ [' ctime' , false, true , R[F[' time' , ' clock' ], C[' CLOCKS_PER_SEC' ]]],
98
+ [' cuchar' , true , true , R[F[' mbrtoc(?:16|32)' , ' c(?:16|32)rtomb' ]] ],
99
+ [' deque' , true , true , R[T[' deque' ]] ],
100
+ [' forward_list' , true , true , R[T[' forward_list' ]] ],
101
+ [' fstream' , true , true , R[T[' fstream' ]] ],
102
+ [' functional' , true , true , R[T[' unary_function' , ' binary_function' , ' ref' , ' cref' , ' plus' , ' minus' , ' multiplies' , ' divides' , ' modulus' , ' negate' , ' equal_to' , ' not_equal_to' , ' greater' , ' less' , ' greater_equal' , ' less_equal' , ' logical_and' , ' logical_or' , ' logical_not' , ' bit_and' , ' bit_or' , ' bit_xor' , ' mem_fn' , ' mem_fun_ref' , ' function' , ' pointer_to_unary_function' , ' pointer_to_binary_function' , ' binder1st' , ' binder2nd' , ' is_bind_expression' , ' is_placeholder' , ' bind' , ' unary_negate' , ' binary_negate' ]] ],
103
+ [' iomanip' , true , true , R[F[' setprecision' , ' setiosflags' , ' setbase' , ' setw' , ' (?:set|put)_(?:money|time)' ], C[' fixed' , ' hex' ]]],
104
+ [' iostream' , true , true , R[C[' c(?:err|out|in)' ]] ],
105
+ [' limits' , true , true , R[T[' numeric_limits' ]] ],
106
+ [' list' , true , true , R[T[' list' ]] ],
107
+ [' map' , true , true , R[T[' (?:multi)?map' ]] ],
108
+ [' mutex' , true , true , R[C[' lock_guard' , ' unique_lock' ], F[' try_lock' , ' lock' , ' call_once' ], T[' (?:recursive_)?(?:timed_)?mutex' , ' defer_lock' , ' try_to_lock' , ' adopt_lock' ]] ],
109
+ [' new' , true , true , R[F[' set_new_handler' ], C[' nothrow' ]] ],
110
+ [' numeric' , true , true , R[F[' partial_sum' , ' accumulate' , ' adjacent_difference' , ' inner_product' ]] ],
111
+ [' queue' , true , true , R[T[' queue' ,' priority_queue' ]] ],
112
+ [' set' , true , true , R[T[' (?:multi)?set' ]] ],
113
+ [' sstream' , true , true , R[C[' [io]?stringstream' ]] ],
114
+ [' string' , true , true , R[C[' string' ]] ],
115
+ [' strings.h' , false, true , R[F[' b(?:cmp|copy|zero)' , ' strn?casecmp' ]] ],
116
+ [' thread' , true , true , R[C[' thread' ], F[' this_thread::yield' , ' this_thread::get_id' , ' this_thread::sleep_until' , ' this_thread::sleep_for' ]],],
117
+ [' tuple' , true , true , R[T[' tuple' ], F[' make_tuple' , ' tie' , ' tuple_cat' , ' forward_as_tuple' ]] ],
118
+ ['type_traits' , true , true , R[T['is_void', 'is_null_pointer', 'is_integral', 'is_floating_point', 'is_array', 'is_pointer', 'is_lvalue_reference', 'is_rvalue_reference', 'is_member_object_pointer', 'is_member_function_pointer', 'is_enum', 'is_union', 'is_class', 'is_function', 'is_reference', 'is_arithmetic', 'is_fundamental', 'is_object', 'is_scalar', 'is_compound', 'is_member_pointer', 'is_const', 'is_volatile', 'is_trivial', 'is_trivially_copyable', 'is_standard_layout', 'is_pod', 'is_literal_type', 'is_empty', 'is_polymorphic', 'is_abstract', 'is_signed', 'is_unsigned', 'is_constructible', 'is_default_constructible', 'is_copy_constructible', 'is_move_constructible', 'is_assignable', 'is_copy_assignable', 'is_move_assignable', 'is_destructible', 'is_trivially_constructible', 'is_trivially_default_constructible', 'is_trivially_copy_constructible', 'is_trivially_move_constructible', 'is_trivially_assignable', 'is_trivially_copy_assignable', 'is_trivially_move_assignable', 'is_trivially_destructible', 'is_nothrow_constructible', 'is_nothrow_default_constructible', 'is_nothrow_copy_constructible', 'is_nothrow_move_constructible', 'is_nothrow_assignable', 'is_nothrow_copy_assignable', 'is_nothrow_move_assignable', 'is_nothrow_destructible', 'has_virtual_destructor', 'alignment_of', 'rank', 'extent', 'is_same', 'is_base_of', 'is_convertible', 'remove_const', 'remove_volatile', 'remove_cv', 'add_const', 'add_volatile', 'add_cv', 'remove_reference', 'add_lvalue_reference', 'add_rvalue_reference', 'make_signed', 'make_unsigned', 'remove_extent', 'remove_all_extents', 'remove_pointer', 'add_pointer', 'aligned_storage', 'decay', 'enable_if', 'conditional', 'common_type', 'underlying_type', 'result_of']] ],
119
+ [' typeindex' , true , true , R[T[' type_index' ]] ],
120
+ [' typeinfo' , false, true , R[C[' typeid' ]] ],
121
+ [' unordered_map' , true , true , R[T[' unordered_(?:multi)?map' ]] ],
122
+ [' unordered_set' , true , true , R[T[' unordered_(?:multi)?set' ]] ],
123
+ [' utility' , true , true , R[T[' pair' ], F[' make_pair' , ' forward' , ' exchange' ]] ],
124
+ [' vector' , true , true , R[T[' vector' ]] ],
111
125
]
112
126
113
127
USING_STD = ' using namespace std;'
0 commit comments