File Index Symbol Index

#include "TypePrinter.h" #include "LastArg.h"
namespace
type_printer
{
template
<>
struct
TypePrinter
<
wchar_t
> :
PrimitiveTypePrinter
<
TypePrinter
<
wchar_t
>> {
static
const
char
*
const
Name
; };
const
char
*
const
TypePrinter
<
wchar_t
>::
Name
=
"wchar_t"
; }
using
namespace
type_printer
;
using
namespace
last_arg
;
int
main
() { {
// print types
} {
struct
Cat
{
Cat
*
tag
=
nullptr
; };
struct
Dog
{
Dog
*
tag
=
nullptr
; };
// access member field returned from the last argument of the function call
LastArg
().
tag
;
LastArg
(
0
).
tag
;
LastArg
(
false
).
tag
;
LastArg
(
1
,
true
,
Cat
()).
tag
;
LastArg
(
0
,
false
,
Dog
()).
tag
;
LastArg
(
Cat
(),
Dog
(),
1
).
tag
;
LastArg
(
Dog
(),
Cat
(),
true
).
tag
; }
return
0
; }