New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Page 97, thread_local object #44
Comments
Hi @jpc0016! Sorry you're having trouble with this. Is it possible that you haven't included the body of the Have a look at https://github.com/JLospinoso/ccc/blob/master/chapter_4/listing_4_6.cpp. It should compile (example: https://wandbox.org/permlink/0MAvZho8A9F46In6) |
Hi @jpc0016, I think you've uncovered a deeper issue! The standard actually says that the
I'll put together an Errata for this -- thanks for reporting and I hope you enjoy the rest of the book! |
I cannot replicate results in Listing 4-7 with code in Listing 4-6. "Tracer" (line 17) is not recognized as an object when using "thread_local" keyword; however, "Tracer" is recognized when I use "static" keyword and I get the output in Listing 4-7. I added the "thread" header file,
#include <thread>
, and it still did not work. Both clang++ and g++ are up to date which should support threading. Help is appreciated.The text was updated successfully, but these errors were encountered: