public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/64865] std::allocator::construct/destroy not called for specialization of std::allocator<trivialtype> Date: Fri, 30 Jan 2015 11:06:00 -0000 [thread overview] Message-ID: <bug-64865-4-r2Ee4rojRk@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-64865-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64865 --- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to TC from comment #2) > Since the allocator_type member must be the Alloc template argument provided > by the user and not any rebound types, though, N.B. libstdc++ supports std::vector<int, std::allocator<char>> and so always rebinds the _Alloc parameter to get an allocator for the value_type. That doesn't change your argument though, because it will rebind it to allocator<value_type> and that's the type that's specialized. > it seems to me that it is in > fact guaranteed that their versions of construct() and destroy() will be > called, as the paragraph you cite requires the use of > allocator_traits<allocator_type>::construct and > allocator_traits<allocator_type>::destroy. That's a defect, see http://cplusplus.github.io/LWG/lwg-active.html#2218 That defect is a problem for node-based containers, but in principle any container should be able to use allocator_traits<allocator_type>::rebind_traits<SomeInternalType>::construct() to construct the elements, in which case your allocator<value_type> specialization is not used.
prev parent reply other threads:[~2015-01-30 11:06 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-01-29 17:22 [Bug libstdc++/64865] New: " Casey at Carter dot net 2015-01-30 9:51 ` [Bug libstdc++/64865] " redi at gcc dot gnu.org 2015-01-30 10:43 ` rs2740 at gmail dot com 2015-01-30 11:06 ` redi at gcc dot gnu.org [this message]
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=bug-64865-4-r2Ee4rojRk@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@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).