Loading [MathJax]/extensions/TeX/AMSsymbols.js
KASKADE 7 development version
Toggle main menu visibility
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
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
l
m
n
o
p
q
r
s
t
u
v
w
y
Variables
Typedefs
b
c
d
e
f
g
h
i
l
m
p
q
r
s
t
u
v
Enumerations
Enumerator
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
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
x
y
Enumerations
Enumerator
a
b
c
d
e
f
g
h
i
k
m
n
q
s
t
v
Related Functions
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
o
p
r
s
t
u
v
x
z
Functions
a
b
c
d
e
f
g
m
o
r
s
t
u
z
Variables
Typedefs
Enumerations
Macros
d
e
h
i
j
k
l
m
s
t
u
v
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
utilities
memory.hh
Go to the documentation of this file.
1
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2
/* */
3
/* This file is part of the library KASKADE 7 */
4
/* https://www.zib.de/research/projects/kaskade7-finite-element-toolbox */
5
/* */
6
/* Copyright (C) 2016-2018 Zuse Institute Berlin */
7
/* */
8
/* KASKADE 7 is distributed under the terms of the ZIB Academic License. */
9
/* see $KASKADE/academic.txt */
10
/* */
11
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
12
13
#ifndef UTILITIES_MEMORY
14
#define UTILITIES_MEMORY
15
16
namespace
Kaskade
17
{
32
template
<
class
A>
33
auto
moveUnique
(A&& a)
34
{
35
using
T = std::remove_reference_t<A>;
36
return
std::unique_ptr<T>(
new
T(std::move(a)));
37
}
38
47
template
<
class
A>
48
A
duplicate
(A
const
& a)
49
{
50
return
A(a);
51
}
52
}
53
54
55
#endif
Kaskade::moveUnique
auto moveUnique(A &&a)
Creates a dynamically allocated object from an r-value reference.
Definition:
memory.hh:33
Kaskade::duplicate
A duplicate(A const &a)
Creates a copy of a given object.
Definition:
memory.hh:48
Kaskade
Definition:
abstract_interface.hh:15
Generated on Fri Sep 6 2024 13:13:00 for KASKADE 7 development version by
1.9.4