Path: ...!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!raubtier-asyl.eternal-september.org!.POSTED!not-for-mail From: Bonita Montero Newsgroups: comp.lang.c Subject: Re: Top 10 most common hard skills listed on resumes... Date: Wed, 28 Aug 2024 19:13:08 +0200 Organization: A noiseless patient Spider Lines: 31 Message-ID: References: <20240825192810.0000672c@yahoo.com> <20240825220016.00002793@yahoo.com> <86bk1e4y7t.fsf@linuxsc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Wed, 28 Aug 2024 19:13:06 +0200 (CEST) Injection-Info: raubtier-asyl.eternal-september.org; posting-host="533d64590f09fbd7a1b41b803c3065f2"; logging-data="3743575"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/v2K94uZdBvKmry/UN+zzJCUH547x1TuQ=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:YOsZltqttU7YT+/yO5tF9s3n2WM= In-Reply-To: Content-Language: de-DE Bytes: 3076 Am 28.08.2024 um 19:02 schrieb Thiago Adams: > On 28/08/2024 11:55, Bonita Montero wrote: >> Am 28.08.2024 um 15:52 schrieb Thiago Adams: >> >>> You have to deallocate only if the ownership still with the >>> same object. This is not the case when the object is moved. >> >> Take this code >> >> string str; >> >> int main () >> { >>      string str( "hello" ); >>      ::str = move( str ); >> } >> >> With clang-cl (the MSVC-flavour of clang) the whole string-creation >> and destruction is opmized away and the compiler directly checks if >> ::str contains any externally allocated and if not it makes a short >> -string-optimized "copy" to ::str. That's nine instructions for the >> whole string copy with clang-cl 17.0.3; no external call. >> >> > > If you put everything on compiler bill, then you don't need move etc.. > This create a language that is hard to trust. > All C++-compilers today can handle this.