mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-09-01 21:32:35 +02:00
Fix Template Specialization Index CodeBlock for const in printData (#4446)
This commit is contained in:
@@ -23,7 +23,7 @@ void printData(const T& data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
void printData(const char*& data) {
|
void printData(const char* const & data) {
|
||||||
std::cout << "Specialized template for const char*: " << data << std::endl;
|
std::cout << "Specialized template for const char*: " << data << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,4 +81,4 @@ int main() {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
In this example, the `MyPair` template class is partially specialized to provide a different behavior when the second template parameter is of type `int`.
|
In this example, the `MyPair` template class is partially specialized to provide a different behavior when the second template parameter is of type `int`.
|
||||||
|
Reference in New Issue
Block a user