Intermediate C++
Q47 / 100

What is template specialization?

Correct! Well done.

Incorrect.

The correct answer is A) Providing optimized or different behavior for a specific type in a template

A

Correct Answer

Providing optimized or different behavior for a specific type in a template

Explanation

template<> void swap<std::string>(std::string& a, std::string& b) provides a custom implementation for std::string while the generic template handles all other types.

Progress
47/100