I have created an Stack extension for std::stack
.
I have created a template class whose code is here:
template<class _StackType>
class Stack
{
std::stack<_StackType> data_container;
mutable std::mutex M;
public :
Stack(const Stack& other)
{
std::lock_guard<std::mutex> lock(other.M);
this->data_container = other.data_container;
}
But when I initialize it :
Stack<int> myStack;
It throws the following error:
error: no matching function for call to `‘Stack<int>::Stack()’`
It seems there is some problems with operator. I did try to create an operator overloading but failed at my attempts.
What is the cause of error?