acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
array.h
1//
2// Created by camilo on 2/22/2024 <3ThomasBorregaardSorensen!!
3//
4#pragma once
5
6
7
8namespace comparison
9{
10
11
12 namespace array
13 {
14
15 template < typename A, prototype_integral I, typename T >
16 bool defer_transfer_to(A & a, I i, const T & t)
17 {
18
19 auto find = a.find_first(t);
20
21 if(find == i)
22 {
23
24 return false;
25
26 }
27
28 a.erase_at(find);
29
30 if(i > find)
31 {
32
33 i--;
34
35 }
36
37 a.insert_at(i, t);
38
39 return true;
40
41 }
42
43
44 } // namespace array
45
46
47} // namespace comparison