From a633a217ea9e1c919c85833878bf3b80aeb76d57 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 11 Nov 2016 16:47:25 -0800 Subject: [PATCH] Fix incorrect (ill-formed) example for class template argument deduction --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4f00064..cc9942f 100644 --- a/README.md +++ b/README.md @@ -75,14 +75,15 @@ C++11 includes the following new library features: ### Template argument deduction for class templates Automatic template argument deduction much like how it's done for functions, but now including class constructors. ```c++ -template +template struct MyContainer { T val; + MyContainer() : val() {} MyContainer(T val) : val(val) {} // ... }; MyContainer c1{ 1 }; // OK MyContainer -MyContainer c2; // OK MyContainer<> +MyContainer c2; // OK MyContainer ``` ### Declaring non-type template parameters with auto