This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Make string_view operations involving CharT* *not* noexcept and consistent beween string_view and string_view.tcc.
- From: Marc Glisse <marc dot glisse at inria dot fr>
- To: Ed Smith-Rowland <3dw4rd at verizon dot net>
- Cc: "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>
- Date: Sat, 29 Mar 2014 22:18:04 +0100 (CET)
- Subject: Re: Make string_view operations involving CharT* *not* noexcept and consistent beween string_view and string_view.tcc.
- Authentication-results: sourceware.org; auth=none
- References: <533716DC dot 10109 at verizon dot net>
- Reply-to: "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>
You forgot gcc-patches@ ... Maybe you could create an alias in your mailer
so it automatically adds it when you write to libstdc++@gcc.gnu.org?
On Sat, 29 Mar 2014, Ed Smith-Rowland wrote:
In string_view I botched the noexcept specification of operations like find
and friends with CharT* arguments.
I'm a little surprised the inconsistency between string_view and
string_view.tcc didn't error. In fact, in one repo thats a little behind
trunk it does. I'll continue to look after that issue separately.
Built and tested clean on x86_64-linux. OK?
(some remarks since I am taking my first look at this file)
I am wondering if you couldn't add more noexcept instead, for some of
those functions (we are allowed to have more than the standard). The
constructor basic_string_view(const char*,size_t) can clearly be marked
noexcept, for instance, and that means find(const char*,size_t,size_t)
should have the same guarantees as find(basic_string_view,size_t).
I notice that the default constructor and basic_string_view(nullptr,n)
have _M_str point to a special array. What would break with using 0?
Those remarks can all wait.
--
Marc Glisse