kimgr added a subscriber: kimgr.
kimgr added a comment.

Inline question on ctor+nullptr


================
Comment at: include/string_view:216
@@ +215,3 @@
+       basic_string_view(const _CharT* __s)
+               : __data(__s), __size(_Traits::length(__s)) {}
+
----------------
I'm working from the paper at https://isocpp.org/files/papers/N3762.html, and I 
find it a little sketchy on the policy for nullptrs.

Since the ctor above accepts nullptr as long as the length is zero, would it 
make sense to do that here too? That is, only call _Traits::length for 
non-nullptr __s args?


https://reviews.llvm.org/D21459



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to