CppForge
NewQuality grading: sanitizers + AST analysis

Write C++ the way
production demands.

Every submission runs through real compilers, sanitizers and a quality grader. You don't just see "accepted" — you see how good your code actually is.

cppforge.dev/tasks/unique-ptr-pool
AdvancedMemory
Build a fixed-size object pool

Allocate a pool up front and hand out unique_ptr handles that return to the pool on destruction. No heap churn, no leaks.

Tests
Reuses freed slots
No allocation after warm-up
Custom deleter returns to pool
Survives ASan + UBSan
pool.cppRunSubmit
template<class T>
unique_ptr<T, Ret> acquire() {
  auto i = free_.back(); free_.pop_back();
  return { &slots_[i], Ret{this, i} };
}
// return slot to the pool on destroy
void operator()(T* p) { free_.push_back(p - slots_); }
Accepted4/4 tests · 0 leaks Quality 92 · A
What happens on submit

One submit, four quality gates

1
Compile

GCC & Clang with -Wall -Wextra. Warnings count.

2
Run tests

Unit tests against your implementation, edge cases included.

3
Sanitize

ASan + UBSan catch leaks, memory errors and undefined behaviour.

4
Grade quality

AST analysis scores RAII, ownership and idioms.

Six tracks
Explore all