DGtal
2.0.0
Loading...
Searching...
No Matches
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
// //
B
Definition
testPartialTemplateSpecialization.cpp:63
B::Super
A< TC, int > Super
Definition
testPartialTemplateSpecialization.cpp:65
B::C
Super::C C
Definition
testPartialTemplateSpecialization.cpp:66
B::B
B(const C &c)
Definition
testPartialTemplateSpecialization.cpp:73
A
Definition
testCountedConstPtrOrConstPtr.cpp:43
A::A
A(const C &c)
Definition
testPartialTemplateSpecialization.cpp:53
A::C
TC C
Definition
testPartialTemplateSpecialization.cpp:46
A::A
A(int _a)
Definition
testCountedConstPtrOrConstPtr.cpp:44
main
int main()
Definition
testBits.cpp:56
tests
base
testPartialTemplateSpecialization.cpp
Generated on Thu Jul 10 2025 13:20:43 for DGtal by
1.9.8