public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: "François Dumont" <frs.dumont@gmail.com>
Cc: "libstdc++@gcc.gnu.org" <libstdc++@gcc.gnu.org>,
	gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: Default std::vector<bool> default and move constructor
Date: Fri, 02 Jun 2017 10:27:00 -0000	[thread overview]
Message-ID: <20170602102718.GD12306@redhat.com> (raw)
In-Reply-To: <f5c82f7f-a075-641f-7fc4-11144a023949@gmail.com>

On 01/06/17 22:49 +0200, François Dumont wrote:
>On 01/06/2017 15:34, Jonathan Wakely wrote:
>>On 31/05/17 22:28 +0200, François Dumont wrote:
>>>Unless I made a mistake it revealed that restoring explicit call 
>>>to _Bit_alloc_type() in default constructor was not enough. G++ 
>>>doesn't transform it into a value-init if needed. I don't know if 
>>>it is a compiler bug but I had to do just like presented in the 
>>>Standard to achieve the expected behavior.
>>
>>That really shouldn't be necessary (see blow).
>>
>>>This value-init is specific to post-C++11 right ? Maybe I could 
>>>remove the useless explicit call to _Bit_alloc_type() in pre-C++11 
>>>mode ?
>>
>>No, because C++03 also requires the allocator to be value-initialized.
>
>Ok so I'll try to make the test C++03 compatible.

That would require a much more complicated allocator, so I don't think
it's too important.

If you define the constructor like:

      _Bvector_impl()
      _GLIBCXX_NOEXCEPT_IF( noexcept(_Bit_alloc_type()) )
      : _Bit_alloc_type()
      { }

then it will do the same thing for C++03 as for later versions, so
testing for C++11 only should be good enough.

  reply	other threads:[~2017-06-02 10:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-15 18:38 François Dumont
2017-05-15 19:36 ` Marc Glisse
2017-05-16 20:38   ` François Dumont
2017-05-16 21:39     ` Marc Glisse
2017-05-19 19:42   ` François Dumont
2017-05-23 20:14     ` François Dumont
2017-05-25 16:33 ` Jonathan Wakely
2017-05-26 21:34   ` François Dumont
2017-05-27 11:16     ` Jonathan Wakely
2017-05-28 20:29       ` François Dumont
2017-05-29 20:57         ` François Dumont
2017-05-31 10:37           ` Jonathan Wakely
2017-05-31 20:34             ` François Dumont
2017-06-01 13:34               ` Jonathan Wakely
2017-06-01 20:49                 ` François Dumont
2017-06-02 10:27                   ` Jonathan Wakely [this message]
2017-06-13 20:36                 ` François Dumont
2017-06-15 11:07                   ` Jonathan Wakely
2017-05-31 11:13         ` Jonathan Wakely

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=20170602102718.GD12306@redhat.com \
    --to=jwakely@redhat.com \
    --cc=frs.dumont@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@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: link
Be 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).