public inbox for libstdc++-cvs@sourceware.org help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r11-9768] libstdc++: Simplify std::allocator_traits<allocator<void>>::construct Date: Mon, 4 Apr 2022 11:47:16 +0000 (GMT) [thread overview] Message-ID: <20220404114716.1CF463858016@sourceware.org> (raw) https://gcc.gnu.org/g:123f87f604e894a747201e8c3e2dabe50ad05d9b commit r11-9768-g123f87f604e894a747201e8c3e2dabe50ad05d9b Author: Jonathan Wakely <jwakely@redhat.com> Date: Tue Jan 4 16:39:01 2022 +0000 libstdc++: Simplify std::allocator_traits<allocator<void>>::construct We don't need a preprocessor condition to decide whether to use placement new or std::construct_at, because std::_Construct already does that. libstdc++-v3/ChangeLog: * include/bits/alloc_traits.h (allocator_traits<allocator<void>>): Use std::_Construct for construct. (cherry picked from commit 917c7b136e8b556b0027223058006a6caeb56871) Diff: --- libstdc++-v3/include/bits/alloc_traits.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/libstdc++-v3/include/bits/alloc_traits.h b/libstdc++-v3/include/bits/alloc_traits.h index 602a90d4d8a..5e19ffece50 100644 --- a/libstdc++-v3/include/bits/alloc_traits.h +++ b/libstdc++-v3/include/bits/alloc_traits.h @@ -632,13 +632,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION static _GLIBCXX20_CONSTEXPR void construct(allocator_type&, _Up* __p, _Args&&... __args) noexcept(std::is_nothrow_constructible<_Up, _Args...>::value) - { -#if __cplusplus <= 201703L - ::new((void *)__p) _Up(std::forward<_Args>(__args)...); -#else - std::construct_at(__p, std::forward<_Args>(__args)...); -#endif - } + { std::_Construct(__p, std::forward<_Args>(__args)...); } /** * @brief Destroy an object of type `_Up`
reply other threads:[~2022-04-04 11:47 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220404114716.1CF463858016@sourceware.org \ --to=redi@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ --cc=libstdc++-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).