Loading [MathJax]/extensions/TeX/AMSsymbols.js
DGtal
1.4.2
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
x
Variables
a
d
e
f
h
i
l
n
o
p
t
w
x
Typedefs
a
b
c
d
e
i
k
l
n
o
p
r
s
u
v
z
Enumerations
Enumerator
a
b
c
d
e
g
h
i
j
l
m
n
o
p
s
t
u
v
w
z
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
Data Fields
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
c
e
f
h
i
l
m
n
o
p
r
s
t
u
Enumerator
a
b
c
d
e
f
g
l
m
o
p
r
s
t
u
v
x
y
z
Related Functions
a
b
c
d
e
f
g
i
k
l
m
o
p
s
t
u
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
testPartialTemplateSpecialization.cpp
Go to the documentation of this file.
1
31
#include <iostream>
33
#include <boost/type_traits/is_arithmetic.hpp>
34
#include <boost/type_traits/is_integral.hpp>
35
#include <boost/utility/enable_if.hpp>
36
#include "DGtal/base/Common.h"
37
39
// Functions for testing class cpp11.
41
42
template
<
typename
TC,
typename
TD >
43
class
A
44
{
45
public
:
46
typedef
TC C;
47
48
A(
const
C& c );
49
};
50
51
template
<
typename
TC,
typename
TD >
52
inline
53
A< TC, TD >::A(
const
C& c )
54
{
55
boost::ignore_unused_variable_warning( c );
56
std::cout <<
"Generic"
<< std::endl;
57
}
58
59
60
61
template
<
typename
TC >
//int specialization
62
class
B :
public
A< TC, int >
63
{
64
public
:
65
typedef
A< TC, int > Super;
66
typedef
typename
Super::C C;
//Compile en rajoutant cette ligne (et en changeant les appels à Super::C par C)
67
68
B(
const
C& c );
69
};
70
71
template
<
typename
TC>
72
inline
73
B<TC>::B(
const
C& c) : Super(c)
74
{
75
std::cout <<
"Specialized"
<< std::endl;
76
}
77
78
79
80
int
main
(
int
/*argc*/
,
char
**
/*argv*/
)
81
{
82
B<int> a(1);
83
84
return
0;
85
}
86
// //
main
int main(int, char **)
Definition:
testPartialTemplateSpecialization.cpp:80
tests
base
testPartialTemplateSpecialization.cpp
Generated on Mon Dec 23 2024 13:18:51 for DGtal by
1.9.1