ROSE
0.11.145.250
Toggle main menu visibility
Main Page
Related Pages
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
q
r
s
t
u
v
w
x
y
z
Variables
a
c
d
g
h
i
l
m
n
s
t
u
v
Typedefs
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
x
Enumerations
a
b
c
d
e
f
i
k
l
m
o
p
s
t
v
w
x
Enumerator
a
b
c
d
e
f
h
i
l
m
n
o
p
s
t
u
v
w
y
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
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
w
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Enumerator
a
b
c
d
e
f
g
i
l
m
n
o
p
r
s
t
u
v
w
x
y
Related Symbols
b
i
o
Files
File List
Examples
src
Rose
As.h
1
#ifndef ROSE_As_H
2
#define ROSE_As_H
3
#include <RoseFirst.h>
4
5
#include <Sawyer/SharedPointer.h>
6
#include <boost/shared_ptr.hpp>
7
#include <memory>
8
9
namespace
Rose
{
10
52
template
<
class
T,
class
U>
53
std::shared_ptr<T>
54
as
(
const
std::shared_ptr<U> &p) {
55
return
std::dynamic_pointer_cast<T>(p);
56
}
54
as
(
const
std::shared_ptr<U> &p) {
…
}
57
58
template
<
class
T,
class
U>
59
boost::shared_ptr<T>
60
as
(
const
boost::shared_ptr<U> &p) {
61
return
boost::dynamic_pointer_cast<T>(p);
62
}
60
as
(
const
boost::shared_ptr<U> &p) {
…
}
63
64
template
<
class
T,
class
U>
65
Sawyer::SharedPointer<T>
66
as
(
const
Sawyer::SharedPointer<U>
&p) {
67
return
p.template dynamicCast<T>();
68
}
66
as
(
const
Sawyer::SharedPointer<U>
&p) {
…
}
69
70
template
<
class
T,
class
U>
71
T*
72
as
(U *p) {
73
return
dynamic_cast<
T*
>
(p);
74
}
72
as
(U *p) {
…
}
77
}
// namespace
78
79
#endif
Sawyer::SharedPointer
Reference-counting intrusive smart pointer.
Definition
SharedPointer.h:65
Rose
The ROSE library.
Definition
BinaryTutorial.dox:3
Rose::as
std::shared_ptr< T > as(const std::shared_ptr< U > &p)
Dynamic pointer down-cast.
Definition
As.h:54
Generated on Mon Apr 14 2025 00:25:53 for ROSE by
1.9.8