Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

New answers tagged

2 votes
Accepted

Templatizing a Timer class

Let the caller convert durations You are right that having milliseconds() and seconds() member functions is not nice, and you ...
user avatar
  • 32.6k
4 votes

Templatizing a Timer class

Time warp Anything but std::chrono::steady_clock does not guarantee being monotonic and ticks having more-or-less constant time between them as time moves forward. ...
user avatar
  • 9,079
3 votes
Accepted

C++17 view over the Ith elements of tuples in containers of tuples

Missing iterators As it is now, I would say it is cute, but not very useful. In most of your test code, you can see that using std::get<>() requires less ...
user avatar
  • 32.6k
5 votes
Accepted

Create and view a family tree

This is by no means exhaustive, more a list of general highlights on what to focus on rather that deep analysis of the implementation. Some general pieces of advice first: Use some coding conventions ...
user avatar
  • 166
2 votes

Multi-threaded Mandelbrot set generator slower than single thread

Distributing the work among threads D. Jurcau already mentioned that you are not distributing your work correctly. It's even worse than his terse answer hints at. One issue is that inside the lambda ...
user avatar
  • 32.6k
1 vote

Multi-threaded Mandelbrot set generator slower than single thread

You don't distribute work among your threads correctly. According to your code, only by the time a thread has completed its work is the start point for the next thread(s) updated.
user avatar
  • 2,975
2 votes

Storing different types with common base using atomic-based typeid

I usually do a line-by-line review of the code, but that seems pointless here, because you have three different implementations of the same “thing”, and are ultimately only interested in one. There’s ...
user avatar
  • 8,241

Top 50 recent answers are included