From 698a84986145e40893ad69fa51a35a6e39a3ec08 Mon Sep 17 00:00:00 2001 From: Alberto Luaces Date: Fri, 11 Nov 2016 20:19:43 +0100 Subject: [PATCH 1/3] Fixed misspelling --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5051ef2..cd5cc70 100644 --- a/README.md +++ b/README.md @@ -713,13 +713,13 @@ foo.foo; // == 0 ### User-defined literals User-defined literals allow you to extend the language and add your own syntax. To create a literal, define a `T operator "" X(...) { ... }` function that returns a type `T`, with a name `X`. Note that the name of this function defines the name of the literal. Any literal names not starting with an underscore are reserved and won't be invoked. There are rules on what parameters a user-defined literal function should accept, according to what type the literal is called on. -Converting Celcius to Fahrenheit: +Converting Celsius to Fahrenheit: ```c++ // `unsigned long long` parameter required for integer literal. -long long operator "" _celcius(unsigned long long tempCelcius) { - return std::llround(tempCelcius * 1.8 + 32); +long long operator "" _celsius(unsigned long long tempCelsius) { + return std::llround(tempCelsius * 1.8 + 32); } -24_celcius; // == 75 +24_celsius; // == 75 ``` String to integer conversion: From b924bed254af53a3f61ae36c746785eeadae9559 Mon Sep 17 00:00:00 2001 From: thukydides Date: Fri, 11 Nov 2016 20:35:19 +0100 Subject: [PATCH 2/3] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cd5cc70..4f00064 100644 --- a/README.md +++ b/README.md @@ -370,9 +370,10 @@ m.insert(std::move(e)); ### Binary literals Binary literals provide a convenient way to represent a base-2 number. +It is possible to separate digits with `'`. ```c++ 0b110 // == 6 -0b11111111 // == 255 +0b1111'1111 // == 255 ``` ### Generic lambda expressions From a633a217ea9e1c919c85833878bf3b80aeb76d57 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 11 Nov 2016 16:47:25 -0800 Subject: [PATCH 3/3] 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