Header-Only Very Simple Garbage Collector Library for C++
PROJECT IS JUST FOR FUN
- Copy
GarbageCollector.h
to your project - Use it :)
#include "Example.h"
#include "GarbageCollector.h"
int main() {
// You can change interval of garbage collector working
GarbageCollector::gcInterval = 5s;
// Start garbage collection
return GarbageCollector::runtime([]() {
auto example = gc(new Example());
// Some useful code...
return 0;
});
}