Search⌘ K
AI Features

Quiz: Generic Programming and Templates

Test your understanding with a couple of technical questions.

We'll cover the following...
Technical Quiz
1.

Consider the following code:

template <typename T>
class Wrapper {
    T data;
public:
    Wrapper(T d) : data(d) {}
};

Which line correctly instantiates this class for a double?

A.

Wrapper w = 5.5;

B.

Wrapper<double> w(5.5);

C.

Wrapper(5.5) w;

D.

template Wrapper<double> w(5.5);


1 / 6
...