New answers tagged

0 votes

Design a set to classes to report battery/power status of different Alexa devices

Well, I feel like this deserves an answer somewhere, even if it's probably off-topic here. So I'm just going to write an answer and mark it as a community-wiki: The task: Depending on how this stage ...
2 votes

C++ custom string class implementation

You Can Add private Member Functions and friend Functions At least, I think you can. That doesn’t change the the public API one ...
Davislor's user avatar
  • 5,893
2 votes

C++ custom string class implementation

Overview: I found one bug. Your move constructor puts the object into an invalid state, where you can then potentially invoke undefined behavior. You have a small memory leak in the ...
Martin York's user avatar
  • 93.8k
4 votes

C++ custom string class implementation

This looks quite good, I see you have thought about most of the corner cases. However, a few were missed: new can throw When you allocate memory with ...
G. Sliepen's user avatar
  • 49.3k
2 votes

std::chrono compatible clock using CLOCK_MONOTONIC_RAW

The source code looks good. Merge to main and ship it. Consider writing test code which highlights observed behavior difference between this and competing time ...
J_H's user avatar
  • 13.7k
5 votes
Accepted

std::chrono compatible clock using CLOCK_MONOTONIC_RAW

The implementation looks correct to me. I do want to address some potential misunderstanding though: Since steady_clock is affected by certain clock adjustments, […...
G. Sliepen's user avatar
  • 49.3k

Top 50 recent answers are included