I have a circular buffer class whose constructor is:
template <class T>
class circular_buffer {
public:
circular_buffer(size_t size) :
buf(std::unique_ptr<T[]>(new T[size])),
max_size(size)
{}
I want to create a std::array of these circular buffers. So I need a declaration that is something like:
std::array< circular_buffer<TMyType>, MAX_BUFFERS > bufferArray;
But that fails with error:
function was implicitly deleted because a data member 'std::array<circular_buffer<TMyType>,14>::_Elems' has either no appropriate default constructor or overload resolution was ambiguous
The reason seems obvious that I am providing no parameter for circular_buffer's constructor ('size').
How would I correct the declaration of bufferArray to specify 'size'?