What is the reason for why is_lock_free requires an instance (it’s a member function)? Why not a metafunction of the type, or a static constexpr member function?
I am looking for an actual instance of why it is necessary.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The standard allows a type to be sometimes lock-free.
The C++ atomic paper n2427 states the reason behind:
And also (as Jesse Good pointed out):