File Index
Symbol Index
#ifndef VCZH_POINTER
#define VCZH_POINTER
#include "Basic.h"
namespace
{
template
<
typename
,
typename
=
>
struct
{
static
__forceinline
volatile
*
(
*
)
{
return
new
(
0
);
}
static
__forceinline
void
(
volatile
*
,
void
*
)
{
delete
;
delete
(
*)
;
}
};
template
<
typename
>
class
{
template
<
typename
X>
friend
class
;
protected
:
typedef
void
(*
)(
volatile
*,
void
*);
volatile
*
=
nullptr
;
*
=
nullptr
;
void
*
=
nullptr
;
=
nullptr
;
void
()
{
=
nullptr
;
=
nullptr
;
=
nullptr
;
=
nullptr
;
}
void
()
{
if
(
)
{
}
}
void
(
bool
=
true
)
{
if
(
)
{
if (DECRC(counter) == 0)
if
((
((
volatile
long
*)(
))) ==
0
)
{
if
(
)
{
(
,
);
}
();
}
}
}
volatile
*
()
const
{
return
;
}
(
volatile
*
,
*
,
void
*
,
)
:counter(
)
, reference(
)
, originalReference(
)
, originalDestructor(
)
{
();
}
public
:
() =
default
;
(
*
)
{
if
(
)
{
=
<
>::
(
);
=
;
=
;
= &
<
>::
;
();
}
}
(
const
<
>&
)
:counter(
.
)
, reference(
.
)
, originalReference(
.
)
, originalDestructor(
.
)
{
();
}
(
<
>&&
)
:counter(
.
)
, reference(
.
)
, originalReference(
.
)
, originalDestructor(
.
)
{
.
();
}
template
<
typename
,
typename
=
typename
<
void
,
typename
<
,
>::
>::
>
(
const
<
>&
)
{
if
(
auto
=
.
())
{
=
.
();
=
converted
;
=
.
;
=
.
;
();
}
}
template
<
typename
,
typename
=
typename
<
void
,
typename
<
,
>::
>::
>
(
<
>&&
)
{
if
(
auto
=
.
())
{
=
.
();
=
converted
;
=
.
;
=
.
;
.
();
}
}
()
{
();
}
*
()
{
auto
=
;
(
false
);
return
detached
;
}
template
<
typename
>
<
>
()
const
{
*
=
dynamic_cast
<
*>(
);
return
<
>((
converted
?
:
0
),
converted
,
,
);
}
<
>&
(
*
)
{
();
if
(
)
{
=
<
>::
(
);
=
;
=
;
= &
<
>::
;
();
}
else
{
();
}
return
*
this
;
}
<
>&
(
const
<
>&
)
{
if
(
this
!= &
)
{
();
=
.
;
=
.
;
=
.
;
=
.
;
();
}
return
*
this
;
}
<
>&
(
<
>&&
)
{
if
(
this
!= &
)
{
();
=
.
;
=
.
;
=
.
;
=
.
;
.
();
}
return
*
this
;
}
bool
(
const
*
)
const
{
return
==
;
}
bool
(
const
*
)
const
{
return
!=
;
}
bool
(
const
*
)
const
{
return
>
;
}
bool
(
const
*
)
const
{
return
>=
;
}
bool
(
const
*
)
const
{
return
<
;
}
bool
(
const
*
)
const
{
return
<=
;
}
bool
(
const
<
>&
)
const
{
return
==
.
;
}
bool
(
const
<
>&
)
const
{
return
!=
.
;
}
bool
(
const
<
>&
)
const
{
return
>
.
;
}
bool
(
const
<
>&
)
const
{
return
>=
.
;
}
bool
(
const
<
>&
)
const
{
return
<
.
;
}
bool
(
const
<
>&
)
const
{
return
<=
.
;
}
bool
()
const
{
return
!=
0
;
}
*
()
const
{
return
;
}
*
()
const
{
return
;
}
};
template
<
typename
>
class
{
protected
:
volatile
*
;
*
;
void
()
{
if
(
)
{
}
}
void
()
{
if
(
)
{
if(DECRC(counter)==0)
if
((
((
volatile
long
*)(
)))==
0
)
{
delete
;
->Release();
=
0
;
=
0
;
}
}
}
volatile
*
()
const
{
return
;
}
(
volatile
*
,
*
)
:counter(
)
,reference(
)
{
();
}
public
:
()
{
=
0
;
=
0
;
}
(
*
)
{
if
(
)
{
=
new
volatile
(
1
);
=
;
}
else
{
=
0
;
=
0
;
}
}
(
const
<
>&
)
{
=
.
;
=
.
;
();
}
(
<
>&&
)
{
=
.
;
=
.
;
.
=
0
;
.
=
0
;
}
()
{
();
}
<
>&
(
*
)
{
();
if
(
)
{
=
new
(
1
);
=
;
}
else
{
=
0
;
=
0
;
}
return
*
this
;
}
<
>&
(
const
<
>&
)
{
if
(
this
!=&
)
{
();
=
.
;
=
.
;
();
}
return
*
this
;
}
<
>&
(
<
>&&
)
{
if
(
this
!=&
)
{
();
=
.
;
=
.
;
.
=
0
;
.
=
0
;
}
return
*
this
;
}
bool
(
const
*
)
const
{
return
==
;
}
bool
(
const
*
)
const
{
return
!=
;
}
bool
(
const
*
)
const
{
return
>
;
}
bool
(
const
*
)
const
{
return
>=
;
}
bool
(
const
*
)
const
{
return
<
;
}
bool
(
const
*
)
const
{
return
<=
;
}
bool
(
const
<
>&
)
const
{
return
==
.
;
}
bool
(
const
<
>&
)
const
{
return
!=
.
;
}
bool
(
const
<
>&
)
const
{
return
>
.
;
}
bool
(
const
<
>&
)
const
{
return
>=
.
;
}
bool
(
const
<
>&
)
const
{
return
<
.
;
}
bool
(
const
<
>&
)
const
{
return
<=
.
;
}
bool
()
const
{
return
!=
0
;
}
*
()
const
{
return
;
}
*
()
const
{
return
;
}
};
template
<
typename
,
typename
...
>
<
>
(
...
)
{
return
new
(
...);
}
template
<
typename
>
struct
<
<
>>
{
typedef
*
;
static
*
(
const
<
>&
)
{
return
.
();
}
};
template
<
typename
>
struct
<
<
>>
{
static
const
bool
=
false
;
};
template
<
typename
>
struct
<
<
>>
{
typedef
*
;
static
*
(
const
<
>&
)
{
return
.
();
}
};
template
<
typename
>
struct
<
<
>>
{
static
const
bool
=
false
;
};
}
#endif