bad_alloc handling

+ map.insert() replace map.operator[] for init, more efficient
This commit is contained in:
LuckyLaszlo
2022-08-08 04:24:03 +02:00
parent 1ccf61bc68
commit 02cfdf43bc
8 changed files with 162 additions and 136 deletions

View File

@@ -1,6 +1,14 @@
#include "utils.hpp"
void throw_test()
{
static int i = 0;
++i;
if (i % 8 == 0)
throw std::bad_alloc();
}
std::vector<std::string> split(std::string input, char delimiter)
{
std::vector<std::string> answer;