From d01675876f7346865638ab6a2b35408f112e7ee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arturo=20Mart=C3=ADn-de-Nicol=C3=A1s?= Date: Wed, 24 Aug 2016 16:01:48 -0500 Subject: [PATCH] Added `s` suffix to string literal As written, the type for "Hamlet" without the `s` suffix will be deduced to `const char*` instead of the intended `std::string`, see example earlier for auto deduced `std::string` for "Ophelia"s with the `s` suffix. --- CppCoreGuidelines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 13b4ad9..5e14896 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -14134,7 +14134,7 @@ Note that C++17 will make this rule redundant by allowing the template arguments [Template parameter deduction for constructors (Rev. 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0091r1.html). For example: - tuple t1 = {1, "Hamlet", 3.14}; // deduced: tuple + tuple t1 = {1, "Hamlet"s, 3.14}; // deduced: tuple ##### Enforcement