Jpp
15.0.0
the software that should make you happy
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
examples
JLang
JTypedef.cc
Go to the documentation of this file.
1
2
#include <iostream>
3
#include <iomanip>
4
5
#include "
JLang/JVoid.hh
"
6
7
#include "
Jeep/JParser.hh
"
8
#include "
Jeep/JMessage.hh
"
9
10
11
namespace
{
12
13
using namespace
JPP;
14
15
struct
__A__ {
16
typedef
int
data_type;
17
};
18
19
struct
__B__ {
20
};
21
22
template
<
class
T,
class
JType_t =
void
>
23
struct
JTypedef
24
{
25
static
const
bool
has_typedef =
false
;
26
};
27
28
template
<
class
T>
29
struct
JTypedef<
T
, typename
JVoid
<typename
T
::data_type>::type>
30
{
31
static
const
bool
has_typedef =
true
;
32
};
33
34
35
#define PRINT(OUT, T) OUT << #T << ": typedef = " << JTypedef<T>::has_typedef << endl;
36
}
37
38
39
/**
40
* \file
41
*
42
* Example program to test JLANG::JTypedef class.
43
* \author mdejong
44
*/
45
int
main
(
int
argc,
char
**argv)
46
{
47
using namespace
std;
48
49
int
debug
;
50
51
try
{
52
53
JParser<>
zap(
"Example program to test type defs."
);
54
55
zap[
'd'
] =
make_field
(
debug
) = 3;
56
57
zap(argc, argv);
58
}
59
catch
(
const
exception &error) {
60
FATAL
(error.what() << endl);
61
}
62
63
64
PRINT
(cout, __A__);
65
PRINT
(cout, __B__);
66
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1500
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1961
T
do set_variable OUTPUT_DIRECTORY $WORKDIR T
Definition:
JCalibrateHeight.sh:61
JVoid.hh
debug
int debug
debug level
Definition:
JSirene.cc:63
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JParser.hh
Utility class to parse command line options.
PRINT
#define PRINT(OUT, T)
Definition:
JTypedef.cc:35
JLANG::JVoid
Auxiliary class for void type definition.
Definition:
JVoid.hh:20
Generated by
1.8.5