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

Louis Dionne via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 28 15:20:46 PDT 2018


ldionne added inline comments.


================
Comment at: include/string:856
+        _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
+        explicit basic_string(const _Tp& __t, const allocator_type& __a);
+
----------------
tcanens wrote:
> 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());`)
Ah, you're right. So basically

```
template<class T>
explicit basic_string(const T& t,
                      const Allocator& a = Allocator());
```

is implemented as two overloads

```
template<class T>
explicit basic_string(const T& t);
```

and 

```
template<class T>
explicit basic_string(const T& t, const Allocator& a);
```



https://reviews.llvm.org/D48616





More information about the cfe-commits mailing list