From cbbdeb03542f805dc68b4de0b3bda99fa0a5a054 Mon Sep 17 00:00:00 2001 From: Neil Henderson <2060747+bluetarpmedia@users.noreply.github.com> Date: Thu, 29 Feb 2024 10:10:41 +1000 Subject: [PATCH] Update aliases.md Signed-off-by: Neil Henderson <2060747+bluetarpmedia@users.noreply.github.com> --- docs/cpp2/aliases.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/cpp2/aliases.md b/docs/cpp2/aliases.md index 17e8104ef..501c02882 100644 --- a/docs/cpp2/aliases.md +++ b/docs/cpp2/aliases.md @@ -1,6 +1,6 @@ # Aliases -Aliases are pronounced **"synonym for**, and written using the same **name `:` kind `=` value** [declaration syntax](../cpp2/declarations.md) as everything in Cpp2: +Aliases are pronounced **"synonym for"**, and written using the same **name `:` kind `=` value** [declaration syntax](../cpp2/declarations.md) as everything in Cpp2: - **name** is declared to be a synonym for **value**. @@ -37,7 +37,7 @@ main: () = { ## Type aliases -A namespace alias is written the same way as a [type](types.md), but using `==` and with the name of another type as its value. For example: +A type alias is written the same way as a [type](types.md), but using `==` and with the name of another type as its value. For example: ``` cpp title="Type aliases" hl_lines="1 2 7 10" // 'imap' is a type defined as a synonym for 'std::map' @@ -49,7 +49,7 @@ main: () = { map2: imap = (); // Assertion they are the same type, using the same_as concept - assert( std::same_as< decltype(map1), decltype(map2) > ); + static_assert( std::same_as< decltype(map1), decltype(map2) > ); } ``` @@ -67,7 +67,7 @@ main: () = { ints: std::array = (); // Assertion that the size is the square of 4 - assert( ints.size() == 16 ); + static_assert( ints.size() == 16 ); // And if can be used at run time, with run time values std::cout << "the square of 4 is (square(4))$\n"; @@ -89,7 +89,7 @@ BufferSize: i32 == 1'000'000; main: () = { buf: std::array = (); - assert( buf.size() == BufferSize ); + static_assert( buf.size() == BufferSize ); } ```