[v3 PATCH] Implement std::string_view and P0254r2, Integrating std::string_view and std::string.
Jonathan Wakely
jwakely@redhat.com
Thu Jul 28 20:57:00 GMT 2016
On 27/07/16 17:53 +0100, Jonathan Wakely wrote:
>On 25/07/16 00:41 +0300, Ville Voutilainen wrote:
>>Changelog as it was before, tested on Linux-x64.
>>
>>I haven't fixed all section references of string tests, and I haven't
>>added section references
>>to string_view tests, because they didn't have any. I also haven't
>>added tests that test the various
>>exception-throwing cases for the various operations. Doing those changes is
>>a) going to change many many files
>>b) probably not urgent
>>so here's a modest suggestion:
>>let's put this patch in, and tweak the section references in the other
>>tests later with separate patches,
>>as well as add more comprehensive exception-tests.
>>
>>Ok for trunk?
>
>+#if __cplusplus > 201402L
>+ /**
>+ * @brief Append a string_view.
>+ * @param __sv The string_view to be appended.
>+ * @return Reference to this string.
>+ */
>+ basic_string& append(__sv_type __sv)
>+ {
>+ return this->append(__sv.data(), __sv.size());
>+ }
The new member functions in std::string aren't instantiated in the
library, because the relevant files are compiled as C++14, so any file
which doesn't inline the new functions (e.g. at -O0) gets undefined
references. I'll fix that after I update the baseline files.
More information about the Gcc-patches
mailing list