-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
VS2013 atomic_flag compile error #3
Comments
Thanks for opening an issue! I haven't encountered it because I haven't gotten around to adding VS2013 support yet (expect a solution + projects for the tests and benchmarks soonish). Apparently it's unspecified in the C++11 standard whether ATOMIC_FLAG_INIT can be used in other ways than What is specified is that calling the default constructor does not necessarily initialize the object to the cleared state (which is silly, in my opinion). So the fix is to leave it uninitialized and then assign to it in the constructor of the queue, which should be portable across all compilers. |
Done. Let me know if you run into any other issues! |
Wow, I shouldn't fix bugs on my way to bed. That first commit didn't compile, as I changed it to call the assignment operator ( |
It looks good to me! Thanks! |
Hi, thanks for making this project. I've been doing C# for over seven years, so it's a good learning experience for me!
When trying to get this running in Visual Studio 2013, I got this compile error:
The compile error is because this member initializer:
... uses a constructor that is deleted:
The default parameterless constructor is available, so the fix is to remove the
ATOMIC_FLAG_INIT
parameter and the atomic_flag still gets initialized to zero. Line 436 becomes:I have no idea what the repercussions are for other compilers. I also don't understand why you haven't encountered this problem. I'm compiling for Win32, in case that matters.
--Ron
The text was updated successfully, but these errors were encountered: