This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch] Small refactor on <regex> _State<>
- From: Tim Shen <timshen at google dot com>
- To: Jonathan Wakely <jwakely at redhat dot com>
- Cc: "libstdc++" <libstdc++ at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 29 Jul 2015 01:43:17 -0700
- Subject: Re: [Patch] Small refactor on <regex> _State<>
- Authentication-results: sourceware.org; auth=none
- References: <CAG4ZjNnYLoCYnjNpkJYHa2Q-ux0KnKmVXBDUOa33xk29MzeTKA at mail dot gmail dot com> <20150725153121 dot GW21787 at redhat dot com> <CAG4ZjNnvm=QAwihOUvMLtOezYprtasaJOY3i-MhJV0Tf4z5mpg at mail dot gmail dot com> <20150728151925 dot GO10878 at redhat dot com> <20150729083214 dot GB13355 at redhat dot com>
On Wed, Jul 29, 2015 at 1:32 AM, Jonathan Wakely <jwakely@redhat.com> wrote:
> Apologies, you have a user-declared move constructor, so assignment is
> already deleted. It wouldn't hurt to make that explicit though:
I'm just bad at memorizing when they are implicitly
declared/defined/deleted and fully unware of the deleted copy
assignment :)
It's better to make it explicit, since I don't want to be clever on
pretending knowing all ctor/assigment rules :)
> _State& operator=(const _State&) = delete;
>
> So it's just the alignment issue that I'm concerned about now.
>
Will alignof(std::function<bool(C)>) be all the same across
instantiations, including user-defined C, now and in the future?
I created template parameter _Matcher_size (which should be
__matcher_size) because I don't want to make this assumption on
sizeof(). If they (both alignment and size) are expected to be the
same, we can remove that template parameter (and all indentation
changes!); otherwise, is alignment more unlikely to change than size
the reason we always stick on alignof(std::function<bool(char)>)?
--
Regards,
Tim Shen