[PATCH] D48616: Implement LWG 2946, 3075 and 3076

Tim Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 28 12:55:13 PDT 2018


tcanens added inline comments.


================
Comment at: include/string:856
+        _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+        explicit basic_string(const _Tp& __t, const allocator_type& __a);
+
----------------
ldionne wrote:
> I think this `explicit` shouldn't be there, too.
This one is `explicit` in the standard (because it had a default argument: `template<class T> explicit basic_string(const T& t, const Allocator& a = Allocator());`)


================
Comment at: include/string:1987
 {
     __self_view __sv = __self_view(__t).substr(__pos, __n);
----------------
`__self_view(__t)` is wrong - the wording was intentionally crafted to require the conversion to `basic_string_view` to be done using copy-initialization. Using direct-initialization can potentially result in different overload resolution results.


https://reviews.llvm.org/D48616





More information about the cfe-commits mailing list