This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: std::__debug::vector default ctor must not be defaulted
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: Stephan Bergmann <sbergman at redhat dot com>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Wed, 29 Apr 2015 11:13:57 +0100
- Subject: Re: std::__debug::vector default ctor must not be defaulted
- Authentication-results: sourceware.org; auth=none
- References: <553FAA55 dot 7020607 at redhat dot com> <20150428172542 dot GC3618 at redhat dot com> <55407AD1 dot 3010006 at redhat dot com>
On 29/04/15 08:31 +0200, Stephan Bergmann wrote:
On 04/28/2015 07:25 PM, Jonathan Wakely wrote:
The disadvantage is that you can't compile almost useless code (an
empty vector that can never be modified to be non-empty) without
adding an explicit initializer.
Turns out there are three places in LibreOffice that use such empty
const vectors (to pass into a function that takes a vector const&
argument, or to verbosely return an empty vector from a function,
[1][2]), but of course no problem to put explicit initializers there.
Yes, as soon as I hit send I thought of some non-useless reasons to do
it, similar to the first of those cases :-)