1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-08-29 03:59:54 +02:00

Fix Template Specialization Index CodeBlock for const in printData (#4446)

This commit is contained in:
Andret Carpizo
2023-09-12 09:31:24 -06:00
committed by GitHub
parent 8ca9f976cd
commit 8903f11f02

View File

@@ -23,7 +23,7 @@ void printData(const T& data) {
}
template <>
void printData(const char*& data) {
void printData(const char* const & data) {
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`.