Debug Assertion Failed, vector subscript out of range
问题 my program should implement a threadsafe stack in c++ I get an error when I want to start the programm: Debug assertion Failed! ...\vector Line 1201 Expression: vector subscript out of range I absolutely don't know what's wrong with the code #include <condition_variable> #include <iostream> #include <memory> #include <mutex> #include <thread> #include <vector> #define NUM_ELEMENTS 10 using namespace std; class Stack { protected: vector<int> stack; int topOfStack; int maxSize; mutable mutex