175. Template

Question.10

A buffer class provides a default size:

template<typename T, int Size = 32>
class Buffer {
   T data[Size];
public:
   int capacity() const { return Size; }
};

Buffer<int> a;      // Uses default Size=32
Buffer<int, 128> b; // Overrides to 128
printf("%d %d", a.capacity(), b.capacity());

What is the output?

Need Help? Refer to the Quick Guide below

Select Answer