Article View: comp.lang.c++
Article #961Re: What does this code
From: Chris M. Thomasson
Date: Fri, 20 Nov 2026 22:39
Date: Fri, 20 Nov 2026 22:39
21 lines
1811 bytes
1811 bytes
On 11/20/2026 2:39 PM, Chris M. Thomasson wrote:
> On 11/19/2026 11:48 PM, Bonita Montero wrote:
>> Cool code without any branches and conditional
>> moves if the compiler does it as I intended.
>>
>> inline xsm_lock::operator int() const noexcept
>> {
>> return (int)m_shared | -(int)!m_pMtx;
>> }
>>
>> m_pMtx is a pointer.
>> Chris, I'm sure *you* would use relacy with that.
>>
>
> ;^) What is m_shared? A raw pointer?
DOH!!!!! Sorry Bonita. You said it was a bool.
>
> Btw, there is no shame in using an interesting race detector.
Technical Details
Message-ID:
<11dqi7q$3jvib$2@dont-email.me>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<11dou16$2vlr8$1@raubtier-asyl.eternal-september.org> <11dqi6j$3jvib$1@dont-email.me>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> Newsgroups: comp.lang.c++ Subject: Re: What does this code Date: Fri, 20 Nov 2026 14:39:53 -0800 Organization: A noiseless patient Spider Lines: 21 Message-ID: <11dqi7q$3jvib$2@dont-email.me> References: <11dou16$2vlr8$1@raubtier-asyl.eternal-september.org> <11dqi6j$3jvib$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Fri, 20 Nov 2026 22:39:55 +0000 (UTC) Injection-Info: dont-email.me; logging-data="3800651"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19GKOLQ1+fzZ5eD1s4nD9rJhfMNIkpwzb8="; posting-host="fa5c50218976ec21e33b4cef826fe31b" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:O8BeaHXhC7KvZwOBErxxlJ9mkKQ= sha256:ynia1nVXHCaNIHSeATQmQixXhTBf0mDL1ADCI+MjHMk= sha1:QuyrSygqq8YLA5fcumSLMSx299k= sha256:+h1wezzEJKY4y6G1QNp1EcPsVQeTqV1A27hUw6R8OLM= Content-Language: en-US In-Reply-To: <11dqi6j$3jvib$1@dont-email.me>