CS106L

The C++ Template Factory

0 points

Attendancefor this activity has closed. Sign in to be counted — nothing is recorded while you are signed out, and the activity itself works either way.

Template Instantiation and Distinct Types

A is like a factory blueprint: supply a type, and the compiler creates a concrete . Different materials lead to distinct product types.

1template <typename T>2class ProductBox {3public:4    T item;5};6 7ProductBox<int> bolts;8ProductBox<double> paint;

Our factory has a ProductBox<T> blueprint. Which statement is true?

0 of 1 done