Skip to content

Commit aa9c168

Browse files
Update aliases.md (#1005)
Signed-off-by: Neil Henderson <2060747+bluetarpmedia@users.noreply.github.com>
1 parent 74fb716 commit aa9c168

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/cpp2/aliases.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Aliases
22

3-
Aliases are pronounced **"synonym for**, and written using the same **name `:` kind `=` value** [declaration syntax](../cpp2/declarations.md) as everything in Cpp2:
3+
Aliases are pronounced **"synonym for"**, and written using the same **name `:` kind `=` value** [declaration syntax](../cpp2/declarations.md) as everything in Cpp2:
44

55
- **name** is declared to be a synonym for **value**.
66

@@ -37,7 +37,7 @@ main: () = {
3737

3838
## <a id="type-aliases"></a> Type aliases
3939

40-
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:
40+
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:
4141

4242
``` cpp title="Type aliases" hl_lines="1 2 7 10"
4343
// 'imap<T>' is a type defined as a synonym for 'std::map<i32, T>'
@@ -49,7 +49,7 @@ main: () = {
4949
map2: imap<std::string> = ();
5050

5151
// Assertion they are the same type, using the same_as concept
52-
assert( std::same_as< decltype(map1), decltype(map2) > );
52+
static_assert( std::same_as< decltype(map1), decltype(map2) > );
5353
}
5454
```
5555

@@ -67,7 +67,7 @@ main: () = {
6767
ints: std::array<i32, square(4)> = ();
6868

6969
// Assertion that the size is the square of 4
70-
assert( ints.size() == 16 );
70+
static_assert( ints.size() == 16 );
7171

7272
// And if can be used at run time, with run time values
7373
std::cout << "the square of 4 is (square(4))$\n";
@@ -89,7 +89,7 @@ BufferSize: i32 == 1'000'000;
8989

9090
main: () = {
9191
buf: std::array<std::byte, BufferSize> = ();
92-
assert( buf.size() == BufferSize );
92+
static_assert( buf.size() == BufferSize );
9393
}
9494
```
9595

0 commit comments

Comments
 (0)