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
INSTANTIATE_DEFAULT_ARGS.cpp
Go to the documentation of this file.
1
// checking if default args are instantiated
2
3
25
#include "config.h"
26
27
28
template
<
class
T>
29
struct
A
30
{
31
// must be able to use inaccessible members
32
void
foo
(
const
T
& =
T
()) { }
33
34
// must be able to use non-existent members
35
void
bar
(
const
T
& = T::foobar ());
36
};
37
38
template
<
class
T>
39
void
A<T>::bar
(
const
T
&
/* = T::foobar () */
) { }
40
41
struct
B
42
{
43
// no foobar() declared
44
private
:
45
B
() { }
46
};
47
48
#ifndef _RWSTD_NO_EXPLICIT_INSTANTIATION
49
// 14.7.2, p9 - an explicit instantiation does not constitute
50
// a use of a default argument
51
template
class
A<B>
;
52
53
#else
// if defined (_RWSTD_NO_EXPLICIT_INSTANTIATION)
54
55
void
foo
()
56
{
57
&
A<int>::foo
;
58
}
59
60
#endif
// _RWSTD_NO_EXPLICIT_INSTANTIATION
T
#define T
Definition
17.names.cpp:163
B
#define B
Definition
17.names.cpp:145
bar
int bar()
Definition
collapse_static_locals.lib.cpp:36
foo
#define foo(buf, s,...)
Definition
VA_LIST_FUNC_MACRO.cpp:28
A
Definition
NAMESPACE.cpp:25
B
Definition
NAMESPACE.cpp:31
A
Definition
DEFAULT_TEMPLATE_ARGS.cpp:26
A::foo
void foo(const T &=T())
Definition
INSTANTIATE_DEFAULT_ARGS.cpp:32
Generated by
1.9.8