Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
Main Page
Related Pages
Topics
Namespaces
Data Structures
Files
File List
Globals
EXTERNAL_HEADERS
RSL
etc
config
src
instantiation_before_definition.h
Go to the documentation of this file.
1
2
24
#ifndef INSTANTIATION_BEFORE_DEFINITION_INCLUDED
25
#define INSTANTIATION_BEFORE_DEFINITION_INCLUDED
26
27
// NOTE: do not #include config.h here and avoid relying
28
// the config infrastructure automatically establishing
29
// dependencies on other config tests (headers are not
30
// scanned for such dependencies)
31
32
template
<
class
T>
33
T
instantiated_before_defined
(
T
);
34
35
template
<
class
T>
36
struct
InstantiatedBeforeDefined
37
{
38
T
defined_first
(
T
t
) {
39
return
instantiated_first_and_referenced
(
t
);
40
}
41
42
// defined later, lexically after the explicit instantiation directives
43
// below, but not referenced by another member of this class to exercise
44
// (for example) gcc 4.0 bug #623
45
T
instantiated_first
(
T
);
46
47
// same as above but also referenced by another member of this class
48
T
instantiated_first_and_referenced
(
T
)
const
;
49
};
50
51
#if defined (INSTANTIATE_TEMPLATE)
52
53
template
int
instantiated_before_defined
(
int
);
54
template
struct
InstantiatedBeforeDefined<int>
;
55
56
#elif defined (EXTERN_TEMPLATE)
57
58
# if __GNUG__ >= 3
59
// disable gcc 3.x (and beyond) error: ISO C++ forbids the use
60
// of `extern' on explicit instantiations
61
# pragma GCC system_header
62
# endif
// gcc >= 3
63
64
# ifndef SPECIALIZE_FUNCTION_TEMPLATE
65
extern
template
int
instantiated_before_defined
(
int
);
66
# else
// if defined (SPECIALIZE_FUNCTION_TEMPLATE)
67
template
<>
int
instantiated_before_defined
(
int
);
68
# endif
// SPECIALIZE_FUNCTION_TEMPLATE
69
70
extern
template
struct
InstantiatedBeforeDefined<int>
;
71
72
#endif
// INSTANTIATE_TEMPLATE, EXTERN_TEMPLATE
73
74
#if defined (INCLUDE_CC_FILE)
75
# include "
instantiation_before_definition.cc
"
76
#endif
// INCLUDE_CC_FILE
77
78
#endif
// INSTANTIATION_BEFORE_DEFINITION_INCLUDED
T
#define T
Definition
17.names.cpp:163
t
#define t
Definition
17.names.cpp:136
instantiation_before_definition.cc
instantiated_before_defined
T instantiated_before_defined(T)
Definition
instantiation_before_definition.cc:26
InstantiatedBeforeDefined
Definition
instantiation_before_definition.h:37
InstantiatedBeforeDefined::instantiated_first
T instantiated_first(T)
Definition
instantiation_before_definition.cc:34
InstantiatedBeforeDefined::defined_first
T defined_first(T t)
Definition
instantiation_before_definition.h:38
InstantiatedBeforeDefined::instantiated_first_and_referenced
T instantiated_first_and_referenced(T) const
Definition
instantiation_before_definition.cc:42
Generated by
1.9.8