From ed70225208ebd7f51ff42a24f532d2877dab27b8 Mon Sep 17 00:00:00 2001 From: Johannes Loher Date: Mon, 18 Jun 2018 14:56:18 +0200 Subject: [PATCH] small fixes --- hands-on_dlang.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hands-on_dlang.md b/hands-on_dlang.md index 488f60c..df30f97 100644 --- a/hands-on_dlang.md +++ b/hands-on_dlang.md @@ -674,7 +674,7 @@ if (a == 5) { #### switch…case Also very similar to how it is defined in other languages, but for it works for -integer types, bools and strings (which will be covered later). +integer types, bools and strings. ```D string myString; @@ -902,7 +902,7 @@ If a member function of a base class if overwritten, the `override` keyword must be used: ```D -class Bar: Foo { +class Bar : Foo { override void functionFromFoo() {} } ``` @@ -1005,7 +1005,7 @@ struct S(T) { /* … */ } -auto s = S!int; +auto s = S!int(); ``` It is also possible to have variable templates: @@ -1013,7 +1013,7 @@ It is also possible to have variable templates: ```D ubyte[T.sizeof * 8] buffer8(T) = 42; -auto myBuffer = buffer!(int, 8); // create a buffer with space for 8 ints and initialize its elements to 42 +auto myBuffer = buffer!(int); // create a buffer with space for 8 ints and initialize its elements to 42 static assert(is(typeof(myBuffer) == ubyte[32])); assert(myBuffer[0] == 42); ``` @@ -1028,7 +1028,7 @@ template buffer8(T) { #### Template value parameters -So far we have only seen templateF type parameters. It is also possible to have +So far we have only seen template type parameters. It is also possible to have template value parameters: ```D