ROSE
0.11.145.192
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
}
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
}
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
}
69
70
template
<
class
T,
class
U>
71
T*
72
as
(U *p) {
73
return
dynamic_cast<
T*
>
(p);
74
}
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 Dec 16 2024 03:16:58 for ROSE by
1.9.8