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: Jonathan Wakely <jwakely at redhat dot com>
- 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: Wed, 16 Apr 2014 16:15:01 +0100
- 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> <20140415190646 dot GT6807 at redhat dot com> <534E9A5E dot 4090009 at verizon dot net>
On 16/04/14 10:57 -0400, Ed Smith-Rowland wrote:
The latest library fundamentals paper has a lot of changes coming - a
lot of constexpr in the find type functions. Unfortunately, most of
that will wave to wait until we get C++14 constexpr.
Yeah, there's no way we can put constexpr on e.g. string_view::swap()
yet :-)
Also, if the built-in strlen is or could be made constexpr then all
the char* ctors could be constexpr as well.
I think we'd need to make char_traits<char>::length() constexpr too,
and that's not allowed by the standard.
As a result users can only really benefit from everything in
string_view being constexpr if they provide their own char traits
implementation with constexpr functions.