Something went wrong. Try again.
A Tour of C++ for experienced programmers, as if C++26 is the only version that ever existed.
Something went wrong. Try again.
123456789101112131415161718192021222324#include <iostream>
// Primary templatetemplate <typename T>struct Printer { static void print() { std::cout << "primary\n"; }};
// Partial specialization for pointer typestemplate <typename T>struct Printer<T*> { static void print() { std::cout << "pointer\n"; }};
int main() { Printer<int>::print(); // prints "primary" Printer<int*>::print(); // prints "pointer" return 0;}