From: Pedro Alves <palves@redhat.com>
To: Simon Marchi <simon.marchi@polymtl.ca>, gdb-patches@sourceware.org
Subject: Re: [PATCH v3 3/5] Add gdb::string_view
Date: Mon, 09 Apr 2018 13:44:00 -0000 [thread overview]
Message-ID: <eec02469-5ddb-33bf-012d-e577ec31c766@redhat.com> (raw)
In-Reply-To: <20180407132629.3787-3-simon.marchi@polymtl.ca>
On 04/07/2018 02:26 PM, Simon Marchi wrote:
> New in v3:
>
> * Base on the implementation in experimental/, since it is easier to
> adapt to the c++ standard we follow (c++11). I didn't see any
> significant fix to import from the std/ version.
>
> * Tested against clang and clang+libc++ to make sure we don't rely on
> anything internal and specific to libstdc++. This caught a few
> issues.
>
> * Remove hash helpers, operator<<, operator ""sv.
We can always add hash support later, but I suspect it won't be
long until we will miss it, when we try to use string_view with
e.g., an std::unordered_map.
> * Make gdb::string_view an alias of std::string_view when building
> with >= c++17.
>
> * Remove a bunch of constexpr, because they are not valid in c++11
> (e.g. they are not a single return line).
I think I'd prefer to leave the "constexpr"'s in place, but commented out,
instead of just removing it, like '/*constexpr*/', as a clearer marker that
we've removed something that normally would otherwise be there, since for
a future reader, simply removing is indistinguishable with missing/forgetting
a constexpr.
> * Remove hash helpers, because they use libstdc++ internal functions.
> If we need them we always import them later.
Ah, hash helpers mentioned twice. :-)
Technically, the use of uglified (double-underscore or
underscore-followed-by-uppercase) names is undefined behavior for
being reserved to the implementation, but I think that in practice
it's harmless, we should be able to deal with any conflict if it
ever happens. At this stage, I think fewer local changes outweighs
the very small potential for trouble.
LGTM.
Thanks,
Pedro Alves
next prev parent reply other threads:[~2018-04-09 13:44 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-07 13:26 [PATCH v3 1/5] Update ax_cv_cxx_compile_cxx.m4 Simon Marchi
2018-04-07 13:26 ` [PATCH v3 5/5] Adapt and integrate string_view tests Simon Marchi
2018-04-09 13:45 ` Pedro Alves
2018-04-07 13:26 ` [PATCH v3 2/5] Copy string_view files from libstdc++ Simon Marchi
2018-04-09 13:44 ` Pedro Alves
2018-04-09 17:23 ` Simon Marchi
2018-04-09 17:39 ` Pedro Alves
2018-04-09 18:20 ` Simon Marchi
2018-04-07 13:26 ` [PATCH v3 3/5] Add gdb::string_view Simon Marchi
2018-04-09 13:44 ` Pedro Alves [this message]
2018-04-09 17:28 ` Simon Marchi
2018-04-09 17:30 ` Simon Marchi
2018-04-09 18:28 ` Simon Marchi
2018-04-07 13:37 ` [PATCH v3 4/5] Copy string_view tests from libstdc++ Simon Marchi
2018-04-09 13:47 ` Pedro Alves
2018-04-09 13:46 ` [PATCH v3 1/5] Update ax_cv_cxx_compile_cxx.m4 Pedro Alves
2018-04-09 18:27 ` Simon Marchi
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=eec02469-5ddb-33bf-012d-e577ec31c766@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@polymtl.ca \
/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).