ITHelpDec

Results 24 issues of ITHelpDec

PR in response to issue #39. --- In order for this code to run, we must perform the following commits and amend listing 6.1 to return an empty shared pointer...

Combining Listing 6.1 and Listing 8.1 we get the following runtime error: https://github.com/anthonywilliams/ccia_code_samples/blob/6e7ae1d66dbd2e8f1ad18a5cf5c6d25a37b92388/listings/listing_6.1.cpp#L1-L55 https://github.com/anthonywilliams/ccia_code_samples/blob/6e7ae1d66dbd2e8f1ad18a5cf5c6d25a37b92388/listings/listing_8.1.cpp#L1-L106 ```bash libc++abi: terminating due to uncaught exception of type empty_stack: empty stack Message from debugger: killed...

Given the following reading material [here](https://stackoverflow.com/questions/55704567/how-to-understand-calling-compare-exchange-strong-with-stdmemory-order-acquire) and [here](https://stackoverflow.com/questions/74127715/why-are-these-memory-orders-applied-here-in-the-implementation-of-the-lock-free), please consider upgrading the memory-ordering of our `.compare_exchange_strong()` operations from... ```cpp std::memory_order_acquire ``` ...to... ```cpp std::memory_order_acq_rel ``` ...to ensure all accesses to...

Please consider modifying the implicit-boolean `ptr` check at line 34 to `ptr->next.ptr`. --- https://github.com/anthonywilliams/ccia_code_samples/blob/6e7ae1d66dbd2e8f1ad18a5cf5c6d25a37b92388/listings/listing_7.12.cpp#L34 https://github.com/anthonywilliams/ccia_code_samples/blob/16d50777974df5e8d5c94ba23f914726f06fe36e/listings/listing_7.12.cpp#L34 --- Even if the stack is empty while calling the destructor, `ptr` is a valid...

It seems odd to perform work on a node that could potentially be a `nullptr` from the moment the function is called. I hope I'm correct in saying that `.compare_exchange_weak(...)`...

Consider changing... https://github.com/anthonywilliams/ccia_code_samples/blob/6e7ae1d66dbd2e8f1ad18a5cf5c6d25a37b92388/listings/listing_6.12.cpp#L20 ...to... https://github.com/anthonywilliams/ccia_code_samples/blob/42a7c506c2d6af046154c86f10a8b7f7390b6bb9/listings/listing_6.12.cpp#L20 `typedef bucket_iterator` does not exist in the scope of our map class, but of the sub-class `bucket_type`. We must declare `.get_map()` as a friend within...

Consider changing line 23 from... https://github.com/anthonywilliams/ccia_code_samples/blob/6e7ae1d66dbd2e8f1ad18a5cf5c6d25a37b92388/listings/listing_6.11.cpp#L23 ...to... https://github.com/anthonywilliams/ccia_code_samples/blob/e893b0c531110546abf2d2677c1144ea3e290a3d/listings/listing_6.11.cpp#L23 Doesn't preserve const-ness, but fixes the following error, and allows for the code to run. ```bash No viable conversion from returned value...

As it stands, this code will not compile. Provided the headers are self-explanatory, consider exercising consistency with namespaces (like what can be seen with `std::vector` and `std::future`). Either that or...

Functional change to allow compilation (please see #31 to see other potential changes). Previous tests of `spawn_async` in place of `std::async` were not successful, but perhaps this is because ``...

Code tweaked to allow compilation. Subjective amendments included in an attempt to make code more robust and declarative. Please consider writing fuller-bodied code samples to provide more context to the...