darune
darune

Reputation: 11000

Can I add a deduction guide to `std` namespace?

Suppose I want to make a new deduction guide making the following possible ?

std::string str;
std::basic_string_view sv = str;

Would that be an Ok customization ?

Upvotes: 6

Views: 372

Answers (1)

L. F.
L. F.

Reputation: 20609

[namespace.std]/2.4:

The behavior of a C++ program is undefined if it declares [...] a deduction guide for any standard library class template.

Upvotes: 15

Related Questions