/src/CMake/Source/cmList.h
Line | Count | Source |
1 | | /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying |
2 | | file LICENSE.rst or https://cmake.org/licensing for details. */ |
3 | | |
4 | | #pragma once |
5 | | |
6 | | #include "cmConfigure.h" // IWYU pragma: keep |
7 | | |
8 | | #include <algorithm> |
9 | | #include <cstddef> |
10 | | #include <functional> |
11 | | #include <initializer_list> |
12 | | #include <iterator> |
13 | | #include <memory> |
14 | | #include <stdexcept> |
15 | | #include <string> |
16 | | #include <utility> |
17 | | #include <vector> |
18 | | |
19 | | #include <cm/string_view> |
20 | | #include <cm/type_traits> |
21 | | #include <cmext/iterator> |
22 | | |
23 | | #include "cmValue.h" |
24 | | |
25 | | template <typename T> |
26 | | class BT; |
27 | | class cmMakefile; |
28 | | |
29 | | /** |
30 | | * CMake lists management |
31 | | * A CMake list is a string where list elements are separated by the ';' |
32 | | * character. |
33 | | * |
34 | | * For all operations, input arguments (single value like cm::string_view or |
35 | | * multiple values specified through pair of iterators) are, by default, |
36 | | * expanded. The expansion can be controlled by the cmList::ExpandElements |
37 | | * option. |
38 | | * |
39 | | * There ate some exceptions to this rule: |
40 | | * * When the input argument is a cmList instance, the value is not expanded. |
41 | | * * The following methods do not expand their argument: cmList::push_back, |
42 | | * cmList::emplace and cmList::emplace_back. |
43 | | */ |
44 | | |
45 | | class cmList |
46 | | { |
47 | | public: |
48 | | using container_type = std::vector<std::string>; |
49 | | |
50 | | using value_type = container_type::value_type; |
51 | | using allocator_type = container_type::allocator_type; |
52 | | using index_type = std::ptrdiff_t; |
53 | | using size_type = container_type::size_type; |
54 | | using difference_type = container_type::difference_type; |
55 | | using reference = container_type::reference; |
56 | | using const_reference = container_type::const_reference; |
57 | | using iterator = container_type::iterator; |
58 | | using const_iterator = container_type::const_iterator; |
59 | | using reverse_iterator = container_type::reverse_iterator; |
60 | | using const_reverse_iterator = container_type::const_reverse_iterator; |
61 | | |
62 | | static size_type const npos = static_cast<size_type>(-1); |
63 | | |
64 | | static cm::string_view element_separator; |
65 | | |
66 | | enum class EmptyElements |
67 | | { |
68 | | No, |
69 | | Yes, |
70 | | }; |
71 | | enum class ExpandElements |
72 | | { |
73 | | No, |
74 | | Yes, |
75 | | }; |
76 | | |
77 | 0 | cmList() = default; |
78 | | cmList(cmList const&) = default; |
79 | 0 | cmList(cmList&&) = default; |
80 | | |
81 | | cmList(cm::string_view value, |
82 | | ExpandElements expandElements = ExpandElements::Yes, |
83 | | EmptyElements emptyElements = EmptyElements::No) |
84 | 0 | { |
85 | 0 | this->assign(value, expandElements, emptyElements); |
86 | 0 | } |
87 | | cmList(cm::string_view value, EmptyElements emptyElements) |
88 | | : cmList(value, ExpandElements::Yes, emptyElements) |
89 | 0 | { |
90 | 0 | } |
91 | | cmList(std::string const& value, |
92 | | ExpandElements expandElements = ExpandElements::Yes, |
93 | | EmptyElements emptyElements = EmptyElements::No) |
94 | 0 | { |
95 | 0 | this->assign(value, expandElements, emptyElements); |
96 | 0 | } |
97 | | cmList(std::string const& value, EmptyElements emptyElements) |
98 | 0 | : cmList(value, ExpandElements::Yes, emptyElements) |
99 | 0 | { |
100 | 0 | } |
101 | | cmList(cmValue list, ExpandElements expandElements = ExpandElements::Yes, |
102 | | EmptyElements emptyElements = EmptyElements::No) |
103 | 0 | { |
104 | 0 | if (list) { |
105 | 0 | this->assign(*list, expandElements, emptyElements); |
106 | 0 | } |
107 | 0 | } |
108 | | cmList(cmValue list, EmptyElements emptyElements) |
109 | 0 | : cmList(list, ExpandElements::Yes, emptyElements) |
110 | 0 | { |
111 | 0 | } |
112 | | template <typename InputIterator> |
113 | | cmList(InputIterator first, InputIterator last, |
114 | | ExpandElements expandElements = ExpandElements::Yes, |
115 | | EmptyElements emptyElements = EmptyElements::No) |
116 | 0 | { |
117 | 0 | this->assign(first, last, expandElements, emptyElements); |
118 | 0 | } Unexecuted instantiation: cmList::cmList<std::__1::move_iterator<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> > >(std::__1::move_iterator<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> >, std::__1::move_iterator<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> >, cmList::ExpandElements, cmList::EmptyElements) Unexecuted instantiation: cmList::cmList<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*> >(std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>, std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>, cmList::ExpandElements, cmList::EmptyElements) Unexecuted instantiation: cmList::cmList<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> >(std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*>, std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*>, cmList::ExpandElements, cmList::EmptyElements) |
119 | | template <typename InputIterator> |
120 | | cmList(InputIterator first, InputIterator last, EmptyElements emptyElements) |
121 | | : cmList(first, last, ExpandElements::Yes, emptyElements) |
122 | | { |
123 | | } |
124 | | cmList(container_type const& init, |
125 | | ExpandElements expandElements = ExpandElements::Yes, |
126 | | EmptyElements emptyElements = EmptyElements::No) |
127 | 0 | : cmList(init.begin(), init.end(), expandElements, emptyElements) |
128 | 0 | { |
129 | 0 | } |
130 | | cmList(container_type const& init, EmptyElements emptyElements) |
131 | | : cmList(init, ExpandElements::Yes, emptyElements) |
132 | 0 | { |
133 | 0 | } |
134 | | cmList(container_type&& init, |
135 | | ExpandElements expandElements = ExpandElements::Yes, |
136 | | EmptyElements emptyElements = EmptyElements::No) |
137 | 0 | : cmList(std::make_move_iterator(init.begin()), |
138 | 0 | std::make_move_iterator(init.end()), expandElements, |
139 | 0 | emptyElements) |
140 | 0 | { |
141 | 0 | init.clear(); |
142 | 0 | } |
143 | | cmList(container_type&& init, EmptyElements emptyElements) |
144 | | : cmList(std::move(init), ExpandElements::Yes, emptyElements) |
145 | 0 | { |
146 | 0 | } |
147 | 0 | cmList(std::initializer_list<std::string> init) { this->assign(init); } |
148 | | |
149 | 0 | ~cmList() = default; |
150 | | |
151 | | cmList& operator=(cmList const&) = default; |
152 | 0 | cmList& operator=(cmList&&) = default; |
153 | | |
154 | | cmList& operator=(cm::string_view value) |
155 | 0 | { |
156 | 0 | this->assign(value); |
157 | 0 | return *this; |
158 | 0 | } |
159 | | cmList& operator=(std::string const& value) |
160 | 0 | { |
161 | 0 | this->assign(value); |
162 | 0 | return *this; |
163 | 0 | } |
164 | | cmList& operator=(cmValue value) |
165 | 0 | { |
166 | 0 | if (value) { |
167 | 0 | this->operator=(*value); |
168 | 0 | } else { |
169 | 0 | this->clear(); |
170 | 0 | } |
171 | |
|
172 | 0 | return *this; |
173 | 0 | } |
174 | | |
175 | | cmList& operator=(container_type const& init) |
176 | 0 | { |
177 | 0 | this->assign(init); |
178 | 0 | return *this; |
179 | 0 | } |
180 | | cmList& operator=(container_type&& init) |
181 | 0 | { |
182 | 0 | this->assign(std::move(init)); |
183 | |
|
184 | 0 | return *this; |
185 | 0 | } |
186 | | |
187 | | cmList& operator=(std::initializer_list<std::string> init) |
188 | 0 | { |
189 | 0 | this->assign(init); |
190 | 0 | return *this; |
191 | 0 | } |
192 | | |
193 | | void assign(cm::string_view value, |
194 | | ExpandElements expandElements = ExpandElements::Yes, |
195 | | EmptyElements emptyElements = EmptyElements::No) |
196 | 0 | { |
197 | 0 | this->clear(); |
198 | 0 | this->append(value, expandElements, emptyElements); |
199 | 0 | } |
200 | | void assign(cm::string_view value, EmptyElements emptyElements) |
201 | 0 | { |
202 | 0 | this->assign(value, ExpandElements::Yes, emptyElements); |
203 | 0 | } |
204 | | void assign(std::string const& value, |
205 | | ExpandElements expandElements = ExpandElements::Yes, |
206 | | EmptyElements emptyElements = EmptyElements::No) |
207 | 0 | { |
208 | 0 | this->clear(); |
209 | 0 | this->append(value, expandElements, emptyElements); |
210 | 0 | } |
211 | | void assign(std::string const& value, EmptyElements emptyElements) |
212 | 0 | { |
213 | 0 | this->assign(value, ExpandElements::Yes, emptyElements); |
214 | 0 | } |
215 | | void assign(cmValue value, |
216 | | ExpandElements expandElements = ExpandElements::Yes, |
217 | | EmptyElements emptyElements = EmptyElements::No) |
218 | 0 | { |
219 | 0 | if (value) { |
220 | 0 | this->assign(*value, expandElements, emptyElements); |
221 | 0 | } else { |
222 | 0 | this->clear(); |
223 | 0 | } |
224 | 0 | } |
225 | | void assign(cmValue value, EmptyElements emptyElements) |
226 | 0 | { |
227 | 0 | this->assign(value, ExpandElements::Yes, emptyElements); |
228 | 0 | } |
229 | | template <typename InputIterator> |
230 | | void assign(InputIterator first, InputIterator last, |
231 | | ExpandElements expandElements = ExpandElements::Yes, |
232 | | EmptyElements emptyElements = EmptyElements::No) |
233 | 0 | { |
234 | 0 | this->clear(); |
235 | 0 | this->append(first, last, expandElements, emptyElements); |
236 | 0 | } Unexecuted instantiation: void cmList::assign<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*> >(std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>, std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>, cmList::ExpandElements, cmList::EmptyElements) Unexecuted instantiation: void cmList::assign<std::__1::move_iterator<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> > >(std::__1::move_iterator<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> >, std::__1::move_iterator<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> >, cmList::ExpandElements, cmList::EmptyElements) Unexecuted instantiation: void cmList::assign<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*, cmList::ExpandElements, cmList::EmptyElements) Unexecuted instantiation: void cmList::assign<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> >(std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*>, std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*>, cmList::ExpandElements, cmList::EmptyElements) |
237 | | template <typename InputIterator> |
238 | | void assign(InputIterator first, InputIterator last, |
239 | | EmptyElements emptyElements) |
240 | | { |
241 | | this->assign(first, last, ExpandElements::Yes, emptyElements); |
242 | | } |
243 | | void assign(cmList const& init, |
244 | | ExpandElements expandElements = ExpandElements::No, |
245 | | EmptyElements emptyElements = EmptyElements::No) |
246 | 0 | { |
247 | 0 | this->assign(init.begin(), init.end(), expandElements, emptyElements); |
248 | 0 | } |
249 | | void assign(cmList const& init, EmptyElements emptyElements) |
250 | 0 | { |
251 | 0 | this->assign(init, ExpandElements::No, emptyElements); |
252 | 0 | } |
253 | | void assign(cmList&& init, |
254 | | ExpandElements expandElements = ExpandElements::No, |
255 | | EmptyElements emptyElements = EmptyElements::No) |
256 | 0 | { |
257 | 0 | this->assign(std::make_move_iterator(init.begin()), |
258 | 0 | std::make_move_iterator(init.end()), expandElements, |
259 | 0 | emptyElements); |
260 | 0 | init.clear(); |
261 | 0 | } |
262 | | void assign(cmList&& init, EmptyElements emptyElements) |
263 | 0 | { |
264 | 0 | this->assign(std::move(init), ExpandElements::No, emptyElements); |
265 | 0 | } |
266 | | void assign(container_type const& init, |
267 | | ExpandElements expandElements = ExpandElements::Yes, |
268 | | EmptyElements emptyElements = EmptyElements::No) |
269 | 0 | { |
270 | 0 | this->assign(init.begin(), init.end(), expandElements, emptyElements); |
271 | 0 | } |
272 | | void assign(container_type const& init, EmptyElements emptyElements) |
273 | 0 | { |
274 | 0 | this->assign(init, ExpandElements::Yes, emptyElements); |
275 | 0 | } |
276 | | void assign(container_type&& init, |
277 | | ExpandElements expandElements = ExpandElements::Yes, |
278 | | EmptyElements emptyElements = EmptyElements::No) |
279 | 0 | { |
280 | 0 | this->assign(std::make_move_iterator(init.begin()), |
281 | 0 | std::make_move_iterator(init.end()), expandElements, |
282 | 0 | emptyElements); |
283 | 0 | init.clear(); |
284 | 0 | } |
285 | | void assign(container_type&& init, EmptyElements emptyElements) |
286 | 0 | { |
287 | 0 | this->assign(std::move(init), ExpandElements::Yes, emptyElements); |
288 | 0 | } |
289 | | void assign(std::initializer_list<std::string> init) |
290 | 0 | { |
291 | 0 | this->assign(init.begin(), init.end()); |
292 | 0 | } |
293 | | |
294 | | // Conversions |
295 | | std::string to_string() const |
296 | 0 | { |
297 | 0 | return this->join(cmList::element_separator); |
298 | 0 | } |
299 | | |
300 | 0 | operator container_type&() & noexcept { return this->Values; } |
301 | 0 | operator container_type const&() const& noexcept { return this->Values; } |
302 | 0 | operator container_type&&() && noexcept { return std::move(this->Values); } |
303 | | |
304 | | // Element access |
305 | 0 | reference at(size_type pos) { return this->Values.at(pos); } |
306 | 0 | const_reference at(size_type pos) const { return this->Values.at(pos); } |
307 | | |
308 | 0 | reference operator[](size_type pos) { return this->Values[pos]; } |
309 | 0 | const_reference operator[](size_type pos) const { return this->Values[pos]; } |
310 | | |
311 | | reference get_item(index_type pos) |
312 | 0 | { |
313 | 0 | return this->Values.at(this->ComputeIndex(pos)); |
314 | 0 | } |
315 | | const_reference get_item(index_type pos) const |
316 | 0 | { |
317 | 0 | return this->Values.at(this->ComputeIndex(pos)); |
318 | 0 | } |
319 | | |
320 | 0 | reference front() { return this->Values.front(); } |
321 | 0 | const_reference front() const { return this->Values.front(); } |
322 | | |
323 | 0 | reference back() { return this->Values.back(); } |
324 | 0 | const_reference back() const { return this->Values.back(); } |
325 | | |
326 | | // extract sublist in range [first, last) |
327 | | cmList sublist(const_iterator first, const_iterator last) const |
328 | 0 | { |
329 | 0 | return cmList{ first, last, ExpandElements::No, EmptyElements::Yes }; |
330 | 0 | } |
331 | | // Extract sublist in range [first, last) |
332 | | // Throw std::out_of_range if pos is invalid |
333 | | cmList sublist(size_type pos = 0, size_type length = npos) const; |
334 | | |
335 | | // Returns the list of elements |
336 | | // Throw std::out_of_range if any index is invalid |
337 | | cmList get_items(std::initializer_list<index_type> indexes) const |
338 | 0 | { |
339 | 0 | return this->GetItems( |
340 | 0 | std::vector<index_type>{ indexes.begin(), indexes.end() }); |
341 | 0 | } |
342 | | template <typename InputIterator> |
343 | | cmList get_items(InputIterator first, InputIterator last) const |
344 | 0 | { |
345 | 0 | return this->GetItems(std::vector<index_type>{ first, last }); |
346 | 0 | } Unexecuted instantiation: cmList cmList::get_items<std::__1::__wrap_iter<int*> >(std::__1::__wrap_iter<int*>, std::__1::__wrap_iter<int*>) const Unexecuted instantiation: cmList cmList::get_items<std::__1::__wrap_iter<long*> >(std::__1::__wrap_iter<long*>, std::__1::__wrap_iter<long*>) const |
347 | | |
348 | | size_type find(cm::string_view value) const; |
349 | | size_type find(cmValue value) const |
350 | 0 | { |
351 | 0 | if (value) { |
352 | 0 | return this->find(*value); |
353 | 0 | } |
354 | 0 |
|
355 | 0 | return npos; |
356 | 0 | } |
357 | | |
358 | 0 | container_type& data() noexcept { return this->Values; } |
359 | 0 | container_type const& data() const noexcept { return this->Values; } |
360 | | |
361 | | // Iterators |
362 | 0 | iterator begin() noexcept { return this->Values.begin(); } |
363 | 0 | const_iterator begin() const noexcept { return this->Values.begin(); } |
364 | 0 | const_iterator cbegin() const noexcept { return this->Values.cbegin(); } |
365 | | |
366 | 0 | iterator end() noexcept { return this->Values.end(); } |
367 | 0 | const_iterator end() const noexcept { return this->Values.end(); } |
368 | 0 | const_iterator cend() const noexcept { return this->Values.cend(); } |
369 | | |
370 | 0 | reverse_iterator rbegin() noexcept { return this->Values.rbegin(); } |
371 | | const_reverse_iterator rbegin() const noexcept |
372 | 0 | { |
373 | 0 | return this->Values.rbegin(); |
374 | 0 | } |
375 | | const_reverse_iterator crbegin() const noexcept |
376 | 0 | { |
377 | 0 | return this->Values.crbegin(); |
378 | 0 | } |
379 | | |
380 | 0 | reverse_iterator rend() noexcept { return this->Values.rend(); } |
381 | 0 | const_reverse_iterator rend() const noexcept { return this->Values.rend(); } |
382 | | const_reverse_iterator crend() const noexcept |
383 | 0 | { |
384 | 0 | return this->Values.crend(); |
385 | 0 | } |
386 | | |
387 | | // Capacity |
388 | 0 | bool empty() const noexcept { return this->Values.empty(); } |
389 | 0 | size_type size() const noexcept { return this->Values.size(); } |
390 | | |
391 | | // Modifiers |
392 | 0 | void clear() noexcept { this->Values.clear(); } |
393 | | |
394 | | iterator insert(const_iterator pos, cm::string_view value, |
395 | | ExpandElements expandElements = ExpandElements::Yes, |
396 | | EmptyElements emptyElements = EmptyElements::No) |
397 | 0 | { |
398 | 0 | return cmList::Insert(this->Values, pos, std::string(value), |
399 | 0 | expandElements, emptyElements); |
400 | 0 | } |
401 | | iterator insert(const_iterator pos, cm::string_view value, |
402 | | EmptyElements emptyElements) |
403 | 0 | { |
404 | 0 | return this->insert(pos, value, ExpandElements::Yes, emptyElements); |
405 | 0 | } |
406 | | iterator insert(const_iterator pos, std::string const& value, |
407 | | ExpandElements expandElements = ExpandElements::Yes, |
408 | | EmptyElements emptyElements = EmptyElements::No) |
409 | 0 | { |
410 | 0 | return cmList::Insert(this->Values, pos, value, expandElements, |
411 | 0 | emptyElements); |
412 | 0 | } |
413 | | iterator insert(const_iterator pos, std::string const& value, |
414 | | EmptyElements emptyElements) |
415 | 0 | { |
416 | 0 | return this->insert(pos, value, ExpandElements::Yes, emptyElements); |
417 | 0 | } |
418 | | iterator insert(const_iterator pos, cmValue value, |
419 | | ExpandElements expandElements = ExpandElements::Yes, |
420 | | EmptyElements emptyElements = EmptyElements::No) |
421 | 0 | { |
422 | 0 | if (value) { |
423 | 0 | return this->insert(pos, *value, expandElements, emptyElements); |
424 | 0 | } |
425 | 0 |
|
426 | 0 | auto delta = std::distance(this->cbegin(), pos); |
427 | 0 | return this->begin() + delta; |
428 | 0 | } |
429 | | iterator insert(const_iterator pos, cmValue value, |
430 | | EmptyElements emptyElements) |
431 | 0 | { |
432 | 0 | return this->insert(pos, value, ExpandElements::Yes, emptyElements); |
433 | 0 | } |
434 | | template <typename InputIterator> |
435 | | iterator insert(const_iterator pos, InputIterator first, InputIterator last, |
436 | | ExpandElements expandElements = ExpandElements::Yes, |
437 | | EmptyElements emptyElements = EmptyElements::No) |
438 | 0 | { |
439 | 0 | return cmList::Insert(this->Values, pos, first, last, expandElements, |
440 | 0 | emptyElements); |
441 | 0 | } Unexecuted instantiation: std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> cmList::insert<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*> >(std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>, std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>, std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>, cmList::ExpandElements, cmList::EmptyElements) Unexecuted instantiation: std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> cmList::insert<std::__1::move_iterator<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> > >(std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>, std::__1::move_iterator<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> >, std::__1::move_iterator<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> >, cmList::ExpandElements, cmList::EmptyElements) Unexecuted instantiation: std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> cmList::insert<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>(std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*, cmList::ExpandElements, cmList::EmptyElements) Unexecuted instantiation: std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> cmList::insert<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> >(std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>, std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*>, std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*>, cmList::ExpandElements, cmList::EmptyElements) |
442 | | template <typename InputIterator> |
443 | | iterator insert(const_iterator pos, InputIterator first, InputIterator last, |
444 | | EmptyElements emptyElements) |
445 | | { |
446 | | return this->insert(pos, first, last, ExpandElements::Yes, emptyElements); |
447 | | } |
448 | | iterator insert(const_iterator pos, cmList const& values, |
449 | | ExpandElements expandElements = ExpandElements::No, |
450 | | EmptyElements emptyElements = EmptyElements::No) |
451 | 0 | { |
452 | 0 | return this->insert(pos, values.begin(), values.end(), expandElements, |
453 | 0 | emptyElements); |
454 | 0 | } |
455 | | iterator insert(const_iterator pos, cmList const& values, |
456 | | EmptyElements emptyElements) |
457 | 0 | { |
458 | 0 | return this->insert(pos, values, ExpandElements::No, emptyElements); |
459 | 0 | } |
460 | | iterator insert(const_iterator pos, cmList&& values, |
461 | | ExpandElements expandElements = ExpandElements::No, |
462 | | EmptyElements emptyElements = EmptyElements::No) |
463 | 0 | { |
464 | 0 | auto result = this->insert(pos, std::make_move_iterator(values.begin()), |
465 | 0 | std::make_move_iterator(values.end()), |
466 | 0 | expandElements, emptyElements); |
467 | 0 | values.clear(); |
468 | 0 |
|
469 | 0 | return result; |
470 | 0 | } |
471 | | iterator insert(const_iterator pos, cmList&& values, |
472 | | EmptyElements emptyElements) |
473 | 0 | { |
474 | 0 | return this->insert(pos, std::move(values), ExpandElements::No, |
475 | 0 | emptyElements); |
476 | 0 | } |
477 | | iterator insert(const_iterator pos, container_type const& values, |
478 | | ExpandElements expandElements = ExpandElements::Yes, |
479 | | EmptyElements emptyElements = EmptyElements::No) |
480 | 0 | { |
481 | 0 | return this->insert(pos, values.begin(), values.end(), expandElements, |
482 | 0 | emptyElements); |
483 | 0 | } |
484 | | iterator insert(const_iterator pos, container_type const& values, |
485 | | EmptyElements emptyElements) |
486 | 0 | { |
487 | 0 | return this->insert(pos, values, ExpandElements::Yes, emptyElements); |
488 | 0 | } |
489 | | iterator insert(const_iterator pos, container_type&& values, |
490 | | ExpandElements expandElements = ExpandElements::Yes, |
491 | | EmptyElements emptyElements = EmptyElements::No) |
492 | 0 | { |
493 | 0 | auto result = this->insert(pos, std::make_move_iterator(values.begin()), |
494 | 0 | std::make_move_iterator(values.end()), |
495 | 0 | expandElements, emptyElements); |
496 | 0 | values.clear(); |
497 | 0 |
|
498 | 0 | return result; |
499 | 0 | } |
500 | | iterator insert(const_iterator pos, container_type&& values, |
501 | | EmptyElements emptyElements) |
502 | 0 | { |
503 | 0 | return this->insert(pos, std::move(values), ExpandElements::Yes, |
504 | 0 | emptyElements); |
505 | 0 | } |
506 | | iterator insert(const_iterator pos, std::initializer_list<std::string> ilist) |
507 | 0 | { |
508 | 0 | return this->insert(pos, ilist.begin(), ilist.end()); |
509 | 0 | } |
510 | | |
511 | | iterator append(cm::string_view value, |
512 | | ExpandElements expandElements = ExpandElements::Yes, |
513 | | EmptyElements emptyElements = EmptyElements::No) |
514 | 0 | { |
515 | 0 | return this->insert(this->cend(), value, expandElements, emptyElements); |
516 | 0 | } |
517 | | iterator append(cm::string_view value, EmptyElements emptyElements) |
518 | 0 | { |
519 | 0 | return this->append(value, ExpandElements::Yes, emptyElements); |
520 | 0 | } |
521 | | iterator append(std::string const& value, |
522 | | ExpandElements expandElements = ExpandElements::Yes, |
523 | | EmptyElements emptyElements = EmptyElements::No) |
524 | 0 | { |
525 | 0 | return this->insert(this->cend(), value, expandElements, emptyElements); |
526 | 0 | } |
527 | | iterator append(std::string const& value, EmptyElements emptyElements) |
528 | 0 | { |
529 | 0 | return this->append(value, ExpandElements::Yes, emptyElements); |
530 | 0 | } |
531 | | iterator append(cmValue value, |
532 | | ExpandElements expandElements = ExpandElements::Yes, |
533 | | EmptyElements emptyElements = EmptyElements::No) |
534 | 0 | { |
535 | 0 | if (value) { |
536 | 0 | return this->append(*value, expandElements, emptyElements); |
537 | 0 | } |
538 | | |
539 | 0 | return this->end(); |
540 | 0 | } |
541 | | iterator append(cmValue value, EmptyElements emptyElements) |
542 | 0 | { |
543 | 0 | return this->append(value, ExpandElements::Yes, emptyElements); |
544 | 0 | } |
545 | | template <typename InputIterator> |
546 | | iterator append(InputIterator first, InputIterator last, |
547 | | ExpandElements expandElements = ExpandElements::Yes, |
548 | | EmptyElements emptyElements = EmptyElements::No) |
549 | 0 | { |
550 | 0 | return this->insert(this->cend(), first, last, expandElements, |
551 | 0 | emptyElements); |
552 | 0 | } Unexecuted instantiation: std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> cmList::append<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*, cmList::ExpandElements, cmList::EmptyElements) Unexecuted instantiation: std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> cmList::append<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*> >(std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>, std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>, cmList::ExpandElements, cmList::EmptyElements) Unexecuted instantiation: std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> cmList::append<std::__1::move_iterator<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> > >(std::__1::move_iterator<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> >, std::__1::move_iterator<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> >, cmList::ExpandElements, cmList::EmptyElements) Unexecuted instantiation: std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> cmList::append<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> >(std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*>, std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*>, cmList::ExpandElements, cmList::EmptyElements) |
553 | | template <typename InputIterator> |
554 | | iterator append(InputIterator first, InputIterator last, |
555 | | EmptyElements emptyElements) |
556 | | { |
557 | | return this->append(first, last, ExpandElements::Yes, emptyElements); |
558 | | } |
559 | | iterator append(cmList const& values, |
560 | | ExpandElements expandElements = ExpandElements::No, |
561 | | EmptyElements emptyElements = EmptyElements::No) |
562 | 0 | { |
563 | 0 | return this->append(values.begin(), values.end(), expandElements, |
564 | 0 | emptyElements); |
565 | 0 | } |
566 | | iterator append(cmList const& values, EmptyElements emptyElements) |
567 | 0 | { |
568 | 0 | return this->append(values, ExpandElements::No, emptyElements); |
569 | 0 | } |
570 | | iterator append(cmList&& values, |
571 | | ExpandElements expandElements = ExpandElements::No, |
572 | | EmptyElements emptyElements = EmptyElements::No) |
573 | 0 | { |
574 | 0 | auto result = this->append(std::make_move_iterator(values.begin()), |
575 | 0 | std::make_move_iterator(values.end()), |
576 | 0 | expandElements, emptyElements); |
577 | 0 | values.clear(); |
578 | 0 |
|
579 | 0 | return result; |
580 | 0 | } |
581 | | iterator append(cmList&& values, EmptyElements emptyElements) |
582 | 0 | { |
583 | 0 | return this->append(std::move(values), ExpandElements::No, emptyElements); |
584 | 0 | } |
585 | | iterator append(container_type const& values, |
586 | | ExpandElements expandElements = ExpandElements::Yes, |
587 | | EmptyElements emptyElements = EmptyElements::No) |
588 | 0 | { |
589 | 0 | return this->append(values.begin(), values.end(), expandElements, |
590 | 0 | emptyElements); |
591 | 0 | } |
592 | | iterator append(container_type const& values, EmptyElements emptyElements) |
593 | 0 | { |
594 | 0 | return this->append(values, ExpandElements::Yes, emptyElements); |
595 | 0 | } |
596 | | iterator append(container_type&& values, |
597 | | ExpandElements expandElements = ExpandElements::Yes, |
598 | | EmptyElements emptyElements = EmptyElements::No) |
599 | 0 | { |
600 | 0 | auto result = this->append(std::make_move_iterator(values.begin()), |
601 | 0 | std::make_move_iterator(values.end()), |
602 | 0 | expandElements, emptyElements); |
603 | 0 | values.clear(); |
604 | 0 |
|
605 | 0 | return result; |
606 | 0 | } |
607 | | iterator append(container_type&& values, EmptyElements emptyElements) |
608 | 0 | { |
609 | 0 | return this->append(std::move(values), ExpandElements::Yes, emptyElements); |
610 | 0 | } |
611 | | iterator append(std::initializer_list<std::string> ilist) |
612 | 0 | { |
613 | 0 | return this->insert(this->cend(), ilist); |
614 | 0 | } |
615 | | |
616 | | iterator prepend(cm::string_view value, |
617 | | ExpandElements expandElements = ExpandElements::Yes, |
618 | | EmptyElements emptyElements = EmptyElements::No) |
619 | 0 | { |
620 | 0 | return this->insert(this->cbegin(), value, expandElements, emptyElements); |
621 | 0 | } |
622 | | iterator prepend(cm::string_view value, EmptyElements emptyElements) |
623 | 0 | { |
624 | 0 | return this->prepend(value, ExpandElements::Yes, emptyElements); |
625 | 0 | } |
626 | | iterator prepend(std::string const& value, |
627 | | ExpandElements expandElements = ExpandElements::Yes, |
628 | | EmptyElements emptyElements = EmptyElements::No) |
629 | 0 | { |
630 | 0 | return this->insert(this->cbegin(), value, expandElements, emptyElements); |
631 | 0 | } |
632 | | iterator prepend(std::string const& value, EmptyElements emptyElements) |
633 | 0 | { |
634 | 0 | return this->prepend(value, ExpandElements::Yes, emptyElements); |
635 | 0 | } |
636 | | iterator prepend(cmValue value, |
637 | | ExpandElements expandElements = ExpandElements::Yes, |
638 | | EmptyElements emptyElements = EmptyElements::No) |
639 | 0 | { |
640 | 0 | if (value) { |
641 | 0 | return this->prepend(*value, expandElements, emptyElements); |
642 | 0 | } |
643 | 0 |
|
644 | 0 | return this->begin(); |
645 | 0 | } |
646 | | iterator prepend(cmValue value, EmptyElements emptyElements) |
647 | 0 | { |
648 | 0 | return this->prepend(value, ExpandElements::Yes, emptyElements); |
649 | 0 | } |
650 | | template <typename InputIterator> |
651 | | iterator prepend(InputIterator first, InputIterator last, |
652 | | ExpandElements expandElements = ExpandElements::Yes, |
653 | | EmptyElements emptyElements = EmptyElements::No) |
654 | 0 | { |
655 | 0 | return this->insert(this->cbegin(), first, last, expandElements, |
656 | 0 | emptyElements); |
657 | 0 | } Unexecuted instantiation: std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> cmList::prepend<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*> >(std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>, std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>, cmList::ExpandElements, cmList::EmptyElements) Unexecuted instantiation: std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> cmList::prepend<std::__1::move_iterator<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> > >(std::__1::move_iterator<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> >, std::__1::move_iterator<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> >, cmList::ExpandElements, cmList::EmptyElements) |
658 | | template <typename InputIterator> |
659 | | iterator prepend(InputIterator first, InputIterator last, |
660 | | EmptyElements emptyElements) |
661 | | { |
662 | | return this->prepend(first, last, ExpandElements::Yes, emptyElements); |
663 | | } |
664 | | iterator prepend(cmList const& values, |
665 | | ExpandElements expandElements = ExpandElements::No, |
666 | | EmptyElements emptyElements = EmptyElements::No) |
667 | 0 | { |
668 | 0 | return this->prepend(values.begin(), values.end(), expandElements, |
669 | 0 | emptyElements); |
670 | 0 | } |
671 | | iterator prepend(cmList const& values, EmptyElements emptyElements) |
672 | 0 | { |
673 | 0 | return this->prepend(values, ExpandElements::No, emptyElements); |
674 | 0 | } |
675 | | iterator prepend(cmList&& values, |
676 | | ExpandElements expandElements = ExpandElements::No, |
677 | | EmptyElements emptyElements = EmptyElements::No) |
678 | 0 | { |
679 | 0 | auto result = this->prepend(std::make_move_iterator(values.begin()), |
680 | 0 | std::make_move_iterator(values.end()), |
681 | 0 | expandElements, emptyElements); |
682 | 0 | values.clear(); |
683 | 0 |
|
684 | 0 | return result; |
685 | 0 | } |
686 | | iterator prepend(cmList&& values, EmptyElements emptyElements) |
687 | 0 | { |
688 | 0 | return this->prepend(std::move(values), ExpandElements::No, emptyElements); |
689 | 0 | } |
690 | | iterator prepend(container_type const& values, |
691 | | ExpandElements expandElements = ExpandElements::Yes, |
692 | | EmptyElements emptyElements = EmptyElements::No) |
693 | 0 | { |
694 | 0 | return this->prepend(values.begin(), values.end(), expandElements, |
695 | 0 | emptyElements); |
696 | 0 | } |
697 | | iterator prepend(container_type const& values, EmptyElements emptyElements) |
698 | 0 | { |
699 | 0 | return this->prepend(values, ExpandElements::Yes, emptyElements); |
700 | 0 | } |
701 | | iterator prepend(container_type&& values, |
702 | | ExpandElements expandElements = ExpandElements::Yes, |
703 | | EmptyElements emptyElements = EmptyElements::No) |
704 | 0 | { |
705 | 0 | auto result = this->prepend(std::make_move_iterator(values.begin()), |
706 | 0 | std::make_move_iterator(values.end()), |
707 | 0 | expandElements, emptyElements); |
708 | 0 | values.clear(); |
709 | 0 |
|
710 | 0 | return result; |
711 | 0 | } |
712 | | iterator prepend(container_type&& values, EmptyElements emptyElements) |
713 | 0 | { |
714 | 0 | return this->prepend(std::move(values), ExpandElements::Yes, |
715 | 0 | emptyElements); |
716 | 0 | } |
717 | | iterator prepend(std::initializer_list<std::string> ilist) |
718 | 0 | { |
719 | 0 | return this->insert(this->cbegin(), ilist); |
720 | 0 | } |
721 | | |
722 | 0 | void push_back(std::string const& value) { this->Values.push_back(value); } |
723 | | void push_back(cm::string_view value) |
724 | 0 | { |
725 | 0 | this->Values.push_back(std::string{ value }); |
726 | 0 | } |
727 | | void push_back(std::string&& value) |
728 | 0 | { |
729 | 0 | this->Values.push_back(std::move(value)); |
730 | 0 | } |
731 | | |
732 | | template <typename... Args> |
733 | | iterator emplace(const_iterator pos, Args&&... args) |
734 | | { |
735 | | return this->Values.emplace(pos, std::forward<Args>(args)...); |
736 | | } |
737 | | |
738 | | template <typename... Args> |
739 | | void emplace_back(Args&&... args) |
740 | 0 | { |
741 | 0 | this->Values.emplace_back(std::forward<Args>(args)...); |
742 | 0 | } Unexecuted instantiation: void cmList::emplace_back<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&) Unexecuted instantiation: void cmList::emplace_back<char const (&) [6]>(char const (&) [6]) Unexecuted instantiation: void cmList::emplace_back<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Unexecuted instantiation: void cmList::emplace_back<>() Unexecuted instantiation: void cmList::emplace_back<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Unexecuted instantiation: void cmList::emplace_back<char const (&) [3]>(char const (&) [3]) |
743 | | |
744 | | // Inserts elements in the list |
745 | | // Throw std::out_of_range if index is invalid |
746 | | template <typename InputIterator> |
747 | | cmList& insert_items(index_type index, InputIterator first, |
748 | | InputIterator last, |
749 | | ExpandElements expandElements = ExpandElements::Yes, |
750 | | EmptyElements emptyElements = EmptyElements::No) |
751 | 0 | { |
752 | 0 | auto const offset = |
753 | 0 | static_cast<difference_type>(this->ComputeInsertIndex(index)); |
754 | 0 | this->insert(this->begin() + offset, first, last, expandElements, |
755 | 0 | emptyElements); |
756 | 0 | return *this; |
757 | 0 | } Unexecuted instantiation: cmList& cmList::insert_items<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>(long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*, cmList::ExpandElements, cmList::EmptyElements) Unexecuted instantiation: cmList& cmList::insert_items<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*> >(long, std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>, std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>, cmList::ExpandElements, cmList::EmptyElements) |
758 | | template <typename InputIterator> |
759 | | cmList& insert_items(index_type index, InputIterator first, |
760 | | InputIterator last, EmptyElements emptyElements) |
761 | | { |
762 | | this->insert(this->begin() + this->ComputeInsertIndex(index), first, last, |
763 | | ExpandElements::Yes, emptyElements); |
764 | | return *this; |
765 | | } |
766 | | cmList& insert_items(index_type index, |
767 | | std::initializer_list<std::string> values) |
768 | 0 | { |
769 | 0 | return this->insert_items(index, values.begin(), values.end()); |
770 | 0 | } |
771 | | |
772 | | iterator erase(const_iterator pos) |
773 | 0 | { |
774 | | // convert const_iterator in iterator to please non standard c++11 |
775 | | // compilers (gcc 4.8 for example) |
776 | 0 | auto pos2 = |
777 | 0 | this->Values.begin() + std::distance(this->Values.cbegin(), pos); |
778 | 0 | return this->Values.erase(pos2); |
779 | 0 | } |
780 | | iterator erase(const_iterator first, const_iterator last) |
781 | 0 | { |
782 | | // convert const_iterator in iterator to please non standard c++11 |
783 | | // compilers (gcc 4.8 for example) |
784 | 0 | auto first2 = |
785 | 0 | this->Values.begin() + std::distance(this->Values.cbegin(), first); |
786 | 0 | auto last2 = |
787 | 0 | this->Values.begin() + std::distance(this->Values.cbegin(), last); |
788 | 0 | return this->Values.erase(first2, last2); |
789 | 0 | } |
790 | | |
791 | 0 | void pop_back() { this->Values.pop_back(); } |
792 | 0 | void pop_front() { this->Values.erase(this->begin()); } |
793 | | |
794 | | // Removes elements from the list |
795 | | // Throw std::out_of_range if any index is invalid |
796 | | cmList& remove_items(std::initializer_list<index_type> indexes) |
797 | 0 | { |
798 | 0 | return this->RemoveItems( |
799 | 0 | std::vector<index_type>{ indexes.begin(), indexes.end() }); |
800 | 0 | } |
801 | | cmList& remove_items(std::initializer_list<std::string> values) |
802 | 0 | { |
803 | 0 | return this->RemoveItems( |
804 | 0 | std::vector<std::string>{ values.begin(), values.end() }); |
805 | 0 | } |
806 | | template <typename InputIterator> |
807 | | cmList& remove_items(InputIterator first, InputIterator last) |
808 | 0 | { |
809 | 0 | return this->RemoveItems( |
810 | 0 | std::vector<typename InputIterator::value_type>{ first, last }); |
811 | 0 | } Unexecuted instantiation: cmList& cmList::remove_items<std::__1::__wrap_iter<long*> >(std::__1::__wrap_iter<long*>, std::__1::__wrap_iter<long*>) Unexecuted instantiation: cmList& cmList::remove_items<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*> >(std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>, std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>) Unexecuted instantiation: cmList& cmList::remove_items<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> >(std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*>, std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*>) |
812 | | |
813 | | cmList& remove_duplicates(); |
814 | | |
815 | 0 | void resize(size_type count) { this->Values.resize(count); } |
816 | | |
817 | 0 | void reserve(size_type count) { this->Values.reserve(count); } |
818 | | |
819 | | enum class FilterMode |
820 | | { |
821 | | INCLUDE, |
822 | | EXCLUDE |
823 | | }; |
824 | | // Includes or removes items from the list |
825 | | // Throw std::invalid_argument if regular expression is invalid or predicate |
826 | | // function is unknown / does not set its output variable |
827 | | cmList& filter(cm::string_view regex, FilterMode mode); |
828 | | cmList& filter(std::string const& functionName, FilterMode mode, |
829 | | cmMakefile& makefile); |
830 | | |
831 | | cmList& reverse() |
832 | 0 | { |
833 | 0 | std::reverse(this->Values.begin(), this->Values.end()); |
834 | 0 | return *this; |
835 | 0 | } |
836 | | |
837 | | struct SortConfiguration |
838 | | { |
839 | | enum class OrderMode |
840 | | { |
841 | | DEFAULT, |
842 | | ASCENDING, |
843 | | DESCENDING, |
844 | | } Order = OrderMode::DEFAULT; |
845 | | |
846 | | enum class CompareMethod |
847 | | { |
848 | | DEFAULT, |
849 | | STRING, |
850 | | FILE_BASENAME, |
851 | | NATURAL, |
852 | | COMPARATOR, |
853 | | } Compare = CompareMethod::DEFAULT; |
854 | | |
855 | | enum class CaseSensitivity |
856 | | { |
857 | | DEFAULT, |
858 | | SENSITIVE, |
859 | | INSENSITIVE, |
860 | | } Case = CaseSensitivity::DEFAULT; |
861 | | |
862 | | std::string ComparatorFunction; |
863 | | |
864 | | // declare the default constructor to work-around clang bug |
865 | | SortConfiguration(); |
866 | | |
867 | | SortConfiguration(OrderMode order, CompareMethod compare, |
868 | | CaseSensitivity caseSensitivity) |
869 | | : Order(order) |
870 | | , Compare(compare) |
871 | | , Case(caseSensitivity) |
872 | 0 | { |
873 | 0 | } |
874 | | }; |
875 | | cmList& sort(SortConfiguration config = SortConfiguration{}); |
876 | | cmList& sort(SortConfiguration config, cmMakefile& makefile); |
877 | | cmList& sort( |
878 | | SortConfiguration config, |
879 | | std::function<bool(std::string const&, std::string const&)> comparator); |
880 | | |
881 | | // exception raised on error during transform operations |
882 | | class transform_error : public std::runtime_error |
883 | | { |
884 | | public: |
885 | | transform_error(std::string const& error) |
886 | 0 | : std::runtime_error(error) |
887 | 0 | { |
888 | 0 | } |
889 | | }; |
890 | | |
891 | | class TransformSelector |
892 | | { |
893 | | public: |
894 | | using index_type = cmList::index_type; |
895 | | |
896 | | // define some structs used as template selector |
897 | | struct AT; |
898 | | struct FOR; |
899 | | struct REGEX; |
900 | | struct PREDICATE; |
901 | | |
902 | 0 | virtual ~TransformSelector() = default; |
903 | | |
904 | | virtual std::string const& GetTag() = 0; |
905 | | |
906 | | // method NEW is used to allocate a selector of the needed type. |
907 | | // For example: |
908 | | // cmList::TransformSelector::New<AT>({1, 2, 5, 6}); |
909 | | // or |
910 | | // cmList::TransformSelector::New<REGEX>("^XX.*"); |
911 | | static std::unique_ptr<TransformSelector> New(); |
912 | | template <typename Type> |
913 | | static std::unique_ptr<TransformSelector> New( |
914 | | std::initializer_list<index_type>); |
915 | | template <typename Type> |
916 | | static std::unique_ptr<TransformSelector> New( |
917 | | std::vector<index_type> const&); |
918 | | template <typename Type> |
919 | | static std::unique_ptr<TransformSelector> New(std::vector<index_type>&&); |
920 | | |
921 | | template <typename Type> |
922 | | static std::unique_ptr<TransformSelector> New(std::string const&); |
923 | | template <typename Type> |
924 | | static std::unique_ptr<TransformSelector> New(std::string&&); |
925 | | |
926 | | // NewPREDICATE is public (unlike NewAT/NewFOR/NewREGEX) because it takes |
927 | | // a cmMakefile& parameter that cannot be dispatched through the existing |
928 | | // New<Type>() templates. |
929 | | static std::unique_ptr<TransformSelector> NewPREDICATE( |
930 | | std::string const& functionName, cmMakefile& makefile); |
931 | | |
932 | | cmMakefile* Makefile = nullptr; |
933 | | |
934 | | private: |
935 | | static std::unique_ptr<TransformSelector> NewAT( |
936 | | std::initializer_list<index_type> init); |
937 | | static std::unique_ptr<TransformSelector> NewAT( |
938 | | std::vector<index_type> const& init); |
939 | | static std::unique_ptr<TransformSelector> NewAT( |
940 | | std::vector<index_type>&& init); |
941 | | |
942 | | static std::unique_ptr<TransformSelector> NewFOR( |
943 | | std::initializer_list<index_type> init); |
944 | | static std::unique_ptr<TransformSelector> NewFOR( |
945 | | std::vector<index_type> const& init); |
946 | | static std::unique_ptr<TransformSelector> NewFOR( |
947 | | std::vector<index_type>&& init); |
948 | | |
949 | | static std::unique_ptr<TransformSelector> NewREGEX( |
950 | | std::string const& init); |
951 | | static std::unique_ptr<TransformSelector> NewREGEX(std::string&& init); |
952 | | }; |
953 | | |
954 | | enum class TransformAction |
955 | | { |
956 | | APPEND, |
957 | | PREPEND, |
958 | | TOLOWER, |
959 | | TOUPPER, |
960 | | STRIP, |
961 | | GENEX_STRIP, |
962 | | REPLACE, |
963 | | APPLY |
964 | | }; |
965 | | |
966 | | // Transforms the list by applying an action |
967 | | // Throw std::transform_error is any of arguments specified are invalid |
968 | | cmList& transform(TransformAction action, |
969 | | std::unique_ptr<TransformSelector> = {}); |
970 | | cmList& transform(TransformAction action, std::string const& arg, |
971 | | std::unique_ptr<TransformSelector> = {}); |
972 | | cmList& transform(TransformAction action, std::string const& arg1, |
973 | | std::string const& arg2, |
974 | | std::unique_ptr<TransformSelector> = {}); |
975 | | cmList& transform(TransformAction action, |
976 | | std::vector<std::string> const& args, |
977 | | std::unique_ptr<TransformSelector> = {}); |
978 | | cmList& transform(TransformAction action, std::string const& arg, |
979 | | cmMakefile& makefile, |
980 | | std::unique_ptr<TransformSelector> = {}); |
981 | | |
982 | | // Return, for each element of this list, whether `selector` selects it. |
983 | | // Throws transform_error on a malformed selector (e.g. an out-of-range |
984 | | // index), like transform(). |
985 | | std::vector<bool> GetTransformSelection(TransformSelector& selector) const; |
986 | | |
987 | | std::string join(cm::string_view glue) const |
988 | 0 | { |
989 | 0 | return cmList::Join(this->Values, glue); |
990 | 0 | } |
991 | | |
992 | 0 | void swap(cmList& other) noexcept { this->Values.swap(other.Values); } |
993 | | |
994 | | // static members |
995 | | // ============== |
996 | | // these methods can be used to store CMake list expansion directly in a |
997 | | // std::vector. |
998 | | static void assign(std::vector<std::string>& container, |
999 | | cm::string_view value, |
1000 | | EmptyElements emptyElements = EmptyElements::No) |
1001 | 0 | { |
1002 | 0 | container.clear(); |
1003 | 0 | cmList::append(container, value, emptyElements); |
1004 | 0 | } |
1005 | | static void assign(std::vector<std::string>& container, |
1006 | | std::string const& value, |
1007 | | EmptyElements emptyElements = EmptyElements::No) |
1008 | 0 | { |
1009 | 0 | container.clear(); |
1010 | 0 | cmList::append(container, value, emptyElements); |
1011 | 0 | } |
1012 | | static void assign(std::vector<std::string>& container, cmValue value, |
1013 | | EmptyElements emptyElements = EmptyElements::No) |
1014 | 0 | { |
1015 | 0 | if (value) { |
1016 | 0 | cmList::assign(container, *value, emptyElements); |
1017 | 0 | } else { |
1018 | 0 | container.clear(); |
1019 | 0 | } |
1020 | 0 | } |
1021 | | template <typename InputIterator> |
1022 | | static void assign(std::vector<std::string>& container, InputIterator first, |
1023 | | InputIterator last, |
1024 | | EmptyElements emptyElements = EmptyElements::No) |
1025 | | { |
1026 | | container.clear(); |
1027 | | cmList::append(container, first, last, emptyElements); |
1028 | | } |
1029 | | |
1030 | | static std::vector<std::string>::iterator insert( |
1031 | | std::vector<std::string>& container, |
1032 | | std::vector<std::string>::const_iterator pos, cm::string_view value, |
1033 | | EmptyElements emptyElements = EmptyElements::No) |
1034 | 25.1k | { |
1035 | 25.1k | return cmList::Insert(container, pos, std::string(value), |
1036 | 25.1k | ExpandElements::Yes, emptyElements); |
1037 | 25.1k | } |
1038 | | static std::vector<std::string>::iterator insert( |
1039 | | std::vector<std::string>& container, |
1040 | | std::vector<std::string>::const_iterator pos, std::string const& value, |
1041 | | EmptyElements emptyElements = EmptyElements::No) |
1042 | 0 | { |
1043 | 0 | return cmList::Insert(container, pos, value, ExpandElements::Yes, |
1044 | 0 | emptyElements); |
1045 | 0 | } |
1046 | | static std::vector<std::string>::iterator insert( |
1047 | | std::vector<std::string>& container, |
1048 | | std::vector<std::string>::const_iterator pos, cmValue value, |
1049 | | EmptyElements emptyElements = EmptyElements::No) |
1050 | 0 | { |
1051 | 0 | if (value) { |
1052 | 0 | return cmList::insert(container, pos, *value, emptyElements); |
1053 | 0 | } |
1054 | 0 |
|
1055 | 0 | auto delta = std::distance(container.cbegin(), pos); |
1056 | 0 | return container.begin() + delta; |
1057 | 0 | } |
1058 | | template <typename InputIterator> |
1059 | | static std::vector<std::string>::iterator insert( |
1060 | | std::vector<std::string>& container, |
1061 | | std::vector<std::string>::const_iterator pos, InputIterator first, |
1062 | | InputIterator last, EmptyElements emptyElements = EmptyElements::No) |
1063 | | { |
1064 | | return cmList::Insert(container, pos, first, last, ExpandElements::Yes, |
1065 | | emptyElements); |
1066 | | } |
1067 | | |
1068 | | static std::vector<std::string>::iterator append( |
1069 | | std::vector<std::string>& container, cm::string_view value, |
1070 | | EmptyElements emptyElements = EmptyElements::No) |
1071 | 25.1k | { |
1072 | 25.1k | return cmList::insert(container, container.cend(), value, emptyElements); |
1073 | 25.1k | } |
1074 | | static std::vector<std::string>::iterator append( |
1075 | | std::vector<std::string>& container, std::string const& value, |
1076 | | EmptyElements emptyElements = EmptyElements::No) |
1077 | 0 | { |
1078 | 0 | return cmList::insert(container, container.cend(), value, emptyElements); |
1079 | 0 | } |
1080 | | static std::vector<std::string>::iterator append( |
1081 | | std::vector<std::string>& container, cmValue value, |
1082 | | EmptyElements emptyElements = EmptyElements::No) |
1083 | 0 | { |
1084 | 0 | if (value) { |
1085 | 0 | return cmList::append(container, *value, emptyElements); |
1086 | 0 | } |
1087 | | |
1088 | 0 | return container.end(); |
1089 | 0 | } |
1090 | | template <typename InputIterator> |
1091 | | static std::vector<std::string>::iterator append( |
1092 | | std::vector<std::string>& container, InputIterator first, |
1093 | | InputIterator last, EmptyElements emptyElements = EmptyElements::No) |
1094 | | { |
1095 | | return cmList::insert(container, container.cend(), first, last, |
1096 | | emptyElements); |
1097 | | } |
1098 | | |
1099 | | static std::vector<std::string>::iterator prepend( |
1100 | | std::vector<std::string>& container, cm::string_view value, |
1101 | | EmptyElements emptyElements = EmptyElements::No) |
1102 | 0 | { |
1103 | 0 | return cmList::insert(container, container.cbegin(), value, emptyElements); |
1104 | 0 | } |
1105 | | static std::vector<std::string>::iterator prepend( |
1106 | | std::vector<std::string>& container, std::string const& value, |
1107 | | EmptyElements emptyElements = EmptyElements::No) |
1108 | 0 | { |
1109 | 0 | return cmList::insert(container, container.cbegin(), value, emptyElements); |
1110 | 0 | } |
1111 | | static std::vector<std::string>::iterator prepend( |
1112 | | std::vector<std::string>& container, cmValue value, |
1113 | | EmptyElements emptyElements = EmptyElements::No) |
1114 | 0 | { |
1115 | 0 | if (value) { |
1116 | 0 | return cmList::prepend(container, *value, emptyElements); |
1117 | 0 | } |
1118 | 0 |
|
1119 | 0 | return container.begin(); |
1120 | 0 | } |
1121 | | template <typename InputIterator> |
1122 | | static std::vector<std::string>::iterator prepend( |
1123 | | std::vector<std::string>& container, InputIterator first, |
1124 | | InputIterator last, EmptyElements emptyElements = EmptyElements::No) |
1125 | | { |
1126 | | return cmList::insert(container, container.cbegin(), first, last, |
1127 | | emptyElements); |
1128 | | } |
1129 | | |
1130 | | // The following methods offer the possibility to extend a CMake list |
1131 | | // but without any intermediate expansion. So the operation is simply a |
1132 | | // string concatenation with special handling for the CMake list item |
1133 | | // separator |
1134 | | static std::string& append(std::string& list, std::string&& value); |
1135 | | static std::string& append(std::string& list, cm::string_view value); |
1136 | | template <typename InputIterator> |
1137 | | static std::string& append(std::string& list, InputIterator first, |
1138 | | InputIterator last) |
1139 | 0 | { |
1140 | 0 | if (first == last) { |
1141 | 0 | return list; |
1142 | 0 | } |
1143 | | |
1144 | 0 | return cmList::append( |
1145 | 0 | list, cmList::Join(first, last, cmList::element_separator)); |
1146 | 0 | } |
1147 | | |
1148 | | static std::string& prepend(std::string& list, std::string&& value); |
1149 | | static std::string& prepend(std::string& list, cm::string_view value); |
1150 | | template <typename InputIterator> |
1151 | | static std::string& prepend(std::string& list, InputIterator first, |
1152 | | InputIterator last) |
1153 | 0 | { |
1154 | 0 | if (first == last) { |
1155 | 0 | return list; |
1156 | 0 | } |
1157 | | |
1158 | 0 | return cmList::prepend( |
1159 | 0 | list, cmList::Join(first, last, cmList::element_separator)); |
1160 | 0 | } |
1161 | | |
1162 | | template <typename Range, |
1163 | | cm::enable_if_t<cm::is_range<Range>::value, int> = 0> |
1164 | | static std::string to_string(Range const& r) |
1165 | 0 | { |
1166 | 0 | return cmList::Join(r, cmList::element_separator); |
1167 | 0 | } Unexecuted instantiation: _ZN6cmList9to_stringINSt3__16vectorINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS6_IS8_EEEETnNS1_9enable_ifIXsr2cm8is_rangeIT_EE5valueEiE4typeELi0EEES8_RKSC_ Unexecuted instantiation: _ZN6cmList9to_stringINSt3__16vectorINS1_17basic_string_viewIcNS1_11char_traitsIcEEEENS1_9allocatorIS6_EEEETnNS1_9enable_ifIXsr2cm8is_rangeIT_EE5valueEiE4typeELi0EEENS1_12basic_stringIcS5_NS7_IcEEEERKSB_ Unexecuted instantiation: _ZN6cmList9to_stringI7cmRangeIN14RangeIterators17TransformIteratorINSt3__111__wrap_iterIPKNS4_12basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEEPFSB_RSC_EEEETnNS4_9enable_ifIXsr2cm8is_rangeIT_EE5valueEiE4typeELi0EEESB_RKSL_ Unexecuted instantiation: _ZN6cmList9to_stringI7cmRangeINSt3__111__wrap_iterIPNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEEETnNS2_9enable_ifIXsr2cm8is_rangeIT_EE5valueEiE4typeELi0EEES9_RKSE_ Unexecuted instantiation: _ZN6cmList9to_stringINSt3__13setINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS1_4lessIS8_EENS6_IS8_EEEETnNS1_9enable_ifIXsr2cm8is_rangeIT_EE5valueEiE4typeELi0EEES8_RKSE_ Unexecuted instantiation: _ZN6cmList9to_stringI7cmRangeINSt3__111__wrap_iterIPKNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEEETnNS2_9enable_ifIXsr2cm8is_rangeIT_EE5valueEiE4typeELi0EEES9_RKSF_ Unexecuted instantiation: _ZN6cmList9to_stringI7cmRangeINSt3__121__tree_const_iteratorINS2_17basic_string_viewIcNS2_11char_traitsIcEEEEPNS2_11__tree_nodeIS7_PvEElEEETnNS2_9enable_ifIXsr2cm8is_rangeIT_EE5valueEiE4typeELi0EEENS2_12basic_stringIcS6_NS2_9allocatorIcEEEERKSF_ Unexecuted instantiation: _ZN6cmList9to_stringINSt3__16vectorI2BTINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENS7_ISA_EEEETnNS1_9enable_ifIXsr2cm8is_rangeIT_EE5valueEiE4typeELi0EEES9_RKSE_ Unexecuted instantiation: cmMakefile.cxx:_ZN6cmList9to_stringI7cmRangeIN14RangeIterators17TransformIteratorINS2_14FilterIteratorINSt3__111__wrap_iterIPKN10cmMakefile12DeferCommandEEEZNKS7_15DeferGetCallIdsEvE3$_0EEZNKS7_15DeferGetCallIdsEvE3$_1EEETnNS5_9enable_ifIXsr2cm8is_rangeIT_EE5valueEiE4typeELi0EEENS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERKSI_ Unexecuted instantiation: _ZN6cmList9to_stringI7cmRangeINSt3__111__wrap_iterIPK2BTINS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEEEETnNS2_9enable_ifIXsr2cm8is_rangeIT_EE5valueEiE4typeELi0EEESA_RKSH_ |
1168 | | |
1169 | | // Non-members |
1170 | | // =========== |
1171 | | friend bool operator==(cmList const& lhs, cmList const& rhs) noexcept |
1172 | 0 | { |
1173 | 0 | return lhs.Values == rhs.Values; |
1174 | 0 | } |
1175 | | friend bool operator!=(cmList const& lhs, cmList const& rhs) noexcept |
1176 | 0 | { |
1177 | 0 | return lhs.Values != rhs.Values; |
1178 | 0 | } |
1179 | | |
1180 | | private: |
1181 | | size_type ComputeIndex(index_type pos, bool boundCheck = true) const; |
1182 | | size_type ComputeInsertIndex(index_type pos, bool boundCheck = true) const; |
1183 | | |
1184 | | cmList GetItems(std::vector<index_type>&& indexes) const; |
1185 | | |
1186 | | cmList& RemoveItems(std::vector<index_type>&& indexes); |
1187 | | cmList& RemoveItems(std::vector<std::string>&& items); |
1188 | | |
1189 | | static container_type::iterator Insert(container_type& container, |
1190 | | container_type::const_iterator pos, |
1191 | | std::string&& value, |
1192 | | ExpandElements expandElements, |
1193 | | EmptyElements emptyElements); |
1194 | | static container_type::iterator Insert(container_type& container, |
1195 | | container_type::const_iterator pos, |
1196 | | std::string const& value, |
1197 | | ExpandElements expandElements, |
1198 | | EmptyElements emptyElements) |
1199 | 0 | { |
1200 | 0 | auto tmp = value; |
1201 | 0 | return cmList::Insert(container, pos, std::move(tmp), expandElements, |
1202 | 0 | emptyElements); |
1203 | 0 | } |
1204 | | template <typename InputIterator> |
1205 | | static container_type::iterator Insert(container_type& container, |
1206 | | container_type::const_iterator pos, |
1207 | | InputIterator first, |
1208 | | InputIterator last, |
1209 | | ExpandElements expandElements, |
1210 | | EmptyElements emptyElements) |
1211 | 0 | { |
1212 | 0 | auto delta = std::distance(container.cbegin(), pos); |
1213 | |
|
1214 | 0 | if (first == last) { |
1215 | 0 | return container.begin() + delta; |
1216 | 0 | } |
1217 | | |
1218 | 0 | auto insertPos = container.begin() + delta; |
1219 | 0 | if (expandElements == ExpandElements::Yes) { |
1220 | 0 | for (; first != last; ++first) { |
1221 | 0 | auto size = container.size(); |
1222 | 0 | insertPos = cmList::Insert(container, insertPos, *first, |
1223 | 0 | expandElements, emptyElements); |
1224 | 0 | insertPos += static_cast<decltype(delta)>(container.size() - size); |
1225 | 0 | } |
1226 | 0 | } else { |
1227 | 0 | for (; first != last; ++first) { |
1228 | 0 | if (!(*first).empty() || emptyElements == EmptyElements::Yes) { |
1229 | 0 | insertPos = container.insert(insertPos, *first); |
1230 | 0 | ++insertPos; |
1231 | 0 | } |
1232 | 0 | } |
1233 | 0 | } |
1234 | |
|
1235 | 0 | return container.begin() + delta; |
1236 | 0 | } Unexecuted instantiation: std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> cmList::Insert<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*> >(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&, std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>, std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>, std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>, cmList::ExpandElements, cmList::EmptyElements) Unexecuted instantiation: std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> cmList::Insert<std::__1::move_iterator<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> > >(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&, std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>, std::__1::move_iterator<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> >, std::__1::move_iterator<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> >, cmList::ExpandElements, cmList::EmptyElements) Unexecuted instantiation: std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> cmList::Insert<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&, std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*, cmList::ExpandElements, cmList::EmptyElements) Unexecuted instantiation: std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> cmList::Insert<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> >(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >&, std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>, std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*>, std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*>, cmList::ExpandElements, cmList::EmptyElements) |
1237 | | |
1238 | 0 | static std::string const& ToString(std::string const& s) { return s; } |
1239 | 0 | static std::string ToString(cm::string_view s) { return std::string{ s }; } |
1240 | | static std::string const& ToString(BT<std::string> const&); |
1241 | | |
1242 | | template <typename Range> |
1243 | | static std::string Join(Range const& r, cm::string_view glue) |
1244 | 0 | { |
1245 | 0 | if (cm::size(r) == 0) { |
1246 | 0 | return std::string{}; |
1247 | 0 | } |
1248 | | |
1249 | 0 | return cmList::Join(std::begin(r), std::end(r), glue); |
1250 | 0 | } Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > cmList::Join<std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::basic_string_view<char, std::__1::char_traits<char> >) Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > cmList::Join<std::__1::vector<std::__1::basic_string_view<char, std::__1::char_traits<char> >, std::__1::allocator<std::__1::basic_string_view<char, std::__1::char_traits<char> > > > >(std::__1::vector<std::__1::basic_string_view<char, std::__1::char_traits<char> >, std::__1::allocator<std::__1::basic_string_view<char, std::__1::char_traits<char> > > > const&, std::__1::basic_string_view<char, std::__1::char_traits<char> >) Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > cmList::Join<cmRange<RangeIterators::TransformIterator<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > (*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)> > >(cmRange<RangeIterators::TransformIterator<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > (*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)> > const&, std::__1::basic_string_view<char, std::__1::char_traits<char> >) Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > cmList::Join<cmRange<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> > >(cmRange<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> > const&, std::__1::basic_string_view<char, std::__1::char_traits<char> >) Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > cmList::Join<std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >(std::__1::set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, std::__1::basic_string_view<char, std::__1::char_traits<char> >) Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > cmList::Join<cmRange<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*> > >(cmRange<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*> > const&, std::__1::basic_string_view<char, std::__1::char_traits<char> >) Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > cmList::Join<cmRange<std::__1::__tree_const_iterator<std::__1::basic_string_view<char, std::__1::char_traits<char> >, std::__1::__tree_node<std::__1::basic_string_view<char, std::__1::char_traits<char> >, void*>*, long> > >(cmRange<std::__1::__tree_const_iterator<std::__1::basic_string_view<char, std::__1::char_traits<char> >, std::__1::__tree_node<std::__1::basic_string_view<char, std::__1::char_traits<char> >, void*>*, long> > const&, std::__1::basic_string_view<char, std::__1::char_traits<char> >) Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > cmList::Join<std::__1::vector<BT<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<BT<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > >(std::__1::vector<BT<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<BT<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > > const&, std::__1::basic_string_view<char, std::__1::char_traits<char> >) Unexecuted instantiation: cmMakefile.cxx:std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > cmList::Join<cmRange<RangeIterators::TransformIterator<RangeIterators::FilterIterator<std::__1::__wrap_iter<cmMakefile::DeferCommand const*>, cmMakefile::DeferGetCallIds() const::$_0>, cmMakefile::DeferGetCallIds() const::$_1> > >(cmRange<RangeIterators::TransformIterator<RangeIterators::FilterIterator<std::__1::__wrap_iter<cmMakefile::DeferCommand const*>, cmMakefile::DeferGetCallIds() const::$_0>, cmMakefile::DeferGetCallIds() const::$_1> > const&, std::__1::basic_string_view<char, std::__1::char_traits<char> >) Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > cmList::Join<cmRange<std::__1::__wrap_iter<BT<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const*> > >(cmRange<std::__1::__wrap_iter<BT<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const*> > const&, std::__1::basic_string_view<char, std::__1::char_traits<char> >) |
1251 | | template <typename InputIterator> |
1252 | | static std::string Join(InputIterator first, InputIterator last, |
1253 | | cm::string_view glue) |
1254 | 0 | { |
1255 | 0 | if (first == last) { |
1256 | 0 | return std::string{}; |
1257 | 0 | } |
1258 | | |
1259 | 0 | auto const sep = std::string{ glue }; |
1260 | |
|
1261 | 0 | std::string joined = cmList::ToString(*first); |
1262 | 0 | for (auto it = std::next(first); it != last; ++it) { |
1263 | 0 | joined += sep; |
1264 | 0 | joined += cmList::ToString(*it); |
1265 | 0 | } |
1266 | |
|
1267 | 0 | return joined; |
1268 | 0 | } Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > cmList::Join<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*> >(std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>, std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>, std::__1::basic_string_view<char, std::__1::char_traits<char> >) Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > cmList::Join<std::__1::__wrap_iter<std::__1::basic_string_view<char, std::__1::char_traits<char> > const*> >(std::__1::__wrap_iter<std::__1::basic_string_view<char, std::__1::char_traits<char> > const*>, std::__1::__wrap_iter<std::__1::basic_string_view<char, std::__1::char_traits<char> > const*>, std::__1::basic_string_view<char, std::__1::char_traits<char> >) Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > cmList::Join<RangeIterators::TransformIterator<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > (*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)> >(RangeIterators::TransformIterator<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > (*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)>, RangeIterators::TransformIterator<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > (*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)>, std::__1::basic_string_view<char, std::__1::char_traits<char> >) Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > cmList::Join<std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*> >(std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*>, std::__1::__wrap_iter<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*>, std::__1::basic_string_view<char, std::__1::char_traits<char> >) Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > cmList::Join<std::__1::__tree_const_iterator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__tree_node<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void*>*, long> >(std::__1::__tree_const_iterator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__tree_node<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void*>*, long>, std::__1::__tree_const_iterator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::__tree_node<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void*>*, long>, std::__1::basic_string_view<char, std::__1::char_traits<char> >) Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > cmList::Join<std::__1::__tree_const_iterator<std::__1::basic_string_view<char, std::__1::char_traits<char> >, std::__1::__tree_node<std::__1::basic_string_view<char, std::__1::char_traits<char> >, void*>*, long> >(std::__1::__tree_const_iterator<std::__1::basic_string_view<char, std::__1::char_traits<char> >, std::__1::__tree_node<std::__1::basic_string_view<char, std::__1::char_traits<char> >, void*>*, long>, std::__1::__tree_const_iterator<std::__1::basic_string_view<char, std::__1::char_traits<char> >, std::__1::__tree_node<std::__1::basic_string_view<char, std::__1::char_traits<char> >, void*>*, long>, std::__1::basic_string_view<char, std::__1::char_traits<char> >) Unexecuted instantiation: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > cmList::Join<std::__1::__wrap_iter<BT<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const*> >(std::__1::__wrap_iter<BT<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const*>, std::__1::__wrap_iter<BT<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const*>, std::__1::basic_string_view<char, std::__1::char_traits<char> >) Unexecuted instantiation: cmMakefile.cxx:std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > cmList::Join<RangeIterators::TransformIterator<RangeIterators::FilterIterator<std::__1::__wrap_iter<cmMakefile::DeferCommand const*>, cmMakefile::DeferGetCallIds() const::$_0>, cmMakefile::DeferGetCallIds() const::$_1> >(RangeIterators::TransformIterator<RangeIterators::FilterIterator<std::__1::__wrap_iter<cmMakefile::DeferCommand const*>, cmMakefile::DeferGetCallIds() const::$_0>, cmMakefile::DeferGetCallIds() const::$_1>, RangeIterators::TransformIterator<RangeIterators::FilterIterator<std::__1::__wrap_iter<cmMakefile::DeferCommand const*>, cmMakefile::DeferGetCallIds() const::$_0>, cmMakefile::DeferGetCallIds() const::$_1>, std::__1::basic_string_view<char, std::__1::char_traits<char> >) |
1269 | | |
1270 | | container_type Values; |
1271 | | }; |
1272 | | |
1273 | | // specializations for cmList::TransformSelector allocators |
1274 | | // ======================================================== |
1275 | | template <> |
1276 | | inline std::unique_ptr<cmList::TransformSelector> |
1277 | | cmList::TransformSelector::New<cmList::TransformSelector::AT>( |
1278 | | std::initializer_list<index_type> init) |
1279 | 0 | { |
1280 | 0 | return cmList::TransformSelector::NewAT(init); |
1281 | 0 | } |
1282 | | template <> |
1283 | | inline std::unique_ptr<cmList::TransformSelector> |
1284 | | cmList::TransformSelector::New<cmList::TransformSelector::AT>( |
1285 | | std::vector<index_type> const& init) |
1286 | 0 | { |
1287 | 0 | return cmList::TransformSelector::NewAT(init); |
1288 | 0 | } |
1289 | | template <> |
1290 | | inline std::unique_ptr<cmList::TransformSelector> |
1291 | | cmList::TransformSelector::New<cmList::TransformSelector::AT>( |
1292 | | std::vector<index_type>&& init) |
1293 | 0 | { |
1294 | 0 | return cmList::TransformSelector::NewAT(std::move(init)); |
1295 | 0 | } |
1296 | | |
1297 | | template <> |
1298 | | inline std::unique_ptr<cmList::TransformSelector> |
1299 | | cmList::TransformSelector::New<cmList::TransformSelector::FOR>( |
1300 | | std::initializer_list<index_type> init) |
1301 | 0 | { |
1302 | 0 | return cmList::TransformSelector::NewFOR(init); |
1303 | 0 | } |
1304 | | template <> |
1305 | | inline std::unique_ptr<cmList::TransformSelector> |
1306 | | cmList::TransformSelector::New<cmList::TransformSelector::FOR>( |
1307 | | std::vector<index_type> const& init) |
1308 | 0 | { |
1309 | 0 | return cmList::TransformSelector::NewFOR(init); |
1310 | 0 | } |
1311 | | template <> |
1312 | | inline std::unique_ptr<cmList::TransformSelector> |
1313 | | cmList::TransformSelector::New<cmList::TransformSelector::FOR>( |
1314 | | std::vector<index_type>&& init) |
1315 | 0 | { |
1316 | 0 | return cmList::TransformSelector::NewFOR(std::move(init)); |
1317 | 0 | } |
1318 | | |
1319 | | template <> |
1320 | | inline std::unique_ptr<cmList::TransformSelector> |
1321 | | cmList::TransformSelector::New<cmList::TransformSelector::REGEX>( |
1322 | | std::string const& init) |
1323 | 0 | { |
1324 | 0 | return cmList::TransformSelector::NewREGEX(init); |
1325 | 0 | } |
1326 | | template <> |
1327 | | inline std::unique_ptr<cmList::TransformSelector> |
1328 | | cmList::TransformSelector::New<cmList::TransformSelector::REGEX>( |
1329 | | std::string&& init) |
1330 | 0 | { |
1331 | 0 | return cmList::TransformSelector::NewREGEX(std::move(init)); |
1332 | 0 | } |
1333 | | |
1334 | | // Non-member functions |
1335 | | // ==================== |
1336 | | inline std::vector<std::string>& operator+=(std::vector<std::string>& l, |
1337 | | cmList const& r) |
1338 | 0 | { |
1339 | 0 | l.insert(l.end(), r.begin(), r.end()); |
1340 | 0 | return l; |
1341 | 0 | } |
1342 | | inline std::vector<std::string>& operator+=(std::vector<std::string>& l, |
1343 | | cmList&& r) |
1344 | 0 | { |
1345 | 0 | std::move(r.begin(), r.end(), std::back_inserter(l)); |
1346 | 0 | r.clear(); |
1347 | |
|
1348 | 0 | return l; |
1349 | 0 | } |
1350 | | |
1351 | | inline void swap(cmList& lhs, cmList& rhs) noexcept |
1352 | 0 | { |
1353 | 0 | lhs.swap(rhs); |
1354 | 0 | } |
1355 | | |
1356 | | namespace cm { |
1357 | | inline void erase(cmList& list, std::string const& value) |
1358 | 0 | { |
1359 | 0 | list.erase(std::remove(list.begin(), list.end(), value), list.end()); |
1360 | 0 | } |
1361 | | |
1362 | | template <typename Predicate> |
1363 | | inline void erase_if(cmList& list, Predicate pred) |
1364 | 0 | { |
1365 | 0 | list.erase(std::remove_if(list.begin(), list.end(), pred), list.end()); |
1366 | 0 | } Unexecuted instantiation: void cm::erase_if<LinkLibraryNode::Evaluate(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, cm::GenEx::Evaluation*, GeneratorExpressionContent const*, cmGeneratorExpressionDAGChecker*) const::{lambda(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)#1}>(cmList&, LinkLibraryNode::Evaluate(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, cm::GenEx::Evaluation*, GeneratorExpressionContent const*, cmGeneratorExpressionDAGChecker*) const::{lambda(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)#1})Unexecuted instantiation: void cm::erase_if<DeviceLinkNode::Evaluate(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, cm::GenEx::Evaluation*, GeneratorExpressionContent const*, cmGeneratorExpressionDAGChecker*) const::{lambda(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)#1}>(cmList&, DeviceLinkNode::Evaluate(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, cm::GenEx::Evaluation*, GeneratorExpressionContent const*, cmGeneratorExpressionDAGChecker*) const::{lambda(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)#1})Unexecuted instantiation: cmGeneratorTarget.cxx:void cm::erase_if<cmGeneratorTarget::GetLinkerTypeProperty(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const::$_0>(cmList&, cmGeneratorTarget::GetLinkerTypeProperty(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const::$_0) |
1367 | | |
1368 | | // |
1369 | | // Provide a special implementation of cm::append because, in this case, |
1370 | | // expansion must not be applied to the inserted elements |
1371 | | // |
1372 | | #if defined(__SUNPRO_CC) && defined(__sparc) |
1373 | | // Oracle DeveloperStudio C++ compiler on Solaris/Sparc fails to compile |
1374 | | // templates with constraints. |
1375 | | // So, on this platform, use only simple templates. |
1376 | | template <typename InputIt, |
1377 | | cm::enable_if_t<cm::is_input_iterator<InputIt>::value, int> = 0> |
1378 | | void append(cmList& v, InputIt first, InputIt last) |
1379 | | { |
1380 | | v.append(first, last, cmList::ExpandElements::No); |
1381 | | } |
1382 | | |
1383 | | template <typename Range, |
1384 | | cm::enable_if_t<cm::is_input_range<Range>::value, int> = 0> |
1385 | | void append(cmList& v, Range const& r) |
1386 | | { |
1387 | | v.append(r.begin(), r.end(), cmList::ExpandElements::No); |
1388 | | } |
1389 | | |
1390 | | #else |
1391 | | |
1392 | | template < |
1393 | | typename InputIt, |
1394 | | cm::enable_if_t< |
1395 | | cm::is_input_iterator<InputIt>::value && |
1396 | | std::is_convertible<typename std::iterator_traits<InputIt>::value_type, |
1397 | | cmList::value_type>::value, |
1398 | | int> = 0> |
1399 | | void append(cmList& v, InputIt first, InputIt last) |
1400 | | { |
1401 | | v.append(first, last, cmList::ExpandElements::No); |
1402 | | } |
1403 | | |
1404 | | template <typename Range, |
1405 | | cm::enable_if_t<cm::is_input_range<Range>::value && |
1406 | | std::is_convertible<typename Range::value_type, |
1407 | | cmList::value_type>::value, |
1408 | | int> = 0> |
1409 | | void append(cmList& v, Range const& r) |
1410 | 0 | { |
1411 | 0 | v.append(r.begin(), r.end(), cmList::ExpandElements::No); |
1412 | 0 | } |
1413 | | #endif |
1414 | | |
1415 | | } // namespace cm |
1416 | | |
1417 | | /** |
1418 | | * Helper functions for legacy support. Use preferably cmList class directly |
1419 | | * or the static methods of the class. |
1420 | | */ |
1421 | | inline void cmExpandList( |
1422 | | cm::string_view arg, std::vector<std::string>& argsOut, |
1423 | | cmList::EmptyElements emptyElements = cmList::EmptyElements::No) |
1424 | 25.1k | { |
1425 | 25.1k | cmList::append(argsOut, arg, emptyElements); |
1426 | 25.1k | } |
1427 | | inline void cmExpandList( |
1428 | | cmValue arg, std::vector<std::string>& argsOut, |
1429 | | cmList::EmptyElements emptyElements = cmList::EmptyElements::No) |
1430 | 0 | { |
1431 | 0 | cmList::append(argsOut, arg, emptyElements); |
1432 | 0 | } |