New answers tagged

2 votes

A recursive_minmax Template Function Implementation in C++

Bug You iterate the range twice, once for each partial result, which is forbidden for a simple std::ranges::input_range. You need at least a ...
Deduplicator's user avatar
  • 18.9k
1 vote
Accepted

A recursive_minmax Template Function Implementation in C++

Separate concerns You are not following the principle of separation of concerns. Whenever you write a recursive_foo() function, you should separate the concern of ...
G. Sliepen's user avatar
  • 50.6k
2 votes

C++ implementation of a concurrent queue and of a thread pool

Remove empty() The result of empty() is a lie. Consider that between returning the result and the caller looking at it, some ...
G. Sliepen's user avatar
  • 50.6k
5 votes

C++ heap allocator using an explicit free list

Overview Must say that when reading complex code, the first thing I want to read is the constructor and destructor. Personally I always put these first in a source file. Without understanding these ...
Martin York's user avatar
  • 94.3k

Top 50 recent answers are included