The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

Bo (2) [Avatar] Offline
#1
In listing 3.4 and 3.5 I have two suggestions.

struct empty_stack should use noexcept instead of the deprecated syntax throw() for the what() method.

Secondly, even though the emphasis in this part of the text is on the race-free pop method the push method should likely have the following interface:
void push(const T& new_value);
instead of the current copy-by-value.

Kind regards
Bo Rydberg
anthony.williams (216) [Avatar] Offline
#2
Agreed on noexcept vs throw(). Fixed.

I've changed push to use std::move internally