Loading [MathJax]/extensions/tex2jax.js
Gorgon Game Engine
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
o
p
r
s
t
v
Enumerations
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
x
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
f
i
k
l
n
p
r
s
t
v
y
Enumerations
a
c
d
e
f
g
i
m
n
p
r
s
t
u
v
w
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Related Functions
Files
File List
File Members
All
a
c
d
e
g
h
k
l
m
n
o
p
s
Functions
Variables
g
k
Macros
a
c
d
e
g
h
l
m
n
p
s
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Vector.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <utility>
4
5
namespace
Gorgon
{
namespace
Containers {
6
9
template
<
class
T_,
class
V_>
10
void
PushBackUnique
(V_ &vector, T_ &&val) {
11
for
(
const
auto
&e : vector) {
12
if
(e == val)
return
;
13
}
14
15
vector.push_back(std::forward<T_>(val));
16
}
17
21
template
<
class
T_,
class
V_,
class
P_>
22
void
PushBackUnique
(V_ &vector,
const
T_ &val, P_ pred) {
23
for
(
const
auto
&e : vector) {
24
if
(pred(e, val))
return
;
25
}
26
27
vector.push_back(val);
28
}
29
33
template
<
class
T_,
class
V_>
34
void
PushBackOrUpdate
(V_ &vector, T_ &&val) {
35
for
(
auto
&e : vector) {
36
if
(e == val) e = std::forward<T_>(val);
37
}
38
39
vector.push_back(std::forward<T_>(val));
40
}
41
45
template
<
class
T_,
class
V_,
class
P_>
46
void
PushBackOrUpdate
(V_ &vector,
const
T_ &val, P_ pred) {
47
for
(
auto
&e : vector) {
48
if
(pred(e, val)) e = std::forward<T_>(val);
49
}
50
51
vector.push_back(val);
52
}
53
54
}}
Gorgon
Root namespace for Gorgon Game Engine.
Definition:
Any.h:19
Gorgon::Containers::PushBackUnique
void PushBackUnique(V_ &vector, T_ &&val)
This function push_backs an item to the given vector if the item does not exists in the vector.
Definition:
Vector.h:10
Gorgon::Containers::PushBackOrUpdate
void PushBackOrUpdate(V_ &vector, T_ &&val)
This function push_backs an item to the given vector if the item does not exists in the vector,...
Definition:
Vector.h:34
Gorgon
Containers
Vector.h
Generated on Sun Nov 15 2020 14:36:03 for Gorgon Game Engine by
1.8.20