-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathlist.hpp
812 lines (680 loc) · 19.8 KB
/
list.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
/**
* @file list.hpp
* @brief
* @date 2021-01-19
* @author Peter
* @copyright
* Peter of [ThinkSpirit Laboratory](http://thinkspirit.org/)
* of [Nanjing University of Information Science & Technology](http://www.nuist.edu.cn/)
* all rights reserved
*/
#ifndef KERBAL_AUTONM_LIST_HPP
#define KERBAL_AUTONM_LIST_HPP
#include <kerbal/container/detail/container_rebind_allocator_overload.hpp>
#include <kerbal/container/detail/list_base/list_node.hpp>
#include <kerbal/container/detail/list_base/list_iterator.hpp>
#include <kerbal/container/detail/list_base.hpp>
#include <kerbal/compare/sequence_compare.hpp>
#include <kerbal/compatibility/constexpr.hpp>
#include <kerbal/compatibility/move.hpp>
#include <kerbal/compatibility/namespace_std_scope.hpp>
#include <kerbal/compatibility/noexcept.hpp>
#include <kerbal/utility/declval.hpp>
#include <kerbal/utility/noncopyable.hpp>
#if __cplusplus < 201103L
# include <kerbal/macro/macro_concat.hpp>
# include <kerbal/macro/ppexpand.hpp>
#endif
#if __cplusplus >= 201103L
# include <kerbal/utility/forward.hpp>
#endif
namespace kerbal
{
namespace autonm
{
namespace detail
{
template <typename T>
class autonm_list_node :
public kerbal::container::detail::list_node<T>
{
private:
typedef kerbal::container::detail::list_node<T> super;
public:
KERBAL_CONSTEXPR
autonm_list_node() :
super(kerbal::utility::in_place_t())
{
}
# if __cplusplus >= 201103L
template <typename ... Args>
KERBAL_CONSTEXPR
explicit autonm_list_node(kerbal::utility::in_place_t in_place, Args && ... args):
super(in_place, kerbal::utility::forward<Args>(args)...)
{
}
# else
# define EMPTY
# define LEFT_JOIN_COMMA(exp) , exp
# define THEAD_NOT_EMPTY(exp) template <exp>
# define TARGS_DECL(i) typename KERBAL_MACRO_CONCAT(Arg, i)
# define ARGS_DECL(i) const KERBAL_MACRO_CONCAT(Arg, i) & KERBAL_MACRO_CONCAT(arg, i)
# define ARGS_USE(i) KERBAL_MACRO_CONCAT(arg, i)
# define FBODY(i) \
KERBAL_OPT_PPEXPAND_WITH_COMMA_N(THEAD_NOT_EMPTY, EMPTY, TARGS_DECL, i) \
explicit autonm_list_node( \
kerbal::utility::in_place_t in_place \
KERBAL_OPT_PPEXPAND_WITH_COMMA_N(LEFT_JOIN_COMMA, EMPTY, ARGS_DECL, i) \
) : \
super(in_place KERBAL_OPT_PPEXPAND_WITH_COMMA_N(LEFT_JOIN_COMMA, EMPTY, ARGS_USE, i)) \
{ \
} \
KERBAL_PPEXPAND_N(FBODY, KERBAL_PPEXPAND_EMPTY_SEPARATOR, 0)
KERBAL_PPEXPAND_N(FBODY, KERBAL_PPEXPAND_EMPTY_SEPARATOR, 20)
# undef EMPTY
# undef LEFT_JOIN_COMMA
# undef THEAD_NOT_EMPTY
# undef TARGS_DECL
# undef ARGS_DECL
# undef ARGS_USE
# undef FBODY
# endif
};
template <typename T, typename SemiAllocator>
struct list_typedef_helper
{
typedef kerbal::autonm::detail::autonm_list_node<T> auto_node;
typedef SemiAllocator semi_allocator_type;
typedef kerbal::container::detail::container_rebind_allocator_overload<
semi_allocator_type, auto_node
> list_semi_allocator_overload;
};
} // namespace detail
template <typename T, typename SemiAllocator>
class list :
protected kerbal::autonm::detail::list_typedef_helper<T, SemiAllocator>::list_semi_allocator_overload ,
protected kerbal::container::detail::list_type_only<T>,
private kerbal::utility::noncopyable
{
private:
typedef kerbal::autonm::detail::list_typedef_helper<T, SemiAllocator> list_typedef_helper;
typedef kerbal::container::detail::list_type_unrelated list_type_unrelated;
typedef typename list_typedef_helper::list_semi_allocator_overload list_semi_allocator_overload;
typedef kerbal::container::detail::list_type_only<T> list_type_only;
public:
typedef typename list_typedef_helper::auto_node auto_node;
public:
typedef T value_type;
typedef const value_type const_type;
typedef value_type & reference;
typedef const value_type & const_reference;
typedef value_type * pointer;
typedef const value_type * const_pointer;
# if __cplusplus >= 201103L
typedef value_type && rvalue_reference;
typedef const value_type && const_rvalue_reference;
# endif
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
typedef typename list_type_only::iterator iterator;
typedef typename list_type_only::const_iterator const_iterator;
typedef typename list_type_only::reverse_iterator reverse_iterator;
typedef typename list_type_only::const_reverse_iterator const_reverse_iterator;
public:
typedef SemiAllocator semi_allocator_type;
private:
typedef typename list_semi_allocator_overload::rebind_allocator_type node_semi_allocator_type;
typedef typename list_semi_allocator_overload::rebind_allocator_traits node_semi_allocator_traits;
private:
KERBAL_CONSTEXPR14
node_semi_allocator_type & semi_alloc() KERBAL_NOEXCEPT
{
return this->list_semi_allocator_overload::alloc();
}
KERBAL_CONSTEXPR
const node_semi_allocator_type & semi_alloc() const KERBAL_NOEXCEPT
{
return this->list_semi_allocator_overload::alloc();
}
public:
//===================
// construct/copy/destroy
KERBAL_CONSTEXPR20
list()
KERBAL_CONDITIONAL_NOEXCEPT(
list_type_only::is_nothrow_init_to_self_constructible::value
) :
list_type_only(kerbal::container::detail::init_list_node_ptr_to_self_tag())
{
}
# if __cplusplus >= 201103L
KERBAL_CONSTEXPR20
list(list && src)
KERBAL_CONDITIONAL_NOEXCEPT(
list_type_only::is_nothrow_move_constructible::value
) :
list_type_only(kerbal::compatibility::move(src))
{
}
# endif
KERBAL_CONSTEXPR20
~list()
{
this->list_type_only::k_destroy_using_allocator(this->semi_alloc());
}
public:
//===================
// move assign
# if __cplusplus >= 201103L
KERBAL_CONSTEXPR20
list & operator=(list && src)
KERBAL_CONDITIONAL_NOEXCEPT(
noexcept(
kerbal::utility::declthis<list>()->assign(kerbal::compatibility::move(src))
)
)
{
this->assign(kerbal::compatibility::move(src));
return *this;
}
KERBAL_CONSTEXPR20
void assign(list && src) KERBAL_NOEXCEPT
{
this->k_move_assign(
this->semi_alloc(),
static_cast<list_type_only &&>(src)
);
}
# endif
//===================
// element access
using list_type_only::front;
using list_type_only::back;
//===================
// iterator
using list_type_only::begin;
using list_type_only::cbegin;
using list_type_only::end;
using list_type_only::cend;
using list_type_only::rbegin;
using list_type_only::crbegin;
using list_type_only::rend;
using list_type_only::crend;
using list_type_only::nth;
using list_type_only::index_of;
//===================
// capacity
using list_type_only::empty;
using list_type_only::size;
//===================
// insert
KERBAL_CONSTEXPR20
void push_front(auto_node & node) KERBAL_NOEXCEPT
{
list_type_unrelated::k_hook_node(this->list_type_unrelated::basic_begin(), &node);
}
KERBAL_CONSTEXPR20
void push_back(auto_node & node) KERBAL_NOEXCEPT
{
list_type_unrelated::k_hook_node(this->list_type_unrelated::basic_end(), &node);
}
KERBAL_CONSTEXPR20
iterator insert(const_iterator pos, auto_node & node) KERBAL_NOEXCEPT
{
list_type_unrelated::k_hook_node(pos, &node);
return (++pos).cast_to_mutable();
}
template <typename ForwardIterator>
KERBAL_CONSTEXPR20
typename kerbal::type_traits::enable_if<
kerbal::iterator::is_forward_compatible_iterator<ForwardIterator>::value,
iterator
>::type
insert(const_iterator pos, ForwardIterator first, ForwardIterator last)
{
if (first == last) {
return pos.cast_to_mutable();
}
ForwardIterator it(first);
ForwardIterator next(first); ++next;
while (next != last) {
(*it).next = &*next;
(*next).prev = &*it;
it = next;
++next;
}
list_type_unrelated::k_hook_node(pos, &*first, &*it);
return iterator(&*first);
}
/*
template <typename ForwardIterator>
KERBAL_CONSTEXPR20
typename kerbal::type_traits::enable_if<
kerbal::iterator::is_forward_compatible_iterator<ForwardIterator>::value,
iterator
>::type
insert(const_iterator pos, ForwardIterator first, ForwardIterator last)
{
if (first == last) {
return pos.cast_to_mutable();
}
ForwardIterator start(first);
do {
list_type_unrelated::k_hook_node(pos, &*first);
++first;
} while (first != last);
return iterator(&*start);
}
*/
//===================
// erase
KERBAL_CONSTEXPR20
void clear()
{
list_type_only::k_clear_using_allocator(this->semi_alloc());
}
KERBAL_CONSTEXPR20
iterator erase(const_iterator pos)
{
return list_type_only::k_erase_using_allocator(this->semi_alloc(), pos);
}
KERBAL_CONSTEXPR20
iterator erase(const_iterator first, const_iterator last)
{
return list_type_only::k_erase_using_allocator(this->semi_alloc(), first, last);
}
KERBAL_CONSTEXPR20
void pop_front()
{
list_type_only::k_pop_front_using_allocator(this->semi_alloc());
}
KERBAL_CONSTEXPR20
void pop_back()
{
list_type_only::k_pop_back_using_allocator(this->semi_alloc());
}
//===================
// operation
KERBAL_CONSTEXPR20
void reverse(const_iterator first, const_iterator last) KERBAL_NOEXCEPT
{
this->list_type_only::k_reverse(first, last);
}
KERBAL_CONSTEXPR20
void reverse() KERBAL_NOEXCEPT
{
this->list_type_only::reverse();
}
KERBAL_CONSTEXPR20
iterator rotate(const_iterator first, const_iterator n_first, const_iterator last) KERBAL_NOEXCEPT
{
return this->list_type_only::rotate(first, n_first, last);
}
using list_type_only::rotate;
template <typename BinaryPredict>
KERBAL_CONSTEXPR20
void merge(list & other, BinaryPredict cmp)
KERBAL_CONDITIONAL_NOEXCEPT(
noexcept(
kerbal::utility::declthis<list>()->list_type_only::k_merge(
static_cast<list_type_only &>(other),
cmp
)
)
)
{
this->list_type_only::k_merge(static_cast<list_type_only &>(other), cmp);
}
KERBAL_CONSTEXPR20
void merge(list & other)
KERBAL_CONDITIONAL_NOEXCEPT(
noexcept(
kerbal::utility::declthis<list>()->list_type_only::k_merge(
static_cast<list_type_only &>(other)
)
)
)
{
this->list_type_only::k_merge(static_cast<list_type_only &>(other));
}
# if __cplusplus >= 201103L
template <typename BinaryPredict>
KERBAL_CONSTEXPR20
void merge(list && other, BinaryPredict cmp)
KERBAL_CONDITIONAL_NOEXCEPT(
noexcept(
kerbal::utility::declthis<list>()->list_type_only::k_merge(
static_cast<list_type_only &&>(other),
cmp
)
)
)
{
this->list_type_only::k_merge(static_cast<list_type_only &&>(other), cmp);
}
KERBAL_CONSTEXPR20
void merge(list && other)
KERBAL_CONDITIONAL_NOEXCEPT(
noexcept(
kerbal::utility::declthis<list>()->list_type_only::k_merge(
static_cast<list_type_only &&>(other)
)
)
)
{
this->list_type_only::k_merge(static_cast<list_type_only &&>(other));
}
# endif
template <typename BinaryPredict>
KERBAL_CONSTEXPR20
void sort(const_iterator first, const_iterator last, BinaryPredict cmp)
KERBAL_CONDITIONAL_NOEXCEPT(
noexcept(list_type_only::k_sort(first, last, cmp))
)
{
list_type_only::k_sort(first, last, cmp);
}
KERBAL_CONSTEXPR20
void sort(const_iterator first, const_iterator last)
KERBAL_CONDITIONAL_NOEXCEPT(
noexcept(list_type_only::k_sort(first, last))
)
{
list_type_only::k_sort(first, last);
}
template <typename BinaryPredict>
KERBAL_CONSTEXPR20
void sort(BinaryPredict cmp)
KERBAL_CONDITIONAL_NOEXCEPT(
noexcept(
kerbal::utility::declthis<list>()->list_type_only::sort(cmp)
)
)
{
this->list_type_only::sort(cmp);
}
KERBAL_CONSTEXPR20
void sort()
KERBAL_CONDITIONAL_NOEXCEPT(
noexcept(
kerbal::utility::declthis<list>()->list_type_only::sort()
)
)
{
this->list_type_only::sort();
}
KERBAL_CONSTEXPR20
size_type remove(const_reference val)
{
return list_type_only::k_remove_using_allocator(this->semi_alloc(), val);
}
KERBAL_CONSTEXPR20
size_type remove(const_iterator first, const_iterator last, const_reference val)
{
return list_type_only::k_remove_using_allocator(this->semi_alloc(), first, last, val);
}
template <typename UnaryPredicate>
KERBAL_CONSTEXPR20
size_type remove_if(UnaryPredicate predicate)
{
return list_type_only::k_remove_if_using_allocator(this->semi_alloc(), predicate);
}
template <typename UnaryPredicate>
KERBAL_CONSTEXPR20
size_type remove_if(const_iterator first, const_iterator last, UnaryPredicate predicate)
{
return list_type_only::k_remove_if_using_allocator(this->semi_alloc(), first, last, predicate);
}
KERBAL_CONSTEXPR20
size_type unique()
{
return list_type_only::k_unique_using_allocator(this->semi_alloc());
}
template <typename BinaryPredicate>
KERBAL_CONSTEXPR20
size_type unique(BinaryPredicate pred)
{
return list_type_only::k_unique_using_allocator(this->semi_alloc(), pred);
}
KERBAL_CONSTEXPR20
size_type unique(const_iterator first, const_iterator last)
{
return list_type_only::k_unique_using_allocator(this->semi_alloc(), first, last);
}
template <typename BinaryPredicate>
KERBAL_CONSTEXPR20
size_type unique(const_iterator first, const_iterator last, BinaryPredicate pred)
{
return list_type_only::k_unique_using_allocator(this->semi_alloc(), first, last, pred);
}
KERBAL_CONSTEXPR20
void splice(
const_iterator pos,
list & other
) KERBAL_NOEXCEPT
{
list_type_unrelated::k_splice(
pos,
static_cast<list_type_unrelated &>(other)
);
}
KERBAL_CONSTEXPR20
void splice(
const_iterator pos, list & /*other*/,
const_iterator opos
) KERBAL_NOEXCEPT
{
list_type_unrelated::k_splice(pos, opos);
}
KERBAL_CONSTEXPR20
void splice(
const_iterator pos,
list & /*other*/,
const_iterator first, const_iterator last
) KERBAL_NOEXCEPT
{
list_type_unrelated::k_splice(pos, first, last);
}
# if __cplusplus >= 201103L
KERBAL_CONSTEXPR20
void splice(
const_iterator pos,
list && other
) KERBAL_NOEXCEPT
{
list_type_unrelated::k_splice(
pos,
static_cast<list_type_unrelated &&>(other)
);
}
KERBAL_CONSTEXPR20
void splice(
const_iterator pos, list && /*other*/,
const_iterator opos
) KERBAL_NOEXCEPT
{
list_type_unrelated::k_splice(pos, opos);
}
KERBAL_CONSTEXPR20
void splice(
const_iterator pos,
list && /*other*/,
const_iterator first, const_iterator last
) KERBAL_NOEXCEPT
{
list_type_unrelated::k_splice(pos, first, last);
}
# endif
KERBAL_CONSTEXPR20
void swap(list & with) KERBAL_NOEXCEPT
{
list_semi_allocator_overload::k_swap_allocator_if_propagate(
static_cast<list_semi_allocator_overload &>(*this),
static_cast<list_semi_allocator_overload &>(with)
);
list_type_unrelated::k_swap_type_unrelated(
static_cast<list_type_unrelated &>(*this),
static_cast<list_type_unrelated &>(with)
);
}
template <typename BinaryPredict>
KERBAL_CONSTEXPR20
static
void set_difference(list & l1, const list & l2, list & lto, BinaryPredict cmp)
{
list_type_only::k_set_difference(l1, l2, lto, cmp);
}
KERBAL_CONSTEXPR20
static
void set_difference(list & l1, const list & l2, list & lto)
{
list_type_only::k_set_difference(l1, l2, lto);
}
template <typename BinaryPredict>
KERBAL_CONSTEXPR20
static
void set_intersection(list & l1, list & l2, list & lto, BinaryPredict cmp)
{
list_type_only::k_set_intersection(l1, l2, lto, cmp);
}
KERBAL_CONSTEXPR20
static
void set_intersection(list & l1, list & l2, list & lto)
{
list_type_only::k_set_intersection(l1, l2, lto);
}
template <typename BinaryPredict>
KERBAL_CONSTEXPR20
static
void set_symmetric_difference(list & l1, list & l2, list & lto, BinaryPredict cmp)
{
list_type_only::k_set_symmetric_difference(l1, l2, lto, cmp);
}
KERBAL_CONSTEXPR20
static
void set_symmetric_difference(list & l1, list & l2, list & lto)
{
list_type_only::k_set_symmetric_difference(l1, l2, lto);
}
template <typename BinaryPredict>
KERBAL_CONSTEXPR20
static
void set_union(list & l1, list & l2, list & lto, BinaryPredict cmp)
{
list_type_only::k_set_union(l1, l2, lto, cmp);
}
KERBAL_CONSTEXPR20
static
void set_union(list & l1, list & l2, list & lto)
{
list_type_only::k_set_union(l1, l2, lto);
}
# if __cplusplus >= 201103L
KERBAL_CONSTEXPR20
list & operator+=(list && with) KERBAL_NOEXCEPT
{
this->splice(this->cend(), kerbal::compatibility::move(with));
return *this;
}
# endif
};
template <typename T, typename SemiAllocator>
KERBAL_CONSTEXPR20
bool operator==(
const list<T, SemiAllocator> & lhs,
const list<T, SemiAllocator> & rhs
)
{
return kerbal::compare::sequence_equal_to(
lhs.cbegin(), lhs.cend(),
rhs.cbegin(), rhs.cend()
);
}
template <typename T, typename SemiAllocator>
KERBAL_CONSTEXPR20
bool operator!=(
const list<T, SemiAllocator> & lhs,
const list<T, SemiAllocator> & rhs
)
{
return kerbal::compare::sequence_not_equal_to(
lhs.cbegin(), lhs.cend(),
rhs.cbegin(), rhs.cend()
);
}
template <typename T, typename SemiAllocator>
KERBAL_CONSTEXPR20
bool operator<(
const list<T, SemiAllocator> & lhs,
const list<T, SemiAllocator> & rhs
)
{
return kerbal::compare::sequence_less(
lhs.cbegin(), lhs.cend(),
rhs.cbegin(), rhs.cend()
);
}
template <typename T, typename SemiAllocator>
KERBAL_CONSTEXPR20
bool operator>(
const list<T, SemiAllocator> & lhs,
const list<T, SemiAllocator> & rhs
)
{
return kerbal::compare::sequence_greater(
lhs.cbegin(), lhs.cend(),
rhs.cbegin(), rhs.cend()
);
}
template <typename T, typename SemiAllocator>
KERBAL_CONSTEXPR20
bool operator<=(
const list<T, SemiAllocator> & lhs,
const list<T, SemiAllocator> & rhs
)
{
return kerbal::compare::sequence_less_equal(
lhs.cbegin(), lhs.cend(),
rhs.cbegin(), rhs.cend()
);
}
template <typename T, typename SemiAllocator>
KERBAL_CONSTEXPR20
bool operator>=(
const list<T, SemiAllocator> & lhs,
const list<T, SemiAllocator> & rhs
)
{
return kerbal::compare::sequence_greater_equal(
lhs.cbegin(), lhs.cend(),
rhs.cbegin(), rhs.cend()
);
}
} // namespace autonm
namespace algorithm
{
template <typename T, typename SemiAllocator>
KERBAL_CONSTEXPR20
void swap(
kerbal::autonm::list<T, SemiAllocator> & a,
kerbal::autonm::list<T, SemiAllocator> & b
)
KERBAL_CONDITIONAL_NOEXCEPT(noexcept(a.swap(b)))
{
a.swap(b);
}
} // namespace algorithm
} // namespace kerbal
KERBAL_NAMESPACE_STD_BEGIN
template <typename T, typename SemiAllocator>
KERBAL_CONSTEXPR20
void swap(
kerbal::autonm::list<T, SemiAllocator> & a,
kerbal::autonm::list<T, SemiAllocator> & b
)
KERBAL_CONDITIONAL_NOEXCEPT(noexcept(a.swap(b)))
{
a.swap(b);
}
KERBAL_NAMESPACE_STD_END
#endif // KERBAL_AUTONM_LIST_HPP