L
LRS Kumar
In Section 1.4 of Alexandrescu's Modern C++ Design, he states the
following:
<quote>
1. You cannot specialize structure. Using templates alone you cannot
specialize the structure of a class (its data members). You can only
specialize only functions.
</quote>
What does the author mean by that? Wouldn't the following constitute
"specializing structure"?
template<typename T>
class A {
T t;
};
template<>
class A<int> {
float t;
std::string s;
};
Thanks in advance for your time.
Terribly confused,
LRS
following:
<quote>
1. You cannot specialize structure. Using templates alone you cannot
specialize the structure of a class (its data members). You can only
specialize only functions.
</quote>
What does the author mean by that? Wouldn't the following constitute
"specializing structure"?
template<typename T>
class A {
T t;
};
template<>
class A<int> {
float t;
std::string s;
};
Thanks in advance for your time.
Terribly confused,
LRS