1 #pragma clang system_header
3 #include "system-header-simulator-cxx.h"
6 template <class X
, class Y
>
7 const X
*cast(Y Value
);
9 template <class X
, class Y
>
10 const X
*dyn_cast(Y
*Value
);
11 template <class X
, class Y
>
12 const X
&dyn_cast(Y
&Value
);
14 template <class X
, class Y
>
15 const X
*cast_or_null(Y Value
);
17 template <class X
, class Y
>
18 const X
*dyn_cast_or_null(Y
*Value
);
19 template <class X
, class Y
>
20 const X
*dyn_cast_or_null(Y
&Value
);
22 template <class X
, class Y
> inline bool isa(const Y
&Val
);
24 template <typename First
, typename Second
, typename
... Rest
, typename Y
>
25 inline bool isa(const Y
&Val
) {
26 return isa
<First
>(Val
) || isa
<Second
, Rest
...>(Val
);
29 template <typename
... X
, class Y
>
30 inline bool isa_and_nonnull(const Y
&Val
) {
33 return isa
<X
...>(Val
);
36 template <typename X
, typename Y
>
37 std::unique_ptr
<X
> cast(std::unique_ptr
<Y
> &&Value
);